diff client/src/identify/Identify.vue @ 1071:f8f398e36e38

client: improve area measurement * Change way of transfering data for display towards using the store where different quantities, symbols can be used. This way we do not depend on the identify tool to find our feature. It avoids the problem that the final click on a snap to point for an area may not hit our feshly drawn feature. At the same time it will get easier to display the measurement result in a different way, like translating the quantity. Right now it is displayed on top of the identified box.
author Bernhard Reiter <bernhard@intevation.de>
date Fri, 26 Oct 2018 10:31:52 +0200
parents 7ec2133c6404
children 2c3d32322126
line wrap: on
line diff
--- a/client/src/identify/Identify.vue	Fri Oct 26 10:05:20 2018 +0200
+++ b/client/src/identify/Identify.vue	Fri Oct 26 10:31:52 2018 +0200
@@ -12,6 +12,11 @@
                 </div>
                 <hr>
                 <div class="d-flex flex-column features">
+                    <small v-if="currentMeasurement">
+                      {{ currentMeasurement.quantity }}
+                      ({{ currentMeasurement.unitSymbol }}):
+                      {{ currentMeasurement.value }}
+                    </small>
                     <div v-for="feature of identifiedFeatures" :key="feature.getId()">
                         <div v-if="feature.getId()">
                             {{ feature.getId().replace(/[.][^.]*$/,"") /* cut away everything from the last . to the end */}}:
@@ -104,7 +109,7 @@
   },
   computed: {
     ...mapGetters("application", ["versionStr"]),
-    ...mapState("identifystore", ["identifiedFeatures"]),
+    ...mapState("identifystore", ["identifiedFeatures", "currentMeasurement"]),
     identifyStyle() {
       return {
         "ui-element": true,