Mercurial > gemma
changeset 860:38b682eaa7b1
client: add updateing of bottleneck filter
* Add a watcher on the selectedMorph to trigger the update of the bottleneck
filter.
* Reverse the parameter to updateBottleneckFilter() to the order that was
mostly used.
author | Bernhard Reiter <bernhard@intevation.de> |
---|---|
date | Fri, 28 Sep 2018 17:19:08 +0200 |
parents | f82c31428a27 |
children | aa4aaf04d41e |
files | client/src/map/Maplayer.vue client/src/map/store.js |
diffstat | 2 files changed, 10 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/client/src/map/Maplayer.vue Fri Sep 28 16:54:24 2018 +0200 +++ b/client/src/map/Maplayer.vue Fri Sep 28 17:19:08 2018 +0200 @@ -282,8 +282,8 @@ return loader; }, // TODOISO call if new survey is selected - updateBottleneckFilter(datestr, bottleneck_id) { - console.log(datestr); + 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 + "'" }); @@ -302,6 +302,12 @@ this.$nextTick(() => { map.updateSize(); }); + }, + selectedMorph(newSelectedMorph) { + this.updateBottleneckFilter( + newSelectedMorph.bottleneck_id, + newSelectedMorph.date_info + ); } }, mounted() { @@ -473,7 +479,7 @@ // so none is shown // this.updateBottleneckFilter("1999-10-01", "AT_Bottleneck_44"); // test date - this.updateBottleneckFilter("2018-08-30", "AT_Bottleneck_44"); + this.updateBottleneckFilter("AT_Bottleneck_44", "2018-08-30"); this.activateIdentifyMode(); } };
--- a/client/src/map/store.js Fri Sep 28 16:54:24 2018 +0200 +++ b/client/src/map/store.js Fri Sep 28 17:19:08 2018 +0200 @@ -48,8 +48,7 @@ headers: { "X-Gemma-Auth": localStorage.getItem("token") } - }) - .then(response => { + }).then(response => { var arrayBufferView = new Uint8Array(response); var blob = new Blob([arrayBufferView], { type: "image/png"