@opengeoweb/core 4.5.0 → 4.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/index.esm.js +610 -252
  2. package/index.umd.js +565 -195
  3. package/lib/components/MapWarning/MapWarningProperties.d.ts +1 -0
  4. package/lib/components/TimeSlider/TimeSlider.d.ts +1 -0
  5. package/lib/components/TimeSlider/TimeSliderButtons/AnimationLengthButton/AnimationLengthButton.d.ts +9 -0
  6. package/lib/components/TimeSlider/TimeSliderButtons/AnimationLengthButton/AnimationLengthButton.spec.d.ts +1 -0
  7. package/lib/components/TimeSlider/TimeSliderButtons/AnimationLengthButton/AnimationLengthButtonConnect.d.ts +6 -0
  8. package/lib/components/TimeSlider/TimeSliderButtons/AnimationLengthButton/AnimationLengthButtonConnect.spec.d.ts +1 -0
  9. package/lib/components/TimeSlider/TimeSliderButtons/OptionsMenuButton/OptionsMenu.d.ts +1 -0
  10. package/lib/components/TimeSlider/TimeSliderButtons/OptionsMenuButton/OptionsMenuButton.d.ts +6 -0
  11. package/lib/components/TimeSlider/TimeSliderCurrentTimeBox/TimeSliderCurrentTimeBox.d.ts +3 -2
  12. package/lib/components/TimeSlider/TimeSliderCurrentTimeBox/TimeSliderCurrentTimeBoxConnect.d.ts +4 -0
  13. package/lib/components/TimeSlider/TimeSliderCurrentTimeBox/TimeSliderCurrentTimeBoxMouseEvents.d.ts +2 -2
  14. package/lib/components/TimeSlider/TimeSliderLegend/TimeSliderLegend.d.ts +3 -0
  15. package/lib/components/TimeSlider/TimeSliderLegend/TimeSliderLegendConnect.d.ts +4 -0
  16. package/lib/components/TimeSlider/TimeSliderLegend/TimeSliderLegendUtils.d.ts +1 -0
  17. package/lib/hooks/useSetupDialog/useSetupDialog.d.ts +2 -0
  18. package/lib/index.d.ts +1 -3
  19. package/lib/store/mapStore/map/reducer.d.ts +4 -8
  20. package/lib/store/mapStore/map/selectors.d.ts +21 -40
  21. package/lib/store/mapStore/map/types.d.ts +15 -14
  22. package/lib/store/ui/reducer.d.ts +5 -1
  23. package/lib/store/ui/selectors.d.ts +24 -0
  24. package/lib/store/ui/types.d.ts +10 -0
  25. package/lib/utils/testUtils.d.ts +1 -0
  26. package/package.json +5 -5
package/index.umd.js CHANGED
@@ -241,6 +241,19 @@
241
241
  Scale[Scale["DataScale"] = 8] = "DataScale";
242
242
  })(Scale || (Scale = {}));
243
243
 
244
+ var AnimationLength;
245
+
246
+ (function (AnimationLength) {
247
+ AnimationLength[AnimationLength["Minutes15"] = 15] = "Minutes15";
248
+ AnimationLength[AnimationLength["Minutes30"] = 30] = "Minutes30";
249
+ AnimationLength[AnimationLength["Hours1"] = 60] = "Hours1";
250
+ AnimationLength[AnimationLength["Hours2"] = 120] = "Hours2";
251
+ AnimationLength[AnimationLength["Hours3"] = 180] = "Hours3";
252
+ AnimationLength[AnimationLength["Hours6"] = 360] = "Hours6";
253
+ AnimationLength[AnimationLength["Hours12"] = 720] = "Hours12";
254
+ AnimationLength[AnimationLength["Hours24"] = 1440] = "Hours24";
255
+ })(AnimationLength || (AnimationLength = {}));
256
+
244
257
  var MapActionOrigin;
245
258
 
246
259
  (function (MapActionOrigin) {
@@ -434,6 +447,7 @@
434
447
  var types$2 = /*#__PURE__*/Object.freeze({
435
448
  __proto__: null,
436
449
  get Scale () { return Scale; },
450
+ get AnimationLength () { return AnimationLength; },
437
451
  get MapActionOrigin () { return MapActionOrigin; },
438
452
  get LayerType () { return LayerType; },
439
453
  get LayerStatus () { return LayerStatus; },
@@ -1841,7 +1855,9 @@
1841
1855
  activeMapId: activeMapId,
1842
1856
  isOpen: setOpen,
1843
1857
  type: type,
1844
- source: source
1858
+ source: source,
1859
+ isLoading: false,
1860
+ error: undefined
1845
1861
  };
1846
1862
  };
1847
1863
  var initialState$4 = {
@@ -1924,6 +1940,18 @@
1924
1940
  setActiveWindowId: function setActiveWindowId(draft, action) {
1925
1941
  var activeWindowId = action.payload.activeWindowId;
1926
1942
  draft.activeWindowId = activeWindowId;
1943
+ },
1944
+ toggleIsLoadingDialog: function toggleIsLoadingDialog(draft, action) {
1945
+ var _a = action.payload,
1946
+ isLoading = _a.isLoading,
1947
+ type = _a.type;
1948
+ draft.dialogs[type].isLoading = isLoading;
1949
+ },
1950
+ setErrorDialog: function setErrorDialog(draft, action) {
1951
+ var _a = action.payload,
1952
+ error = _a.error,
1953
+ type = _a.type;
1954
+ draft.dialogs[type].error = error;
1927
1955
  }
1928
1956
  }
1929
1957
  });
@@ -2148,17 +2176,6 @@
2148
2176
 
2149
2177
  draft.byId[mapId].animationDelay = animationDelay;
2150
2178
  },
2151
- setAnimationInterval: function setAnimationInterval(draft, action) {
2152
- var _a = action.payload,
2153
- mapId = _a.mapId,
2154
- interval = _a.interval;
2155
-
2156
- if (!draft.byId[mapId]) {
2157
- return;
2158
- }
2159
-
2160
- draft.byId[mapId].timeStep = interval;
2161
- },
2162
2179
  layerMoveLayer: function layerMoveLayer(draft, action) {
2163
2180
  var _a = action.payload,
2164
2181
  oldIndex = _a.oldIndex,
@@ -2193,6 +2210,17 @@
2193
2210
 
2194
2211
  draft.byId[mapId].timeSliderCenterTime = timeSliderCenterTime;
2195
2212
  },
2213
+ setTimeSliderUnfilteredSelectedTime: function setTimeSliderUnfilteredSelectedTime(draft, action) {
2214
+ var _a = action.payload,
2215
+ mapId = _a.mapId,
2216
+ timeSliderUnfilteredSelectedTime = _a.timeSliderUnfilteredSelectedTime;
2217
+
2218
+ if (!draft.byId[mapId]) {
2219
+ return;
2220
+ }
2221
+
2222
+ draft.byId[mapId].timeSliderUnfilteredSelectedTime = timeSliderUnfilteredSelectedTime;
2223
+ },
2196
2224
  setTimeSliderSecondsPerPx: function setTimeSliderSecondsPerPx(draft, action) {
2197
2225
  var _a = action.payload,
2198
2226
  mapId = _a.mapId,
@@ -2317,17 +2345,6 @@
2317
2345
 
2318
2346
  draft.byId[mapId].activeMapPresetId = presetId;
2319
2347
  },
2320
- setIsMapPresetLoading: function setIsMapPresetLoading(draft, action) {
2321
- var _a = action.payload,
2322
- mapId = _a.mapId,
2323
- isLoading = _a.isLoading;
2324
-
2325
- if (!draft.byId[mapId]) {
2326
- return;
2327
- }
2328
-
2329
- draft.byId[mapId].isMapPresetLoading = isLoading;
2330
- },
2331
2348
  setHasMapPresetChanges: function setHasMapPresetChanges(draft, action) {
2332
2349
  var _a = action.payload,
2333
2350
  mapId = _a.mapId,
@@ -2339,17 +2356,6 @@
2339
2356
 
2340
2357
  draft.byId[mapId].hasMapPresetChanges = hasChanges;
2341
2358
  },
2342
- setMapPresetError: function setMapPresetError(draft, action) {
2343
- var _a = action.payload,
2344
- mapId = _a.mapId,
2345
- error = _a.error;
2346
-
2347
- if (!draft.byId[mapId]) {
2348
- return;
2349
- }
2350
-
2351
- draft.byId[mapId].mapPresetError = error;
2352
- },
2353
2359
  toggleDockedLayerManager: function toggleDockedLayerManager(draft, action) {
2354
2360
  var _a = action.payload,
2355
2361
  mapId = _a.mapId,
@@ -3043,6 +3049,12 @@
3043
3049
 
3044
3050
  return (_a = store === null || store === void 0 ? void 0 : store.ui) === null || _a === void 0 ? void 0 : _a.activeWindowId;
3045
3051
  };
3052
+ var getDialogIsLoading = toolkit.createSelector(getDialogDetailsByType, function (details) {
3053
+ return details && details.isLoading || false;
3054
+ });
3055
+ var getDialogError = toolkit.createSelector(getDialogDetailsByType, function (details) {
3056
+ return details && details.error || '';
3057
+ });
3046
3058
 
3047
3059
  var selectors$1 = /*#__PURE__*/Object.freeze({
3048
3060
  __proto__: null,
@@ -3053,7 +3065,9 @@
3053
3065
  getDialogOrder: getDialogOrder,
3054
3066
  getDialogIsOrderedOnTop: getDialogIsOrderedOnTop,
3055
3067
  getDialogSource: getDialogSource,
3056
- getActiveWindowId: getActiveWindowId
3068
+ getActiveWindowId: getActiveWindowId,
3069
+ getDialogIsLoading: getDialogIsLoading,
3070
+ getDialogError: getDialogError
3057
3071
  });
3058
3072
 
