diff client/src/store/map.js @ 1313:e4e35fb2d995

save map extent (center/zoom) in store, to not lose it when switching between map and admin area
author Markus Kottlaender <markus@intevation.de>
date Fri, 23 Nov 2018 15:18:14 +0100
parents 99c039e86624
children ea3a89a1813a
line wrap: on
line diff
--- a/client/src/store/map.js	Fri Nov 23 13:57:31 2018 +0100
+++ b/client/src/store/map.js	Fri Nov 23 15:18:14 2018 +0100
@@ -31,6 +31,11 @@
 const init = () => {
   return {
     openLayersMap: null,
+    extent: {
+      lat: 6155376,
+      lon: 1819178,
+      zoom: 11
+    },
     identifiedFeatures: [], // map features identified by clicking on the map
     currentMeasurement: null, // distance or area from line-/polygon-/cutTool
     lineTool: null, // open layers interaction object (Draw)
@@ -347,6 +352,9 @@
     }
   },
   mutations: {
+    extent: (state, extent) => {
+      state.extent = extent;
+    },
     toggleVisibility: (state, layer) => {
       state.layers[layer].isVisible = !state.layers[layer].isVisible;
       state.layers[layer].data.setVisible(state.layers[layer].isVisible);