diff --git a/lib/map.js b/lib/map.js index a6e1468..ef7a74c 100644 --- a/lib/map.js +++ b/lib/map.js @@ -122,7 +122,7 @@ define(["map/clientlayer", "map/labelslayer", var self = this var barycenter var groupOnline, groupOffline, groupNew, groupLost, groupLines - var savedBounds + var savedView var map, userLocation var layerControl @@ -136,7 +136,8 @@ define(["map/clientlayer", "map/labelslayer", }) function saveView() { - savedBounds = map.getBounds() + savedView = {center: map.getCenter(), + zoom: map.getZoom()} } function enableTracking() { @@ -286,8 +287,8 @@ define(["map/clientlayer", "map/labelslayer", if (!nopanzoom) if (m) goto(m) - else if (savedBounds) - map.fitBounds(savedBounds) + else if (savedView) + map.setView(savedView.center, savedView.zoom) else resetZoom() }