Merge branch '1115-Redimensiónde-los-iconos-y-texto-en-mapas-GIS' into 'develop'
Hold mark labels font size when autorefresh and fix drag map font size bug - #1115 See merge request !660
This commit is contained in:
commit
f8a1b77158
|
@ -368,6 +368,7 @@ function gis_activate_ajax_refresh($layers = null, $lastTimeOfData = null, $publ
|
|||
}
|
||||
}
|
||||
}
|
||||
EventZoomEnd(null,map.zoom);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -396,7 +397,7 @@ function gis_activate_ajax_refresh($layers = null, $lastTimeOfData = null, $publ
|
|||
}
|
||||
?>
|
||||
}
|
||||
|
||||
|
||||
last_time_of_data = Math.round(new Date().getTime() / 1000); //Unixtimestamp
|
||||
|
||||
//Test if the user change the refresh time.
|
||||
|
@ -405,11 +406,16 @@ function gis_activate_ajax_refresh($layers = null, $lastTimeOfData = null, $publ
|
|||
idIntervalAjax = setInterval("clock_ajax_refresh()", refreshAjaxIntervalSeconds);
|
||||
oldRefreshAjaxIntervalSeconds = refreshAjaxIntervalSeconds;
|
||||
}
|
||||
|
||||
EventZoomEnd(null,map.zoom);
|
||||
|
||||
|
||||
}
|
||||
|
||||
$(document).ready (
|
||||
function () {
|
||||
idIntervalAjax = setInterval("clock_ajax_refresh()", refreshAjaxIntervalSeconds);
|
||||
EventZoomEnd(null,map.zoom);
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
|
|
@ -138,6 +138,7 @@ function js_printMap(id_div, initial_zoom, center_latitude, center_longitude, ob
|
|||
var baseLayer = null;
|
||||
|
||||
map.events.on({"zoomend": EventZoomEnd});
|
||||
map.events.on({"mouseup": EventZoomEnd});
|
||||
|
||||
//Define the maps layer
|
||||
for (var baselayerIndex in objBaseLayers) {
|
||||
|
@ -224,10 +225,18 @@ function js_printMap(id_div, initial_zoom, center_latitude, center_longitude, ob
|
|||
.transform(map.displayProjection, map.getProjectionObject());
|
||||
|
||||
map.setCenter (lonLat, initial_zoom);
|
||||
|
||||
}
|
||||
|
||||
function EventZoomEnd (evt) {
|
||||
var actual_zoom = (evt.object.zoom < 6) ? 6 : evt.object.zoom;
|
||||
function EventZoomEnd (evt,zoom = map.zoom) {
|
||||
if(evt == null){
|
||||
var actual_zoom = (zoom < 6) ? 6 : zoom;
|
||||
}
|
||||
else{
|
||||
var actual_zoom = (evt.object.zoom < 6) ? 6 : evt.object.zoom;
|
||||
}
|
||||
|
||||
|
||||
var max_width_marker = 38;
|
||||
var max_zoom_map = map.numZoomLevels;
|
||||
var max_font_size = 15;
|
||||
|
@ -258,7 +267,6 @@ function EventZoomEnd (evt) {
|
|||
var new_width_marker = (actual_zoom * max_width_marker) / max_zoom_map;
|
||||
var new_height_marker = (actual_zoom * max_width_marker) / max_zoom_map;
|
||||
|
||||
console.log(feature);
|
||||
feature.style.fontSize = '' + actual_font_size + ' !important';
|
||||
feature.style.graphicHeight = new_height_marker;
|
||||
feature.style.graphicWidth = new_width_marker;
|
||||
|
@ -280,6 +288,7 @@ function EventZoomEnd (evt) {
|
|||
function changeShowStatus(newShowStatus) {
|
||||
statusShow = newShowStatus;
|
||||
hideAgentsStatus();
|
||||
EventZoomEnd(null,map.zoom);
|
||||
js_refreshParentLines();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue