# HG changeset patch # User Thomas Junk # Date 1549464804 -3600 # Node ID e901f509bfcd5eed3de6ef15c38288eb29ede8ac # Parent 0cae90830be0b4e9271b604838af1112092eba49 moveToExtent substitutes moveMap where easy doable diff -r 0cae90830be0 -r e901f509bfcd client/src/components/Bottlenecks.vue --- 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 }); diff -r 0cae90830be0 -r e901f509bfcd client/src/components/ImportStretches.vue --- 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 }); diff -r 0cae90830be0 -r e901f509bfcd client/src/components/Search.vue --- 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, diff -r 0cae90830be0 -r e901f509bfcd client/src/components/fairway/Profiles.vue --- 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 }); diff -r 0cae90830be0 -r e901f509bfcd client/src/components/staging/StagingDetail.vue --- 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", {