changeset 5088:99ece290b9a9 time-sliding

client: Use proper time value in refresh layers requests * Update TIME value in the refreshTimebasedLayers to let layers refresh with a right value
author Fadi Abbud <fadi.abbud@intevation.de>
date Fri, 20 Mar 2020 15:57:57 +0100
parents d77dd0220780
children b47f2e3e0a75
files client/src/store/map.js
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/store/map.js	Fri Mar 20 15:27:25 2020 +0100
+++ b/client/src/store/map.js	Fri Mar 20 15:57:57 2020 +0100
@@ -622,7 +622,7 @@
         }
       });
     },
-    refreshTimebasedLayers({ state }) {
+    refreshTimebasedLayers({ state, rootState }) {
       const layers = [
         "BOTTLENECKS",
         "GAUGES",
@@ -637,6 +637,11 @@
           let layer = map.getLayer(layers[i]);
           if (layer instanceof VectorLayer) {
             layer.getSource().clear(true);
+          } else {
+            // Refresh layers with updated TIME value
+            layer.getSource().updateParams({
+              TIME: rootState.application.refreshLayersTime.toISOString()
+            });
           }
           layer.getSource().refresh();
         }