changeset 3127:0374197c384f

client: fix openLayersMap getter calls
author Markus Kottlaender <markus@intevation.de>
date Mon, 29 Apr 2019 16:05:14 +0200
parents f6fb8803032f
children 1610d3042bbb
files client/src/components/ImportStretches.vue client/src/components/Pdftool.vue client/src/components/importoverview/BottleneckDetail.vue client/src/components/importoverview/StretchDetails.vue
diffstat 4 files changed, 21 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/ImportStretches.vue	Mon Apr 29 15:08:59 2019 +0200
+++ b/client/src/components/ImportStretches.vue	Mon Apr 29 16:05:14 2019 +0200
@@ -459,7 +459,9 @@
     },
     moveMapToStretch(stretch) {
       this.$store.commit("imports/selectedStretchId", stretch.id);
-      this.openLayersMap.getLayer("STRETCHES").setVisible(true);
+      this.openLayersMap()
+        .getLayer("STRETCHES")
+        .setVisible(true);
       this.$store.dispatch("map/moveToFeauture", {
         feature: stretch,
         zoom: 17,
--- a/client/src/components/Pdftool.vue	Mon Apr 29 15:08:59 2019 +0200
+++ b/client/src/components/Pdftool.vue	Mon Apr 29 16:05:14 2019 +0200
@@ -264,7 +264,7 @@
       //    which will generate the pdf and resets the map view
       // Step 2 which starts rendering a map with the necessary image size
 
-      var map = this.openLayersMap;
+      var map = this.openLayersMap();
       this.mapSize = map.getSize(); // size in pixels of the map in the DOM
       // Calculate the extent for the current view state and the passed size.
       // The size is the pixel dimensions of the box into which the calculated
@@ -436,12 +436,14 @@
       map.getView().fit(this.mapExtent, { size: mapSizeForPrint });
     },
     cancel() {
-      this.openLayersMap.un(
+      this.openLayersMap().un(
         this.rendercompleteListener.type,
         this.rendercompleteListener.listener
       );
-      this.openLayersMap.setSize(this.mapSize);
-      this.openLayersMap.getView().fit(this.mapExtent, { size: this.mapSize });
+      this.openLayersMap().setSize(this.mapSize);
+      this.openLayersMap()
+        .getView()
+        .fit(this.mapExtent, { size: this.mapSize });
       this.readyToGenerate = true;
     },
     // add the used map scale and papersize
@@ -753,7 +755,9 @@
       if (
         this.selectedBottleneck &&
         this.selectedSurvey &&
-        this.openLayersMap.getLayer("BOTTLENECKISOLINE").getVisible()
+        this.openLayersMap()
+          .getLayer("BOTTLENECKISOLINE")
+          .getVisible()
       ) {
         // transforming into an HTMLImageElement only to find out
         // the width x height of the legend image
@@ -792,7 +796,9 @@
       if (
         this.selectedBottleneck &&
         this.selectedSurvey &&
-        this.openLayersMap.getLayer("BOTTLENECKISOLINE").getVisible()
+        this.openLayersMap()
+          .getLayer("BOTTLENECKISOLINE")
+          .getVisible()
       ) {
         let survey = this.selectedSurvey;
 
--- a/client/src/components/importoverview/BottleneckDetail.vue	Mon Apr 29 15:08:59 2019 +0200
+++ b/client/src/components/importoverview/BottleneckDetail.vue	Mon Apr 29 16:05:14 2019 +0200
@@ -147,7 +147,9 @@
         });
     },
     moveToBottleneck(index) {
-      this.openLayersMap.getLayer("BOTTLENECKS").setVisible(true);
+      this.openLayersMap()
+        .getLayer("BOTTLENECKS")
+        .setVisible(true);
       this.$store.dispatch("map/moveToFeauture", {
         feature: this.bottlenecks[index],
         zoom: 17,
--- a/client/src/components/importoverview/StretchDetails.vue	Mon Apr 29 15:08:59 2019 +0200
+++ b/client/src/components/importoverview/StretchDetails.vue	Mon Apr 29 16:05:14 2019 +0200
@@ -36,7 +36,9 @@
   methods: {
     zoomToStretch() {
       const name = this.details.summary.stretch;
-      this.openLayersMap.getLayer("STRETCHES").setVisible(true);
+      this.openLayersMap()
+        .getLayer("STRETCHES")
+        .setVisible(true);
       this.$store
         .dispatch("imports/loadStretch", name)
         .then(response => {