changeset 4576:3290d1b2c580 iso-areas

Merged default into iso-areas branch.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 07 Oct 2019 17:49:25 +0200
parents 6415368c2c60 (current diff) 63fceb662047 (diff)
children 82029885c11b
files
diffstat 6 files changed, 35 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/fairway/BottleneckDialogue.vue	Mon Oct 07 17:48:56 2019 +0200
+++ b/client/src/components/fairway/BottleneckDialogue.vue	Mon Oct 07 17:49:25 2019 +0200
@@ -380,6 +380,7 @@
       "endPoint",
       "profileLoading",
       "differencesLoading",
+      "currentDifference",
       "waterLevels",
       "currentProfile"
     ]),
@@ -572,7 +573,30 @@
           }
         }
       )
-        .then()
+        .then(response => {
+          this.$store.commit(
+            "fairwayprofile/setCurrentDifference",
+            response.data.id
+          );
+          if (this.openLayersMap(COMPARESURVEYS.compare.id)) {
+            this.openLayersMap(COMPARESURVEYS.compare.id)
+              .getLayer("DIFFERENCES")
+              .getSource()
+              .updateParams({
+                LAYERS: "sounding_differences",
+                VERSION: "1.1.1",
+                TILED: true,
+                CQL_FILTER: "id=" + response.data.id
+              });
+            this.openLayersMap(COMPARESURVEYS.compare.id)
+              .getLayer("DIFFERENCES")
+              .getSource()
+              .refresh();
+            this.openLayersMap(COMPARESURVEYS.compare.id)
+              .getLayer("DIFFERENCES")
+              .setVisible(false);
+          }
+        })
         .catch(error => {
           let status, data, message;
           if (error.response) {
--- a/client/src/components/fairway/Fairwayprofile.vue	Mon Oct 07 17:48:56 2019 +0200
+++ b/client/src/components/fairway/Fairwayprofile.vue	Mon Oct 07 17:49:25 2019 +0200
@@ -284,20 +284,11 @@
       let style = this.openLayersMap()
         .getLayer("FAIRWAYDIMENSIONSLOS" + los)
         .getStyle()()[0];
-
       // use spread operator to clone arrays
       let fillColor = style.getFill().getColor();
-      let fillOpacity =
-        fillColor.length < 8
-          ? 0.8
-          : parseFloat(parseInt(fillColor.slice(7), 16) / 255).toFixed(2);
       let strokeColor = style.getStroke().getColor();
-      let strokeOpacity =
-        strokeColor.length < 8
-          ? 0.8
-          : parseFloat(parseInt(strokeColor.slice(7), 16) / 255).toFixed(2);
       let strokeDash = style.getStroke().getLineDash();
-      return { fillColor, fillOpacity, strokeColor, strokeOpacity, strokeDash };
+      return { fillColor, strokeColor, strokeDash };
     },
     applyChange() {
       if (this.form.template.hasOwnProperty("properties")) {
@@ -479,9 +470,7 @@
               { x: endPoint, y: this.useCustomDepth ? this.depth : depth }
             ])
             .attr("fill", `${this.getLayerStyle(data.los).fillColor}`)
-            .attr("fill-opacity", this.getLayerStyle(data.los).fillOpacity)
             .attr("stroke", `${this.getLayerStyle(data.los).strokeColor}`)
-            .attr("stroke-opacity", this.getLayerStyle(data.los).strokeOpacity)
             .attr("stroke-dasharray", this.getLayerStyle(data.los).strokeDash)
             .attr("d", fairwayArea)
             .attr("transform", `translate(0 ${-offsetY})`);
--- a/client/src/components/map/Map.vue	Mon Oct 07 17:48:56 2019 +0200
+++ b/client/src/components/map/Map.vue	Mon Oct 07 17:49:25 2019 +0200
@@ -327,9 +327,8 @@
           parseInt(color.slice(3, 5), 16) +
           ", " +
           parseInt(color.slice(5, 7), 16) +
-          (color.length > 7
-            ? ", " + parseInt(color.slice(7, 9), 16) / 255
-            : "") +
+          ", " +
+          (color.length > 7 ? parseInt(color.slice(7, 9), 16) / 255 : "1") +
           ")"
         );
       };
--- a/client/src/components/map/layers.js	Mon Oct 07 17:48:56 2019 +0200
+++ b/client/src/components/map/layers.js	Mon Oct 07 17:49:25 2019 +0200
@@ -492,7 +492,8 @@
             params: {
               LAYERS: "sounding_differences",
               VERSION: "1.1.1",
-              TILED: true
+              TILED: true,
+              CQL_FILTER: "id=" + store.state.fairwayprofile.currentDifference
             },
             tileLoadFunction: function(tile, src) {
               HTTP.get(src, {
--- a/client/src/store/fairwayprofile.js	Mon Oct 07 17:48:56 2019 +0200
+++ b/client/src/store/fairwayprofile.js	Mon Oct 07 17:49:25 2019 +0200
@@ -36,6 +36,7 @@
     profileLoading: false,
     selectedCut: null,
     differencesLoading: false,
+    currentDifference: null,
     depth: 2.5,
     useCustomDepth: true
   };
@@ -72,6 +73,9 @@
     setDifferencesLoading: (state, value) => {
       state.differencesLoading = value;
     },
+    setCurrentDifference: (state, value) => {
+      state.currentDifference = value;
+    },
     profileLoaded: (state, answer) => {
       const { response, surveyDate } = answer;
       const { data } = response;
--- a/docker/Dockerfile.backend	Mon Oct 07 17:48:56 2019 +0200
+++ b/docker/Dockerfile.backend	Mon Oct 07 17:49:25 2019 +0200
@@ -5,6 +5,7 @@
 
 RUN sed -i 's/\(deb.*\)$/\1 universe/' /etc/apt/sources.list
 
+RUN apt-get update && apt-get install -y software-properties-common
 RUN add-apt-repository ppa:longsleep/golang-backports &&\
     apt-get update &&\
     apt-get -y install --no-install-recommends libxml2-utils\