diff client/src/morphtool/Morphtool.vue @ 1140:2e06bc53b002

separating line/polygon/cut tools in UI Measurements can now be made while a bottleneck and sounding data is selected. The open layers interaction object(s) are now in the vuex store to disable them from other components (Morphtool.vue). Line and Polygon are now to separate buttons.
author Markus Kottlaender <markus@intevation.de>
date Mon, 12 Nov 2018 14:45:07 +0100
parents d9e6a1f6f394
children 5f98d0c9d738
line wrap: on
line diff
--- a/client/src/morphtool/Morphtool.vue	Wed Nov 07 15:26:46 2018 +0100
+++ b/client/src/morphtool/Morphtool.vue	Mon Nov 12 14:45:07 2018 +0100
@@ -104,12 +104,13 @@
  * Author(s):
  * Thomas Junk <thomas.junk@intevation.de>
  */
-import { mapState } from "vuex";
+import { mapState, mapGetters } from "vuex";
 
 export default {
   name: "morphtool",
   computed: {
-    ...mapState("map", ["drawMode"]),
+    ...mapGetters("map", ["getLayerByName"]),
+    ...mapState("map", ["openLayersMap", "cutTool"]),
     ...mapState("bottlenecks", [
       "selectedBottleneck",
       "surveys",
@@ -120,9 +121,9 @@
     clearSelection() {
       this.$store.dispatch("bottlenecks/setSelectedBottleneck", null);
       this.$store.commit("application/showSplitscreen", false);
-      if (this.drawMode) {
-        this.$store.commit("map/toggleDrawModeLine");
-      }
+      this.$store.commit("map/cutMode", false);
+      this.getLayerByName("Cut Tool").data.getSource().clear();
+      this.openLayersMap.removeInteraction(this.cutTool)
     }
   }
 };