diff client/src/components/toolbar/Polygontool.vue @ 2957:b74ebeb2bdc8

client: layers: improved structure of layer configuration The object is now less cluttered, access to the layers is more direct, no need for helper methods anymore.
author Markus Kottlaender <markus@intevation.de>
date Mon, 08 Apr 2019 15:32:53 +0200
parents c0162cbb5775
children 44493664d40e
line wrap: on
line diff
--- a/client/src/components/toolbar/Polygontool.vue	Mon Apr 08 14:53:09 2019 +0200
+++ b/client/src/components/toolbar/Polygontool.vue	Mon Apr 08 15:32:53 2019 +0200
@@ -25,14 +25,12 @@
  * Author(s):
  * Markus Kottländer <markus.kottlaender@intevation.de>
  */
-import { mapState, mapGetters } from "vuex";
-import { LAYERS } from "@/store/map.js";
+import { mapState } from "vuex";
 
 export default {
   name: "polygontool",
   computed: {
-    ...mapGetters("map", ["getVSourceByName"]),
-    ...mapState("map", ["lineTool", "polygonTool", "cutTool"]),
+    ...mapState("map", ["layers", "lineTool", "polygonTool", "cutTool"]),
     label() {
       return this.$gettext("Measure Area");
     }
@@ -43,7 +41,7 @@
       this.lineTool.setActive(false);
       this.cutTool.setActive(false);
       this.$store.commit("map/setCurrentMeasurement", null);
-      this.getVSourceByName(LAYERS.DRAWTOOL).clear();
+      this.layers.DRAWTOOL.getSource().clear();
     }
   }
 };