Improved the GIS map screen

This commit is contained in:
Alejandro Gallardo Escobar 2018-05-08 10:07:33 +02:00
parent cc06dfe876
commit e1319cb584
1 changed files with 22 additions and 17 deletions

View File

@ -161,12 +161,12 @@ $buttons[]['text'] = ' ' . __('Show agents by state: ') .
ui_print_page_header(__('Map') . " » " . __('Map') . " " . $map['map_name'],
"images/op_gis.png", false, "", false, $buttons);
if ($config["pure"] == 0) {
echo "<div id='map' style='width: 100%; height: 500px; border: 1px solid black;' ></div>";
}
else {
echo "<div id='map' style='position:absolute; top:40px; z-index:100; width: 100%; height: 500px; min-height:500px; border: 1px solid black;' ></div>";
}
$map_inline_style = "width: 100%; min-height:500px; height: calc(100vh - 80px);";
$map_inline_style .= $config["pure"]
? "position:absolute; top: 80px; left: 0px;"
: "border: 1px solid black;";
echo '<div id="map" style="' . $map_inline_style . '" />';
gis_print_map('map', $map['zoom_level'], $map['initial_latitude'],
$map['initial_longitude'], $baselayers, $controls);
@ -239,17 +239,22 @@ if ($layers != false) {
}
// Resize GIS map on fullscreen
if ($config["pure"] != 0) {
?>
<script type="text/javascript">
$().ready(function() {
// if ($config["pure"] != 0) {
// <script type="text/javascript">
// $().ready(function() {
var new_height = $(document).height();
$("#map").css("height", new_height - 60);
$("svg[id*=OpenLayers]").css("height", new_height - 60);
// var new_height = $(document).height();
// $("#map").css("height", new_height - 60);
// $("svg[id*=OpenLayers]").css("height", new_height - 60);
});
</script>
<?php
}
// });
// </script>
// }
?>
<script type="text/javascript">
$(document).ready(function() {
var $map = $("#map");
$map.css("height", "calc(100vh - " + $map.offset().top + "px - 20px)");
});
</script>