Mercurial > gemma
changeset 3873:d62de00e4c28
client: fixed zooming to bottlenecks from mapPopup or bottleneck list
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Tue, 09 Jul 2019 17:57:44 +0200 |
parents | a7a75e003b78 |
children | 044569f900d1 |
files | client/src/components/Bottlenecks.vue client/src/components/map/MapPopup.vue |
diffstat | 2 files changed, 16 insertions(+), 23 deletions(-) [+] |
line wrap: on
line diff
--- a/client/src/components/Bottlenecks.vue Tue Jul 09 17:12:58 2019 +0200 +++ b/client/src/components/Bottlenecks.vue Tue Jul 09 17:57:44 2019 +0200 @@ -144,7 +144,7 @@ .then(() => { this.$store.dispatch("map/moveToFeauture", { feature: bottleneck, - zoom: 17, + zoom: 16, preventZoomOut: true }); }); @@ -158,7 +158,7 @@ .then(() => { this.$store.dispatch("map/moveToFeauture", { feature: bottleneck, - zoom: 17, + zoom: 16, preventZoomOut: true }); });
--- a/client/src/components/map/MapPopup.vue Tue Jul 09 17:12:58 2019 +0200 +++ b/client/src/components/map/MapPopup.vue Tue Jul 09 17:57:44 2019 +0200 @@ -135,7 +135,6 @@ */ import { mapState } from "vuex"; import Overlay from "ol/Overlay.js"; -import { getCenter } from "ol/extent"; import { TYPES } from "@/store/fairwayavailability"; export default { @@ -182,16 +181,13 @@ "bottlenecks/setSelectedBottleneck", bottleneck.get("objnam") ); - this.$store.dispatch("map/moveMap", { - coordinates: getCenter( - bottleneck - .getGeometry() - .clone() - .transform("EPSG:3857", "EPSG:4326") - .getExtent() - ), - zoom: 17, - preventZoomOut: true + this.$store.dispatch("map/moveToBoundingBox", { + boundingBox: bottleneck + .getGeometry() + .clone() + .transform("EPSG:3857", "EPSG:4326") + .getExtent(), + zoom: 16 }); this.close(); }, @@ -210,16 +206,13 @@ "bottlenecks/setSelectedBottleneck", bottleneck.get("objnam") ); - this.$store.dispatch("map/moveMap", { - coordinates: getCenter( - bottleneck - .getGeometry() - .clone() - .transform("EPSG:3857", "EPSG:4326") - .getExtent() - ), - zoom: 17, - preventZoomOut: true + this.$store.dispatch("map/moveToBoundingBox", { + boundingBox: bottleneck + .getGeometry() + .clone() + .transform("EPSG:3857", "EPSG:4326") + .getExtent(), + zoom: 16 }); this.openFairwayAvailability(); },