diff client/src/map/store.js @ 770:c12ec7fde3f2

client: add simple identify top area box * Add Identify.vue as a top area box that display the currently identified features in a short text-only way. This can be styled further, also the box is not yet resized dynamically. Put in to subdir layers because it is closest to Layers.vue, which was used as a template. * Introduce a new mapstore/identifiedFeatures state.
author Bernhard Reiter <bernhard@intevation.de>
date Wed, 26 Sep 2018 09:13:29 +0200
parents 105c421f99b1
children cb6dc630c702
line wrap: on
line diff
--- a/client/src/map/store.js	Tue Sep 25 21:51:53 2018 +0200
+++ b/client/src/map/store.js	Wed Sep 26 09:13:29 2018 +0200
@@ -147,7 +147,8 @@
         }),
         isVisible: true
       }
-    ]
+    ],
+    identifiedFeatures: []
   },
   getters: {
     layers: state => {
@@ -155,12 +156,18 @@
     },
     getLayerByName: state => name => {
       return state.layers.find(layer => layer.name === name);
+    },
+    identifiedFeatures: state => {
+      return state.identifiedFeatures;
     }
   },
   mutations: {
     toggleVisibility: (state, layer) => {
       state.layers[layer].isVisible = !state.layers[layer].isVisible;
       state.layers[layer].data.setVisible(state.layers[layer].isVisible);
+    },
+    setIdentifiedFeatures: (state, identifiedFeatures) => {
+      state.identifiedFeatures = identifiedFeatures;
     }
   }
 };