changeset 2211:e901f509bfcd pdf-export

moveToExtent substitutes moveMap where easy doable
author Thomas Junk <thomas.junk@intevation.de>
date Wed, 06 Feb 2019 15:53:24 +0100
parents 0cae90830be0
children 733cfc3db48a
files client/src/components/Bottlenecks.vue client/src/components/ImportStretches.vue client/src/components/Search.vue client/src/components/fairway/Profiles.vue client/src/components/staging/StagingDetail.vue
diffstat 5 files changed, 9 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/Bottlenecks.vue	Wed Feb 06 15:20:58 2019 +0100
+++ b/client/src/components/Bottlenecks.vue	Wed Feb 06 15:53:24 2019 +0100
@@ -221,8 +221,8 @@
           this.$store.commit("bottlenecks/selectedSurvey", survey);
         })
         .then(() => {
-          this.$store.commit("map/moveMap", {
-            coordinates: bottleneck.geometry.coordinates,
+          this.$store.commit("map/moveToExtent", {
+            feature: bottleneck,
             zoom: 17,
             preventZoomOut: true
           });
@@ -238,8 +238,8 @@
           this.$store.commit("bottlenecks/setFirstSurveySelected");
         })
         .then(() => {
-          this.$store.commit("map/moveMap", {
-            coordinates: bottleneck.geometry.coordinates,
+          this.$store.commit("map/moveToExtent", {
+            feature: bottleneck,
             zoom: 17,
             preventZoomOut: true
           });
--- a/client/src/components/ImportStretches.vue	Wed Feb 06 15:20:58 2019 +0100
+++ b/client/src/components/ImportStretches.vue	Wed Feb 06 15:53:24 2019 +0100
@@ -263,7 +263,6 @@
 import { mapState, mapGetters } from "vuex";
 import { displayError, displayInfo } from "@/lib/errors.js";
 import { formatSurveyDate } from "@/lib/date.js";
-import center from "@turf/center";
 
 export default {
   name: "importstretches",
@@ -357,9 +356,8 @@
       });
     },
     moveMapToStretch(index) {
-      const { coordinates } = center(this.stretches[index]).geometry;
-      this.$store.commit("map/moveMap", {
-        coordinates: coordinates,
+      this.$store.commit("map/moveToExtent", {
+        feature: this.stretches[index],
         zoom: 17,
         preventZoomOut: true
       });
--- a/client/src/components/Search.vue	Wed Feb 06 15:20:58 2019 +0100
+++ b/client/src/components/Search.vue	Wed Feb 06 15:53:24 2019 +0100
@@ -269,7 +269,6 @@
         if (resultEntry.type === "bottleneck") zoom = 17;
         if (resultEntry.type === "rhm") zoom = 15;
         if (resultEntry.type === "city") zoom = 13;
-
         this.$store.commit("map/moveMap", {
           coordinates: resultEntry.geom.coordinates,
           zoom,
--- a/client/src/components/fairway/Profiles.vue	Wed Feb 06 15:20:58 2019 +0100
+++ b/client/src/components/fairway/Profiles.vue	Wed Feb 06 15:53:24 2019 +0100
@@ -460,8 +460,8 @@
         bn => bn.properties.name === this.selectedBottleneck
       );
       if (!bottleneck) return;
-      this.$store.commit("map/moveMap", {
-        coordinates: bottleneck.geometry.coordinates,
+      this.$store.commit("map/moveToExtent", {
+        feature: bottleneck,
         zoom: 17,
         preventZoomOut: true
       });
--- a/client/src/components/staging/StagingDetail.vue	Wed Feb 06 15:20:58 2019 +0100
+++ b/client/src/components/staging/StagingDetail.vue	Wed Feb 06 15:53:24 2019 +0100
@@ -162,7 +162,6 @@
 import { or as orFilter, equalTo as equalToFilter } from "ol/format/filter.js";
 import { displayError } from "@/lib/errors.js";
 import { mapState } from "vuex";
-import center from "@turf/center";
 
 export default {
   name: "stagingdetail",
@@ -302,8 +301,7 @@
       return item.status === STATES.APPROVED;
     },
     moveToBottleneck(index) {
-      const { coordinates } = center(this.bottlenecks[index]).geometry;
-      this.moveMap(coordinates);
+      this.moveToExtent(this.bottlenecks[index]);
     },
     moveToExtent(feature) {
       this.$store.commit("map/moveToExtent", {