# HG changeset patch # User Sascha L. Teichmann # Date 1570463365 -7200 # Node ID 3290d1b2c58073123ff91cdd9db9c7839d7e9565 # Parent 6415368c2c6041e454e2efb959fdb7265f4ce31e# Parent 63fceb662047ce1008bdee96911cbe4d622a190b Merged default into iso-areas branch. diff -r 6415368c2c60 -r 3290d1b2c580 client/src/components/fairway/BottleneckDialogue.vue --- 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) { diff -r 6415368c2c60 -r 3290d1b2c580 client/src/components/fairway/Fairwayprofile.vue --- 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})`); diff -r 6415368c2c60 -r 3290d1b2c580 client/src/components/map/Map.vue --- 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") + ")" ); }; diff -r 6415368c2c60 -r 3290d1b2c580 client/src/components/map/layers.js --- 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, { diff -r 6415368c2c60 -r 3290d1b2c580 client/src/store/fairwayprofile.js --- 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; diff -r 6415368c2c60 -r 3290d1b2c580 docker/Dockerfile.backend --- 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\