Mercurial > gemma
changeset 5083:5ec30f63fd58 time-sliding
client: reload only the relevant layers with changed value on time-slider
author | Fadi Abbud <fadi.abbud@intevation.de> |
---|---|
date | Wed, 18 Mar 2020 17:35:35 +0100 |
parents | c4ebb6ccc588 |
children | 2c3108152497 |
files | client/src/components/TimeSlider.vue client/src/store/map.js |
diffstat | 2 files changed, 21 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/client/src/components/TimeSlider.vue Wed Mar 18 14:11:44 2020 +0100 +++ b/client/src/components/TimeSlider.vue Wed Mar 18 17:35:35 2020 +0100 @@ -195,7 +195,7 @@ }, refreshLayers() { this.$store.commit("map/startTimeSlide"); - this.$store.dispatch("map/refreshLayers"); + this.$store.dispatch("map/refreshTimebasedLayers"); this.$nextTick(() => { this.$store.commit("map/finishTimeSlide"); });
--- a/client/src/store/map.js Wed Mar 18 14:11:44 2020 +0100 +++ b/client/src/store/map.js Wed Mar 18 17:35:35 2020 +0100 @@ -622,6 +622,26 @@ } }); }, + refreshTimebasedLayers({ state }) { + const layers = [ + "BOTTLENECKS", + "GAUGES", + "FAIRWAYDIMENSIONSLOS1", + "FAIRWAYDIMENSIONSLOS2", + "FAIRWAYDIMENSIONSLOS3", + "WATERWAYAXIS", + "FAIRWAYMARKS" + ]; + state.openLayersMaps.forEach(map => { + for (let i = 0; i < layers.length; i++) { + let layer = map.getLayer(layers[i]); + if (layer instanceof VectorLayer) { + layer.getSource().clear(true); + } + layer.getSource().refresh(); + } + }); + }, moveToBoundingBox( { state }, { boundingBox, zoom, preventZoomOut, duration }