comparison client/src/components/identify/Identify.vue @ 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 4063adda3095
children d0f6c222f4f9
comparison
equal deleted inserted replaced
2746:349a3610dfc5 2747:fb5deecb77f1
126 * Bernhard E. Reiter <bernhard.reiter@intevation.de> 126 * Bernhard E. Reiter <bernhard.reiter@intevation.de>
127 * Markus Kottländer <markus.kottlaender@intevation.de> 127 * Markus Kottländer <markus.kottlaender@intevation.de>
128 */ 128 */
129 import { mapState, mapGetters } from "vuex"; 129 import { mapState, mapGetters } from "vuex";
130 import { formatter } from "./formatter"; 130 import { formatter } from "./formatter";
131 import { displayInfo } from "@/lib/errors.js"; 131 import { getCenter } from "ol/extent";
132 132
133 export default { 133 export default {
134 name: "identify", 134 name: "identify",
135 computed: { 135 computed: {
136 ...mapGetters("application", ["versionStr"]), 136 ...mapGetters("application", ["versionStr"]),
138 ...mapGetters("map", ["filteredIdentifiedFeatures"]), 138 ...mapGetters("map", ["filteredIdentifiedFeatures"]),
139 ...mapState("map", ["currentMeasurement"]) 139 ...mapState("map", ["currentMeasurement"])
140 }, 140 },
141 methods: { 141 methods: {
142 zoomTo(feature) { 142 zoomTo(feature) {
143 displayInfo({ 143 this.$store.commit("map/moveMap", {
144 message: 144 coordinates: getCenter(
145 "Coordinates:\n" + 145 feature
146 JSON.stringify(feature.getProperties().bbox) 146 .getGeometry()
147 .split(",") 147 .clone()
148 .join("\n") 148 .transform("EPSG:3857", "EPSG:4326")
149 .getExtent()
150 ),
151 zoom: 17,
152 preventZoomOut: true
149 }); 153 });
150 }, 154 },
151 close() { 155 close() {
152 this.$store.commit("application/showIdentify", false); 156 this.$store.commit("application/showIdentify", false);
153 }, 157 },