3059
3073
  /* *
@@ -3878,6 +3892,19 @@
3878
3892
  var getMapTimeSliderCenterTime = toolkit.createSelector(getMapById, function (store) {
3879
3893
  return store ? store.timeSliderCenterTime : moment__default["default"]().unix();
3880
3894
  });
3895
+ /**
3896
+ * Returns the unflitered selected time of time slider
3897
+ * This is not used to set the selected time itself, which is controlled by TimeBounds where values are rounded.
3898
+ *
3899
+ * Example: selectedTime = getTimeSliderUnfliteredSelectedTime(store, 'mapid_1')
3900
+ * @param {object} store store: object - store object
3901
+ * @param {string} mapId mapId: string - Id of the map
3902
+ * @returns {number} returnType: number - unfiltered selected time as a unix timestamp
3903
+ */
3904
+
3905
+ var getTimeSliderUnfilteredSelectedTime = toolkit.createSelector(getMapById, function (store) {
3906
+ return store ? store.timeSliderUnfilteredSelectedTime : null;
3907
+ });
3881
3908
  /**
3882
3909
  * Returns the number of seconds per pixel on the time slider
3883
3910
  *
@@ -4185,18 +4212,6 @@
4185
4212
  shouldShowLegend: shouldShowLegend
4186
4213
  });
4187
4214
  }, selectorMemoizationOptions);
4188
- /**
4189
- * Returns the loading state of the map preset
4190
- *
4191
- * Example getIsMapPresetLoading(store, mapId);
4192
- * @param {object} store store: object - store object
4193
- * @param {string} mapId mapId: string - Id of the map
4194
- * @returns {boolean} returnType: boolean
4195
- */
4196
-
4197
- var getIsMapPresetLoading = toolkit.createSelector(getMapById, function (store) {
4198
- return store && store.isMapPresetLoading ? store.isMapPresetLoading : false;
4199
- });
4200
4215
  /**
4201
4216
  * Returns the has changes state of the map preset
4202
4217
  *
@@ -4209,18 +4224,6 @@
4209
4224
  var getHasMapPresetChanges = toolkit.createSelector(getMapById, function (store) {
4210
4225
  return store && store.hasMapPresetChanges ? store.hasMapPresetChanges : false;
4211
4226
  });
4212
- /**
4213
- * Returns the error state of the map preset
4214
- *
4215
- * Example getMapPresetError(store, mapId);
4216
- * @param {object} store store: object - store object
4217
- * @param {string} mapId mapId: string - Id of the map
4218
- * @returns {Error} returnType: string
4219
- */
4220
-
4221
- var getMapPresetError = toolkit.createSelector(getMapById, function (store) {
4222
- return store === null || store === void 0 ? void 0 : store.mapPresetError;
4223
- });
4224
4227
  /**
4225
4228
  * Returns whether the docked layer manager is open
4226
4229
  *
@@ -4263,6 +4266,7 @@
4263
4266
  getMapTimeStep: getMapTimeStep,
4264
4267
  getMapAnimationDelay: getMapAnimationDelay,
4265
4268
  getMapTimeSliderCenterTime: getMapTimeSliderCenterTime,
4269
+ getTimeSliderUnfilteredSelectedTime: getTimeSliderUnfilteredSelectedTime,
4266
4270
  getMapTimeSliderSecondsPerPx: getMapTimeSliderSecondsPerPx,
4267
4271
  getMapTimeSliderDataScaleToSecondsPerPx: getMapTimeSliderDataScaleToSecondsPerPx,
4268
4272
  isTimestepAuto: isTimestepAuto,
@@ -4282,9 +4286,7 @@
4282
4286
  getActiveMapPresetId: getActiveMapPresetId,
4283
4287
  getLegendId: getLegendId,
4284
4288
  getMapPreset: getMapPreset,
4285
- getIsMapPresetLoading: getIsMapPresetLoading,
4286
4289
  getHasMapPresetChanges: getHasMapPresetChanges,
4287
- getMapPresetError: getMapPresetError,
4288
4290
  getIsDockedLayerManagerOpen: getIsDockedLayerManagerOpen
4289
4291
  });
4290
4292
 
@@ -8324,9 +8326,9 @@
8324
8326
  , 17];
8325
8327
  return [4
8326
8328
  /*yield*/
