changeset 2868:85dd3f98e18a

show differences moved up in legend. Switch isolines off when showing differences
author Thomas Junk <thomas.junk@intevation.de>
date Fri, 29 Mar 2019 12:56:29 +0100
parents 23ff7f6c543b
children 02f51054f648
files client/src/components/fairway/Profiles.vue client/src/store/map.js
diffstat 2 files changed, 30 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/fairway/Profiles.vue	Fri Mar 29 12:07:09 2019 +0100
+++ b/client/src/components/fairway/Profiles.vue	Fri Mar 29 12:56:29 2019 +0100
@@ -424,6 +424,7 @@
               this.additionalSurvey.date_info +
               "'"
           });
+          this.$store.commit("map/setLayerInvisible", LAYERS.BOTTLENECKISOLINE);
           this.$store.commit("map/setLayerVisible", LAYERS.DIFFERENCES);
         })
         .catch(error => {
--- a/client/src/store/map.js	Fri Mar 29 12:07:09 2019 +0100
+++ b/client/src/store/map.js	Fri Mar 29 12:56:29 2019 +0100
@@ -51,7 +51,7 @@
   GAUGES: "Gauges",
   DRAWTOOL: "Draw Tool",
   CUTTOOL: "Cut Tool",
-  DIFFERENCES: "Differences"
+  DIFFERENCES: "Bottleneck Differences"
 };
 
 const moveMap = ({ view, extent, zoom, preventZoomOut }) => {
@@ -327,6 +327,34 @@
         showInLegend: true
       },
       {
+        name: LAYERS.DIFFERENCES,
+        data: new TileLayer({
+          source: new TileWMS({
+            preload: 0,
+            projection: "EPSG:4326",
+            url: window.location.origin + "/api/internal/wms",
+            params: {
+              LAYERS: "sounding_differences",
+              VERSION: "1.1.1",
+              TILED: true
+            },
+            tileLoadFunction: function(tile, src) {
+              // console.log("calling for", tile, src);
+              HTTP.get(src, {
+                headers: {
+                  "X-Gemma-Auth": localStorage.getItem("token")
+                },
+                responseType: "blob"
+              }).then(response => {
+                tile.getImage().src = URL.createObjectURL(response.data);
+              });
+            } // TODO  tile.setState(TileState.ERROR);
+          })
+        }),
+        isVisible: false,
+        showInLegend: true
+      },
+      {
         name: LAYERS.BOTTLENECKSTATUS,
         forLegendStyle: { point: true, resolution: 16 },
         data: new VectorLayer({
@@ -551,34 +579,6 @@
         }),
         isVisible: true,
         showInLegend: false
-      },
-      {
-        name: LAYERS.DIFFERENCES,
-        data: new TileLayer({
-          source: new TileWMS({
-            preload: 0,
-            projection: "EPSG:4326",
-            url: window.location.origin + "/api/internal/wms",
-            params: {
-              LAYERS: "sounding_differences",
-              VERSION: "1.1.1",
-              TILED: true
-            },
-            tileLoadFunction: function(tile, src) {
-              // console.log("calling for", tile, src);
-              HTTP.get(src, {
-                headers: {
-                  "X-Gemma-Auth": localStorage.getItem("token")
-                },
-                responseType: "blob"
-              }).then(response => {
-                tile.getImage().src = URL.createObjectURL(response.data);
-              });
-            } // TODO  tile.setState(TileState.ERROR);
-          })
-        }),
-        isVisible: false,
-        showInLegend: true
       }
     ]
   };