# HG changeset patch # User Markus Kottlaender # Date 1557857290 -7200 # Node ID 916d4c898f08aa5fe36004e0f3c13dbd1b05b8cc # Parent 909a19e97db962f77b0609053de9595f2c2f56f3 client: import stretches: prevent map/identify popup from opening when selecting a distance mark on the map diff -r 909a19e97db9 -r 916d4c898f08 client/src/components/Contextbox.vue --- 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( diff -r 909a19e97db9 -r 916d4c898f08 client/src/components/ImportStretches.vue --- 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; } diff -r 909a19e97db9 -r 916d4c898f08 client/src/store/map.js --- 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);