8327
- , effects.put(mapActions$1.setAnimationInterval({
8329
+ , effects.put(mapActions$1.setTimeStep({
8328
8330
  mapId: mapId,
8329
- interval: interval
8331
+ timeStep: interval
8330
8332
  }))];
8331
8333
 
8332
8334
  case 16:
@@ -9757,7 +9759,7 @@
9757
9759
  * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9758
9760
  * Copyright 2022 - Finnish Meteorological Institute (FMI)
9759
9761
  * */
9760
- var marks$2 = [{
9762
+ var marks$3 = [{
9761
9763
  value: 0,
9762
9764
  label: '0 %'
9763
9765
  }, {
@@ -9893,7 +9895,7 @@
9893
9895
  step: 0.01,
9894
9896
  max: 1,
9895
9897
  min: 0,
9896
- marks: marks$2,
9898
+ marks: marks$3,
9897
9899
  onChange: function onChange(event, newValue) {
9898
9900
  event.stopPropagation();
9899
9901
  onLayerChangeOpacity(newValue);
@@ -10070,7 +10072,9 @@
10070
10072
  return /*#__PURE__*/React__namespace.createElement(shared.ManagerButton, {
10071
10073
  tooltipTitle: tooltipTitle,
10072
10074
  onClick: onClick,
10073
- icon: /*#__PURE__*/React__namespace.createElement(theme.Flag, {
10075
+ icon: isActive ? /*#__PURE__*/React__namespace.createElement(theme.Both, {
10076
+ sx: iconStyle
10077
+ }) : /*#__PURE__*/React__namespace.createElement(theme.None, {
10074
10078
  sx: iconStyle
10075
10079
  }),
10076
10080
  testId: id,
@@ -12222,6 +12226,9 @@
12222
12226
  onClick: function onClick() {
12223
12227
  return onChangeSize(sizeSmall);
12224
12228
  },
12229
+ onTouchEnd: function onTouchEnd() {
12230
+ return onChangeSize(sizeSmall);
12231
+ },
12225
12232
  sx: iconStyle,
12226
12233
  className: "collapseSmall-btn"
12227
12234
  }, /*#__PURE__*/React__namespace.createElement(theme.CollapseSmall, null))), /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
@@ -12232,6 +12239,9 @@
12232
12239
  onClick: function onClick() {
12233
12240
  return onChangeSize(sizeMedium);
12234
12241
  },
12242
+ onTouchEnd: function onTouchEnd() {
12243
+ return onChangeSize(sizeMedium);
12244
+ },
12235
12245
  sx: iconStyle,
12236
12246
  className: "collapseMedium-btn"
12237
12247
  }, /*#__PURE__*/React__namespace.createElement(theme.CollapseMedium, null))), /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
@@ -12242,6 +12252,9 @@
12242
12252
  onClick: function onClick() {
12243
12253
  return onChangeSize(sizeLarge);
12244
12254
  },
12255
+ onTouchEnd: function onTouchEnd() {
12256
+ return onChangeSize(sizeLarge);
12257
+ },
12245
12258
  sx: iconStyle,
12246
12259
  className: "collapseLarge-btn"
12247
12260
  }, /*#__PURE__*/React__namespace.createElement(theme.CollapseLarge, null))), /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
@@ -12253,6 +12266,9 @@
12253
12266
  sx: iconStyle,
12254
12267
  onClick: function onClick() {
12255
12268
  return onClickDockButton();
12269
+ },
12270
+ onTouchEnd: function onTouchEnd() {
12271
+ return onClickDockButton();
12256
12272
  }
12257
12273
  }, isDockedLayerManager ? /*#__PURE__*/React__namespace.createElement(theme.CollapseWindow, {
12258
12274
  "data-testid": "dockedLayerManager-collapse"
@@ -12384,7 +12400,11 @@
12384
12400
  setSize(dragSize);
12385
12401
  }
12386
12402
  }
12387
- }, /*#__PURE__*/React__namespace.createElement(material.Box, null, isLoading && /*#__PURE__*/React__namespace.createElement(material.LinearProgress, {
12403
+ }, /*#__PURE__*/React__namespace.createElement(material.Box, {
12404
+ onKeyDown: function onKeyDown(event) {
12405
+ event.stopPropagation();
12406
+ }
12407
+ }, isLoading && /*#__PURE__*/React__namespace.createElement(material.LinearProgress, {
12388
12408
  "data-testid": "loading-bar",
12389
12409
  color: "secondary",
12390
12410
  sx: {
@@ -12491,12 +12511,20 @@
12491
12511
  var isDialogOpen = reactRedux.useSelector(function (store) {
12492
12512
  return getisDialogOpen(store, dialogType);
12493
12513
  });
12514
+ var uiIsLoading = reactRedux.useSelector(function (store) {
12515
+ return getDialogIsLoading(store, dialogType);
12516
+ });
12517
+ var uiError = reactRedux.useSelector(function (store) {
12518
+ return getDialogError(store, dialogType);
12519
+ });
12494
12520
  return {
12495
12521
  setDialogOrder: setDialogOrder,
12496
12522
  dialogOrder: dialogOrder,
12497
12523
  onCloseDialog: onCloseDialog,
12498
12524
  uiSource: uiSource,
12499
- isDialogOpen: isDialogOpen
12525
+ isDialogOpen: isDialogOpen,
12526
+ uiIsLoading: uiIsLoading,
12527
+ uiError: uiError
12500
12528
  };
12501
12529
  };
12502
12530
 
@@ -12603,19 +12631,15 @@
12603
12631
  var mapId = reactRedux.useSelector(function (store) {
12604
12632
  return getDialogMapId(store, dialogType);
12605
12633
  });
12606
- var isMapPresetLoading = reactRedux.useSelector(function (store) {
12607
- return getIsMapPresetLoading(store, mapId);
12608
- });
12609
- var mapPresetError = reactRedux.useSelector(function (store) {
12610
- return getMapPresetError(store, mapId);
12611
- });
12612
12634
 
12613
12635
  var _d = useSetupDialog(dialogType),
12614
12636
  dialogOrder = _d.dialogOrder,
12615
12637
  setDialogOrder = _d.setDialogOrder,
12616
12638
  onCloseDialog = _d.onCloseDialog,
12617
12639
  isDialogOpen = _d.isDialogOpen,
12618
- uiSource = _d.uiSource;
12640
+ uiSource = _d.uiSource,
12641
+ uiIsLoading = _d.uiIsLoading,
12642
+ uiError = _d.uiError;
12619
12643
 
12620
12644
  useFetchServices(dialogType, preloadedMapServices);
12621
12645
 
@@ -12640,8 +12664,8 @@
12640
12664
  order: dialogOrder,
12641
12665
  source: uiSource,
12642
12666
  leftHeaderComponent: leftHeaderComponent,
12643
- isLoading: isMapPresetLoading,
12644
- error: mapPresetError,
12667
+ isLoading: uiIsLoading,
12668
+ error: uiError,
12645
12669
  onToggleDock: onToggleDock
12646
12670
  });
12647
12671
  };
@@ -14310,6 +14334,7 @@
14310
14334
  var rowMargin = 4;
14311
14335
  var rowHeight = widthToRowHeight(layerSelectWidth);
14312
14336
  var layerSelectFilterHeight = 155 + serviceListHeight;
14337
+ var minHeight = 400;
14313
14338
  return /*#__PURE__*/React__namespace.createElement(material.Box, {
14314
14339
  "data-testid": "layerList"
14315
14340
  }, /*#__PURE__*/React__namespace.createElement(material.Box, {
@@ -14318,7 +14343,7 @@
14318
14343
  fontSize: '12px'
14319
14344
  }
14320
14345
  }, filteredLayers.length, " results"), /*#__PURE__*/React__namespace.createElement(reactWindow.FixedSizeList, {
14321
- height: layerSelectHeight - layerSelectFilterHeight,
14346
+ height: layerSelectHeight - layerSelectFilterHeight < minHeight ? minHeight : layerSelectHeight - layerSelectFilterHeight,
14322
14347
  itemCount: filteredLayers.length,
14323
14348
  itemSize: rowHeight + rowMargin
14324
14349
  }, function (_a) {
@@ -15164,7 +15189,14 @@
15164
15189
  left: 100
15165
15190
  },
15166
15191
  isOpen: isOpen,
15167
- onChangeSize: onChangeSize,
15192
+ onResizeStop: function onResizeStop(_event, _direction, node) {
15193
+ var width = node.offsetWidth,
15194
+ height = node.offsetHeight;
15195
+ onChangeSize({
15196
+ width: width,
15197
+ height: height
15198
+ });
15199
+ },
15168
15200
  onClose: onClose,
15169
15201
  headerSize: "small",
15170
15202
  bounds: bounds,
@@ -16692,7 +16724,7 @@
16692
16724
  * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16693
16725
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
16694
16726
  * */
16695
- var marks$1 = [{
16727
+ var marks$2 = [{
16696
16728
  label: '1 min',
16697
16729
  value: 1,
16698
16730
  text: '1m'
@@ -16787,18 +16819,11 @@
16787
16819
  disabled = _b === void 0 ? false : _b,
16788
16820
  _c = _a.isTimestepAuto,
16789
16821
  isTimestepAuto = _c === void 0 ? false : _c,
16790
- timeDimension = _a.timeDimension,
16791
16822
  onChangeTimeStep = _a.onChangeTimeStep,
16792
16823
  _d = _a.onToggleTimestepAuto,
16793
16824
  onToggleTimestepAuto = _d === void 0 ? function () {} : _d,
16794
16825
  _e = _a.isOpenByDefault,
16795
16826
  isOpenByDefault = _e === void 0 ? false : _e;
16796
- var timeStepFromLayer = getActiveLayerTimeStep(timeDimension) || timeStep;
16797
- React__namespace.useEffect(function () {
16798
- if (isTimestepAuto) {
16799
- onChangeTimeStep(timeStepFromLayer);
16800
- }
16801
- }, [timeStepFromLayer, isTimestepAuto, onChangeTimeStep]);
16802
16827
 
16803
16828
  var handleMenuItemClick = function handleMenuItemClick(mark) {
16804
16829
  if (isTimestepAuto) {
@@ -16811,7 +16836,7 @@
16811
16836
  return /*#__PURE__*/React__namespace.createElement(TimeSliderMenu, {
16812
16837
  title: timeStepTitle,
16813
16838
  isOpenByDefault: isOpenByDefault,
16814
- marks: marks$1,
16839
+ marks: marks$2,
16815
16840
  value: timeStep,
16816
16841
  handleMenuItemClick: handleMenuItemClick,
16817
16842
  isDisabled: disabled,
@@ -16838,7 +16863,7 @@
16838
16863
  * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16839
16864
  * Copyright 2022 - Finnish Meteorological Institute (FMI)
16840
16865
  * */
16841
- var marks = [{
16866
+ var marks$1 = [{
16842
16867
  label: '5 min',
16843
16868
  value: Scale.Minutes5,
16844
16869
  text: '5m'
@@ -16889,7 +16914,7 @@
16889
16914
  var onChangeSliderValue = function onChangeSliderValue(mark) {
16890
16915
  var newSliderValue = mark.value;
16891
16916
  var newValue = newSliderValue ? Math.round(newSliderValue) : 0;
16892
- var newScale = marks.find(function (el) {
16917
+ var newScale = marks$1.find(function (el) {
16893
16918
  return el.value === newValue;
16894
16919
  }).value;
16895
16920
  var scaleToSecPerPx = newScale === Scale.DataScale ? getScaleToSecondsPerPxForDataScale(layers) : scaleToSecondsPerPx[newScale];
@@ -16900,7 +16925,7 @@
16900
16925
  return /*#__PURE__*/React__namespace.createElement(TimeSliderMenu, {
16901
16926
  handleMenuItemClick: onChangeSliderValue,
16902
16927
  icon: /*#__PURE__*/React__namespace.createElement(theme.Clock, null),
16903
- marks: marks,
16928
+ marks: marks$1,
16904
16929
  title: "Time scale",
16905
16930
  value: timeSliderScale,
16906
16931
  onChangeMouseWheel: onChangeSliderValue
@@ -16923,7 +16948,7 @@
16923
16948
  * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16924
16949
  * Copyright 2022 - Finnish Meteorological Institute (FMI)
16925
16950
  * */
16926
- var title = 'Now';
16951
+ var title$1 = 'Now';
16927
16952
 
16928
16953
  var NowButton = function NowButton(_a) {
16929
16954
  var _b = _a.onSetNow,
@@ -16931,7 +16956,7 @@
16931
16956
  _c = _a.disabled,
16932
16957
  disabled = _c === void 0 ? false : _c;
16933
16958
  return /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
16934
- title: title,
16959
+ title: title$1,
16935
16960
  "data-testid": "nowButtonTooltip"
16936
16961
  }, /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(shared.ToolButton, {
16937
16962
  disabled: disabled,
@@ -16944,6 +16969,86 @@
16944
16969
  }))));
16945
16970
  };
16946
16971
 
16972
+ /* *
16973
+ * Licensed under the Apache License, Version 2.0 (the "License");
16974
+ * you may not use this file except in compliance with the License.
16975
+ * You may obtain a copy of the License at
16976
+ *
16977
+ * http://www.apache.org/licenses/LICENSE-2.0
16978
+ *
16979
+ * Unless required by applicable law or agreed to in writing, software
16980
+ * distributed under the License is distributed on an "AS IS" BASIS,
16981
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16982
+ * See the License for the specific language governing permissions and
16983
+ * limitations under the License.
16984
+ *
16985
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16986
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
16987
+ * */
16988
+ var title = 'Animation';
16989
+ var marks = [{
16990
+ label: '15 min',
16991
+ value: AnimationLength.Minutes15,
16992
+ text: '15m'
16993
+ }, {
16994
+ label: '30 min',
16995
+ value: AnimationLength.Minutes30,
16996
+ text: '30m'
16997
+ }, {
16998
+ label: '1 h',
16999
+ value: AnimationLength.Hours1,
17000
+ text: '1h'
17001
+ }, {
17002
+ label: '2 h',
17003
+ value: AnimationLength.Hours2,
17004
+ text: '2h'
17005
+ }, {
17006
+ label: '3 h',
17007
+ value: AnimationLength.Hours3,
17008
+ text: '3h'
17009
+ }, {
17010
+ label: '6 h',
17011
+ value: AnimationLength.Hours6,
17012
+ text: '6h'
17013
+ }, {
17014
+ label: '12 h',
17015
+ value: AnimationLength.Hours12,
17016
+ text: '12h'
17017
+ }, {
17018
+ label: '24 h',
17019
+ value: AnimationLength.Hours24,
17020
+ text: '24h'
17021
+ }].sort(function (a, b) {
17022
+ return b.value - a.value;
17023
+ });
17024
+
17025
+ var AnimationLengthButton = function AnimationLengthButton(_a) {
17026
+ var _b = _a.disabled,
17027
+ disabled = _b === void 0 ? false : _b,
17028
+ _c = _a.animationLength,
17029
+ animationLength = _c === void 0 ? AnimationLength.Hours1 : _c,
17030
+ onChangeAnimationLength = _a.onChangeAnimationLength;
17031
+
17032
+ var onChangeSliderValue = function onChangeSliderValue(mark) {
17033
+ var newSliderValue = mark.value;
17034
+ var newValue = newSliderValue ? Math.round(newSliderValue) : 0;
17035
+ var newLength = marks.find(function (el) {
17036
+ return el.value === newValue;
17037
+ }).value;
17038
+ onChangeAnimationLength(newLength);
17039
+ };
17040
+
17041
+ return /*#__PURE__*/React__namespace.createElement(TimeSliderMenu, {
17042
+ handleMenuItemClick: onChangeSliderValue,
17043
+ icon: /*#__PURE__*/React__namespace.createElement(theme.Animation, null),
17044
+ marks: marks,
17045
+ title: title,
17046
+ isDisabled: disabled,
17047
+ value: animationLength,
17048
+ onChangeMouseWheel: onChangeSliderValue
17049
+ });
17050
+ };
17051
+
16947
17052
  /* *
16948
17053
  * Licensed under the Apache License, Version 2.0 (the "License");
16949
17054
  * you may not use this file except in compliance with the License.
@@ -16965,7 +17070,8 @@
16965
17070
  nowBtn = _a.nowBtn,
16966
17071
  speedBtn = _a.speedBtn,
16967
17072
  timeScaleBtn = _a.timeScaleBtn,
16968
- timeStepBtn = _a.timeStepBtn;
17073
+ timeStepBtn = _a.timeStepBtn,
17074
+ animationLengthBtn = _a.animationLengthBtn;
16969
17075
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
16970
17076
  item: true,
16971
17077
  xs: "auto"
@@ -16981,6 +17087,11 @@
16981
17087
  })), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
16982
17088
  item: true,
16983
17089
  xs: "auto"
17090
+ }, animationLengthBtn || /*#__PURE__*/React__default["default"].createElement(AnimationLengthButton, {
17091
+ onChangeAnimationLength: function onChangeAnimationLength() {}
17092
+ })), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
17093
+ item: true,
17094
+ xs: "auto"
16984
17095
  }, timeStepBtn || /*#__PURE__*/React__default["default"].createElement(TimeStepButton, {
16985
17096
  timeStep: 0,
16986
17097
  onChangeTimeStep: function onChangeTimeStep() {}
@@ -17019,22 +17130,34 @@
17019
17130
  speedBtn = _a.speedBtn,
17020
17131
  timeStepBtn = _a.timeStepBtn,
17021
17132
  timeScaleBtn = _a.timeScaleBtn,
17133
+ animationLengthBtn = _a.animationLengthBtn,
17022
17134
  _b = _a.isOpenByDefault,
17023
- isOpenByDefault = _b === void 0 ? false : _b;
17135
+ isOpenByDefault = _b === void 0 ? false : _b,
17136
+ timeStep = _a.timeStep,
17137
+ timeDimension = _a.timeDimension,
17138
+ onChangeTimeStep = _a.onChangeTimeStep,
17139
+ _c = _a.isTimestepAuto,
17140
+ isTimestepAuto = _c === void 0 ? false : _c;
17024
17141
 
17025
- var _c = __read(React.useState(null), 2),
17026
- anchorEl = _c[0],
17027
- setAnchorEl = _c[1];
17142
+ var _d = __read(React.useState(null), 2),
17143
+ anchorEl = _d[0],
17144
+ setAnchorEl = _d[1];
17028
17145
 
17029
- var _d = __read(React.useState(false), 2),
17030
- open = _d[0],
17031
- setOpen = _d[1];
17146
+ var _e = __read(React.useState(false), 2),
17147
+ open = _e[0],
17148
+ setOpen = _e[1];
17032
17149
 
17033
17150
  React.useEffect(function () {
17034
17151
  if (anchorEl && isOpenByDefault) {
17035
17152
  setOpen(true);
17036
17153
  }
17037
17154
  }, [anchorEl, isOpenByDefault]);
17155
+ var timeStepFromLayer = getActiveLayerTimeStep(timeDimension) || timeStep;
17156
+ React__default["default"].useEffect(function () {
17157
+ if (isTimestepAuto) {
17158
+ onChangeTimeStep(timeStepFromLayer);
17159
+ }
17160
+ }, [timeStepFromLayer, isTimestepAuto, onChangeTimeStep]);
17038
17161
  return /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement(shared.CustomTooltip, {
17039
17162
  title: "Animation options",
17040
17163
  placement: "bottom"
@@ -17070,6 +17193,7 @@
17070
17193
  timeScaleBtn: timeScaleBtn,
17071
17194
  timeStepBtn: timeStepBtn,
17072
17195
  speedBtn: speedBtn,
17196
+ animationLengthBtn: animationLengthBtn,
17073
17197
  autoUpdateBtn: autoUpdateBtn
17074
17198
  })))));
17075
17199
  };
@@ -17352,11 +17476,12 @@
17352
17476
  var drawTimeText = function drawTimeText(ctx, theme, stepPx, height, timeText, scale) {
17353
17477
  var ctx2 = ctx;
17354
17478
  var _a = theme.palette.geowebColors.timeSlider.timelineText,
17479
+ fontSize = _a.fontSize,
17355
17480
  fontFamily = _a.fontFamily,
17356
17481
  color = _a.color;
17357
17482
  ctx2.fillStyle = color; // time text has smaller font than other timeline text
17358
17483
 
17359
- ctx2.font = "12px " + fontFamily;
17484
+ ctx2.font = fontSize + "px " + fontFamily;
17360
17485
  ctx2.textAlign = 'left';
17361
17486
 
17362
17487
  if (scale === Scale.Year || scale === Scale.Month || scale === Scale.Week || scale === Scale.Day) {
@@ -17388,7 +17513,7 @@
17388
17513
  ctx2.fillStyle = color;
17389
17514
  ctx2.font = fontSize + "px " + fontFamily;
17390
17515
  ctx2.textAlign = 'left';
17391
- ctx2.fillText(newDate, stepPx + 2, height - 30);
17516
+ ctx2.fillText(newDate, stepPx + 2, height - 10);
17392
17517
  };
17393
17518
 
17394
17519
  var drawLeftSideDateText = function drawLeftSideDateText(ctx, theme, newDate, height) {
@@ -17881,9 +18006,9 @@
17881
18006
  drawDefaultBackground();
17882
18007
  drawObservedData();
17883
18008
  drawForecastData();
18009
+ drawNightOrAlternateTime();
17884
18010
  drawAnimationArea();
17885
18011
  drawDraggableIcons();
17886
- drawNightOrAlternateTime();
17887
18012
 
17888
18013
  function drawDefaultBackground() {
17889
18014
  ctx.fillStyle = legendNoDataBackground.rgba;
@@ -17906,18 +18031,23 @@
17906
18031
 
17907
18032
  function drawAnimationArea() {
17908
18033
  ctx.fillStyle = theme$1.palette.geowebColors.timeSlider.timelineSelectionBackground.rgba;
17909
- ctx.fillRect(animationStartPx, y, Math.max(animationEndPx - animationStartPx, y), height);
18034
+ ctx.strokeStyle = theme$1.palette.geowebColors.timeSlider.timelineSelectionOutline.rgba;
18035
+ ctx.lineWidth = 3;
18036
+ ctx.rect(animationStartPx, y, Math.max(animationEndPx - animationStartPx, y), height);
18037
+ ctx.fill();
18038
+ ctx.stroke();
17910
18039
  }
17911
18040
 
17912
18041
  function drawDraggableIcons() {
17913
18042
  ctx.save();
17914
18043
  var path = new Path2D(theme.dragHandlePath);
17915
18044
  ctx.translate(animationStartPx, y);
17916
- ctx.fillStyle = theme$1.palette.geowebColors.timeSlider.timelineSelectionBackground.rgba;
18045
+ ctx.fillStyle = theme$1.palette.geowebColors.timeSlider.timelineTimeScale.fill;
17917
18046
  ctx.fill(path);
17918
18047
  ctx.restore();
17919
18048
  ctx.save();
17920
18049
  ctx.translate(animationEndPx - 24, y);
18050
+ ctx.fillStyle = theme$1.palette.geowebColors.timeSlider.timelineTimeScale.fill;
17921
18051
  ctx.fill(path);
17922
18052
  ctx.restore();
17923
18053
  }
@@ -18067,6 +18197,11 @@
18067
18197
  var isRightAnimationIconArea = function isRightAnimationIconArea(x, rightMarkerPx, width) {
18068
18198
  return x >= rightMarkerPx - width && x <= rightMarkerPx;
18069
18199
  };
18200
+ var isInsideAnimationArea = function isInsideAnimationArea(x, leftMarkerPx, rightMarkerPx) {
18201
+ var isInsideOnLeftSide = x >= leftMarkerPx;
18202
+ var isInsideOnRightSide = x <= rightMarkerPx;
18203
+ return isInsideOnLeftSide && isInsideOnRightSide;
18204
+ };
18070
18205
  /**
18071
18206
  * @param x The pin location
18072
18207
  * @param selectedTimePx The selected px
@@ -18097,7 +18232,8 @@
18097
18232
  var DRAG_AREA_WIDTH = 24;
18098
18233
 
18099
18234
  var TimeSliderLegend = function TimeSliderLegend(_a) {
18100
- var centerTime = _a.centerTime,
18235
+ var mapId = _a.mapId,
18236
+ centerTime = _a.centerTime,
18101
18237
  secondsPerPx = _a.secondsPerPx,
18102
18238
  _b = _a.dataScaleToSecondsPerPx,
18103
18239
  dataScaleToSecondsPerPx = _b === void 0 ? defaultDataScaleToSecondsPerPx : _b,
@@ -18109,10 +18245,11 @@
18109
18245
  dataEndTime = _a.dataEndTime,
18110
18246
  animationStartTime = _a.animationStartTime,
18111
18247
  animationEndTime = _a.animationEndTime,
18112
- isTimeSliderHoverOn = _a.isTimeSliderHoverOn,
18113
18248
  timeStep = _a.timeStep,
18114
18249
  _d = _a.mapIsActive,
18115
18250
  mapIsActive = _d === void 0 ? true : _d,
18251
+ unfilteredSelectedTime = _a.unfilteredSelectedTime,
18252
+ setUnfilteredSelectedTime = _a.setUnfilteredSelectedTime,
18116
18253
  onSetNewDate = _a.onSetNewDate,
18117
18254
  onSetCenterTime = _a.onSetCenterTime,
18118
18255
  onSetAnimationStartTime = _a.onSetAnimationStartTime,
@@ -18142,23 +18279,39 @@
18142
18279
  setCenterTimeDragging = _k[1];
18143
18280
 
18144
18281
  var _l = __read(React__namespace.useState(false), 2),
18145
- mouseDownInLegend = _l[0],
18146
- setMouseDownInLegend = _l[1];
18282
+ dragTooltipOpen = _l[0],
18283
+ setDragTooltipOpen = _l[1];
18284
+
18285
+ var _m = __read(React__namespace.useState(false), 2),
18286
+ mouseDownInLegend = _m[0],
18287
+ setMouseDownInLegend = _m[1];
18147
18288
 
18148
- var _m = __read(React__namespace.useState(animationStartTime && moment__default["default"].utc(animationStartTime).unix()), 2),
18149
- localAnimationStartTime = _m[0],
18150
- setLocalAnimationStartTime = _m[1];
18289
+ var _o = __read(React__namespace.useState(animationStartTime && moment__default["default"].utc(animationStartTime).unix()), 2),
18290
+ localAnimationStartTime = _o[0],
18291
+ setLocalAnimationStartTime = _o[1];
18151
18292
 
18152
- var _o = __read(React__namespace.useState(animationEndTime && moment__default["default"].utc(animationEndTime).unix()), 2),
18153
- localAnimationEndTime = _o[0],
18154
- setLocalAnimationEndTime = _o[1];
18293
+ var _p = __read(React__namespace.useState(animationEndTime && moment__default["default"].utc(animationEndTime).unix()), 2),
18294
+ localAnimationEndTime = _p[0],
18295
+ setLocalAnimationEndTime = _p[1];
18155
18296
 
18156
- var elem = document.querySelector('.timeSliderLegend');
18157
- var pixelsToLeft = elem === null || elem === void 0 ? void 0 : elem.getBoundingClientRect()['left']; // we need to subtract the left padding so event.x start within the canvas.
18297
+ var _q = __read(React__namespace.useState(moment__default["default"].utc(0)), 2),
18298
+ tooltipTime = _q[0],
18299
+ setTooltipTime = _q[1];
18158
18300
 
18159
- var _p = __read(React__namespace.useState('auto'), 2),
18160
- cursorStyle = _p[0],
18161
- setCursorStyle = _p[1];
18301
+ var _r = __read(React__namespace.useState(false), 2),
18302
+ animationAreaDragging = _r[0],
18303
+ setAnimationAreaDragging = _r[1];
18304
+
18305
+ var animationDiff = React__namespace.useRef();
18306
+ var isClickOrDrag = React__namespace.useRef();
18307
+ var pixelsMovedSinceStartDragging = React__namespace.useRef(0);
18308
+ var elem = document.querySelector(".timeSliderLegend_" + mapId);
18309
+ var pixelsToLeft = elem === null || elem === void 0 ? void 0 : elem.getBoundingClientRect()['left'];
18310
+ var pixelsToTop = elem === null || elem === void 0 ? void 0 : elem.getBoundingClientRect()['top'];
18311
+
18312
+ var _s = __read(React__namespace.useState('auto'), 2),
18313
+ cursorStyle = _s[0],
18314
+ setCursorStyle = _s[1];
18162
18315
 
18163
18316
  var curTime = selectedTime !== undefined ? moment__default["default"].unix(selectedTime).toISOString() : moment__default["default"].utc().toISOString();
18164
18317
  React__namespace.useEffect(function () {
@@ -18188,7 +18341,7 @@
18188
18341
  return function () {
18189
18342
  document.removeEventListener('keydown', handleKeyDown);
18190
18343
  };
18191
- }, [timeStep, isTimeSliderHoverOn, currentTime, dataStartTime, dataEndTime, mapIsActive, onSetCenterTime, onSetNewDate, curTime]);
18344
+ }, [curTime, currentTime, dataEndTime, dataStartTime, mapIsActive, onSetCenterTime, onSetNewDate, timeStep]);
18192
18345
  /**
18193
18346
  * remove active drag. can happen outside canvas.
18194
18347
  */
@@ -18201,13 +18354,18 @@
18201
18354
  setRightMarkerDragging(false);
18202
18355
  setMouseDownInLegend(false);
18203
18356
  setCenterTimeDragging(false);
18357
+ setDragTooltipOpen(false);
18358
+ setAnimationAreaDragging(false);
18359
+ startDraggingPosition.current = 0;
18360
+ pixelsMovedSinceStartDragging.current = 0;
18361
+ animationDiff.current = undefined;
18204
18362
  };
18205
18363
 
18206
18364
  document.addEventListener('mouseup', handleMouseUp);
18207
18365
  return function () {
18208
18366
  document.removeEventListener('mouseup', handleMouseUp);
18209
18367
  };
18210
- });
18368
+ }, [centerTimeDragging]);
18211
18369
  var onMouseTouchMoveActions = React.useCallback(function (x) {
18212
18370
  if (!localAnimationStartTime || !localAnimationEndTime) return;
18213
18371
 
@@ -18218,43 +18376,78 @@
18218
18376
  rightMarkerPx = _a[1];
18219
18377
 
18220
18378
  if (leftMarkerDragging) {
18379
+ var mousePosition = leftMarkerPx + x;
18380
+ var rightAnimationPosition = rightMarkerPx - DRAG_AREA_WIDTH * 2; // update tooltip position while dragging
18221
18381
  // Prevent dragging if it would cause markers to cross over, except if the markers
18222
18382
  // are moved away from being crossed over
18223
- if (x >= rightMarkerPx - DRAG_AREA_WIDTH * 2 || x <= 0) return; // change local time bounds according to either dragged marker
18224
18383
 
18225
- var mouseTimeUnix = pixelToTimestamp(x - DRAG_AREA_WIDTH / 2, // lets us drag on the marker
18384
+ if (mousePosition >= rightAnimationPosition || mousePosition <= 0) return; // set animation drag info dialog location
18385
+
18386
+ dragTooltipPosition.current = pixelsToLeft ? mousePosition + pixelsToLeft : mousePosition; // change local time bounds according to either dragged marker
18387
+
18388
+ var mouseTimeUnix = pixelToTimestamp(mousePosition, // lets us drag on the marker
18226
18389
  centerTime, canvasWidth, secondsPerPx);
18227
18390
  setLocalAnimationStartTime(mouseTimeUnix);
18391
+ setTooltipTime(moment__default["default"].unix(mouseTimeUnix));
18228
18392
  return;
18229
18393
  }
18230
18394
 
18231
18395
  if (rightMarkerDragging) {
18232
- // Similar condition for other marker
18233
- if (x <= leftMarkerPx + DRAG_AREA_WIDTH * 2 || x >= canvasWidth) return; // change local time bounds according to either dragged marker
18396
+ var mousePosition = rightMarkerPx + x;
18397
+ var leftAnimationPosition = leftMarkerPx + DRAG_AREA_WIDTH * 2; // Similar condition for other marker
18398
+
18399
+ if (leftAnimationPosition >= mousePosition || mousePosition >= canvasWidth) return; // set animation drag info dialog location
18234
18400
 
18235
- var mouseTimeUnix = pixelToTimestamp(x + DRAG_AREA_WIDTH / 2, // lets us drag on the marker
18401
+ dragTooltipPosition.current = pixelsToLeft ? mousePosition + pixelsToLeft : mousePosition; // change local time bounds according to either dragged marker
18402
+
18403
+ var mouseTimeUnix = pixelToTimestamp(mousePosition, // lets us drag on the marker
18236
18404
  centerTime, canvasWidth, secondsPerPx);
18237
18405
  setLocalAnimationEndTime(mouseTimeUnix);
18406
+ setTooltipTime(moment__default["default"].unix(mouseTimeUnix));
18407
+ return;
18238
18408
  }
18239
- }, [centerTime, leftMarkerDragging, localAnimationEndTime, localAnimationStartTime, rightMarkerDragging, secondsPerPx, canvasWidth]);
18409
+
18410
+ if (animationAreaDragging) {
18411
+ if (animationDiff.current === undefined) {
18412
+ var startDraggingPositionTimestamp = pixelToTimestamp(startDraggingPosition.current, centerTime, canvasWidth, secondsPerPx);
18413
+ var diffLeftAnimationToStartDraggingPosition = startDraggingPositionTimestamp - localAnimationStartTime;
18414
+ var diffRightAnimationToStartDraggingPosition = localAnimationEndTime - startDraggingPositionTimestamp;
18415
+ animationDiff.current = {
18416
+ diffStartToRight: diffRightAnimationToStartDraggingPosition,
18417
+ diffStartToLeft: diffLeftAnimationToStartDraggingPosition
18418
+ };
18419
+ return;
18420
+ }
18421
+
18422
+ pixelsMovedSinceStartDragging.current += x;
18423
+ var currentPositionTimestamp = pixelToTimestamp(startDraggingPosition.current + pixelsMovedSinceStartDragging.current, centerTime, canvasWidth, secondsPerPx);
18424
+ var _b = animationDiff.current,
18425
+ diffStartToRight = _b.diffStartToRight,
18426
+ diffStartToLeft = _b.diffStartToLeft;
18427
+ var startTime = currentPositionTimestamp - diffStartToLeft;
18428
+ var endTime = currentPositionTimestamp + diffStartToRight;
18429
+ setLocalAnimationStartTime(startTime);
18430
+ setLocalAnimationEndTime(endTime);
18431
+ }
18432
+ }, [localAnimationStartTime, localAnimationEndTime, leftMarkerDragging, rightMarkerDragging, animationAreaDragging, centerTime, canvasWidth, secondsPerPx, pixelsToLeft, animationDiff]);
18240
18433
  var setSelectedTime = React.useCallback(function (x) {
18241
- setNewRoundedTime(x, centerTime, canvasWidth, secondsPerPx, timeStep, dataStartTime, dataEndTime, onSetNewDate);
18242
- }, [canvasWidth, centerTime, dataEndTime, dataStartTime, onSetNewDate, secondsPerPx, timeStep]);
18434
+ var unfliteredSelectedTimePx = timestampToPixel(unfilteredSelectedTime, centerTime, canvasWidth, secondsPerPx) + x;
18435
+ setUnfilteredSelectedTime(pixelToTimestamp(unfliteredSelectedTimePx, centerTime, canvasWidth, secondsPerPx));
18436
+ setNewRoundedTime(unfliteredSelectedTimePx, centerTime, canvasWidth, secondsPerPx, timeStep, dataStartTime, dataEndTime, onSetNewDate);
18437
+ }, [canvasWidth, centerTime, dataEndTime, dataStartTime, onSetNewDate, secondsPerPx, setUnfilteredSelectedTime, timeStep, unfilteredSelectedTime]);
18243
18438
  React__namespace.useEffect(function () {
18244
18439
  var handleMouseMove = function handleMouseMove(event) {
18440
+ if (event.movementX === 0) return;
18441
+
18245
18442
  if (mouseDownInLegend) {
18246
18443
  setCenterTimeDragging(true);
18247
18444
  var dragDistanceTime = event.movementX * secondsPerPx;
18248
18445
  var newCenterTime = centerTime - dragDistanceTime;
18249
18446
  onSetCenterTime && onSetCenterTime(newCenterTime);
18250
- } else {
18251
- if (!pixelsToLeft) return;
18252
-
18253
- if (leftMarkerDragging || rightMarkerDragging) {
18254
- onMouseTouchMoveActions(event.clientX - pixelsToLeft);
18255
- } else if (selectedTimeDragging) {
18256
- setSelectedTime(event.clientX - pixelsToLeft);
18257
- }
18447
+ } else if (leftMarkerDragging || rightMarkerDragging || animationAreaDragging) {
18448
+ onMouseTouchMoveActions(event.movementX);
18449
+ } else if (selectedTimeDragging) {
18450
+ setSelectedTime(event.movementX);
18258
18451
  }
18259
18452
  };
18260
18453
 
@@ -18262,10 +18455,14 @@
18262
18455
  return function () {
18263
18456
  document.removeEventListener('mousemove', handleMouseMove);
18264
18457
  };
18265
- }, [centerTime, secondsPerPx, onSetCenterTime, mouseDownInLegend, leftMarkerDragging, rightMarkerDragging, onMouseTouchMoveActions, selectedTimeDragging, setSelectedTime, pixelsToLeft]);
18458
+ }, [animationAreaDragging, centerTime, leftMarkerDragging, mouseDownInLegend, onMouseTouchMoveActions, onSetCenterTime, rightMarkerDragging, secondsPerPx, selectedTimeDragging, setSelectedTime]);
18266
18459
  var theme = material.useTheme();
18460
+ var startDraggingPosition = React__namespace.useRef(0);
18267
18461
 
18268
18462
  var onMouseDown = function onMouseDown(x, y, width) {
18463
+ isClickOrDrag.current = 'click';
18464
+ startDraggingPosition.current = x;
18465
+
18269
18466
  var _a = __read([localAnimationStartTime, localAnimationEndTime, selectedTime].map(function (timestamp) {
18270
18467
  return timestampToPixel(timestamp, centerTime, width, secondsPerPx);
18271
18468
  }), 3),
@@ -18281,16 +18478,27 @@
18281
18478
  }
18282
18479
 
18283
18480
  if (animationStartTime && animationEndTime && onSetAnimationStartTime && onSetAnimationEndTime) {
18284
- // start dragging either marker
18481
+ dragTooltipPosition.current = pixelsToLeft ? x + pixelsToLeft : x; // start dragging either marker
18482
+
18285
18483
  if (isLeftAnimationIconArea(x, leftMarkerPx, DRAG_AREA_WIDTH) && !rightMarkerDragging) {
18286
18484
  setCursorStyle('grabbing');
18287
18485
  setLeftMarkerDragging(true);
18486
+ setTooltipTime(moment__default["default"].utc(animationStartTime));
18487
+ setDragTooltipOpen(true);
18288
18488
  return;
18289
18489
  }
18290
18490
 
18291
18491
  if (isRightAnimationIconArea(x, rightMarkerPx, DRAG_AREA_WIDTH) && !leftMarkerDragging) {
18292
18492
  setCursorStyle('grabbing');
18293
18493
  setRightMarkerDragging(true);
18494
+ setTooltipTime(moment__default["default"].utc(animationEndTime));
18495
+ setDragTooltipOpen(true);
18496
+ return;
18497
+ }
18498
+
18499
+ if (isInsideAnimationArea(x, leftMarkerPx, rightMarkerPx) && !animationAreaDragging) {
18500
+ setCursorStyle('grabbing');
18501
+ setAnimationAreaDragging(true);
18294
18502
  return;
18295
18503
  }
18296
18504
  } // clicking the timeslider
@@ -18299,18 +18507,36 @@
18299
18507
  setMouseDownInLegend(true);
18300
18508
  };
18301
18509
 
18510
+ React__namespace.useEffect(function () {
18511
+ var stoppedDragging = !leftMarkerDragging && !rightMarkerDragging && !animationAreaDragging;
18512
+
18513
+ if (stoppedDragging) {
18514
+ if (localAnimationStartTime !== convertStringTimeToUnix(animationStartTime)) {
18515
+ onSetAnimationStartTime(moment__default["default"].utc(localAnimationStartTime * 1000).format(dateFormat));
18516
+ }
18517
+
18518
+ if (localAnimationEndTime !== convertStringTimeToUnix(animationEndTime)) {
18519
+ onSetAnimationEndTime(moment__default["default"].utc(localAnimationEndTime * 1000).format(dateFormat));
18520
+ }
18521
+ } // eslint-disable-next-line react-hooks/exhaustive-deps
18522
+
18523
+ }, [leftMarkerDragging, rightMarkerDragging, animationAreaDragging]);
18524
+
18302
18525
  var onMouseUpTouchEnd = function onMouseUpTouchEnd(x) {
18303
- // Dispatch changes when releasing mouse
18304
- if (leftMarkerDragging) {
18305
- onSetAnimationStartTime(moment__default["default"].utc(localAnimationStartTime * 1000).format(dateFormat));
18306
- } else if (rightMarkerDragging) {
18307
- onSetAnimationEndTime(moment__default["default"].utc(localAnimationEndTime * 1000).format(dateFormat));
18308
- } else if (!selectedTimeDragging && !centerTimeDragging) {
18309
- setSelectedTime(x);
18526
+ if (isClickOrDrag.current === 'click') {
18527
+ // we need to set the unfiltered time, so the timebox will update accordingly
18528
+ setUnfilteredSelectedTime(pixelToTimestamp(x, centerTime, canvasWidth, secondsPerPx));
18529
+ setNewRoundedTime(x, centerTime, canvasWidth, secondsPerPx, timeStep, dataStartTime, dataEndTime, onSetNewDate);
18310
18530
  }
18531
+
18532
+ isClickOrDrag.current = undefined;
18311
18533
  };
18312
18534
 
18313
18535
  var onMouseMove = function onMouseMove(x, y, event, width) {
18536
+ if (isClickOrDrag.current === 'click') {
18537
+ isClickOrDrag.current = 'drag';
18538
+ }
18539
+
18314
18540
  if (selectedTimeDragging || leftMarkerDragging || rightMarkerDragging) return;
18315
18541
 
18316
18542
  var _a = __read([localAnimationStartTime, localAnimationEndTime, selectedTime].map(function (timestamp) {
@@ -18324,18 +18550,41 @@
18324
18550
  var leftAnimationIconArea = isLeftAnimationIconArea(x, leftMarkerPx, DRAG_AREA_WIDTH);
18325
18551
  var rightAnimationIconArea = isRightAnimationIconArea(x, rightMarkerPx, DRAG_AREA_WIDTH);
18326
18552
  var selectedTimeArea = isSelectedTimeIconArea(x, selectedTimePx, DRAG_AREA_WIDTH);
18553
+ var insideAnimationArea = isInsideAnimationArea(x, leftMarkerPx, rightMarkerPx);
18327
18554
  var hoveringLegendHandles = leftAnimationIconArea || rightAnimationIconArea || selectedTimeArea || mouseDownInLegend;
18328
18555
 
18329
18556
  if (hoveringLegendHandles) {
18330
18557
  setCursorStyle('ew-resize');
18558
+ } else if (insideAnimationArea && !animationAreaDragging) {
18559
+ setCursorStyle('grab');
18560
+ } else if (insideAnimationArea && animationAreaDragging) {
18561
+ setCursorStyle('grabbing');
18331
18562
  } else {
18332
18563
  setCursorStyle('auto');
18333
18564
  }
18334
18565
  };
18335
18566
 
18336
- return /*#__PURE__*/React__namespace.createElement(material.Box, {
18567
+ var dragTooltipPosition = React__namespace.useRef();
18568
+ var popperRef = React__namespace.useRef(null);
18569
+
18570
+ var setTooltipPosition = function setTooltipPosition() {
18571
+ var tooltipX = dragTooltipPosition.current;
18572
+ var tooltipY = pixelsToTop && pixelsToTop - TIME_SLIDER_LEGEND_HEIGHT * 2.5;
18573
+ return new DOMRect(tooltipX, tooltipY, 0, 0);
18574
+ };
18575
+
18576
+ return /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
18577
+ title: tooltipTime.format('HH:mm'),
18578
+ open: dragTooltipOpen,
18579
+ PopperProps: {
18580
+ popperRef: popperRef,
18581
+ anchorEl: {
18582
+ getBoundingClientRect: setTooltipPosition
18583
+ }
18584
+ }
18585
+ }, /*#__PURE__*/React__namespace.createElement(material.Box, {
18337
18586
  "data-testid": "timeSliderLegend",
18338
- className: "timeSliderLegend",
18587
+ className: "timeSliderLegend_" + mapId,
18339
18588
  sx: {
18340
18589
  height: TIME_SLIDER_LEGEND_HEIGHT + "px",
18341
18590
  borderRadius: '4.5px',
@@ -18357,9 +18606,13 @@
18357
18606
  setCanvasWidth(width);
18358
18607
  drawTimeSliderLegend(ctx, theme, width, height, centerTime, secondsPerPx, dataScaleToSecondsPerPx, selectedTime, scale, currentTime, localAnimationStartTime, localAnimationEndTime, dataStartTime, dataEndTime);
18359
18608
  }
18360
- }));
18609
+ })));
18361
18610
  };
18362
18611
 
18612
+ function convertStringTimeToUnix(time) {
18613
+ return time ? moment__default["default"].utc(time).unix() : undefined;
18614
+ }
18615
+
18363
18616
  var TIME_SLIDER_LEGEND_HEIGHT = 24;
18364
18617
 
18365
18618
  /* *
@@ -18411,7 +18664,7 @@
18411
18664
  * */
18412
18665
  var onMouseMove = function onMouseMove(x, width, selectedTime, centerTime, secondsPerPx, mouseDownInTimeBox, isTimeBoxArea, setCursorStyle) {
18413
18666
  if (!selectedTime || mouseDownInTimeBox) return;
18414
- var selectedTimePx = timestampToPixel(selectedTime.unix(), centerTime, width, secondsPerPx);
18667
+ var selectedTimePx = timestampToPixel(selectedTime, centerTime, width, secondsPerPx);
18415
18668
 
18416
18669
  if (isTimeBoxArea(x, selectedTimePx)) {
18417
18670
  setCursorStyle('grab');
@@ -18421,7 +18674,7 @@
18421
18674
  };
18422
18675
  var onMouseDown = function onMouseDown(x, width, selectedTime, centerTime, secondsPerPx, isTimeBoxArea, setCursorStyle, setMouseDownInTimeBox) {
18423
18676
  if (!selectedTime) return;
18424
- var selectedTimePx = timestampToPixel(selectedTime.unix(), centerTime, width, secondsPerPx);
18677
+ var selectedTimePx = timestampToPixel(selectedTime, centerTime, width, secondsPerPx);
18425
18678
 
18426
18679
  if (isTimeBoxArea(x, selectedTimePx)) {
18427
18680
  setCursorStyle('grabbing');
@@ -18536,7 +18789,9 @@
18536
18789
  timeStep = _a.timeStep,
18537
18790
  dataStartTime = _a.dataStartTime,
18538
18791
  dataEndTime = _a.dataEndTime,
18539
- onSetNewDate = _a.onSetNewDate;
18792
+ unfilteredSelectedTime = _a.unfilteredSelectedTime,
18793
+ onSetNewDate = _a.onSetNewDate,
18794
+ setUnfilteredSelectedTime = _a.setUnfilteredSelectedTime;
18540
18795
  var TIME_BOX_WIDTH = 140;
18541
18796
  var theme = material.useTheme();
18542
18797
 
@@ -18577,11 +18832,9 @@
18577
18832
  React__default["default"].useEffect(function () {
18578
18833
  var handleMouseMove = function handleMouseMove(event) {
18579
18834
  if (mouseDownInTimeBox) {
18580
- var elem = document.querySelector('.timeSliderTimeBox');
18581
- var rect = elem === null || elem === void 0 ? void 0 : elem.getBoundingClientRect(); // we need to subtract the left padding so event.x start within the canvas.
18582
-
18583
- if (!rect) return;
18584
- setNewRoundedTime(event.clientX - rect['left'], centerTime, canvasWidth, secondsPerPx, timeStep, dataStartTime, dataEndTime, onSetNewDate);
18835
+ var localSelectedTimePx = timestampToPixel(unfilteredSelectedTime, centerTime, canvasWidth, secondsPerPx) + event.movementX;
18836
+ setUnfilteredSelectedTime(pixelToTimestamp(localSelectedTimePx, centerTime, canvasWidth, secondsPerPx));
18837
+ setNewRoundedTime(localSelectedTimePx, centerTime, canvasWidth, secondsPerPx, timeStep, dataStartTime, dataEndTime, onSetNewDate);
18585
18838
  }
18586
18839
  };
18587
18840
 
@@ -18589,7 +18842,7 @@
18589
18842
  return function () {
18590
18843
  document.removeEventListener('mousemove', handleMouseMove);
18591
18844
  };
18592
- });
18845
+ }, [canvasWidth, centerTime, dataEndTime, dataStartTime, mouseDownInTimeBox, onSetNewDate, secondsPerPx, setUnfilteredSelectedTime, timeStep, unfilteredSelectedTime]);
18593
18846
  return /*#__PURE__*/React__default["default"].createElement(system.Box, {
18594
18847
  "data-testid": "timeSliderTimeBox",
18595
18848
  className: "timeSliderTimeBox",
@@ -18610,11 +18863,14 @@
18610
18863
  onMouseDown(x, width, selectedTime, centerTime, secondsPerPx, isTimeBoxArea, setCursorStyle, setMouseDownInTimeBox);
18611
18864
  },
18612
18865
  onMouseUp: function onMouseUp(x) {
18613
- setNewRoundedTime(x, centerTime, canvasWidth, secondsPerPx, timeStep, dataStartTime, dataEndTime, onSetNewDate);
18866
+ if (mouseDownInTimeBox) {
18867
+ setUnfilteredSelectedTime(pixelToTimestamp(x, centerTime, canvasWidth, secondsPerPx));
18868
+ setNewRoundedTime(x, centerTime, canvasWidth, secondsPerPx, timeStep, dataStartTime, dataEndTime, onSetNewDate);
18869
+ }
18614
18870
  },
18615
18871
  onRenderCanvas: function onRenderCanvas(ctx, width, height) {
18616
18872
  setCanvasWidth(width);
18617
- renderTimeSliderCurrentTimeBox(ctx, theme, width, height, centerTime, selectedTime.unix(), secondsPerPx, scale);
18873
+ renderTimeSliderCurrentTimeBox(ctx, theme, width, height, centerTime, selectedTime, secondsPerPx, scale);
18618
18874
  }
18619
18875
  }));
18620
18876
  };
@@ -18656,12 +18912,13 @@
18656
18912
  var defaultProps = {
18657
18913
  centerTime: moment__default["default"].utc().startOf('day').hours(12).unix(),
18658
18914
  secondsPerPx: 5,
18659
- selectedTime: moment__default["default"].utc().startOf('day').hours(12),
18915
+ selectedTime: moment__default["default"].utc().startOf('day').hours(12).unix(),
18660
18916
  dataScaleToSecondsPerPx: defaultDataScaleToSecondsPerPx
18661
18917
  };
18662
18918
 
18663
18919
  var TimeSlider = function TimeSlider(_a) {
18664
- var buttons = _a.buttons,
18920
+ var mapId = _a.mapId,
18921
+ buttons = _a.buttons,
18665
18922
  timeBox = _a.timeBox,
18666
18923
  legend = _a.legend,
18667
18924
  _b = _a.mapIsActive,
@@ -18671,6 +18928,11 @@
18671
18928
  _d = _a.onToggleTimeSlider,
18672
18929
  onToggleTimeSlider = _d === void 0 ? function () {} : _d;
18673
18930
  useTimeSliderKeyBoardControl(mapIsActive, isVisible, onToggleTimeSlider);
18931
+
18932
+ var _e = __read(React__namespace.useState(defaultProps.selectedTime), 2),
18933
+ unfilteredSelectedTime = _e[0],
18934
+ setUnfilteredSelectedTime = _e[1];
18935
+
18674
18936
  var visibilityState = isVisible ? 'visible' : 'hidden';
18675
18937
  return isVisible ? /*#__PURE__*/React__namespace.createElement(material.Grid, {
18676
18938
  style: {
@@ -18695,7 +18957,8 @@
18695
18957
  zIndex: 99
18696
18958
  }
18697
18959
  }, timeBox || /*#__PURE__*/React__namespace.createElement(TimeSliderCurrentTimeBox, __assign({}, defaultProps, {
18698
- selectedTime: defaultProps.selectedTime
18960
+ unfilteredSelectedTime: unfilteredSelectedTime,
18961
+ setUnfilteredSelectedTime: setUnfilteredSelectedTime
18699
18962
  }))), /*#__PURE__*/React__namespace.createElement(material.Grid, {
18700
18963
  item: true
18701
18964
  }), /*#__PURE__*/React__namespace.createElement(material.Grid, {
@@ -18703,8 +18966,10 @@
18703
18966
  }, buttons || /*#__PURE__*/React__namespace.createElement(TimeSliderButtons, null)), /*#__PURE__*/React__namespace.createElement(material.Grid, {
18704
18967
  item: true
18705
18968
  }, legend || /*#__PURE__*/React__namespace.createElement(TimeSliderLegend, __assign({}, defaultProps, {
18706
- selectedTime: defaultProps.selectedTime.unix(),
18707
- mapIsActive: mapIsActive
18969
+ mapId: mapId,
18970
+ mapIsActive: mapIsActive,
18971
+ unfilteredSelectedTime: unfilteredSelectedTime,
18972
+ setUnfilteredSelectedTime: setUnfilteredSelectedTime
18708
18973
  })), ' '), /*#__PURE__*/React__namespace.createElement(material.Grid, {
18709
18974
  item: true,
18710
18975
  sx: {
@@ -18838,12 +19103,6 @@
18838
19103
  var isTimestepAuto$1 = reactRedux.useSelector(function (store) {
18839
19104
  return isTimestepAuto(store, mapId);
18840
19105
  });
18841
- var activeLayerId = reactRedux.useSelector(function (store) {
18842
- return getActiveLayerId(store, mapId);
18843
- });
18844
- var activeLayerTimeDimension = reactRedux.useSelector(function (store) {
18845
- return getLayerTimeDimension(store, activeLayerId);
18846
- });
18847
19106
  var onToggleTimestepAuto = React__namespace.useCallback(function () {
18848
19107
  dispatch(mapActions$1.toggleTimestepAuto({
18849
19108
  mapId: mapId,
@@ -18863,9 +19122,7 @@
18863
19122
  timeStep: timeStep,
18864
19123
  onChangeTimeStep: onSetTimeStep,
18865
19124
  disabled: isAnimating$1,
18866
- isTimestepAuto: isTimestepAuto$1,
18867
- onToggleTimestepAuto: onToggleTimestepAuto,
18868
- timeDimension: activeLayerTimeDimension
19125
+ onToggleTimestepAuto: onToggleTimestepAuto
18869
19126
  });
18870
19127
  };
18871
19128
 
@@ -18999,6 +19256,57 @@
18999
19256
  });
19000
19257
  };
19001
19258
 
19259
+ /* *
19260
+ * Licensed under the Apache License, Version 2.0 (the "License");
19261
+ * you may not use this file except in compliance with the License.
19262
+ * You may obtain a copy of the License at
19263
+ *
19264
+ * http://www.apache.org/licenses/LICENSE-2.0
19265
+ *
19266
+ * Unless required by applicable law or agreed to in writing, software
19267
+ * distributed under the License is distributed on an "AS IS" BASIS,
19268
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19269
+ * See the License for the specific language governing permissions and
19270
+ * limitations under the License.
19271
+ *
19272
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
19273
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
19274
+ * */
19275
+
19276
+ var AnimationLengthButtonConnect = function AnimationLengthButtonConnect(_a) {
19277
+ var mapId = _a.mapId;
19278
+ var dispatch = reactRedux.useDispatch();
19279
+ var isAnimating$1 = reactRedux.useSelector(function (store) {
19280
+ return isAnimating(store, mapId);
19281
+ });
19282
+ var animationStartTime = reactRedux.useSelector(function (store) {
19283
+ return getAnimationStartTime(store, mapId);
19284
+ });
19285
+ var animationEndTime = reactRedux.useSelector(function (store) {
19286
+ return getAnimationEndTime(store, mapId);
19287
+ });
19288
+ var currentDiffInMinutes = moment__default["default"](animationEndTime).diff(moment__default["default"](animationStartTime), 'minutes');
19289
+ var currentLength = Object.values(AnimationLength).map(function (val) {
19290
+ return Number(val);
19291
+ }).find(function (val) {
19292
+ return val >= currentDiffInMinutes;
19293
+ });
19294
+
19295
+ var handlechangeAnimationLength = function handlechangeAnimationLength(length) {
19296
+ var animationEndTime = moment__default["default"](animationStartTime).add(length, 'minutes').toISOString();
19297
+ dispatch(mapActions$1.setAnimationEndTime({
19298
+ mapId: mapId,
19299
+ animationEndTime: animationEndTime
19300
+ }));
19301
+ };
19302
+
19303
+ return /*#__PURE__*/React__namespace.createElement(AnimationLengthButton, {
19304
+ disabled: isAnimating$1,
19305
+ animationLength: currentLength || Number(AnimationLength.Hours24),
19306
+ onChangeAnimationLength: handlechangeAnimationLength
19307
+ });
19308
+ };
19309
+
19002
19310
  /* *
19003
19311
  * Licensed under the Apache License, Version 2.0 (the "License");
19004
19312
  * you may not use this file except in compliance with the License.
@@ -19027,11 +19335,35 @@
19027
19335
  var OptionsMenuButtonConnect = function OptionsMenuButtonConnect(_a) {
19028
19336
  var sourceId = _a.sourceId,
19029
19337
  mapId = _a.mapId;
19338
+ var dispatch = reactRedux.useDispatch();
19339
+ var isTimestepAuto$1 = reactRedux.useSelector(function (store) {
19340
+ return isTimestepAuto(store, mapId);
19341
+ });
19342
+ var timeStep = reactRedux.useSelector(function (store) {
19343
+ return getMapTimeStep(store, mapId);
19344
+ });
19345
+ var activeLayerId = reactRedux.useSelector(function (store) {
19346
+ return getActiveLayerId(store, mapId);
19347
+ });
19348
+ var activeLayerTimeDimension = reactRedux.useSelector(function (store) {
19349
+ return getLayerTimeDimension(store, activeLayerId);
19350
+ });
19351
+ var onSetTimeStep = React__namespace.useCallback(function (timeStep, origin) {
19352
+ dispatch(mapActions$1.setTimeStep(__assign({
19353
+ mapId: mapId,
19354
+ timeStep: timeStep
19355
+ }, origin && {
19356
+ origin: origin
19357
+ })));
19358
+ }, [dispatch, mapId]);
19030
19359
  return /*#__PURE__*/React__namespace.createElement(OptionsMenuButton, {
19031
19360
  nowBtn: /*#__PURE__*/React__namespace.createElement(NowButtonConnect, {
19032
19361
  mapId: mapId,
19033
19362
  sourceId: sourceId
19034
19363
  }),
19364
+ animationLengthBtn: /*#__PURE__*/React__namespace.createElement(AnimationLengthButtonConnect, {
19365
+ mapId: mapId
19366
+ }),
19035
19367
  autoUpdateBtn: /*#__PURE__*/React__namespace.createElement(AutoUpdateButtonConnect, {
19036
19368
  mapId: mapId
19037
19369
  }),
@@ -19043,7 +19375,11 @@
19043
19375
  }),
19044
19376
  timeScaleBtn: /*#__PURE__*/React__namespace.createElement(TimeScaleButtonConnect, {
19045
19377
  mapId: mapId
19046
- })
19378
+ }),
19379
+ timeStep: timeStep,
19380
+ isTimestepAuto: isTimestepAuto$1,
19381
+ onChangeTimeStep: onSetTimeStep,
19382
+ timeDimension: activeLayerTimeDimension
19047
19383
  });
