changeset 1062:d3bdad8ed8d3

client: simply code structure and add author * Move drawMode from being a parameter to maplayer to being aquired from the application store within Maplayer.vue. This way Main.vue does not need to know about drawMode, which is a minor simplification. * Add Bernhard to the authors of Maplayer.vue.
author Bernhard Reiter <bernhard@intevation.de>
date Thu, 25 Oct 2018 21:10:23 +0200
parents 3418f3e2c822
children 7ec2133c6404
files client/src/application/Main.vue client/src/map/Maplayer.vue
diffstat 2 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/application/Main.vue	Thu Oct 25 21:04:32 2018 +0200
+++ b/client/src/application/Main.vue	Thu Oct 25 21:10:23 2018 +0200
@@ -1,7 +1,6 @@
 <template>
     <div class="main d-flex flex-column">
         <Maplayer
-            :drawMode="drawMode"
             :split="isSplitscreen"
             :lat="6155376"
             :long="1819178"
@@ -74,7 +73,7 @@
     };
   },
   computed: {
-    ...mapGetters("application", ["isSplitscreen", "drawMode"]),
+    ...mapGetters("application", ["isSplitscreen"]),
     ...mapState("fairwayprofile", [
       "currentProfile",
       "minAlt",
--- a/client/src/map/Maplayer.vue	Thu Oct 25 21:04:32 2018 +0200
+++ b/client/src/map/Maplayer.vue	Thu Oct 25 21:10:23 2018 +0200
@@ -27,16 +27,17 @@
 /*
  * This is Free Software under GNU Affero General Public License v >= 3.0
  * without warranty, see README.md and license for details.
- * 
+ *
  * SPDX-License-Identifier: AGPL-3.0-or-later
  * License-Filename: LICENSES/AGPL-3.0.txt
- * 
+ *
  * Copyright (C) 2018 by via donau 
  *   – Österreichische Wasserstraßen-Gesellschaft mbH
  * Software engineering by Intevation GmbH
- * 
+ *
  * Author(s):
- * Thomas Junk <thomas.junk@intevation.de>
+ * * Thomas Junk <thomas.junk@intevation.de>
+ * * Bernhard E. Reiter <bernhard.reiter@intevation.de>
  */
 import { HTTP } from "../application/lib/http";
 import { mapGetters, mapState } from "vuex";
@@ -60,7 +61,7 @@
 /* eslint-disable no-console */
 export default {
   name: "maplayer",
-  props: ["drawMode", "lat", "long", "zoom", "split"],
+  props: ["lat", "long", "zoom", "split"],
   data() {
     return {
       projection: "EPSG:3857",
@@ -71,6 +72,7 @@
   },
   computed: {
     ...mapGetters("mapstore", ["layers", "getLayerByName"]),
+    ...mapState("application", ["drawMode"]),
     ...mapState("mapstore", ["openLayersMap"]),
     ...mapState("fairwayprofile", ["selectedMorph"]),
     mapStyle() {
@@ -158,7 +160,7 @@
       const length = getLength(event.feature.getGeometry());
       this.$store.commit("identifystore/setCurrentMeasurement", length);
       // also place the a rounded length in a property, so identify can show it
-      event.feature.set("length", Math.round(length * 10) / 10);
+      event.feature.set("length (m)", Math.round(length * 10) / 10);
 
       // if a survey has been selected, request a profile
       // TODO an improvement could be to check if the line intersects