changeset 3261:916d4c898f08

client: import stretches: prevent map/identify popup from opening when selecting a distance mark on the map
author Markus Kottlaender <markus@intevation.de>
date Tue, 14 May 2019 20:08:10 +0200
parents 909a19e97db9
children a2e9671f4ad6
files client/src/components/Contextbox.vue client/src/components/ImportStretches.vue client/src/store/map.js
diffstat 3 files changed, 16 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/Contextbox.vue	Tue May 14 19:52:26 2019 +0200
+++ b/client/src/components/Contextbox.vue	Tue May 14 20:08:10 2019 +0200
@@ -56,6 +56,7 @@
   },
   methods: {
     close() {
+      this.$store.commit("map/mapPopupEnabled", true);
       this.$store.commit("application/searchQuery", "");
       this.$store.commit("application/showContextBox", false);
       this.$store.commit(
--- a/client/src/components/ImportStretches.vue	Tue May 14 19:52:26 2019 +0200
+++ b/client/src/components/ImportStretches.vue	Tue May 14 20:08:10 2019 +0200
@@ -375,6 +375,7 @@
         this.endrhm = this.pipetteEnd ? location : this.endrhm;
         this.pipetteStart = false;
         this.pipetteEnd = false;
+        this.$store.commit("map/mapPopupEnabled", true);
       }
     }
   },
@@ -500,9 +501,11 @@
         .getLayer("DISTANCEMARKSAXIS")
         .setVisible(true);
       if (t === "start") {
+        this.$store.commit("map/mapPopupEnabled", this.pipetteStart);
         this.pipetteStart = !this.pipetteStart;
         this.pipetteEnd = false;
       } else {
+        this.$store.commit("map/mapPopupEnabled", this.pipetteEnd);
         this.pipetteEnd = !this.pipetteEnd;
         this.pipetteStart = false;
       }
--- a/client/src/store/map.js	Tue May 14 19:52:26 2019 +0200
+++ b/client/src/store/map.js	Tue May 14 20:08:10 2019 +0200
@@ -33,6 +33,7 @@
     syncedMaps: [],
     syncedView: null,
     mapPopup: null,
+    mapPopupEnabled: true,
     initialLoad: true,
     extent: {
       lat: 6155376,
@@ -91,6 +92,9 @@
     mapPopup: (state, popup) => {
       state.mapPopup = popup;
     },
+    mapPopupEnabled: (state, enabled) => {
+      state.mapPopupEnabled = enabled;
+    },
     setIdentifiedFeatures: (state, identifiedFeatures) => {
       state.identifiedFeatures = identifiedFeatures;
     },
@@ -336,13 +340,14 @@
           // The following cases require a manual decision via the popup because
           // the targeted feature is not clear.
           if (
-            bottlenecks.length ||
-            gauges.length > 1 ||
-            stretches.length > 1 ||
-            sections.length > 1 ||
-            (sections.length && stretches.length) ||
-            (gauges.length && sections.length) ||
-            (gauges.length && stretches.length)
+            (bottlenecks.length ||
+              gauges.length > 1 ||
+              stretches.length > 1 ||
+              sections.length > 1 ||
+              (sections.length && stretches.length) ||
+              (gauges.length && sections.length) ||
+              (gauges.length && stretches.length)) &&
+            state.mapPopupEnabled
           ) {
             state.mapPopup.setMap(map);
             state.mapPopup.setPosition(event.coordinate);