Mercurial > gemma
changeset 922:1334756abb72
Merge
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 04 Oct 2018 19:13:48 +0200 |
parents | 52cb0b82b490 (current diff) 054561be4d68 (diff) |
children | ec9c3a111bb7 |
files | |
diffstat | 1 files changed, 18 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/client/src/map/Maplayer.vue Thu Oct 04 18:53:22 2018 +0200 +++ b/client/src/map/Maplayer.vue Thu Oct 04 19:13:48 2018 +0200 @@ -295,16 +295,24 @@ // TODOISO call if new survey is selected updateBottleneckFilter(bottleneck_id, datestr) { console.log("updating filter with", bottleneck_id, datestr); - var wmsSrc = this.getLayerByName("Bottleneck isolines").data.getSource(); - // TODOISO check if this works - wmsSrc.updateParams({ - cql_filter: - "date_info='" + - datestr + - "' AND bottleneck_id='" + - bottleneck_id + - "'" - }); + var layer = this.getLayerByName("Bottleneck isolines"); + var wmsSrc = layer.data.getSource(); + + if (bottleneck_id != "does_not_exist") { + wmsSrc.updateParams({ + cql_filter: + "date_info='" + + datestr + + "' AND bottleneck_id='" + + bottleneck_id + + "'" + }); + layer.isVisible = true; + layer.data.setVisible(true); + } else { + layer.isVisible = false; + layer.data.setVisible(false); + } }, onBeforePrint(/* evt */) { // console.log("onBeforePrint(", evt ,")");