comparison 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
comparison
equal deleted inserted replaced
2135:60c493aaee43 2136:3138d60dd1a6
261 * Thomas Junk <thomas.junk@intevation.de> 261 * Thomas Junk <thomas.junk@intevation.de>
262 */ 262 */
263 import { mapState, mapGetters } from "vuex"; 263 import { mapState, mapGetters } from "vuex";
264 import { displayError, displayInfo } from "@/lib/errors.js"; 264 import { displayError, displayInfo } from "@/lib/errors.js";
265 import { formatSurveyDate } from "@/lib/date.js"; 265 import { formatSurveyDate } from "@/lib/date.js";
266 import center from "@turf/center";
267 266
268 export default { 267 export default {
269 name: "importstretches", 268 name: "importstretches",
270 data() { 269 data() {
271 return { 270 return {
355 title: this.$gettext("Not implemented"), 354 title: this.$gettext("Not implemented"),
356 message: this.$gettext("Deleting " + this.stretches[index].id) 355 message: this.$gettext("Deleting " + this.stretches[index].id)
357 }); 356 });
358 }, 357 },
359 moveMapToStretch(index) { 358 moveMapToStretch(index) {
360 const { coordinates } = center(this.stretches[index]).geometry; 359 this.$store.commit("map/moveToExtent", {
361 this.$store.commit("map/moveMap", { 360 feature: this.stretches[index],
362 coordinates: coordinates,
363 zoom: 17, 361 zoom: 17,
364 preventZoomOut: true 362 preventZoomOut: true
365 }); 363 });
366 }, 364 },
367 formatSurveyDate(d) { 365 formatSurveyDate(d) {