Mercurial > gemma
changeset 3017:9a408a8b74b8
client: inlined some functions that were used only once
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Thu, 11 Apr 2019 16:56:15 +0200 |
parents | 083cd270bdfd |
children | 42d1e31de844 |
files | client/src/components/importoverview/BottleneckDetail.vue client/src/components/importoverview/SoundingResultDetail.vue client/src/components/importoverview/StretchDetails.vue |
diffstat | 3 files changed, 9 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/client/src/components/importoverview/BottleneckDetail.vue Thu Apr 11 16:44:27 2019 +0200 +++ b/client/src/components/importoverview/BottleneckDetail.vue Thu Apr 11 16:56:15 2019 +0200 @@ -148,11 +148,8 @@ }, moveToBottleneck(index) { this.openLayersMap.getLayer("BOTTLENECKS").setVisible(true); - this.moveToExtent(this.bottlenecks[index]); - }, - moveToExtent(feature) { this.$store.commit("map/moveToExtent", { - feature: feature, + feature: this.bottlenecks[index], zoom: 17, preventZoomOut: true });
--- a/client/src/components/importoverview/SoundingResultDetail.vue Thu Apr 11 16:44:27 2019 +0200 +++ b/client/src/components/importoverview/SoundingResultDetail.vue Thu Apr 11 16:56:15 2019 +0200 @@ -32,17 +32,13 @@ ...mapState("imports", ["showAdditional", "details"]) }, methods: { - moveMap(coordinates) { + zoomTo() { + const { lat, lon, bottleneck, date } = this.details.summary; this.$store.commit("map/moveMap", { - coordinates: coordinates, + coordinates: [lat, lon], zoom: 17, preventZoomOut: true }); - }, - zoomTo() { - const { lat, lon, bottleneck, date } = this.details.summary; - const coordinates = [lat, lon]; - this.moveMap(coordinates); this.$store .dispatch("bottlenecks/setSelectedBottleneck", bottleneck) .then(() => {
--- a/client/src/components/importoverview/StretchDetails.vue Thu Apr 11 16:44:27 2019 +0200 +++ b/client/src/components/importoverview/StretchDetails.vue Thu Apr 11 16:56:15 2019 +0200 @@ -34,13 +34,6 @@ ...mapState("map", ["openLayersMap"]) }, methods: { - moveToExtent(feature) { - this.$store.commit("map/moveToExtent", { - feature: feature, - zoom: 17, - preventZoomOut: true - }); - }, zoomToStretch() { const name = this.details.summary.stretch; this.openLayersMap.getLayer("STRETCHES").setVisible(true); @@ -49,7 +42,11 @@ .then(response => { if (response.data.features.length < 1) throw new Error("no feaures found for: " + name); - this.moveToExtent(response.data.features[0]); + this.$store.commit("map/moveToExtent", { + feature: response.data.features[0], + zoom: 17, + preventZoomOut: true + }); }) .catch(error => { console.log(error);