automatically zoom to location/POI

pull/1/head
Michael Peter Christen 10 years ago
parent fa2ad101ec
commit 509eba2484

@ -67,13 +67,14 @@
window.setInterval("refresh()", 1000); window.setInterval("refresh()", 1000);
} }
function zoomChanged () { function zoomChanged() {
shallZoom = false; // no automatic zoom if user hs zoomed shallZoom = false; // no automatic zoom if user hs zoomed
refreshsearch(); refreshsearch();
} }
// called if a search is submitted // called if a search is submitted
function search() { function search() {
shallZoom = true;
refreshsearch(); refreshsearch();
} }
@ -128,7 +129,8 @@
// check if any of the markers is visible on the screen. // check if any of the markers is visible on the screen.
// this is only necessary if shallZoom = false since this would set shallZoom = true // this is only necessary if shallZoom = false since this would set shallZoom = true
var bounds = searchLayer_md1.getDataExtent(); var bounds = searchLayer_md1.getDataExtent();
if (bounds == null) searchLayer_co1.getDataExtent(); if (bounds == null) bounds = searchLayer_co1.getDataExtent();
/* /*
if (!shallZoom) { if (!shallZoom) {
// check all markers // check all markers

Loading…
Cancel
Save