changeset 2735:3c2ac140ad30

identify_tool: zoom to BBox PoC implemented
author Thomas Junk <thomas.junk@intevation.de>
date Tue, 19 Mar 2019 16:32:07 +0100
parents 375c9dd935ad
children 017b1c0decfd
files client/src/components/identify/Identify.vue
diffstat 1 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/identify/Identify.vue	Tue Mar 19 16:01:58 2019 +0100
+++ b/client/src/components/identify/Identify.vue	Tue Mar 19 16:32:07 2019 +0100
@@ -33,7 +33,10 @@
             class="d-flex justify-content-between px-2"
           >
             <b>{{ $gettext(prop.key) }}</b>
-            {{ prop.val }}
+            <span v-if="prop.key != 'bbox'">{{ prop.val }}</span>
+            <a v-else @click="zoomTo(prop.val)" href="#"
+              ><translate>Zoom to</translate></a
+            >
           </small>
         </div>
         <div
@@ -111,6 +114,7 @@
  */
 import { mapState, mapGetters } from "vuex";
 import { formatter } from "./formatter";
+import { displayInfo } from "@/lib/errors.js";
 
 export default {
   name: "identify",
@@ -121,6 +125,15 @@
     ...mapState("map", ["currentMeasurement"])
   },
   methods: {
+    zoomTo(val) {
+      displayInfo({
+        message:
+          "Coordinates:\n" +
+          JSON.stringify(val)
+            .split(",")
+            .join("\n")
+      });
+    },
     close() {
       this.$store.commit("application/showIdentify", false);
     },