Mercurial > gemma
changeset 2747:fb5deecb77f1
client:identified box: implement the bbox zoom button
author | Fadi Abbud <fadi.abbud@intevation.de> |
---|---|
date | Wed, 20 Mar 2019 17:19:59 +0100 |
parents | 349a3610dfc5 |
children | c6695d6e9334 |
files | client/src/components/identify/Identify.vue |
diffstat | 1 files changed, 11 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/client/src/components/identify/Identify.vue Wed Mar 20 17:09:07 2019 +0100 +++ b/client/src/components/identify/Identify.vue Wed Mar 20 17:19:59 2019 +0100 @@ -128,7 +128,7 @@ */ import { mapState, mapGetters } from "vuex"; import { formatter } from "./formatter"; -import { displayInfo } from "@/lib/errors.js"; +import { getCenter } from "ol/extent"; export default { name: "identify", @@ -140,12 +140,16 @@ }, methods: { zoomTo(feature) { - displayInfo({ - message: - "Coordinates:\n" + - JSON.stringify(feature.getProperties().bbox) - .split(",") - .join("\n") + this.$store.commit("map/moveMap", { + coordinates: getCenter( + feature + .getGeometry() + .clone() + .transform("EPSG:3857", "EPSG:4326") + .getExtent() + ), + zoom: 17, + preventZoomOut: true }); }, close() {