19048
19384
  };
19049
19385
 
@@ -19197,9 +19533,11 @@
19197
19533
  timeValue: getTime(getSynchronizationGroupStore(store), props.sourceId),
19198
19534
  animationStartTime: getAnimationStartTime(store, props.mapId),
19199
19535
  animationEndTime: getAnimationEndTime(store, props.mapId),
19200
- activeWindowId: getActiveWindowId(store)
19536
+ activeWindowId: getActiveWindowId(store),
19537
+ unfilteredSelectedTime: getTimeSliderUnfilteredSelectedTime(store, props.mapId)
19201
19538
  };
19202
19539
  }, {
19540
+ setTimeSliderUnfilteredSelectedTime: mapActions$1.setTimeSliderUnfilteredSelectedTime,
19203
19541
  stopMapAnimation: mapActions$1.mapStopAnimation,
19204
19542
  setTime: genericActions.setTime,
19205
19543
  mapSetTimeSliderCenterTime: mapActions$1.setTimeSliderCenterTime,
@@ -19228,7 +19566,9 @@
19228
19566
  mapSetTimeSliderCenterTime = _a.mapSetTimeSliderCenterTime,
19229
19567
  mapSetTimeSliderSecondsPerPx = _a.mapSetTimeSliderSecondsPerPx,
19230
19568
  setAnimationStartTime = _a.setAnimationStartTime,
19231
- setAnimationEndTime = _a.setAnimationEndTime;
19569
+ setAnimationEndTime = _a.setAnimationEndTime,
19570
+ unfilteredSelectedTime = _a.unfilteredSelectedTime,
19571
+ setTimeSliderUnfilteredSelectedTime = _a.setTimeSliderUnfilteredSelectedTime;
19232
19572
  var selectedTime = getTimeBounds(dimensions).selectedTime;
19233
19573
  var currentTime = moment__default["default"].utc().unix();
19234
19574
 
@@ -19238,6 +19578,7 @@
19238
19578
 
19239
19579
  var mapIsActive = mapId === activeWindowId;
19240
19580
  return /*#__PURE__*/React__namespace.createElement(TimeSliderLegend, {
19581
+ mapId: mapId,
19241
19582
  centerTime: centerTime,
19242
19583
  secondsPerPx: secondsPerPx,
19243
19584
  dataScaleToSecondsPerPx: dataScaleToSecondsPerPx,
@@ -19251,6 +19592,13 @@
19251
19592
  animationEndTime: animationEndTime,
19252
19593
  timeStep: timeStep,
19253
19594
  mapIsActive: mapIsActive,
19595
+ unfilteredSelectedTime: unfilteredSelectedTime || selectedTime,
19596
+ setUnfilteredSelectedTime: function setUnfilteredSelectedTime(timeSliderUnfilteredSelectedTime) {
19597
+ if (setTimeSliderUnfilteredSelectedTime) setTimeSliderUnfilteredSelectedTime({
19598
+ timeSliderUnfilteredSelectedTime: timeSliderUnfilteredSelectedTime,
19599
+ mapId: mapId
19600
+ });
19601
+ },
19254
19602
  onSetNewDate: function onSetNewDate(newDate) {
19255
19603
  if (isAnimating) {
19256
19604
  stopMapAnimation({
@@ -19330,9 +19678,11 @@
19330
19678
  secondsPerPx: getMapTimeSliderSecondsPerPx(store, props.mapId),
19331
19679
  scale: getMapTimeSliderScale(store, props.mapId),
19332
19680
  timeStep: getMapTimeStep(store, props.mapId),
19333
- isAnimating: isAnimating(store, props.mapId)
19681
+ isAnimating: isAnimating(store, props.mapId),
19682
+ unfilteredSelectedTime: getTimeSliderUnfilteredSelectedTime(store, props.mapId)
19334
19683
  };
19335
19684
  }, {
19685
+ setTimeSliderUnfilteredSelectedTime: mapActions$1.setTimeSliderUnfilteredSelectedTime,
19336
19686
  stopMapAnimation: mapActions$1.mapStopAnimation,
19337
19687
  setTime: genericActions.setTime
19338
19688
  });
@@ -19348,8 +19698,10 @@
19348
19698
  timeStep = _a.timeStep,
19349
19699
  isAnimating = _a.isAnimating,
19350
19700
  stopMapAnimation = _a.stopMapAnimation,
19701
+ unfilteredSelectedTime = _a.unfilteredSelectedTime,
19702
+ setTimeSliderUnfilteredSelectedTime = _a.setTimeSliderUnfilteredSelectedTime,
19351
19703
  setTime = _a.setTime;
19352
- var selectedTime = getMomentTimeBounds(dimensions).selectedTime;
19704
+ var selectedTime = getTimeBounds(dimensions).selectedTime;
19353
19705
 
19354
19706
  var _b = __read(getDataLimitsFromLayers(layers), 2),
19355
19707
  dataStartTime = _b[0],
@@ -19363,6 +19715,13 @@
19363
19715
  dataStartTime: dataStartTime,
19364
19716
  dataEndTime: dataEndTime,
19365
19717
  timeStep: timeStep,
19718
+ unfilteredSelectedTime: unfilteredSelectedTime || selectedTime,
19719
+ setUnfilteredSelectedTime: function setUnfilteredSelectedTime(timeSliderUnfilteredSelectedTime) {
19720
+ if (setTimeSliderUnfilteredSelectedTime) setTimeSliderUnfilteredSelectedTime({
19721
+ timeSliderUnfilteredSelectedTime: timeSliderUnfilteredSelectedTime,
19722
+ mapId: mapId
19723
+ });
19724
+ },
19366
19725
  onSetNewDate: function onSetNewDate(newDate) {
19367
19726
  if (isAnimating) {
19368
19727
  stopMapAnimation({
@@ -19447,6 +19806,7 @@
19447
19806
  };
19448
19807
 
19449
19808
  return /*#__PURE__*/React__namespace.createElement(TimeSlider, {
19809
+ mapId: mapId,
19450
19810
  buttons: /*#__PURE__*/React__namespace.createElement(TimeSliderButtonsConnect, {
19451
19811
  mapId: mapId,
19452
19812
  sourceId: sourceId
@@ -23529,12 +23889,11 @@
23529
23889
  var handleKeyPress = function handleKeyPress(event) {
23530
23890
  var target = event.target;
23531
23891
  var map = getWMJSMapById(mapId);
23892
+ var key = event.key,
23893
+ type = event.type;
23894
+ keysPressedDown[key] = type === 'keydown';
23532
23895
 
23533
23896
  if (map && target.tagName !== 'INPUT' && mapIsActive) {
23534
- var key = event.key,
23535
- type = event.type;
23536
- keysPressedDown[key] = type === 'keydown';
23537
-
23538
23897
  if (keysPressedDown['+']) {
23539
23898
  map.zoomIn(1);
23540
23899
  } else if (keysPressedDown['-']) {
@@ -23911,6 +24270,9 @@
23911
24270
  mapId: mapId,
23912
24271
  sourceId: sourceId
23913
24272
  }),
24273
+ animationLengthBtn: /*#__PURE__*/React__default["default"].createElement(AnimationLengthButtonConnect, {
24274
+ mapId: mapId
24275
+ }),
23914
24276
  autoUpdateBtn: /*#__PURE__*/React__default["default"].createElement(AutoUpdateButtonConnect, {
23915
24277
  mapId: mapId
23916
24278
  }),
@@ -25594,21 +25956,29 @@
25594
25956
  * */
25595
25957
  var MapWarningProperties = function MapWarningProperties(_a) {
25596
25958
  var selectedFeatureProperties = _a.selectedFeatureProperties,
25597
- languageIndex = _a.languageIndex;
25959
+ languageIndex = _a.languageIndex,
25960
+ parentSize = _a.parentSize;
25598
25961
  var language = languageIndex || 0;
25962
+ var newWidth = parentSize ? parentSize - 100 : 350;
25599
25963
  return /*#__PURE__*/React__default["default"].createElement("div", {
25964
+ style: {
25965
+ position: 'fixed',
25966
+ width: newWidth + "px",
25967
+ height: '1px',
25968
+ display: 'flex',
25969
+ justifyContent: 'center',
25970
+ left: '50px'
25971
+ }
25972
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
25600
25973
  "data-testid": "map-warning-properties",
25601
25974
  style: {
25602
- width: '100%',
25603
- height: '15%',
25604
- marginTop: '30px',
25605
- marginLeft: '100px',
25606
- position: 'relative',
25607
- zIndex: 10000,
25608
- backgroundColor: '#CCCCCCC0',
25975
+ marginTop: '50px',
25976
+ width: '350px',
25977
+ height: '190px',
25609
25978
  padding: '0px 20px 20px',
25610
25979
  overflow: 'auto',
25611
- fontSize: '11px'
25980
+ fontSize: '11px',
25981
+ backgroundColor: '#CCCCCCC0'
25612
25982
  }
25613
25983
  }, /*#__PURE__*/React__default["default"].createElement("h1", {
25614
25984
  "data-testid": "map-warning-properties-title"
@@ -25622,7 +25992,7 @@
25622
25992
  "data-testid": "map-warning-properties-row"
25623
25993
  }, "Sender: ", selectedFeatureProperties.languages[language].senderName), selectedFeatureProperties.identifier && /*#__PURE__*/React__default["default"].createElement("pre", {
25624
25994
  "data-testid": "map-warning-properties-row"
25625
- }, "Identifier: ", selectedFeatureProperties.identifier));
25995
+ }, "Identifier: ", selectedFeatureProperties.identifier)));
25626
25996
  };
25627
25997
 
25628
25998
  /* *