# HG changeset patch # User Thomas Junk # Date 1563527064 -7200 # Node ID 224ee5a3acb1a16fb0c742dd426b01f5eb2d7f29 # Parent 74ae9be9dc69c392c1d59f3b661ed9a9179fc25c Layerselect: when no bottleneck/no survey is selected, both ISOLINE and DIFFERENCES layer are activated with cql filter for bottleneck_id=NO_BOTTLENECK_SELECTED diff -r 74ae9be9dc69 -r 224ee5a3acb1 client/src/components/layers/Layerselect.vue --- a/client/src/components/layers/Layerselect.vue Fri Jul 19 09:54:40 2019 +0200 +++ b/client/src/components/layers/Layerselect.vue Fri Jul 19 11:04:24 2019 +0200 @@ -59,6 +59,7 @@ "differencesLegendImgDataURL" ]), ...mapGetters("map", ["openLayersMap"]), + ...mapState("bottlenecks", ["selectedSurvey"]), layer() { return this.openLayersMap().getLayer(this.layerId); }, @@ -69,6 +70,18 @@ methods: { toggle(map) { if (map) { + if ( + (this.layerId === "BOTTLENECKISOLINE" || + this.layerId === "DIFFERENCES") && + !this.selectedSurvey + ) { + map + .getLayer(this.layerId) + .getSource() + .updateParams({ + cql_filter: `bottleneck_id='NO_BOTTLENECK_SELECTED'` + }); + } map .getLayer(this.layerId) .setVisible(!map.getLayer(this.layerId).getVisible());