diff --git a/spatial/static/spatial/js/gridmap.js b/spatial/static/spatial/js/gridmap.js index 2f0fadf41e541615544d648e06d8431e21f698b9..2e03afe6c069d54fb0958b171e5e0c7a768f02ca 100644 --- a/spatial/static/spatial/js/gridmap.js +++ b/spatial/static/spatial/js/gridmap.js @@ -193,6 +193,8 @@ msLoadMap(): Unable to access file. (/disks/data01/mapserver/wms/SEPTREFFUM/SEPT setCurrentDate(todayLayerIndex); switchLayer(todayLayerIndex); + // Set zoom and center either based on what the user previously had set, + // or fit the map to the layer's extent var storedMapSettings = getLocalSettings([ "gridmap.longitude", "gridmap.latitude", @@ -225,6 +227,7 @@ msLoadMap(): Unable to access file. (/disks/data01/mapserver/wms/SEPTREFFUM/SEPT map.on('singleclick', displayQueryResult); + // Store user's zoom/pan preferences for the next browser session map.on('moveend', function(evt) { // Store map settings var centerCoordinate = ol.proj.transform(map.getView().getCenter(), map.getView().getProjection().getCode(),'EPSG:4326');