diff client/src/components/ImportStretches.vue @ 2136:3138d60dd1a6

moveToExtent substitutes moveMap where easy doable
author Thomas Junk <thomas.junk@intevation.de>
date Wed, 06 Feb 2019 15:53:24 +0100
parents e9879eb7e965
children 55bedb39295a
line wrap: on
line diff
--- 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
       });