# HG changeset patch # User Raimund Renkert # Date 1570450955 -7200 # Node ID 9887061df57bd15d3904fa36947f2b80c76e9a67 # Parent 7cca4aa9a04ac0d6a8d6ba9d677eb06cdaa2a18c Use CQL filter to load the current survey difference. diff -r 7cca4aa9a04a -r 9887061df57b client/src/components/fairway/BottleneckDialogue.vue --- a/client/src/components/fairway/BottleneckDialogue.vue Mon Oct 07 13:30:55 2019 +0200 +++ b/client/src/components/fairway/BottleneckDialogue.vue Mon Oct 07 14:22:35 2019 +0200 @@ -380,6 +380,7 @@ "endPoint", "profileLoading", "differencesLoading", + "currentDifference", "waterLevels", "currentProfile" ]), @@ -572,7 +573,27 @@ } } ) - .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(); + } + }) .catch(error => { let status, data, message; if (error.response) { diff -r 7cca4aa9a04a -r 9887061df57b client/src/components/map/layers.js --- a/client/src/components/map/layers.js Mon Oct 07 13:30:55 2019 +0200 +++ b/client/src/components/map/layers.js Mon Oct 07 14:22:35 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 7cca4aa9a04a -r 9887061df57b client/src/store/fairwayprofile.js --- a/client/src/store/fairwayprofile.js Mon Oct 07 13:30:55 2019 +0200 +++ b/client/src/store/fairwayprofile.js Mon Oct 07 14:22:35 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;