@opengeoweb/core 4.5.0 → 4.6.1

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 (46) hide show
  1. package/index.esm.js +1220 -391
  2. package/index.umd.js +1227 -362
  3. package/lib/components/ConfigurableMap/ConfigurableMapConnect.d.ts +1 -0
  4. package/lib/components/FeatureInfo/GetFeatureInfoButtonConnect.d.ts +8 -0
  5. package/lib/components/FeatureInfo/GetFeatureInfoButtonConnect.spec.d.ts +1 -0
  6. package/lib/components/FeatureInfo/GetFeatureInfoConnect.d.ts +8 -0
  7. package/lib/components/FeatureInfo/GetFeatureInfoConnect.spec.d.ts +1 -0
  8. package/lib/components/FeatureInfo/GetFeatureInfoDialog.d.ts +16 -0
  9. package/lib/components/FeatureInfo/GetFeatureInfoDialog.spec.d.ts +1 -0
  10. package/lib/components/FeatureInfo/index.d.ts +3 -0
  11. package/lib/components/FeatureInfo/utils.d.ts +17 -0
  12. package/lib/components/FeatureInfo/utils.spec.d.ts +1 -0
  13. package/lib/components/LayerManager/LayerSelect/LayerSelectUtils.d.ts +2 -2
  14. package/lib/components/LayerManager/LayerSelect/ServiceList/ServiceList.d.ts +2 -2
  15. package/lib/components/LayerManager/LayerSelect/ServiceOptionsDialog/ServiceOptionsDialog.d.ts +2 -2
  16. package/lib/components/LayerManager/LayerSelect/ServicePopup/ServicePopup.d.ts +2 -2
  17. package/lib/components/LayerManager/LayerSelect/ServicePopup/utils.d.ts +3 -3
  18. package/lib/components/MapWarning/MapWarningProperties.d.ts +1 -0
  19. package/lib/components/TimeSlider/TimeSlider.d.ts +1 -0
  20. package/lib/components/TimeSlider/TimeSliderButtons/AnimationLengthButton/AnimationLengthButton.d.ts +9 -0
  21. package/lib/components/TimeSlider/TimeSliderButtons/AnimationLengthButton/AnimationLengthButton.spec.d.ts +1 -0
  22. package/lib/components/TimeSlider/TimeSliderButtons/AnimationLengthButton/AnimationLengthButtonConnect.d.ts +6 -0
  23. package/lib/components/TimeSlider/TimeSliderButtons/AnimationLengthButton/AnimationLengthButtonConnect.spec.d.ts +1 -0
  24. package/lib/components/TimeSlider/TimeSliderButtons/OptionsMenuButton/OptionsMenu.d.ts +1 -0
  25. package/lib/components/TimeSlider/TimeSliderButtons/OptionsMenuButton/OptionsMenuButton.d.ts +6 -0
  26. package/lib/components/TimeSlider/TimeSliderCurrentTimeBox/TimeSliderCurrentTimeBox.d.ts +3 -2
  27. package/lib/components/TimeSlider/TimeSliderCurrentTimeBox/TimeSliderCurrentTimeBoxConnect.d.ts +4 -0
  28. package/lib/components/TimeSlider/TimeSliderCurrentTimeBox/TimeSliderCurrentTimeBoxMouseEvents.d.ts +2 -2
  29. package/lib/components/TimeSlider/TimeSliderLegend/TimeSliderLegend.d.ts +3 -0
  30. package/lib/components/TimeSlider/TimeSliderLegend/TimeSliderLegendConnect.d.ts +4 -0
  31. package/lib/components/TimeSlider/TimeSliderLegend/TimeSliderLegendUtils.d.ts +1 -0
  32. package/lib/hooks/useSetupDialog/useSetupDialog.d.ts +2 -0
  33. package/lib/index.d.ts +1 -3
  34. package/lib/store/layerSelect/reducer.d.ts +3 -1
  35. package/lib/store/layerSelect/selectors.d.ts +6 -39
  36. package/lib/store/layerSelect/types.d.ts +12 -20
  37. package/lib/store/layerSelect/utils.d.ts +5 -0
  38. package/lib/store/layerSelect/utils.spec.d.ts +1 -0
  39. package/lib/store/mapStore/map/reducer.d.ts +4 -8
  40. package/lib/store/mapStore/map/selectors.d.ts +21 -40
  41. package/lib/store/mapStore/map/types.d.ts +15 -14
  42. package/lib/store/ui/reducer.d.ts +5 -1
  43. package/lib/store/ui/selectors.d.ts +24 -0
  44. package/lib/store/ui/types.d.ts +12 -1
  45. package/lib/utils/testUtils.d.ts +1 -0
  46. package/package.json +10 -9
package/index.umd.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@reduxjs/toolkit'), require('immer'), require('moment'), require('react'), require('lodash'), require('redux-saga/effects'), require('react-redux'), require('@opengeoweb/shared'), require('@opengeoweb/theme'), require('@mui/material'), require('@opengeoweb/webmap'), require('react-sortablejs'), require('sortablejs'), require('@opengeoweb/form-fields'), require('react-hook-form'), require('react-window'), require('@mui/material/Box'), require('@mui/material/Typography'), require('@mui/material/Grid'), require('@mui/system'), require('throttle-debounce'), require('lodash.clonedeep'), require('proj4'), require('@turf/turf'), require('react-draggable'), require('re-resizable'), require('@redux-eggs/redux-toolkit'), require('@redux-eggs/saga-extension')) :
3
- typeof define === 'function' && define.amd ? define(['exports', '@reduxjs/toolkit', 'immer', 'moment', 'react', 'lodash', 'redux-saga/effects', 'react-redux', '@opengeoweb/shared', '@opengeoweb/theme', '@mui/material', '@opengeoweb/webmap', 'react-sortablejs', 'sortablejs', '@opengeoweb/form-fields', 'react-hook-form', 'react-window', '@mui/material/Box', '@mui/material/Typography', '@mui/material/Grid', '@mui/system', 'throttle-debounce', 'lodash.clonedeep', 'proj4', '@turf/turf', 'react-draggable', 're-resizable', '@redux-eggs/redux-toolkit', '@redux-eggs/saga-extension'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Core = {}, global.toolkit, global.produce, global.moment, global.React, global._, global.effects, global.reactRedux, global.shared, global.theme, global.material, global.webmap, global.reactSortablejs, global.Sortable, global.formFields, global.reactHookForm, global.reactWindow, global.Box, global.Typography, global.Grid, global.system, global.throttleDebounce, global.cloneDeep, global.proj4, global.turf, global.Draggable, global.reResizable, global.reduxToolkit, global.sagaExtension));
5
- })(this, (function (exports, toolkit, produce, moment, React, _, effects, reactRedux, shared, theme, material, webmap, reactSortablejs, Sortable, formFields, reactHookForm, reactWindow, Box, Typography, Grid, system, throttleDebounce, cloneDeep, proj4, turf, Draggable, reResizable, reduxToolkit, sagaExtension) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@reduxjs/toolkit'), require('immer'), require('moment'), require('react'), require('lodash'), require('redux-saga/effects'), require('react-redux'), require('@opengeoweb/shared'), require('@opengeoweb/theme'), require('@mui/material'), require('@opengeoweb/webmap'), require('react-sortablejs'), require('sortablejs'), require('@opengeoweb/form-fields'), require('react-hook-form'), require('react-window'), require('@mui/material/Box'), require('@mui/material/Typography'), require('@mui/material/Grid'), require('@mui/system'), require('throttle-debounce'), require('lodash.clonedeep'), require('proj4'), require('@turf/turf'), require('react-draggable'), require('re-resizable'), require('axios'), require('@opengeoweb/api'), require('@redux-eggs/redux-toolkit'), require('@redux-eggs/saga-extension')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', '@reduxjs/toolkit', 'immer', 'moment', 'react', 'lodash', 'redux-saga/effects', 'react-redux', '@opengeoweb/shared', '@opengeoweb/theme', '@mui/material', '@opengeoweb/webmap', 'react-sortablejs', 'sortablejs', '@opengeoweb/form-fields', 'react-hook-form', 'react-window', '@mui/material/Box', '@mui/material/Typography', '@mui/material/Grid', '@mui/system', 'throttle-debounce', 'lodash.clonedeep', 'proj4', '@turf/turf', 'react-draggable', 're-resizable', 'axios', '@opengeoweb/api', '@redux-eggs/redux-toolkit', '@redux-eggs/saga-extension'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Core = {}, global.toolkit, global.produce, global.moment, global.React, global._, global.effects, global.reactRedux, global.shared, global.theme, global.material, global.webmap, global.reactSortablejs, global.Sortable, global.formFields, global.reactHookForm, global.reactWindow, global.Box, global.Typography, global.Grid, global.system, global.throttleDebounce, global.cloneDeep, global.proj4, global.turf, global.Draggable, global.reResizable, global.axios, global.api, global.reduxToolkit, global.sagaExtension));
5
+ })(this, (function (exports, toolkit, produce, moment, React, _, effects, reactRedux, shared, theme, material, webmap, reactSortablejs, Sortable, formFields, reactHookForm, reactWindow, Box, Typography, Grid, system, throttleDebounce, cloneDeep, proj4, turf, Draggable, reResizable, axios, api, reduxToolkit, sagaExtension) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -37,6 +37,7 @@
37
37
  var proj4__default = /*#__PURE__*/_interopDefaultLegacy(proj4);
38
38
  var turf__namespace = /*#__PURE__*/_interopNamespace(turf);
39
39
  var Draggable__default = /*#__PURE__*/_interopDefaultLegacy(Draggable);
40
+ var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
40
41
 
41
42
  /*! *****************************************************************************
42
43
  Copyright (c) Microsoft Corporation.
@@ -241,6 +242,19 @@
241
242
  Scale[Scale["DataScale"] = 8] = "DataScale";
242
243
  })(Scale || (Scale = {}));
243
244
 
245
+ var AnimationLength;
246
+
247
+ (function (AnimationLength) {
248
+ AnimationLength[AnimationLength["Minutes15"] = 15] = "Minutes15";
249
+ AnimationLength[AnimationLength["Minutes30"] = 30] = "Minutes30";
250
+ AnimationLength[AnimationLength["Hours1"] = 60] = "Hours1";
251
+ AnimationLength[AnimationLength["Hours2"] = 120] = "Hours2";
252
+ AnimationLength[AnimationLength["Hours3"] = 180] = "Hours3";
253
+ AnimationLength[AnimationLength["Hours6"] = 360] = "Hours6";
254
+ AnimationLength[AnimationLength["Hours12"] = 720] = "Hours12";
255
+ AnimationLength[AnimationLength["Hours24"] = 1440] = "Hours24";
256
+ })(AnimationLength || (AnimationLength = {}));
257
+
244
258
  var MapActionOrigin;
245
259
 
246
260
  (function (MapActionOrigin) {
@@ -434,6 +448,7 @@
434
448
  var types$2 = /*#__PURE__*/Object.freeze({
435
449
  __proto__: null,
436
450
  get Scale () { return Scale; },
451
+ get AnimationLength () { return AnimationLength; },
437
452
  get MapActionOrigin () { return MapActionOrigin; },
438
453
  get LayerType () { return LayerType; },
439
454
  get LayerStatus () { return LayerStatus; },
@@ -1841,7 +1856,9 @@
1841
1856
  activeMapId: activeMapId,
1842
1857
  isOpen: setOpen,
1843
1858
  type: type,
1844
- source: source
1859
+ source: source,
1860
+ isLoading: false,
1861
+ error: undefined
1845
1862
  };
1846
1863
  };
1847
1864
  var initialState$4 = {
@@ -1924,6 +1941,18 @@
1924
1941
  setActiveWindowId: function setActiveWindowId(draft, action) {
1925
1942
  var activeWindowId = action.payload.activeWindowId;
1926
1943
  draft.activeWindowId = activeWindowId;
1944
+ },
1945
+ toggleIsLoadingDialog: function toggleIsLoadingDialog(draft, action) {
1946
+ var _a = action.payload,
1947
+ isLoading = _a.isLoading,
1948
+ type = _a.type;
1949
+ draft.dialogs[type].isLoading = isLoading;
1950
+ },
1951
+ setErrorDialog: function setErrorDialog(draft, action) {
1952
+ var _a = action.payload,
1953
+ error = _a.error,
1954
+ type = _a.type;
1955
+ draft.dialogs[type].error = error;
1927
1956
  }
1928
1957
  }
1929
1958
  });
@@ -2148,17 +2177,6 @@
2148
2177
 
2149
2178
  draft.byId[mapId].animationDelay = animationDelay;
2150
2179
  },
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
2180
  layerMoveLayer: function layerMoveLayer(draft, action) {
2163
2181
  var _a = action.payload,
2164
2182
  oldIndex = _a.oldIndex,
@@ -2193,6 +2211,17 @@
2193
2211
 
2194
2212
  draft.byId[mapId].timeSliderCenterTime = timeSliderCenterTime;
2195
2213
  },
2214
+ setTimeSliderUnfilteredSelectedTime: function setTimeSliderUnfilteredSelectedTime(draft, action) {
2215
+ var _a = action.payload,
2216
+ mapId = _a.mapId,
2217
+ timeSliderUnfilteredSelectedTime = _a.timeSliderUnfilteredSelectedTime;
2218
+
2219
+ if (!draft.byId[mapId]) {
2220
+ return;
2221
+ }
2222
+
2223
+ draft.byId[mapId].timeSliderUnfilteredSelectedTime = timeSliderUnfilteredSelectedTime;
2224
+ },
2196
2225
  setTimeSliderSecondsPerPx: function setTimeSliderSecondsPerPx(draft, action) {
2197
2226
  var _a = action.payload,
2198
2227
  mapId = _a.mapId,
@@ -2317,17 +2346,6 @@
2317
2346
 
2318
2347
  draft.byId[mapId].activeMapPresetId = presetId;
2319
2348
  },
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
2349
  setHasMapPresetChanges: function setHasMapPresetChanges(draft, action) {
2332
2350
  var _a = action.payload,
2333
2351
  mapId = _a.mapId,
@@ -2339,17 +2357,6 @@
2339
2357
 
2340
2358
  draft.byId[mapId].hasMapPresetChanges = hasChanges;
2341
2359
  },
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
2360
  toggleDockedLayerManager: function toggleDockedLayerManager(draft, action) {
2354
2361
  var _a = action.payload,
2355
2362
  mapId = _a.mapId,
@@ -3043,6 +3050,12 @@
3043
3050
 
3044
3051
  return (_a = store === null || store === void 0 ? void 0 : store.ui) === null || _a === void 0 ? void 0 : _a.activeWindowId;
3045
3052
  };
3053
+ var getDialogIsLoading = toolkit.createSelector(getDialogDetailsByType, function (details) {
3054
+ return details && details.isLoading || false;
3055
+ });
3056
+ var getDialogError = toolkit.createSelector(getDialogDetailsByType, function (details) {
3057
+ return details && details.error || '';
3058
+ });
3046
3059
 
3047
3060
  var selectors$1 = /*#__PURE__*/Object.freeze({
3048
3061
  __proto__: null,
@@ -3053,7 +3066,9 @@
3053
3066
  getDialogOrder: getDialogOrder,
3054
3067
  getDialogIsOrderedOnTop: getDialogIsOrderedOnTop,
3055
3068
  getDialogSource: getDialogSource,
3056
- getActiveWindowId: getActiveWindowId
3069
+ getActiveWindowId: getActiveWindowId,
3070
+ getDialogIsLoading: getDialogIsLoading,
3071
+ getDialogError: getDialogError
3057
3072
  });
3058
3073
 
3059
3074
  /* *
@@ -3878,6 +3893,19 @@
3878
3893
  var getMapTimeSliderCenterTime = toolkit.createSelector(getMapById, function (store) {
3879
3894
  return store ? store.timeSliderCenterTime : moment__default["default"]().unix();
3880
3895
  });
3896
+ /**
3897
+ * Returns the unflitered selected time of time slider
3898
+ * This is not used to set the selected time itself, which is controlled by TimeBounds where values are rounded.
3899
+ *
3900
+ * Example: selectedTime = getTimeSliderUnfliteredSelectedTime(store, 'mapid_1')
3901
+ * @param {object} store store: object - store object
3902
+ * @param {string} mapId mapId: string - Id of the map
3903
+ * @returns {number} returnType: number - unfiltered selected time as a unix timestamp
3904
+ */
3905
+
3906
+ var getTimeSliderUnfilteredSelectedTime = toolkit.createSelector(getMapById, function (store) {
3907
+ return store ? store.timeSliderUnfilteredSelectedTime : null;
3908
+ });
3881
3909
  /**
3882
3910
  * Returns the number of seconds per pixel on the time slider
3883
3911
  *
@@ -4185,18 +4213,6 @@
4185
4213
  shouldShowLegend: shouldShowLegend
4186
4214
  });
4187
4215
  }, 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
4216
  /**
4201
4217
  * Returns the has changes state of the map preset
4202
4218
  *
@@ -4209,18 +4225,6 @@
4209
4225
  var getHasMapPresetChanges = toolkit.createSelector(getMapById, function (store) {
4210
4226
  return store && store.hasMapPresetChanges ? store.hasMapPresetChanges : false;
4211
4227
  });
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
4228
  /**
4225
4229
  * Returns whether the docked layer manager is open
4226
4230
  *
@@ -4263,6 +4267,7 @@
4263
4267
  getMapTimeStep: getMapTimeStep,
4264
4268
  getMapAnimationDelay: getMapAnimationDelay,
4265
4269
  getMapTimeSliderCenterTime: getMapTimeSliderCenterTime,
4270
+ getTimeSliderUnfilteredSelectedTime: getTimeSliderUnfilteredSelectedTime,
4266
4271
  getMapTimeSliderSecondsPerPx: getMapTimeSliderSecondsPerPx,
4267
4272
  getMapTimeSliderDataScaleToSecondsPerPx: getMapTimeSliderDataScaleToSecondsPerPx,
4268
4273
  isTimestepAuto: isTimestepAuto,
@@ -4282,9 +4287,7 @@
4282
4287
  getActiveMapPresetId: getActiveMapPresetId,
4283
4288
  getLegendId: getLegendId,
4284
4289
  getMapPreset: getMapPreset,
4285
- getIsMapPresetLoading: getIsMapPresetLoading,
4286
4290
  getHasMapPresetChanges: getHasMapPresetChanges,
4287
- getMapPresetError: getMapPresetError,
4288
4291
  getIsDockedLayerManagerOpen: getIsDockedLayerManagerOpen
4289
4292
  });
4290
4293
 
@@ -4330,6 +4333,47 @@
4330
4333
  FilterType["Group"] = "groups";
4331
4334
  })(FilterType || (FilterType = {}));
4332
4335
 
4336
+ /* *
4337
+ * Licensed under the Apache License, Version 2.0 (the "License");
4338
+ * you may not use this file except in compliance with the License.
4339
+ * You may obtain a copy of the License at
4340
+ *
4341
+ * http://www.apache.org/licenses/LICENSE-2.0
4342
+ *
4343
+ * Unless required by applicable law or agreed to in writing, software
4344
+ * distributed under the License is distributed on an "AS IS" BASIS,
4345
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4346
+ * See the License for the specific language governing permissions and
4347
+ * limitations under the License.
4348
+ *
4349
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
4350
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
4351
+ * */
4352
+ var getFilterId = function getFilterId(filterType, filterName) {
4353
+ return filterType + "-" + filterName;
4354
+ };
4355
+ var produceFilters = function produceFilters(filterNames, filterType, draft, layerSelectFilterAdapter) {
4356
+ filterNames.forEach(function (filterName) {
4357
+ var id = getFilterId(filterType, filterName);
4358
+
4359
+ if (!draft.filters.filters.entities[id]) {
4360
+ // If this filter doesn't exit yet, add it
4361
+ layerSelectFilterAdapter.addOne(draft.filters.filters, {
4362
+ id: id,
4363
+ name: filterName,
4364
+ amount: 1,
4365
+ amountVisible: 1,
4366
+ checked: true,
4367
+ type: filterType
4368
+ });
4369
+ } else {
4370
+ // If it exists already, up the amounts
4371
+ draft.filters.filters.entities[id].amount += 1;
4372
+ draft.filters.filters.entities[id].amountVisible += 1;
4373
+ }
4374
+ });
4375
+ };
4376
+
4333
4377
  /* *
4334
4378
  * Licensed under the Apache License, Version 2.0 (the "License");
4335
4379
  * you may not use this file except in compliance with the License.
@@ -4346,17 +4390,13 @@
4346
4390
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
4347
4391
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
4348
4392
  * */
4393
+ var layerSelectFilterAdapter = toolkit.createEntityAdapter();
4394
+ var layerSelectActiveServicesAdapter = toolkit.createEntityAdapter();
4349
4395
  var initialState$1 = {
4350
4396
  filters: {
4351
4397
  searchFilter: '',
4352
- activeServices: {
4353
- byId: {},
4354
- allIds: []
4355
- },
4356
- filters: {
4357
- byId: {},
4358
- allIds: []
4359
- }
4398
+ activeServices: layerSelectActiveServicesAdapter.getInitialState(),
4399
+ filters: layerSelectFilterAdapter.getInitialState()
4360
4400
  },
4361
4401
  allServicesEnabled: true,
4362
4402
  activeLayerInfo: {
@@ -4380,66 +4420,68 @@
4380
4420
  draft.allServicesEnabled = allServicesEnabled;
4381
4421
  },
4382
4422
  addFiltersAndActiveServices: function addFiltersAndActiveServices(draft, action) {
4383
- var _a = action.payload,
4384
- serviceId = _a.serviceId,
4385
- serviceName = _a.serviceName,
4386
- serviceUrl = _a.serviceUrl,
4387
- _abstract = _a["abstract"],
4388
- keywords = _a.keywords,
4389
- scope = _a.scope,
4390
- groups = _a.groups;
4391
-
4392
- if (!draft.filters.activeServices.byId[serviceId]) {
4393
- draft.filters.activeServices.byId[serviceId] = {};
4394
-
4395
- var addFilters = function addFilters(filterNames, filterType) {
4396
- filterNames.forEach(function (filterName) {
4397
- var id = filterType + "-" + filterName;
4398
-
4399
- if (!draft.filters.filters.byId[id]) {
4400
- draft.filters.filters.byId[id] = {
4401
- id: id,
4402
- name: filterName,
4403
- amount: 1,
4404
- amountVisible: 1,
4405
- checked: true,
4406
- type: filterType
4407
- };
4408
- draft.filters.filters.allIds.push(id);
4409
- } else {
4410
- draft.filters.filters.byId[id].amount += 1;
4411
- draft.filters.filters.byId[id].amountVisible += 1;
4412
- }
4413
- });
4423
+ var _a, _b;
4424
+
4425
+ var _c = action.payload,
4426
+ serviceId = _c.serviceId,
4427
+ serviceName = _c.serviceName,
4428
+ serviceUrl = _c.serviceUrl,
4429
+ _abstract = _c["abstract"],
4430
+ keywords = _c.keywords,
4431
+ scope = _c.scope,
4432
+ groups = _c.groups,
4433
+ isLoading = _c.isLoading;
4434
+
4435
+ if (isLoading) {
4436
+ // If service is still loading, add without filters
4437
+ draft.filters.activeServices.entities[serviceId] = {
4438
+ serviceId: serviceId,
4439
+ enabled: draft.allServicesEnabled,
4440
+ filterIds: [],
4441
+ scope: scope,
4442
+ serviceName: serviceName,
4443
+ serviceUrl: serviceUrl,
4444
+ "abstract": _abstract,
4445
+ isLoading: isLoading
4414
4446
  };
4447
+ }
4448
+
4449
+ if (!isLoading) {
4450
+ // If service is done loading, add with filters
4451
+ if (!((_b = (_a = draft.filters.activeServices.entities[serviceId]) === null || _a === void 0 ? void 0 : _a.filterIds) === null || _b === void 0 ? void 0 : _b.length)) {
4452
+ // If the service has no filters yet, add them
4453
+ produceFilters(groups, FilterType.Group, draft, layerSelectFilterAdapter);
4454
+ produceFilters(keywords, FilterType.Keyword, draft, layerSelectFilterAdapter);
4455
+ }
4415
4456
 
4416
- addFilters(groups, FilterType.Group);
4417
- addFilters(keywords, FilterType.Keyword);
4457
+ var filterIds = groups.map(function (group) {
4458
+ return getFilterId(FilterType.Group, group);
4459
+ }).concat(keywords.map(function (keyword) {
4460
+ return getFilterId(FilterType.Keyword, keyword);
4461
+ }));
4462
+ draft.filters.activeServices.entities[serviceId] = {
4463
+ serviceId: serviceId,
4464
+ enabled: draft.allServicesEnabled,
4465
+ filterIds: filterIds,
4466
+ scope: scope,
4467
+ serviceName: serviceName,
4468
+ serviceUrl: serviceUrl,
4469
+ "abstract": _abstract,
4470
+ isLoading: isLoading
4471
+ };
4418
4472
  }
4419
4473
 
4420
- var filterIds = groups.map(function (group) {
4421
- return FilterType.Group + "-" + group;
4422
- }).concat(keywords.map(function (keyword) {
4423
- return FilterType.Keyword + "-" + keyword;
4424
- }));
4425
- draft.filters.activeServices.byId[serviceId] = {
4426
- serviceId: serviceId,
4427
- enabled: draft.allServicesEnabled,
4428
- filterIds: filterIds,
4429
- scope: scope,
4430
- serviceName: serviceName,
4431
- serviceUrl: serviceUrl,
4432
- "abstract": _abstract
4433
- };
4434
- if (!draft.filters.activeServices.allIds.includes(serviceId)) draft.filters.activeServices.allIds.push(serviceId);
4474
+ if (!draft.filters.activeServices.ids.includes(serviceId)) {
4475
+ draft.filters.activeServices.ids.push(serviceId);
4476
+ }
4435
4477
  },
4436
4478
  layerSelectRemoveService: function layerSelectRemoveService(draft, action) {
4437
4479
  var serviceId = action.payload.serviceId; // 1. Find a service that is to be removed
4438
4480
 
4439
- var foundService = draft.filters.activeServices.byId[serviceId]; // 2. Go through all keywords for removed service, and decrement the amount of all found keywords
4481
+ var foundService = draft.filters.activeServices.entities[serviceId]; // 2. Go through all keywords for removed service, and decrement the amount of all found keywords
4440
4482
 
4441
4483
  foundService.filterIds.forEach(function (filterId) {
4442
- var foundObject = draft.filters.filters.byId[filterId];
4484
+ var foundObject = draft.filters.filters.entities[filterId];
4443
4485
 
4444
4486
  if (foundObject && foundObject.amount) {
4445
4487
  foundObject.amount -= 1;
@@ -4447,17 +4489,14 @@
4447
4489
  }
4448
4490
 
4449
4491
  if (foundObject && foundObject.amount === 0) {
4450
- delete draft.filters.filters.byId[filterId];
4451
- draft.filters.filters.allIds = draft.filters.filters.allIds.filter(function (serviceId) {
4492
+ delete draft.filters.filters.entities[filterId];
4493
+ draft.filters.filters.ids = draft.filters.filters.ids.filter(function (serviceId) {
4452
4494
  return serviceId !== filterId;
4453
4495
  });
4454
4496
  }
4455
4497
  }); // Finally remove object from activeServices, so if the service is added again later on, new object and keywords will be re-added
4456
4498
 
4457
- delete draft.filters.activeServices.byId[serviceId];
4458
- draft.filters.activeServices.allIds = draft.filters.activeServices.allIds.filter(function (id) {
4459
- return id !== serviceId;
4460
- });
4499
+ layerSelectActiveServicesAdapter.removeOne(draft.filters.activeServices, serviceId);
4461
4500
  },
4462
4501
  enableActiveService: function enableActiveService(draft, action) {
4463
4502
  var e_1, _a;
@@ -4465,12 +4504,12 @@
4465
4504
  var _b = action.payload,
4466
4505
  serviceId = _b.serviceId,
4467
4506
  keywords = _b.filters;
4468
- draft.filters.activeServices.byId[serviceId].enabled = true;
4507
+ draft.filters.activeServices.entities[serviceId].enabled = true;
4469
4508
 
4470
4509
  try {
4471
4510
  for (var keywords_1 = __values(keywords), keywords_1_1 = keywords_1.next(); !keywords_1_1.done; keywords_1_1 = keywords_1.next()) {
4472
4511
  var keyword = keywords_1_1.value;
4473
- draft.filters.filters.byId[keyword].amountVisible += 1;
4512
+ draft.filters.filters.entities[keyword].amountVisible += 1;
4474
4513
  }
4475
4514
  } catch (e_1_1) {
4476
4515
  e_1 = {
@@ -4490,12 +4529,12 @@
4490
4529
  var _b = action.payload,
4491
4530
  serviceId = _b.serviceId,
4492
4531
  keywords = _b.filters;
4493
- draft.filters.activeServices.byId[serviceId].enabled = false;
4532
+ draft.filters.activeServices.entities[serviceId].enabled = false;
4494
4533
 
4495
4534
  try {
4496
4535
  for (var keywords_2 = __values(keywords), keywords_2_1 = keywords_2.next(); !keywords_2_1.done; keywords_2_1 = keywords_2.next()) {
4497
4536
  var keyword = keywords_2_1.value;
4498
- draft.filters.filters.byId[keyword].amountVisible -= 1;
4537
+ draft.filters.filters.entities[keyword].amountVisible -= 1;
4499
4538
  }
4500
4539
  } catch (e_2_1) {
4501
4540
  e_2 = {
@@ -4512,15 +4551,15 @@
4512
4551
  toggleFilter: function toggleFilter(draft, action) {
4513
4552
  var filterIds = action.payload.filterIds;
4514
4553
  filterIds.forEach(function (filterId) {
4515
- draft.filters.filters.byId[filterId].checked = !draft.filters.filters.byId[filterId].checked;
4554
+ draft.filters.filters.entities[filterId].checked = !draft.filters.filters.entities[filterId].checked;
4516
4555
  });
4517
4556
  },
4518
4557
  enableOnlyOneFilter: function enableOnlyOneFilter(draft, action) {
4519
4558
  var filterId = action.payload.filterId;
4520
- draft.filters.filters.allIds.forEach(function (filterId) {
4521
- draft.filters.filters.byId[filterId].checked = false;
4559
+ draft.filters.filters.ids.forEach(function (filterId) {
4560
+ draft.filters.filters.entities[filterId].checked = false;
4522
4561
  });
4523
- draft.filters.filters.byId[filterId].checked = true;
4562
+ draft.filters.filters.entities[filterId].checked = true;
4524
4563
  },
4525
4564
  setActiveLayerInfo: function setActiveLayerInfo(draft, action) {
4526
4565
  var layer = action.payload.layer;
@@ -4616,21 +4655,30 @@
4616
4655
 
4617
4656
 
4618
4657
  var getSearchFilter = toolkit.createSelector(layerSelectStore, function (store) {
4619
- return store ? store.filters.searchFilter : '';
4658
+ var _a;
4659
+
4660
+ return ((_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.searchFilter) || '';
4620
4661
  });
4621
4662
  /**
4622
4663
  * Returns active services array
4623
4664
  *
4624
4665
  * Example getActiveServices(store);
4625
4666
  * @param {object} store store: object - store object
4626
- * @returns {object} returnType: object of active services
4667
+ * @returns {ActiveServiceObjectEntities} returnType: ActiveServiceObjectEntitiesobject of active services
4627
4668
  */
4669
+ // cast to usable type - selectEntities returns Dictionary<ActiveServiceObject> which is not usable inside of the code
4628
4670
 
4629
- var getActiveServices = toolkit.createSelector(layerSelectStore, function (store) {
4630
- var _a;
4671
+ var getActiveServices = function getActiveServices(store) {
4672
+ return getActiveServicesDictionary(store);
4673
+ };
4674
+ var getActiveServicesDictionary = layerSelectActiveServicesAdapter.getSelectors(function (store) {
4675
+ var _a, _b;
4631
4676
 
4632
- return store ? (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.activeServices.byId : {};
4633
- }, selectorMemoizationOptions);
4677
+ return ((_b = (_a = store === null || store === void 0 ? void 0 : store.layerSelect) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.activeServices) || {
4678
+ entities: {},
4679
+ ids: []
4680
+ };
4681
+ }).selectEntities;
4634
4682
  /**
4635
4683
  * Returns active services by id
4636
4684
  *
@@ -4641,9 +4689,9 @@
4641
4689
  */
4642
4690
 
4643
4691
  var getActiveServiceById = function getActiveServiceById(store, serviceId) {
4644
- var _a, _b;
4692
+ var _a, _b, _c;
4645
4693
 
4646
- var enabledServices = ((_b = (_a = store === null || store === void 0 ? void 0 : store.layerSelect) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.activeServices.byId[serviceId]) || {};
4694
+ var enabledServices = ((_c = (_b = (_a = store === null || store === void 0 ? void 0 : store.layerSelect) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.activeServices) === null || _c === void 0 ? void 0 : _c.entities[serviceId]) || {};
4647
4695
  return enabledServices;
4648
4696
  };
4649
4697
  /**
@@ -4657,10 +4705,10 @@
4657
4705
  var getEnabledServiceIds = toolkit.createSelector(layerSelectStore, function (store) {
4658
4706
  var _a, _b;
4659
4707
 
4660
- var enabledServices = (_b = (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.activeServices.allIds.filter(function (serviceId) {
4661
- var _a;
4708
+ var enabledServices = (_b = (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.activeServices.ids.filter(function (serviceId) {
4709
+ var _a, _b, _c;
4662
4710
 
4663
- return (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.activeServices.byId[serviceId].enabled;
4711
+ return (_c = (_b = (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.activeServices) === null || _b === void 0 ? void 0 : _b.entities[serviceId]) === null || _c === void 0 ? void 0 : _c.enabled;
4664
4712
  })) !== null && _b !== void 0 ? _b : [];
4665
4713
  return enabledServices;
4666
4714
  }, selectorMemoizationOptions);
@@ -4673,17 +4721,17 @@
4673
4721
  */
4674
4722
 
4675
4723
  var getCheckedFilterIds = toolkit.createSelector(layerSelectStore, function (store) {
4676
- var _a, _b;
4724
+ var _a, _b, _c;
4677
4725
 
4678
- var checkedFilters = (_b = (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.filters.allIds.filter(function (filterId) {
4679
- var _a, _b;
4726
+ var checkedFilters = (_c = (_b = (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.ids.filter(function (filterId) {
4727
+ var _a, _b, _c;
4680
4728
 
4681
- return (_b = (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.filters.byId[filterId]) === null || _b === void 0 ? void 0 : _b.checked;
4682
- })) !== null && _b !== void 0 ? _b : [];
4729
+ return (_c = (_b = (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.entities[filterId]) === null || _c === void 0 ? void 0 : _c.checked;
4730
+ })) !== null && _c !== void 0 ? _c : [];
4683
4731
  return checkedFilters.map(function (filterId) {
4684
- var _a;
4732
+ var _a, _b, _c;
4685
4733
 
4686
- return (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.filters.byId[filterId].id;
4734
+ return (_c = (_b = (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.entities[filterId]) === null || _c === void 0 ? void 0 : _c.id;
4687
4735
  });
4688
4736
  }, selectorMemoizationOptions);
4689
4737
  /**
@@ -4693,12 +4741,19 @@
4693
4741
  * @param {object} store store: object - store object
4694
4742
  * @returns {array} returnType: array of all keyword ids
4695
4743
  */
4744
+ // cast to usable type - selectIds returns EntityId[] which is not usable inside of the code
4696
4745
 
4697
- var getAllFilterIds = toolkit.createSelector(layerSelectStore, function (store) {
4746
+ var getAllFilterIds = function getAllFilterIds(store) {
4747
+ return getAllFilterIdsEntity(store);
4748
+ };
4749
+ var getAllFilterIdsEntity = layerSelectFilterAdapter.getSelectors(function (store) {
4698
4750
  var _a, _b;
4699
4751
 
4700
- return (_b = (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.filters.allIds) !== null && _b !== void 0 ? _b : [];
4701
- }, selectorMemoizationOptions);
4752
+ return ((_b = (_a = store === null || store === void 0 ? void 0 : store.layerSelect) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.filters) || {
4753
+ entities: {},
4754
+ ids: []
4755
+ };
4756
+ }).selectIds;
4702
4757
  /**
4703
4758
  * Returns all filters
4704
4759
  *
@@ -4707,15 +4762,14 @@
4707
4762
  * @returns {array} returnType: array of all filters
4708
4763
  */
4709
4764
 
4710
- var getAllFilters = toolkit.createSelector(layerSelectStore, function (store) {
4711
- var filters = store === null || store === void 0 ? void 0 : store.filters.filters.byId;
4712
-
4713
- if (filters) {
4714
- return Object.values(filters);
4715
- }
4765
+ var getAllFilters = layerSelectFilterAdapter.getSelectors(function (store) {
4766
+ var _a, _b;
4716
4767
 
4717
- return [];
4718
- });
4768
+ return ((_b = (_a = store === null || store === void 0 ? void 0 : store.layerSelect) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.filters) || {
4769
+ entities: {},
4770
+ ids: []
4771
+ };
4772
+ }).selectAll;
4719
4773
  /**
4720
4774
  * Returns if all keywords are checked
4721
4775
  *
@@ -4727,12 +4781,29 @@
4727
4781
  var isAllFiltersChecked = toolkit.createSelector(layerSelectStore, function (store) {
4728
4782
  var _a, _b;
4729
4783
 
4730
- return (_b = (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.allIds.every(function (filterId) {
4784
+ return (_b = (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.ids.every(function (filterId) {
4731
4785
  var _a, _b, _c;
4732
4786
 
4733
- return (_c = (_b = (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.byId[filterId]) === null || _c === void 0 ? void 0 : _c.checked;
4787
+ return (_c = (_b = (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.entities[filterId]) === null || _c === void 0 ? void 0 : _c.checked;
4734
4788
  });
4735
4789
  });
4790
+ /**
4791
+ * Gets a KeywordObject by its id
4792
+ *
4793
+ * Example: keywordObject = getKeywordObjectById(store, 'keywordId')
4794
+ * @param {object} store object from which the keyword state will be extracted
4795
+ * @param {string} filterId Id of the keyword
4796
+ * @returns {object} object containing keyword information (id, amount, amountVisible, checked)
4797
+ */
4798
+
4799
+ layerSelectFilterAdapter.getSelectors(function (store) {
4800
+ var _a, _b;
4801
+
4802
+ return ((_b = (_a = store === null || store === void 0 ? void 0 : store.layerSelect) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.filters) || {
4803
+ entities: {},
4804
+ ids: []
4805
+ };
4806
+ }).selectById;
4736
4807
  /**
4737
4808
  * Returns the active layer info
4738
4809
  *
@@ -8324,9 +8395,9 @@
8324
8395
  , 17];
8325
8396
  return [4
8326
8397
  /*yield*/
8327
- , effects.put(mapActions$1.setAnimationInterval({
8398
+ , effects.put(mapActions$1.setTimeStep({
8328
8399
  mapId: mapId,
8329
- interval: interval
8400
+ timeStep: interval
8330
8401
  }))];
8331
8402
 
8332
8403
  case 16:
@@ -8714,7 +8785,8 @@
8714
8785
  keywords: keywords,
8715
8786
  scope: scope,
8716
8787
  groups: groups,
8717
- "abstract": _abstract
8788
+ "abstract": _abstract,
8789
+ isLoading: false
8718
8790
  }))];
8719
8791
 
8720
8792
  case 1:
@@ -8866,7 +8938,7 @@
8866
8938
  results = _a.sent();
8867
8939
  services = results;
8868
8940
  servicesEnabled = Object.values(services).find(function (service) {
8869
- return service.enabled;
8941
+ return service === null || service === void 0 ? void 0 : service.enabled;
8870
8942
  });
8871
8943
  if (!(servicesEnabled === undefined)) return [3
8872
8944
  /*break*/
@@ -8880,7 +8952,7 @@
8880
8952
 
8881
8953
  return effects.put(layerSelectActions.enableActiveService({
8882
8954
  serviceId: serviceId,
8883
- filters: service.filterIds
8955
+ filters: service === null || service === void 0 ? void 0 : service.filterIds
8884
8956
  }));
8885
8957
  }))];
8886
8958
 
@@ -9757,7 +9829,7 @@
9757
9829
  * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9758
9830
  * Copyright 2022 - Finnish Meteorological Institute (FMI)
9759
9831
  * */
9760
- var marks$2 = [{
9832
+ var marks$3 = [{
9761
9833
  value: 0,
9762
9834
  label: '0 %'
9763
9835
  }, {
@@ -9893,7 +9965,7 @@
9893
9965
  step: 0.01,
9894
9966
  max: 1,
9895
9967
  min: 0,
9896
- marks: marks$2,
9968
+ marks: marks$3,
9897
9969
  onChange: function onChange(event, newValue) {
9898
9970
  event.stopPropagation();
9899
9971
  onLayerChangeOpacity(newValue);
@@ -10070,7 +10142,9 @@
10070
10142
  return /*#__PURE__*/React__namespace.createElement(shared.ManagerButton, {
10071
10143
  tooltipTitle: tooltipTitle,
10072
10144
  onClick: onClick,
10073
- icon: /*#__PURE__*/React__namespace.createElement(theme.Flag, {
10145
+ icon: isActive ? /*#__PURE__*/React__namespace.createElement(theme.Both, {
10146
+ sx: iconStyle
10147
+ }) : /*#__PURE__*/React__namespace.createElement(theme.None, {
10074
10148
  sx: iconStyle
10075
10149
  }),
10076
10150
  testId: id,
@@ -12222,6 +12296,9 @@
12222
12296
  onClick: function onClick() {
12223
12297
  return onChangeSize(sizeSmall);
12224
12298
  },
12299
+ onTouchEnd: function onTouchEnd() {
12300
+ return onChangeSize(sizeSmall);
12301
+ },
12225
12302
  sx: iconStyle,
12226
12303
  className: "collapseSmall-btn"
12227
12304
  }, /*#__PURE__*/React__namespace.createElement(theme.CollapseSmall, null))), /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
@@ -12232,6 +12309,9 @@
12232
12309
  onClick: function onClick() {
12233
12310
  return onChangeSize(sizeMedium);
12234
12311
  },
12312
+ onTouchEnd: function onTouchEnd() {
12313
+ return onChangeSize(sizeMedium);
12314
+ },
12235
12315
  sx: iconStyle,
12236
12316
  className: "collapseMedium-btn"
12237
12317
  }, /*#__PURE__*/React__namespace.createElement(theme.CollapseMedium, null))), /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
@@ -12242,6 +12322,9 @@
12242
12322
  onClick: function onClick() {
12243
12323
  return onChangeSize(sizeLarge);
12244
12324
  },
12325
+ onTouchEnd: function onTouchEnd() {
12326
+ return onChangeSize(sizeLarge);
12327
+ },
12245
12328
  sx: iconStyle,
12246
12329
  className: "collapseLarge-btn"
12247
12330
  }, /*#__PURE__*/React__namespace.createElement(theme.CollapseLarge, null))), /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
@@ -12253,6 +12336,9 @@
12253
12336
  sx: iconStyle,
12254
12337
  onClick: function onClick() {
12255
12338
  return onClickDockButton();
12339
+ },
12340
+ onTouchEnd: function onTouchEnd() {
12341
+ return onClickDockButton();
12256
12342
  }
12257
12343
  }, isDockedLayerManager ? /*#__PURE__*/React__namespace.createElement(theme.CollapseWindow, {
12258
12344
  "data-testid": "dockedLayerManager-collapse"
@@ -12384,7 +12470,11 @@
12384
12470
  setSize(dragSize);
12385
12471
  }
12386
12472
  }
12387
- }, /*#__PURE__*/React__namespace.createElement(material.Box, null, isLoading && /*#__PURE__*/React__namespace.createElement(material.LinearProgress, {
12473
+ }, /*#__PURE__*/React__namespace.createElement(material.Box, {
12474
+ onKeyDown: function onKeyDown(event) {
12475
+ event.stopPropagation();
12476
+ }
12477
+ }, isLoading && /*#__PURE__*/React__namespace.createElement(material.LinearProgress, {
12388
12478
  "data-testid": "loading-bar",
12389
12479
  color: "secondary",
12390
12480
  sx: {
@@ -12491,12 +12581,20 @@
12491
12581
  var isDialogOpen = reactRedux.useSelector(function (store) {
12492
12582
  return getisDialogOpen(store, dialogType);
12493
12583
  });
12584
+ var uiIsLoading = reactRedux.useSelector(function (store) {
12585
+ return getDialogIsLoading(store, dialogType);
12586
+ });
12587
+ var uiError = reactRedux.useSelector(function (store) {
12588
+ return getDialogError(store, dialogType);
12589
+ });
12494
12590
  return {
12495
12591
  setDialogOrder: setDialogOrder,
12496
12592
  dialogOrder: dialogOrder,
12497
12593
  onCloseDialog: onCloseDialog,
12498
12594
  uiSource: uiSource,
12499
- isDialogOpen: isDialogOpen
12595
+ isDialogOpen: isDialogOpen,
12596
+ uiIsLoading: uiIsLoading,
12597
+ uiError: uiError
12500
12598
  };
12501
12599
  };
12502
12600
 
@@ -12529,18 +12627,36 @@
12529
12627
  var serviceSetLayers = React__namespace.useCallback(function (payload) {
12530
12628
  dispatch(serviceActions.serviceSetLayers(payload));
12531
12629
  }, [dispatch]);
12630
+ var addFiltersAndActiveServices = React__namespace.useCallback(function (payload) {
12631
+ dispatch(layerSelectActions.addFiltersAndActiveServices(payload));
12632
+ }, [dispatch]);
12532
12633
  React__namespace.useEffect(function () {
12533
12634
  if (isOpenInStore && preloadedServices && preloadedServices.length > 0) {
12534
12635
  mergePresetsAndUserAddedServices(preloadedServices, getUserAddedServices()).forEach(function (service) {
12636
+ var wmService = webmap.WMGetServiceFromStore(service.url);
12637
+ var scope = service.scope ? service.scope : 'system';
12638
+
12639
+ if (isMounted.current) {
12640
+ addFiltersAndActiveServices({
12641
+ serviceId: wmService.id,
12642
+ serviceName: service.name,
12643
+ serviceUrl: service.url,
12644
+ keywords: [],
12645
+ scope: scope,
12646
+ groups: [],
12647
+ "abstract": service["abstract"] || wmService["abstract"],
12648
+ isLoading: true
12649
+ });
12650
+ }
12651
+
12535
12652
  getLayersFlattenedFromService(service.url).then(function (layers) {
12536
12653
  if (isMounted.current) {
12537
- var wmService = webmap.WMGetServiceFromStore(service.url);
12538
12654
  serviceSetLayers({
12539
12655
  id: wmService.id,
12540
12656
  name: service.name,
12541
12657
  serviceUrl: service.url,
12542
12658
  layers: layers,
12543
- scope: service.scope ? service.scope : 'system',
12659
+ scope: scope,
12544
12660
  // first try to load the user abstract, otherwise the service abstract
12545
12661
  "abstract": service["abstract"] || wmService["abstract"]
12546
12662
  });
@@ -12549,9 +12665,8 @@
12549
12665
  return null;
12550
12666
  });
12551
12667
  });
12552
- } // eslint-disable-next-line react-hooks/exhaustive-deps
12553
-
12554
- }, [isOpenInStore, preloadedServices, serviceSetLayers]);
12668
+ }
12669
+ }, [addFiltersAndActiveServices, isMounted, isOpenInStore, preloadedServices, serviceSetLayers]);
12555
12670
  };
12556
12671
  var mergePresetsAndUserAddedServices = function mergePresetsAndUserAddedServices(presets, userAddedServices) {
12557
12672
  return Object.values(__assign(__assign({}, presets.reduce(function (byUrl, preset) {
@@ -12603,19 +12718,15 @@
12603
12718
  var mapId = reactRedux.useSelector(function (store) {
12604
12719
  return getDialogMapId(store, dialogType);
12605
12720
  });
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
12721
 
12613
12722
  var _d = useSetupDialog(dialogType),
12614
12723
  dialogOrder = _d.dialogOrder,
12615
12724
  setDialogOrder = _d.setDialogOrder,
12616
12725
  onCloseDialog = _d.onCloseDialog,
12617
12726
  isDialogOpen = _d.isDialogOpen,
12618
- uiSource = _d.uiSource;
12727
+ uiSource = _d.uiSource,
12728
+ uiIsLoading = _d.uiIsLoading,
12729
+ uiError = _d.uiError;
12619
12730
 
12620
12731
  useFetchServices(dialogType, preloadedMapServices);
12621
12732
 
@@ -12640,8 +12751,8 @@
12640
12751
  order: dialogOrder,
12641
12752
  source: uiSource,
12642
12753
  leftHeaderComponent: leftHeaderComponent,
12643
- isLoading: isMapPresetLoading,
12644
- error: mapPresetError,
12754
+ isLoading: uiIsLoading,
12755
+ error: uiError,
12645
12756
  onToggleDock: onToggleDock
12646
12757
  });
12647
12758
  };
@@ -12862,7 +12973,9 @@
12862
12973
 
12863
12974
  var serviceName = value === null || value === void 0 ? void 0 : value.toLowerCase();
12864
12975
  var foundName = Object.keys(services).find(function (serviceId) {
12865
- return services[serviceId].serviceName.toLowerCase() === serviceName && serviceName !== ownServiceName.toLocaleLowerCase();
12976
+ var _a;
12977
+
12978
+ return ((_a = services[serviceId]) === null || _a === void 0 ? void 0 : _a.serviceName.toLowerCase()) === serviceName && serviceName !== ownServiceName.toLocaleLowerCase();
12866
12979
  });
12867
12980
  return foundName === undefined ? true : VALIDATIONS_NAME_EXISTING;
12868
12981
  };
@@ -12892,7 +13005,9 @@
12892
13005
 
12893
13006
 
12894
13007
  var foundUrl = Object.keys(services).find(function (serviceId) {
12895
- return services[serviceId].serviceUrl === serviceUrl;
13008
+ var _a;
13009
+
13010
+ return ((_a = services[serviceId]) === null || _a === void 0 ? void 0 : _a.serviceUrl) === serviceUrl;
12896
13011
  });
12897
13012
 
12898
13013
  if (foundUrl) {
@@ -14139,7 +14254,7 @@
14139
14254
  var _d = __read(_b, 2),
14140
14255
  b = _d[1];
14141
14256
 
14142
- return a.serviceName.localeCompare(b.serviceName);
14257
+ return a.serviceName.localeCompare(b === null || b === void 0 ? void 0 : b.serviceName);
14143
14258
  }).reduce(function (r, _a) {
14144
14259
  var _b;
14145
14260
 
@@ -14310,6 +14425,7 @@
14310
14425
  var rowMargin = 4;
14311
14426
  var rowHeight = widthToRowHeight(layerSelectWidth);
14312
14427
  var layerSelectFilterHeight = 155 + serviceListHeight;
14428
+ var minHeight = 400;
14313
14429
  return /*#__PURE__*/React__namespace.createElement(material.Box, {
14314
14430
  "data-testid": "layerList"
14315
14431
  }, /*#__PURE__*/React__namespace.createElement(material.Box, {
@@ -14318,7 +14434,7 @@
14318
14434
  fontSize: '12px'
14319
14435
  }
14320
14436
  }, filteredLayers.length, " results"), /*#__PURE__*/React__namespace.createElement(reactWindow.FixedSizeList, {
14321
- height: layerSelectHeight - layerSelectFilterHeight,
14437
+ height: layerSelectHeight - layerSelectFilterHeight < minHeight ? minHeight : layerSelectHeight - layerSelectFilterHeight,
14322
14438
  itemCount: filteredLayers.length,
14323
14439
  itemSize: rowHeight + rowMargin
14324
14440
  }, function (_a) {
@@ -14462,7 +14578,7 @@
14462
14578
  var chip = all ? 'all' : service && service.serviceUrl;
14463
14579
  return /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
14464
14580
  title: (service === null || service === void 0 ? void 0 : service["abstract"]) ? "Abstract: " + service["abstract"] : ''
14465
- }, /*#__PURE__*/React__namespace.createElement(shared.CustomToggleButton, {
14581
+ }, /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(shared.CustomToggleButton, {
14466
14582
  variant: "boxed",
14467
14583
  selected: isSelected,
14468
14584
  tabIndex: 0,
@@ -14475,7 +14591,7 @@
14475
14591
  },
14476
14592
  disabled: isDisabled,
14477
14593
  sx: style
14478
- }, service ? service.serviceName : 'All'));
14594
+ }, service ? service.serviceName : 'All')));
14479
14595
  };
14480
14596
 
14481
14597
  /* *
@@ -14649,7 +14765,7 @@
14649
14765
  all: true,
14650
14766
  isSelected: isAllSelected
14651
14767
  }), Object.keys(activeServices).map(function (serviceId) {
14652
- var _a;
14768
+ var _a, _b;
14653
14769
 
14654
14770
  var service = activeServices[serviceId];
14655
14771
  return /*#__PURE__*/React__namespace.createElement(ServiceChipConnect, {
@@ -14658,7 +14774,7 @@
14658
14774
  service: service,
14659
14775
  isSelected: (_a = activeServices[serviceId]) === null || _a === void 0 ? void 0 : _a.enabled,
14660
14776
  isAllSelected: isAllSelected,
14661
- isDisabled: activeServices[serviceId] === undefined
14777
+ isDisabled: activeServices[serviceId] === undefined || ((_b = activeServices[serviceId]) === null || _b === void 0 ? void 0 : _b.isLoading) === true
14662
14778
  });
14663
14779
  })));
14664
14780
  };
@@ -14928,7 +15044,9 @@
14928
15044
  var getService = function getService(services, serviceUrl) {
14929
15045
  var serviceIds = Object.keys(services);
14930
15046
  var serviceIndex = serviceIds.findIndex(function (serviceId) {
14931
- return services[serviceId].serviceUrl === serviceUrl;
15047
+ var _a;
15048
+
15049
+ return ((_a = services[serviceId]) === null || _a === void 0 ? void 0 : _a.serviceUrl) === serviceUrl;
14932
15050
  });
14933
15051
  if (serviceIndex < 0) return null;
14934
15052
  return services[serviceIds[serviceIndex]];
@@ -15164,7 +15282,14 @@
15164
15282
  left: 100
15165
15283
  },
15166
15284
  isOpen: isOpen,
15167
- onChangeSize: onChangeSize,
15285
+ onResizeStop: function onResizeStop(_event, _direction, node) {
15286
+ var width = node.offsetWidth,
15287
+ height = node.offsetHeight;
15288
+ onChangeSize({
15289
+ width: width,
15290
+ height: height
15291
+ });
15292
+ },
15168
15293
  onClose: onClose,
15169
15294
  headerSize: "small",
15170
15295
  bounds: bounds,
@@ -15820,7 +15945,8 @@
15820
15945
  left: 0,
15821
15946
  margin: 1,
15822
15947
  zIndex: 50,
15823
- top: '96px'
15948
+ top: '96px',
15949
+ userSelect: 'none'
15824
15950
  }
15825
15951
  }, props), /*#__PURE__*/React__namespace.createElement(material.Grid, {
15826
15952
  sx: {
@@ -16692,7 +16818,7 @@
16692
16818
  * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16693
16819
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
16694
16820
  * */
16695
- var marks$1 = [{
16821
+ var marks$2 = [{
16696
16822
  label: '1 min',
16697
16823
  value: 1,
16698
16824
  text: '1m'
@@ -16787,18 +16913,11 @@
16787
16913
  disabled = _b === void 0 ? false : _b,
16788
16914
  _c = _a.isTimestepAuto,
16789
16915
  isTimestepAuto = _c === void 0 ? false : _c,
16790
- timeDimension = _a.timeDimension,
16791
16916
  onChangeTimeStep = _a.onChangeTimeStep,
16792
16917
  _d = _a.onToggleTimestepAuto,
16793
16918
  onToggleTimestepAuto = _d === void 0 ? function () {} : _d,
16794
16919
  _e = _a.isOpenByDefault,
16795
16920
  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
16921
 
16803
16922
  var handleMenuItemClick = function handleMenuItemClick(mark) {
16804
16923
  if (isTimestepAuto) {
@@ -16811,7 +16930,7 @@
16811
16930
  return /*#__PURE__*/React__namespace.createElement(TimeSliderMenu, {
16812
16931
  title: timeStepTitle,
16813
16932
  isOpenByDefault: isOpenByDefault,
16814
- marks: marks$1,
16933
+ marks: marks$2,
16815
16934
  value: timeStep,
16816
16935
  handleMenuItemClick: handleMenuItemClick,
16817
16936
  isDisabled: disabled,
@@ -16838,7 +16957,7 @@
16838
16957
  * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16839
16958
  * Copyright 2022 - Finnish Meteorological Institute (FMI)
16840
16959
  * */
16841
- var marks = [{
16960
+ var marks$1 = [{
16842
16961
  label: '5 min',
16843
16962
  value: Scale.Minutes5,
16844
16963
  text: '5m'
@@ -16889,7 +17008,7 @@
16889
17008
  var onChangeSliderValue = function onChangeSliderValue(mark) {
16890
17009
  var newSliderValue = mark.value;
16891
17010
  var newValue = newSliderValue ? Math.round(newSliderValue) : 0;
16892
- var newScale = marks.find(function (el) {
17011
+ var newScale = marks$1.find(function (el) {
16893
17012
  return el.value === newValue;
16894
17013
  }).value;
16895
17014
  var scaleToSecPerPx = newScale === Scale.DataScale ? getScaleToSecondsPerPxForDataScale(layers) : scaleToSecondsPerPx[newScale];
@@ -16900,7 +17019,7 @@
16900
17019
  return /*#__PURE__*/React__namespace.createElement(TimeSliderMenu, {
16901
17020
  handleMenuItemClick: onChangeSliderValue,
16902
17021
  icon: /*#__PURE__*/React__namespace.createElement(theme.Clock, null),
16903
- marks: marks,
17022
+ marks: marks$1,
16904
17023
  title: "Time scale",
16905
17024
  value: timeSliderScale,
16906
17025
  onChangeMouseWheel: onChangeSliderValue
@@ -16923,7 +17042,7 @@
16923
17042
  * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16924
17043
  * Copyright 2022 - Finnish Meteorological Institute (FMI)
16925
17044
  * */
16926
- var title = 'Now';
17045
+ var title$1 = 'Now';
16927
17046
 
16928
17047
  var NowButton = function NowButton(_a) {
16929
17048
  var _b = _a.onSetNow,
@@ -16931,7 +17050,7 @@
16931
17050
  _c = _a.disabled,
16932
17051
  disabled = _c === void 0 ? false : _c;
16933
17052
  return /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
16934
- title: title,
17053
+ title: title$1,
16935
17054
  "data-testid": "nowButtonTooltip"
16936
17055
  }, /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(shared.ToolButton, {
16937
17056
  disabled: disabled,
@@ -16960,47 +17079,133 @@
16960
17079
  * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16961
17080
  * Copyright 2022 - Finnish Meteorological Institute (FMI)
16962
17081
  * */
16963
- var OptionsMenu = function OptionsMenu(_a) {
16964
- var autoUpdateBtn = _a.autoUpdateBtn,
16965
- nowBtn = _a.nowBtn,
16966
- speedBtn = _a.speedBtn,
16967
- timeScaleBtn = _a.timeScaleBtn,
16968
- timeStepBtn = _a.timeStepBtn;
16969
- return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
16970
- item: true,
16971
- xs: "auto"
16972
- }, nowBtn || /*#__PURE__*/React__default["default"].createElement(NowButton, null)), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
16973
- item: true,
16974
- xs: "auto"
16975
- }, timeScaleBtn || /*#__PURE__*/React__default["default"].createElement(TimeScaleButton, {
16976
- centerTime: 0,
16977
- onChangeTimeSliderScale: function onChangeTimeSliderScale() {},
16978
- secondsPerPx: 0,
16979
- selectedTime: 0,
16980
- timeSliderScale: 0
16981
- })), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
16982
- item: true,
16983
- xs: "auto"
16984
- }, timeStepBtn || /*#__PURE__*/React__default["default"].createElement(TimeStepButton, {
16985
- timeStep: 0,
16986
- onChangeTimeStep: function onChangeTimeStep() {}
16987
- })), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
16988
- item: true,
16989
- xs: "auto"
16990
- }, speedBtn || /*#__PURE__*/React__default["default"].createElement(SpeedButton, {
16991
- animationDelay: defaultAnimationDelayAtStart,
16992
- setMapAnimationDelay: function setMapAnimationDelay() {}
16993
- })), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
16994
- item: true,
16995
- xs: "auto"
16996
- }, autoUpdateBtn || /*#__PURE__*/React__default["default"].createElement(AutoUpdateButton, null)));
16997
- };
16998
-
16999
- /* *
17000
- * Licensed under the Apache License, Version 2.0 (the "License");
17001
- * you may not use this file except in compliance with the License.
17002
- * You may obtain a copy of the License at
17003
- *
17082
+ var title = 'Animation';
17083
+ var marks = [{
17084
+ label: '15 min',
17085
+ value: AnimationLength.Minutes15,
17086
+ text: '15m'
17087
+ }, {
17088
+ label: '30 min',
17089
+ value: AnimationLength.Minutes30,
17090
+ text: '30m'
17091
+ }, {
17092
+ label: '1 h',
17093
+ value: AnimationLength.Hours1,
17094
+ text: '1h'
17095
+ }, {
17096
+ label: '2 h',
17097
+ value: AnimationLength.Hours2,
17098
+ text: '2h'
17099
+ }, {
17100
+ label: '3 h',
17101
+ value: AnimationLength.Hours3,
17102
+ text: '3h'
17103
+ }, {
17104
+ label: '6 h',
17105
+ value: AnimationLength.Hours6,
17106
+ text: '6h'
17107
+ }, {
17108
+ label: '12 h',
17109
+ value: AnimationLength.Hours12,
17110
+ text: '12h'
17111
+ }, {
17112
+ label: '24 h',
17113
+ value: AnimationLength.Hours24,
17114
+ text: '24h'
17115
+ }].sort(function (a, b) {
17116
+ return b.value - a.value;
17117
+ });
17118
+
17119
+ var AnimationLengthButton = function AnimationLengthButton(_a) {
17120
+ var _b = _a.disabled,
17121
+ disabled = _b === void 0 ? false : _b,
17122
+ _c = _a.animationLength,
17123
+ animationLength = _c === void 0 ? AnimationLength.Hours1 : _c,
17124
+ onChangeAnimationLength = _a.onChangeAnimationLength;
17125
+
17126
+ var onChangeSliderValue = function onChangeSliderValue(mark) {
17127
+ var newSliderValue = mark.value;
17128
+ var newValue = newSliderValue ? Math.round(newSliderValue) : 0;
17129
+ var newLength = marks.find(function (el) {
17130
+ return el.value === newValue;
17131
+ }).value;
17132
+ onChangeAnimationLength(newLength);
17133
+ };
17134
+
17135
+ return /*#__PURE__*/React__namespace.createElement(TimeSliderMenu, {
17136
+ handleMenuItemClick: onChangeSliderValue,
17137
+ icon: /*#__PURE__*/React__namespace.createElement(theme.Animation, null),
17138
+ marks: marks,
17139
+ title: title,
17140
+ isDisabled: disabled,
17141
+ value: animationLength,
17142
+ onChangeMouseWheel: onChangeSliderValue
17143
+ });
17144
+ };
17145
+
17146
+ /* *
17147
+ * Licensed under the Apache License, Version 2.0 (the "License");
17148
+ * you may not use this file except in compliance with the License.
17149
+ * You may obtain a copy of the License at
17150
+ *
17151
+ * http://www.apache.org/licenses/LICENSE-2.0
17152
+ *
17153
+ * Unless required by applicable law or agreed to in writing, software
17154
+ * distributed under the License is distributed on an "AS IS" BASIS,
17155
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17156
+ * See the License for the specific language governing permissions and
17157
+ * limitations under the License.
17158
+ *
17159
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
17160
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
17161
+ * */
17162
+ var OptionsMenu = function OptionsMenu(_a) {
17163
+ var autoUpdateBtn = _a.autoUpdateBtn,
17164
+ nowBtn = _a.nowBtn,
17165
+ speedBtn = _a.speedBtn,
17166
+ timeScaleBtn = _a.timeScaleBtn,
17167
+ timeStepBtn = _a.timeStepBtn,
17168
+ animationLengthBtn = _a.animationLengthBtn;
17169
+ return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
17170
+ item: true,
17171
+ xs: "auto"
17172
+ }, nowBtn || /*#__PURE__*/React__default["default"].createElement(NowButton, null)), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
17173
+ item: true,
17174
+ xs: "auto"
17175
+ }, timeScaleBtn || /*#__PURE__*/React__default["default"].createElement(TimeScaleButton, {
17176
+ centerTime: 0,
17177
+ onChangeTimeSliderScale: function onChangeTimeSliderScale() {},
17178
+ secondsPerPx: 0,
17179
+ selectedTime: 0,
17180
+ timeSliderScale: 0
17181
+ })), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
17182
+ item: true,
17183
+ xs: "auto"
17184
+ }, animationLengthBtn || /*#__PURE__*/React__default["default"].createElement(AnimationLengthButton, {
17185
+ onChangeAnimationLength: function onChangeAnimationLength() {}
17186
+ })), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
17187
+ item: true,
17188
+ xs: "auto"
17189
+ }, timeStepBtn || /*#__PURE__*/React__default["default"].createElement(TimeStepButton, {
17190
+ timeStep: 0,
17191
+ onChangeTimeStep: function onChangeTimeStep() {}
17192
+ })), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
17193
+ item: true,
17194
+ xs: "auto"
17195
+ }, speedBtn || /*#__PURE__*/React__default["default"].createElement(SpeedButton, {
17196
+ animationDelay: defaultAnimationDelayAtStart,
17197
+ setMapAnimationDelay: function setMapAnimationDelay() {}
17198
+ })), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
17199
+ item: true,
17200
+ xs: "auto"
17201
+ }, autoUpdateBtn || /*#__PURE__*/React__default["default"].createElement(AutoUpdateButton, null)));
17202
+ };
17203
+
17204
+ /* *
17205
+ * Licensed under the Apache License, Version 2.0 (the "License");
17206
+ * you may not use this file except in compliance with the License.
17207
+ * You may obtain a copy of the License at
17208
+ *
17004
17209
  * http://www.apache.org/licenses/LICENSE-2.0
17005
17210
  *
17006
17211
  * Unless required by applicable law or agreed to in writing, software
@@ -17019,22 +17224,34 @@
17019
17224
  speedBtn = _a.speedBtn,
17020
17225
  timeStepBtn = _a.timeStepBtn,
17021
17226
  timeScaleBtn = _a.timeScaleBtn,
17227
+ animationLengthBtn = _a.animationLengthBtn,
17022
17228
  _b = _a.isOpenByDefault,
17023
- isOpenByDefault = _b === void 0 ? false : _b;
17229
+ isOpenByDefault = _b === void 0 ? false : _b,
17230
+ timeStep = _a.timeStep,
17231
+ timeDimension = _a.timeDimension,
17232
+ onChangeTimeStep = _a.onChangeTimeStep,
17233
+ _c = _a.isTimestepAuto,
17234
+ isTimestepAuto = _c === void 0 ? false : _c;
17024
17235
 
17025
- var _c = __read(React.useState(null), 2),
17026
- anchorEl = _c[0],
17027
- setAnchorEl = _c[1];
17236
+ var _d = __read(React.useState(null), 2),
17237
+ anchorEl = _d[0],
17238
+ setAnchorEl = _d[1];
17028
17239
 
17029
- var _d = __read(React.useState(false), 2),
17030
- open = _d[0],
17031
- setOpen = _d[1];
17240
+ var _e = __read(React.useState(false), 2),
17241
+ open = _e[0],
17242
+ setOpen = _e[1];
17032
17243
 
17033
17244
  React.useEffect(function () {
17034
17245
  if (anchorEl && isOpenByDefault) {
17035
17246
  setOpen(true);
17036
17247
  }
17037
17248
  }, [anchorEl, isOpenByDefault]);
17249
+ var timeStepFromLayer = getActiveLayerTimeStep(timeDimension) || timeStep;
17250
+ React__default["default"].useEffect(function () {
17251
+ if (isTimestepAuto) {
17252
+ onChangeTimeStep(timeStepFromLayer);
17253
+ }
17254
+ }, [timeStepFromLayer, isTimestepAuto, onChangeTimeStep]);
17038
17255
  return /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement(shared.CustomTooltip, {
17039
17256
  title: "Animation options",
17040
17257
  placement: "bottom"
@@ -17070,6 +17287,7 @@
17070
17287
  timeScaleBtn: timeScaleBtn,
17071
17288
  timeStepBtn: timeStepBtn,
17072
17289
  speedBtn: speedBtn,
17290
+ animationLengthBtn: animationLengthBtn,
17073
17291
  autoUpdateBtn: autoUpdateBtn
17074
17292
  })))));
17075
17293
  };
@@ -17352,11 +17570,12 @@
17352
17570
  var drawTimeText = function drawTimeText(ctx, theme, stepPx, height, timeText, scale) {
17353
17571
  var ctx2 = ctx;
17354
17572
  var _a = theme.palette.geowebColors.timeSlider.timelineText,
17573
+ fontSize = _a.fontSize,
17355
17574
  fontFamily = _a.fontFamily,
17356
17575
  color = _a.color;
17357
17576
  ctx2.fillStyle = color; // time text has smaller font than other timeline text
17358
17577
 
17359
- ctx2.font = "12px " + fontFamily;
17578
+ ctx2.font = fontSize + "px " + fontFamily;
17360
17579
  ctx2.textAlign = 'left';
17361
17580
 
17362
17581
  if (scale === Scale.Year || scale === Scale.Month || scale === Scale.Week || scale === Scale.Day) {
@@ -17388,7 +17607,7 @@
17388
17607
  ctx2.fillStyle = color;
17389
17608
  ctx2.font = fontSize + "px " + fontFamily;
17390
17609
  ctx2.textAlign = 'left';
17391
- ctx2.fillText(newDate, stepPx + 2, height - 30);
17610
+ ctx2.fillText(newDate, stepPx + 2, height - 10);
17392
17611
  };
17393
17612
 
17394
17613
  var drawLeftSideDateText = function drawLeftSideDateText(ctx, theme, newDate, height) {
@@ -17881,9 +18100,9 @@
17881
18100
  drawDefaultBackground();
17882
18101
  drawObservedData();
17883
18102
  drawForecastData();
18103
+ drawNightOrAlternateTime();
17884
18104
  drawAnimationArea();
17885
18105
  drawDraggableIcons();
17886
- drawNightOrAlternateTime();
17887
18106
 
17888
18107
  function drawDefaultBackground() {
17889
18108
  ctx.fillStyle = legendNoDataBackground.rgba;
@@ -17906,18 +18125,23 @@
17906
18125
 
17907
18126
  function drawAnimationArea() {
17908
18127
  ctx.fillStyle = theme$1.palette.geowebColors.timeSlider.timelineSelectionBackground.rgba;
17909
- ctx.fillRect(animationStartPx, y, Math.max(animationEndPx - animationStartPx, y), height);
18128
+ ctx.strokeStyle = theme$1.palette.geowebColors.timeSlider.timelineSelectionOutline.rgba;
18129
+ ctx.lineWidth = 3;
18130
+ ctx.rect(animationStartPx, y, Math.max(animationEndPx - animationStartPx, y), height);
18131
+ ctx.fill();
18132
+ ctx.stroke();
17910
18133
  }
17911
18134
 
17912
18135
  function drawDraggableIcons() {
17913
18136
  ctx.save();
17914
18137
  var path = new Path2D(theme.dragHandlePath);
17915
18138
  ctx.translate(animationStartPx, y);
17916
- ctx.fillStyle = theme$1.palette.geowebColors.timeSlider.timelineSelectionBackground.rgba;
18139
+ ctx.fillStyle = theme$1.palette.geowebColors.timeSlider.timelineTimeScale.fill;
17917
18140
  ctx.fill(path);
17918
18141
  ctx.restore();
17919
18142
  ctx.save();
17920
18143
  ctx.translate(animationEndPx - 24, y);
18144
+ ctx.fillStyle = theme$1.palette.geowebColors.timeSlider.timelineTimeScale.fill;
17921
18145
  ctx.fill(path);
17922
18146
  ctx.restore();
17923
18147
  }
@@ -18067,6 +18291,11 @@
18067
18291
  var isRightAnimationIconArea = function isRightAnimationIconArea(x, rightMarkerPx, width) {
18068
18292
  return x >= rightMarkerPx - width && x <= rightMarkerPx;
18069
18293
  };
18294
+ var isInsideAnimationArea = function isInsideAnimationArea(x, leftMarkerPx, rightMarkerPx) {
18295
+ var isInsideOnLeftSide = x >= leftMarkerPx;
18296
+ var isInsideOnRightSide = x <= rightMarkerPx;
18297
+ return isInsideOnLeftSide && isInsideOnRightSide;
18298
+ };
18070
18299
  /**
18071
18300
  * @param x The pin location
18072
18301
  * @param selectedTimePx The selected px
@@ -18097,7 +18326,8 @@
18097
18326
  var DRAG_AREA_WIDTH = 24;
18098
18327
 
18099
18328
  var TimeSliderLegend = function TimeSliderLegend(_a) {
18100
- var centerTime = _a.centerTime,
18329
+ var mapId = _a.mapId,
18330
+ centerTime = _a.centerTime,
18101
18331
  secondsPerPx = _a.secondsPerPx,
18102
18332
  _b = _a.dataScaleToSecondsPerPx,
18103
18333
  dataScaleToSecondsPerPx = _b === void 0 ? defaultDataScaleToSecondsPerPx : _b,
@@ -18109,10 +18339,11 @@
18109
18339
  dataEndTime = _a.dataEndTime,
18110
18340
  animationStartTime = _a.animationStartTime,
18111
18341
  animationEndTime = _a.animationEndTime,
18112
- isTimeSliderHoverOn = _a.isTimeSliderHoverOn,
18113
18342
  timeStep = _a.timeStep,
18114
18343
  _d = _a.mapIsActive,
18115
18344
  mapIsActive = _d === void 0 ? true : _d,
18345
+ unfilteredSelectedTime = _a.unfilteredSelectedTime,
18346
+ setUnfilteredSelectedTime = _a.setUnfilteredSelectedTime,
18116
18347
  onSetNewDate = _a.onSetNewDate,
18117
18348
  onSetCenterTime = _a.onSetCenterTime,
18118
18349
  onSetAnimationStartTime = _a.onSetAnimationStartTime,
@@ -18142,23 +18373,39 @@
18142
18373
  setCenterTimeDragging = _k[1];
18143
18374
 
18144
18375
  var _l = __read(React__namespace.useState(false), 2),
18145
- mouseDownInLegend = _l[0],
18146
- setMouseDownInLegend = _l[1];
18376
+ dragTooltipOpen = _l[0],
18377
+ setDragTooltipOpen = _l[1];
18378
+
18379
+ var _m = __read(React__namespace.useState(false), 2),
18380
+ mouseDownInLegend = _m[0],
18381
+ setMouseDownInLegend = _m[1];
18147
18382
 
18148
- var _m = __read(React__namespace.useState(animationStartTime && moment__default["default"].utc(animationStartTime).unix()), 2),
18149
- localAnimationStartTime = _m[0],
18150
- setLocalAnimationStartTime = _m[1];
18383
+ var _o = __read(React__namespace.useState(animationStartTime && moment__default["default"].utc(animationStartTime).unix()), 2),
18384
+ localAnimationStartTime = _o[0],
18385
+ setLocalAnimationStartTime = _o[1];
18151
18386
 
18152
- var _o = __read(React__namespace.useState(animationEndTime && moment__default["default"].utc(animationEndTime).unix()), 2),
18153
- localAnimationEndTime = _o[0],
18154
- setLocalAnimationEndTime = _o[1];
18387
+ var _p = __read(React__namespace.useState(animationEndTime && moment__default["default"].utc(animationEndTime).unix()), 2),
18388
+ localAnimationEndTime = _p[0],
18389
+ setLocalAnimationEndTime = _p[1];
18155
18390
 
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.
18391
+ var _q = __read(React__namespace.useState(moment__default["default"].utc(0)), 2),
18392
+ tooltipTime = _q[0],
18393
+ setTooltipTime = _q[1];
18158
18394
 
18159
- var _p = __read(React__namespace.useState('auto'), 2),
18160
- cursorStyle = _p[0],
18161
- setCursorStyle = _p[1];
18395
+ var _r = __read(React__namespace.useState(false), 2),
18396
+ animationAreaDragging = _r[0],
18397
+ setAnimationAreaDragging = _r[1];
18398
+
18399
+ var animationDiff = React__namespace.useRef();
18400
+ var isClickOrDrag = React__namespace.useRef();
18401
+ var pixelsMovedSinceStartDragging = React__namespace.useRef(0);
18402
+ var elem = document.querySelector(".timeSliderLegend_" + mapId);
18403
+ var pixelsToLeft = elem === null || elem === void 0 ? void 0 : elem.getBoundingClientRect()['left'];
18404
+ var pixelsToTop = elem === null || elem === void 0 ? void 0 : elem.getBoundingClientRect()['top'];
18405
+
18406
+ var _s = __read(React__namespace.useState('auto'), 2),
18407
+ cursorStyle = _s[0],
18408
+ setCursorStyle = _s[1];
18162
18409
 
18163
18410
  var curTime = selectedTime !== undefined ? moment__default["default"].unix(selectedTime).toISOString() : moment__default["default"].utc().toISOString();
18164
18411
  React__namespace.useEffect(function () {
@@ -18188,7 +18435,7 @@
18188
18435
  return function () {
18189
18436
  document.removeEventListener('keydown', handleKeyDown);
18190
18437
  };
18191
- }, [timeStep, isTimeSliderHoverOn, currentTime, dataStartTime, dataEndTime, mapIsActive, onSetCenterTime, onSetNewDate, curTime]);
18438
+ }, [curTime, currentTime, dataEndTime, dataStartTime, mapIsActive, onSetCenterTime, onSetNewDate, timeStep]);
18192
18439
  /**
18193
18440
  * remove active drag. can happen outside canvas.
18194
18441
  */
@@ -18201,13 +18448,18 @@
18201
18448
  setRightMarkerDragging(false);
18202
18449
  setMouseDownInLegend(false);
18203
18450
  setCenterTimeDragging(false);
18451
+ setDragTooltipOpen(false);
18452
+ setAnimationAreaDragging(false);
18453
+ startDraggingPosition.current = 0;
18454
+ pixelsMovedSinceStartDragging.current = 0;
18455
+ animationDiff.current = undefined;
18204
18456
  };
18205
18457
 
18206
18458
  document.addEventListener('mouseup', handleMouseUp);
18207
18459
  return function () {
18208
18460
  document.removeEventListener('mouseup', handleMouseUp);
18209
18461
  };
18210
- });
18462
+ }, [centerTimeDragging]);
18211
18463
  var onMouseTouchMoveActions = React.useCallback(function (x) {
18212
18464
  if (!localAnimationStartTime || !localAnimationEndTime) return;
18213
18465
 
@@ -18218,43 +18470,78 @@
18218
18470
  rightMarkerPx = _a[1];
18219
18471
 
18220
18472
  if (leftMarkerDragging) {
18473
+ var mousePosition = leftMarkerPx + x;
18474
+ var rightAnimationPosition = rightMarkerPx - DRAG_AREA_WIDTH * 2; // update tooltip position while dragging
18221
18475
  // Prevent dragging if it would cause markers to cross over, except if the markers
18222
18476
  // 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
18477
 
18225
- var mouseTimeUnix = pixelToTimestamp(x - DRAG_AREA_WIDTH / 2, // lets us drag on the marker
18478
+ if (mousePosition >= rightAnimationPosition || mousePosition <= 0) return; // set animation drag info dialog location
18479
+
18480
+ dragTooltipPosition.current = pixelsToLeft ? mousePosition + pixelsToLeft : mousePosition; // change local time bounds according to either dragged marker
18481
+
18482
+ var mouseTimeUnix = pixelToTimestamp(mousePosition, // lets us drag on the marker
18226
18483
  centerTime, canvasWidth, secondsPerPx);
18227
18484
  setLocalAnimationStartTime(mouseTimeUnix);
18485
+ setTooltipTime(moment__default["default"].unix(mouseTimeUnix));
18228
18486
  return;
18229
18487
  }
18230
18488
 
18231
18489
  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
18490
+ var mousePosition = rightMarkerPx + x;
18491
+ var leftAnimationPosition = leftMarkerPx + DRAG_AREA_WIDTH * 2; // Similar condition for other marker
18234
18492
 
18235
- var mouseTimeUnix = pixelToTimestamp(x + DRAG_AREA_WIDTH / 2, // lets us drag on the marker
18493
+ if (leftAnimationPosition >= mousePosition || mousePosition >= canvasWidth) return; // set animation drag info dialog location
18494
+
18495
+ dragTooltipPosition.current = pixelsToLeft ? mousePosition + pixelsToLeft : mousePosition; // change local time bounds according to either dragged marker
18496
+
18497
+ var mouseTimeUnix = pixelToTimestamp(mousePosition, // lets us drag on the marker
18236
18498
  centerTime, canvasWidth, secondsPerPx);
18237
18499
  setLocalAnimationEndTime(mouseTimeUnix);
18500
+ setTooltipTime(moment__default["default"].unix(mouseTimeUnix));
18501
+ return;
18238
18502
  }
18239
- }, [centerTime, leftMarkerDragging, localAnimationEndTime, localAnimationStartTime, rightMarkerDragging, secondsPerPx, canvasWidth]);
18503
+
18504
+ if (animationAreaDragging) {
18505
+ if (animationDiff.current === undefined) {
18506
+ var startDraggingPositionTimestamp = pixelToTimestamp(startDraggingPosition.current, centerTime, canvasWidth, secondsPerPx);
18507
+ var diffLeftAnimationToStartDraggingPosition = startDraggingPositionTimestamp - localAnimationStartTime;
18508
+ var diffRightAnimationToStartDraggingPosition = localAnimationEndTime - startDraggingPositionTimestamp;
18509
+ animationDiff.current = {
18510
+ diffStartToRight: diffRightAnimationToStartDraggingPosition,
18511
+ diffStartToLeft: diffLeftAnimationToStartDraggingPosition
18512
+ };
18513
+ return;
18514
+ }
18515
+
18516
+ pixelsMovedSinceStartDragging.current += x;
18517
+ var currentPositionTimestamp = pixelToTimestamp(startDraggingPosition.current + pixelsMovedSinceStartDragging.current, centerTime, canvasWidth, secondsPerPx);
18518
+ var _b = animationDiff.current,
18519
+ diffStartToRight = _b.diffStartToRight,
18520
+ diffStartToLeft = _b.diffStartToLeft;
18521
+ var startTime = currentPositionTimestamp - diffStartToLeft;
18522
+ var endTime = currentPositionTimestamp + diffStartToRight;
18523
+ setLocalAnimationStartTime(startTime);
18524
+ setLocalAnimationEndTime(endTime);
18525
+ }
18526
+ }, [localAnimationStartTime, localAnimationEndTime, leftMarkerDragging, rightMarkerDragging, animationAreaDragging, centerTime, canvasWidth, secondsPerPx, pixelsToLeft, animationDiff]);
18240
18527
  var setSelectedTime = React.useCallback(function (x) {
18241
- setNewRoundedTime(x, centerTime, canvasWidth, secondsPerPx, timeStep, dataStartTime, dataEndTime, onSetNewDate);
18242
- }, [canvasWidth, centerTime, dataEndTime, dataStartTime, onSetNewDate, secondsPerPx, timeStep]);
18528
+ var unfliteredSelectedTimePx = timestampToPixel(unfilteredSelectedTime, centerTime, canvasWidth, secondsPerPx) + x;
18529
+ setUnfilteredSelectedTime(pixelToTimestamp(unfliteredSelectedTimePx, centerTime, canvasWidth, secondsPerPx));
18530
+ setNewRoundedTime(unfliteredSelectedTimePx, centerTime, canvasWidth, secondsPerPx, timeStep, dataStartTime, dataEndTime, onSetNewDate);
18531
+ }, [canvasWidth, centerTime, dataEndTime, dataStartTime, onSetNewDate, secondsPerPx, setUnfilteredSelectedTime, timeStep, unfilteredSelectedTime]);
18243
18532
  React__namespace.useEffect(function () {
18244
18533
  var handleMouseMove = function handleMouseMove(event) {
18534
+ if (event.movementX === 0) return;
18535
+
18245
18536
  if (mouseDownInLegend) {
18246
18537
  setCenterTimeDragging(true);
18247
18538
  var dragDistanceTime = event.movementX * secondsPerPx;
18248
18539
  var newCenterTime = centerTime - dragDistanceTime;
18249
18540
  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
- }
18541
+ } else if (leftMarkerDragging || rightMarkerDragging || animationAreaDragging) {
18542
+ onMouseTouchMoveActions(event.movementX);
18543
+ } else if (selectedTimeDragging) {
18544
+ setSelectedTime(event.movementX);
18258
18545
  }
18259
18546
  };
18260
18547
 
@@ -18262,10 +18549,14 @@
18262
18549
  return function () {
18263
18550
  document.removeEventListener('mousemove', handleMouseMove);
18264
18551
  };
18265
- }, [centerTime, secondsPerPx, onSetCenterTime, mouseDownInLegend, leftMarkerDragging, rightMarkerDragging, onMouseTouchMoveActions, selectedTimeDragging, setSelectedTime, pixelsToLeft]);
18552
+ }, [animationAreaDragging, centerTime, leftMarkerDragging, mouseDownInLegend, onMouseTouchMoveActions, onSetCenterTime, rightMarkerDragging, secondsPerPx, selectedTimeDragging, setSelectedTime]);
18266
18553
  var theme = material.useTheme();
18554
+ var startDraggingPosition = React__namespace.useRef(0);
18267
18555
 
18268
18556
  var onMouseDown = function onMouseDown(x, y, width) {
18557
+ isClickOrDrag.current = 'click';
18558
+ startDraggingPosition.current = x;
18559
+
18269
18560
  var _a = __read([localAnimationStartTime, localAnimationEndTime, selectedTime].map(function (timestamp) {
18270
18561
  return timestampToPixel(timestamp, centerTime, width, secondsPerPx);
18271
18562
  }), 3),
@@ -18281,16 +18572,27 @@
18281
18572
  }
18282
18573
 
18283
18574
  if (animationStartTime && animationEndTime && onSetAnimationStartTime && onSetAnimationEndTime) {
18284
- // start dragging either marker
18575
+ dragTooltipPosition.current = pixelsToLeft ? x + pixelsToLeft : x; // start dragging either marker
18576
+
18285
18577
  if (isLeftAnimationIconArea(x, leftMarkerPx, DRAG_AREA_WIDTH) && !rightMarkerDragging) {
18286
18578
  setCursorStyle('grabbing');
18287
18579
  setLeftMarkerDragging(true);
18580
+ setTooltipTime(moment__default["default"].utc(animationStartTime));
18581
+ setDragTooltipOpen(true);
18288
18582
  return;
18289
18583
  }
18290
18584
 
18291
18585
  if (isRightAnimationIconArea(x, rightMarkerPx, DRAG_AREA_WIDTH) && !leftMarkerDragging) {
18292
18586
  setCursorStyle('grabbing');
18293
18587
  setRightMarkerDragging(true);
18588
+ setTooltipTime(moment__default["default"].utc(animationEndTime));
18589
+ setDragTooltipOpen(true);
18590
+ return;
18591
+ }
18592
+
18593
+ if (isInsideAnimationArea(x, leftMarkerPx, rightMarkerPx) && !animationAreaDragging) {
18594
+ setCursorStyle('grabbing');
18595
+ setAnimationAreaDragging(true);
18294
18596
  return;
18295
18597
  }
18296
18598
  } // clicking the timeslider
@@ -18299,18 +18601,36 @@
18299
18601
  setMouseDownInLegend(true);
18300
18602
  };
18301
18603
 
18604
+ React__namespace.useEffect(function () {
18605
+ var stoppedDragging = !leftMarkerDragging && !rightMarkerDragging && !animationAreaDragging;
18606
+
18607
+ if (stoppedDragging) {
18608
+ if (localAnimationStartTime !== convertStringTimeToUnix(animationStartTime)) {
18609
+ onSetAnimationStartTime(moment__default["default"].utc(localAnimationStartTime * 1000).format(dateFormat));
18610
+ }
18611
+
18612
+ if (localAnimationEndTime !== convertStringTimeToUnix(animationEndTime)) {
18613
+ onSetAnimationEndTime(moment__default["default"].utc(localAnimationEndTime * 1000).format(dateFormat));
18614
+ }
18615
+ } // eslint-disable-next-line react-hooks/exhaustive-deps
18616
+
18617
+ }, [leftMarkerDragging, rightMarkerDragging, animationAreaDragging]);
18618
+
18302
18619
  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);
18620
+ if (isClickOrDrag.current === 'click') {
18621
+ // we need to set the unfiltered time, so the timebox will update accordingly
18622
+ setUnfilteredSelectedTime(pixelToTimestamp(x, centerTime, canvasWidth, secondsPerPx));
18623
+ setNewRoundedTime(x, centerTime, canvasWidth, secondsPerPx, timeStep, dataStartTime, dataEndTime, onSetNewDate);
18310
18624
  }
18625
+
18626
+ isClickOrDrag.current = undefined;
18311
18627
  };
18312
18628
 
18313
18629
  var onMouseMove = function onMouseMove(x, y, event, width) {
18630
+ if (isClickOrDrag.current === 'click') {
18631
+ isClickOrDrag.current = 'drag';
18632
+ }
18633
+
18314
18634
  if (selectedTimeDragging || leftMarkerDragging || rightMarkerDragging) return;
18315
18635
 
18316
18636
  var _a = __read([localAnimationStartTime, localAnimationEndTime, selectedTime].map(function (timestamp) {
@@ -18324,18 +18644,41 @@
18324
18644
  var leftAnimationIconArea = isLeftAnimationIconArea(x, leftMarkerPx, DRAG_AREA_WIDTH);
18325
18645
  var rightAnimationIconArea = isRightAnimationIconArea(x, rightMarkerPx, DRAG_AREA_WIDTH);
18326
18646
  var selectedTimeArea = isSelectedTimeIconArea(x, selectedTimePx, DRAG_AREA_WIDTH);
18647
+ var insideAnimationArea = isInsideAnimationArea(x, leftMarkerPx, rightMarkerPx);
18327
18648
  var hoveringLegendHandles = leftAnimationIconArea || rightAnimationIconArea || selectedTimeArea || mouseDownInLegend;
18328
18649
 
18329
18650
  if (hoveringLegendHandles) {
18330
18651
  setCursorStyle('ew-resize');
18652
+ } else if (insideAnimationArea && !animationAreaDragging) {
18653
+ setCursorStyle('grab');
18654
+ } else if (insideAnimationArea && animationAreaDragging) {
18655
+ setCursorStyle('grabbing');
18331
18656
  } else {
18332
18657
  setCursorStyle('auto');
18333
18658
  }
18334
18659
  };
18335
18660
 
18336
- return /*#__PURE__*/React__namespace.createElement(material.Box, {
18661
+ var dragTooltipPosition = React__namespace.useRef();
18662
+ var popperRef = React__namespace.useRef(null);
18663
+
18664
+ var setTooltipPosition = function setTooltipPosition() {
18665
+ var tooltipX = dragTooltipPosition.current;
18666
+ var tooltipY = pixelsToTop && pixelsToTop - TIME_SLIDER_LEGEND_HEIGHT * 2.5;
18667
+ return new DOMRect(tooltipX, tooltipY, 0, 0);
18668
+ };
18669
+
18670
+ return /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
18671
+ title: tooltipTime.format('HH:mm'),
18672
+ open: dragTooltipOpen,
18673
+ PopperProps: {
18674
+ popperRef: popperRef,
18675
+ anchorEl: {
18676
+ getBoundingClientRect: setTooltipPosition
18677
+ }
18678
+ }
18679
+ }, /*#__PURE__*/React__namespace.createElement(material.Box, {
18337
18680
  "data-testid": "timeSliderLegend",
18338
- className: "timeSliderLegend",
18681
+ className: "timeSliderLegend_" + mapId,
18339
18682
  sx: {
18340
18683
  height: TIME_SLIDER_LEGEND_HEIGHT + "px",
18341
18684
  borderRadius: '4.5px',
@@ -18357,9 +18700,13 @@
18357
18700
  setCanvasWidth(width);
18358
18701
  drawTimeSliderLegend(ctx, theme, width, height, centerTime, secondsPerPx, dataScaleToSecondsPerPx, selectedTime, scale, currentTime, localAnimationStartTime, localAnimationEndTime, dataStartTime, dataEndTime);
18359
18702
  }
18360
- }));
18703
+ })));
18361
18704
  };
18362
18705
 
18706
+ function convertStringTimeToUnix(time) {
18707
+ return time ? moment__default["default"].utc(time).unix() : undefined;
18708
+ }
18709
+
18363
18710
  var TIME_SLIDER_LEGEND_HEIGHT = 24;
18364
18711
 
18365
18712
  /* *
@@ -18411,7 +18758,7 @@
18411
18758
  * */
18412
18759
  var onMouseMove = function onMouseMove(x, width, selectedTime, centerTime, secondsPerPx, mouseDownInTimeBox, isTimeBoxArea, setCursorStyle) {
18413
18760
  if (!selectedTime || mouseDownInTimeBox) return;
18414
- var selectedTimePx = timestampToPixel(selectedTime.unix(), centerTime, width, secondsPerPx);
18761
+ var selectedTimePx = timestampToPixel(selectedTime, centerTime, width, secondsPerPx);
18415
18762
 
18416
18763
  if (isTimeBoxArea(x, selectedTimePx)) {
18417
18764
  setCursorStyle('grab');
@@ -18421,7 +18768,7 @@
18421
18768
  };
18422
18769
  var onMouseDown = function onMouseDown(x, width, selectedTime, centerTime, secondsPerPx, isTimeBoxArea, setCursorStyle, setMouseDownInTimeBox) {
18423
18770
  if (!selectedTime) return;
18424
- var selectedTimePx = timestampToPixel(selectedTime.unix(), centerTime, width, secondsPerPx);
18771
+ var selectedTimePx = timestampToPixel(selectedTime, centerTime, width, secondsPerPx);
18425
18772
 
18426
18773
  if (isTimeBoxArea(x, selectedTimePx)) {
18427
18774
  setCursorStyle('grabbing');
@@ -18536,7 +18883,9 @@
18536
18883
  timeStep = _a.timeStep,
18537
18884
  dataStartTime = _a.dataStartTime,
18538
18885
  dataEndTime = _a.dataEndTime,
18539
- onSetNewDate = _a.onSetNewDate;
18886
+ unfilteredSelectedTime = _a.unfilteredSelectedTime,
18887
+ onSetNewDate = _a.onSetNewDate,
18888
+ setUnfilteredSelectedTime = _a.setUnfilteredSelectedTime;
18540
18889
  var TIME_BOX_WIDTH = 140;
18541
18890
  var theme = material.useTheme();
18542
18891
 
@@ -18577,11 +18926,9 @@
18577
18926
  React__default["default"].useEffect(function () {
18578
18927
  var handleMouseMove = function handleMouseMove(event) {
18579
18928
  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);
18929
+ var localSelectedTimePx = timestampToPixel(unfilteredSelectedTime, centerTime, canvasWidth, secondsPerPx) + event.movementX;
18930
+ setUnfilteredSelectedTime(pixelToTimestamp(localSelectedTimePx, centerTime, canvasWidth, secondsPerPx));
18931
+ setNewRoundedTime(localSelectedTimePx, centerTime, canvasWidth, secondsPerPx, timeStep, dataStartTime, dataEndTime, onSetNewDate);
18585
18932
  }
18586
18933
  };
18587
18934
 
@@ -18589,7 +18936,7 @@
18589
18936
  return function () {
18590
18937
  document.removeEventListener('mousemove', handleMouseMove);
18591
18938
  };
18592
- });
18939
+ }, [canvasWidth, centerTime, dataEndTime, dataStartTime, mouseDownInTimeBox, onSetNewDate, secondsPerPx, setUnfilteredSelectedTime, timeStep, unfilteredSelectedTime]);
18593
18940
  return /*#__PURE__*/React__default["default"].createElement(system.Box, {
18594
18941
  "data-testid": "timeSliderTimeBox",
18595
18942
  className: "timeSliderTimeBox",
@@ -18610,11 +18957,14 @@
18610
18957
  onMouseDown(x, width, selectedTime, centerTime, secondsPerPx, isTimeBoxArea, setCursorStyle, setMouseDownInTimeBox);
18611
18958
  },
18612
18959
  onMouseUp: function onMouseUp(x) {
18613
- setNewRoundedTime(x, centerTime, canvasWidth, secondsPerPx, timeStep, dataStartTime, dataEndTime, onSetNewDate);
18960
+ if (mouseDownInTimeBox) {
18961
+ setUnfilteredSelectedTime(pixelToTimestamp(x, centerTime, canvasWidth, secondsPerPx));
18962
+ setNewRoundedTime(x, centerTime, canvasWidth, secondsPerPx, timeStep, dataStartTime, dataEndTime, onSetNewDate);
18963
+ }
18614
18964
  },
18615
18965
  onRenderCanvas: function onRenderCanvas(ctx, width, height) {
18616
18966
  setCanvasWidth(width);
18617
- renderTimeSliderCurrentTimeBox(ctx, theme, width, height, centerTime, selectedTime.unix(), secondsPerPx, scale);
18967
+ renderTimeSliderCurrentTimeBox(ctx, theme, width, height, centerTime, selectedTime, secondsPerPx, scale);
18618
18968
  }
18619
18969
  }));
18620
18970
  };
@@ -18656,12 +19006,13 @@
18656
19006
  var defaultProps = {
18657
19007
  centerTime: moment__default["default"].utc().startOf('day').hours(12).unix(),
18658
19008
  secondsPerPx: 5,
18659
- selectedTime: moment__default["default"].utc().startOf('day').hours(12),
19009
+ selectedTime: moment__default["default"].utc().startOf('day').hours(12).unix(),
18660
19010
  dataScaleToSecondsPerPx: defaultDataScaleToSecondsPerPx
18661
19011
  };
18662
19012
 
18663
19013
  var TimeSlider = function TimeSlider(_a) {
18664
- var buttons = _a.buttons,
19014
+ var mapId = _a.mapId,
19015
+ buttons = _a.buttons,
18665
19016
  timeBox = _a.timeBox,
18666
19017
  legend = _a.legend,
18667
19018
  _b = _a.mapIsActive,
@@ -18671,6 +19022,11 @@
18671
19022
  _d = _a.onToggleTimeSlider,
18672
19023
  onToggleTimeSlider = _d === void 0 ? function () {} : _d;
18673
19024
  useTimeSliderKeyBoardControl(mapIsActive, isVisible, onToggleTimeSlider);
19025
+
19026
+ var _e = __read(React__namespace.useState(defaultProps.selectedTime), 2),
19027
+ unfilteredSelectedTime = _e[0],
19028
+ setUnfilteredSelectedTime = _e[1];
19029
+
18674
19030
  var visibilityState = isVisible ? 'visible' : 'hidden';
18675
19031
  return isVisible ? /*#__PURE__*/React__namespace.createElement(material.Grid, {
18676
19032
  style: {
@@ -18695,7 +19051,8 @@
18695
19051
  zIndex: 99
18696
19052
  }
18697
19053
  }, timeBox || /*#__PURE__*/React__namespace.createElement(TimeSliderCurrentTimeBox, __assign({}, defaultProps, {
18698
- selectedTime: defaultProps.selectedTime
19054
+ unfilteredSelectedTime: unfilteredSelectedTime,
19055
+ setUnfilteredSelectedTime: setUnfilteredSelectedTime
18699
19056
  }))), /*#__PURE__*/React__namespace.createElement(material.Grid, {
18700
19057
  item: true
18701
19058
  }), /*#__PURE__*/React__namespace.createElement(material.Grid, {
@@ -18703,8 +19060,10 @@
18703
19060
  }, buttons || /*#__PURE__*/React__namespace.createElement(TimeSliderButtons, null)), /*#__PURE__*/React__namespace.createElement(material.Grid, {
18704
19061
  item: true
18705
19062
  }, legend || /*#__PURE__*/React__namespace.createElement(TimeSliderLegend, __assign({}, defaultProps, {
18706
- selectedTime: defaultProps.selectedTime.unix(),
18707
- mapIsActive: mapIsActive
19063
+ mapId: mapId,
19064
+ mapIsActive: mapIsActive,
19065
+ unfilteredSelectedTime: unfilteredSelectedTime,
19066
+ setUnfilteredSelectedTime: setUnfilteredSelectedTime
18708
19067
  })), ' '), /*#__PURE__*/React__namespace.createElement(material.Grid, {
18709
19068
  item: true,
18710
19069
  sx: {
@@ -18838,12 +19197,6 @@
18838
19197
  var isTimestepAuto$1 = reactRedux.useSelector(function (store) {
18839
19198
  return isTimestepAuto(store, mapId);
18840
19199
  });
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
19200
  var onToggleTimestepAuto = React__namespace.useCallback(function () {
18848
19201
  dispatch(mapActions$1.toggleTimestepAuto({
18849
19202
  mapId: mapId,
@@ -18863,9 +19216,7 @@
18863
19216
  timeStep: timeStep,
18864
19217
  onChangeTimeStep: onSetTimeStep,
18865
19218
  disabled: isAnimating$1,
18866
- isTimestepAuto: isTimestepAuto$1,
18867
- onToggleTimestepAuto: onToggleTimestepAuto,
18868
- timeDimension: activeLayerTimeDimension
19219
+ onToggleTimestepAuto: onToggleTimestepAuto
18869
19220
  });
18870
19221
  };
18871
19222
 
@@ -18999,6 +19350,57 @@
18999
19350
  });
19000
19351
  };
19001
19352
 
19353
+ /* *
19354
+ * Licensed under the Apache License, Version 2.0 (the "License");
19355
+ * you may not use this file except in compliance with the License.
19356
+ * You may obtain a copy of the License at
19357
+ *
19358
+ * http://www.apache.org/licenses/LICENSE-2.0
19359
+ *
19360
+ * Unless required by applicable law or agreed to in writing, software
19361
+ * distributed under the License is distributed on an "AS IS" BASIS,
19362
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19363
+ * See the License for the specific language governing permissions and
19364
+ * limitations under the License.
19365
+ *
19366
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
19367
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
19368
+ * */
19369
+
19370
+ var AnimationLengthButtonConnect = function AnimationLengthButtonConnect(_a) {
19371
+ var mapId = _a.mapId;
19372
+ var dispatch = reactRedux.useDispatch();
19373
+ var isAnimating$1 = reactRedux.useSelector(function (store) {
19374
+ return isAnimating(store, mapId);
19375
+ });
19376
+ var animationStartTime = reactRedux.useSelector(function (store) {
19377
+ return getAnimationStartTime(store, mapId);
19378
+ });
19379
+ var animationEndTime = reactRedux.useSelector(function (store) {
19380
+ return getAnimationEndTime(store, mapId);
19381
+ });
19382
+ var currentDiffInMinutes = moment__default["default"](animationEndTime).diff(moment__default["default"](animationStartTime), 'minutes');
19383
+ var currentLength = Object.values(AnimationLength).map(function (val) {
19384
+ return Number(val);
19385
+ }).find(function (val) {
19386
+ return val >= currentDiffInMinutes;
19387
+ });
19388
+
19389
+ var handlechangeAnimationLength = function handlechangeAnimationLength(length) {
19390
+ var animationEndTime = moment__default["default"](animationStartTime).add(length, 'minutes').toISOString();
19391
+ dispatch(mapActions$1.setAnimationEndTime({
19392
+ mapId: mapId,
19393
+ animationEndTime: animationEndTime
19394
+ }));
19395
+ };
19396
+
19397
+ return /*#__PURE__*/React__namespace.createElement(AnimationLengthButton, {
19398
+ disabled: isAnimating$1,
19399
+ animationLength: currentLength || Number(AnimationLength.Hours24),
19400
+ onChangeAnimationLength: handlechangeAnimationLength
19401
+ });
19402
+ };
19403
+
19002
19404
  /* *
19003
19405
  * Licensed under the Apache License, Version 2.0 (the "License");
19004
19406
  * you may not use this file except in compliance with the License.
@@ -19027,11 +19429,35 @@
19027
19429
  var OptionsMenuButtonConnect = function OptionsMenuButtonConnect(_a) {
19028
19430
  var sourceId = _a.sourceId,
19029
19431
  mapId = _a.mapId;
19432
+ var dispatch = reactRedux.useDispatch();
19433
+ var isTimestepAuto$1 = reactRedux.useSelector(function (store) {
19434
+ return isTimestepAuto(store, mapId);
19435
+ });
19436
+ var timeStep = reactRedux.useSelector(function (store) {
19437
+ return getMapTimeStep(store, mapId);
19438
+ });
19439
+ var activeLayerId = reactRedux.useSelector(function (store) {
19440
+ return getActiveLayerId(store, mapId);
19441
+ });
19442
+ var activeLayerTimeDimension = reactRedux.useSelector(function (store) {
19443
+ return getLayerTimeDimension(store, activeLayerId);
19444
+ });
19445
+ var onSetTimeStep = React__namespace.useCallback(function (timeStep, origin) {
19446
+ dispatch(mapActions$1.setTimeStep(__assign({
19447
+ mapId: mapId,
19448
+ timeStep: timeStep
19449
+ }, origin && {
19450
+ origin: origin
19451
+ })));
19452
+ }, [dispatch, mapId]);
19030
19453
  return /*#__PURE__*/React__namespace.createElement(OptionsMenuButton, {
19031
19454
  nowBtn: /*#__PURE__*/React__namespace.createElement(NowButtonConnect, {
19032
19455
  mapId: mapId,
19033
19456
  sourceId: sourceId
19034
19457
  }),
19458
+ animationLengthBtn: /*#__PURE__*/React__namespace.createElement(AnimationLengthButtonConnect, {
19459
+ mapId: mapId
19460
+ }),
19035
19461
  autoUpdateBtn: /*#__PURE__*/React__namespace.createElement(AutoUpdateButtonConnect, {
19036
19462
  mapId: mapId
19037
19463
  }),
@@ -19043,7 +19469,11 @@
19043
19469
  }),
19044
19470
  timeScaleBtn: /*#__PURE__*/React__namespace.createElement(TimeScaleButtonConnect, {
19045
19471
  mapId: mapId
19046
- })
19472
+ }),
19473
+ timeStep: timeStep,
19474
+ isTimestepAuto: isTimestepAuto$1,
19475
+ onChangeTimeStep: onSetTimeStep,
19476
+ timeDimension: activeLayerTimeDimension
19047
19477
  });
19048
19478
  };
19049
19479
 
@@ -19197,9 +19627,11 @@
19197
19627
  timeValue: getTime(getSynchronizationGroupStore(store), props.sourceId),
19198
19628
  animationStartTime: getAnimationStartTime(store, props.mapId),
19199
19629
  animationEndTime: getAnimationEndTime(store, props.mapId),
19200
- activeWindowId: getActiveWindowId(store)
19630
+ activeWindowId: getActiveWindowId(store),
19631
+ unfilteredSelectedTime: getTimeSliderUnfilteredSelectedTime(store, props.mapId)
19201
19632
  };
19202
19633
  }, {
19634
+ setTimeSliderUnfilteredSelectedTime: mapActions$1.setTimeSliderUnfilteredSelectedTime,
19203
19635
  stopMapAnimation: mapActions$1.mapStopAnimation,
19204
19636
  setTime: genericActions.setTime,
19205
19637
  mapSetTimeSliderCenterTime: mapActions$1.setTimeSliderCenterTime,
@@ -19228,7 +19660,9 @@
19228
19660
  mapSetTimeSliderCenterTime = _a.mapSetTimeSliderCenterTime,
19229
19661
  mapSetTimeSliderSecondsPerPx = _a.mapSetTimeSliderSecondsPerPx,
19230
19662
  setAnimationStartTime = _a.setAnimationStartTime,
19231
- setAnimationEndTime = _a.setAnimationEndTime;
19663
+ setAnimationEndTime = _a.setAnimationEndTime,
19664
+ unfilteredSelectedTime = _a.unfilteredSelectedTime,
19665
+ setTimeSliderUnfilteredSelectedTime = _a.setTimeSliderUnfilteredSelectedTime;
19232
19666
  var selectedTime = getTimeBounds(dimensions).selectedTime;
19233
19667
  var currentTime = moment__default["default"].utc().unix();
19234
19668
 
@@ -19238,6 +19672,7 @@
19238
19672
 
19239
19673
  var mapIsActive = mapId === activeWindowId;
19240
19674
  return /*#__PURE__*/React__namespace.createElement(TimeSliderLegend, {
19675
+ mapId: mapId,
19241
19676
  centerTime: centerTime,
19242
19677
  secondsPerPx: secondsPerPx,
19243
19678
  dataScaleToSecondsPerPx: dataScaleToSecondsPerPx,
@@ -19251,6 +19686,13 @@
19251
19686
  animationEndTime: animationEndTime,
19252
19687
  timeStep: timeStep,
19253
19688
  mapIsActive: mapIsActive,
19689
+ unfilteredSelectedTime: unfilteredSelectedTime || selectedTime,
19690
+ setUnfilteredSelectedTime: function setUnfilteredSelectedTime(timeSliderUnfilteredSelectedTime) {
19691
+ if (setTimeSliderUnfilteredSelectedTime) setTimeSliderUnfilteredSelectedTime({
19692
+ timeSliderUnfilteredSelectedTime: timeSliderUnfilteredSelectedTime,
19693
+ mapId: mapId
19694
+ });
19695
+ },
19254
19696
  onSetNewDate: function onSetNewDate(newDate) {
19255
19697
  if (isAnimating) {
19256
19698
  stopMapAnimation({
@@ -19330,9 +19772,11 @@
19330
19772
  secondsPerPx: getMapTimeSliderSecondsPerPx(store, props.mapId),
19331
19773
  scale: getMapTimeSliderScale(store, props.mapId),
19332
19774
  timeStep: getMapTimeStep(store, props.mapId),
19333
- isAnimating: isAnimating(store, props.mapId)
19775
+ isAnimating: isAnimating(store, props.mapId),
19776
+ unfilteredSelectedTime: getTimeSliderUnfilteredSelectedTime(store, props.mapId)
19334
19777
  };
19335
19778
  }, {
19779
+ setTimeSliderUnfilteredSelectedTime: mapActions$1.setTimeSliderUnfilteredSelectedTime,
19336
19780
  stopMapAnimation: mapActions$1.mapStopAnimation,
19337
19781
  setTime: genericActions.setTime
19338
19782
  });
@@ -19348,8 +19792,10 @@
19348
19792
  timeStep = _a.timeStep,
19349
19793
  isAnimating = _a.isAnimating,
19350
19794
  stopMapAnimation = _a.stopMapAnimation,
19795
+ unfilteredSelectedTime = _a.unfilteredSelectedTime,
19796
+ setTimeSliderUnfilteredSelectedTime = _a.setTimeSliderUnfilteredSelectedTime,
19351
19797
  setTime = _a.setTime;
19352
- var selectedTime = getMomentTimeBounds(dimensions).selectedTime;
19798
+ var selectedTime = getTimeBounds(dimensions).selectedTime;
19353
19799
 
19354
19800
  var _b = __read(getDataLimitsFromLayers(layers), 2),
19355
19801
  dataStartTime = _b[0],
@@ -19363,6 +19809,13 @@
19363
19809
  dataStartTime: dataStartTime,
19364
19810
  dataEndTime: dataEndTime,
19365
19811
  timeStep: timeStep,
19812
+ unfilteredSelectedTime: unfilteredSelectedTime || selectedTime,
19813
+ setUnfilteredSelectedTime: function setUnfilteredSelectedTime(timeSliderUnfilteredSelectedTime) {
19814
+ if (setTimeSliderUnfilteredSelectedTime) setTimeSliderUnfilteredSelectedTime({
19815
+ timeSliderUnfilteredSelectedTime: timeSliderUnfilteredSelectedTime,
19816
+ mapId: mapId
19817
+ });
19818
+ },
19366
19819
  onSetNewDate: function onSetNewDate(newDate) {
19367
19820
  if (isAnimating) {
19368
19821
  stopMapAnimation({
@@ -19447,6 +19900,7 @@
19447
19900
  };
19448
19901
 
19449
19902
  return /*#__PURE__*/React__namespace.createElement(TimeSlider, {
19903
+ mapId: mapId,
19450
19904
  buttons: /*#__PURE__*/React__namespace.createElement(TimeSliderButtonsConnect, {
19451
19905
  mapId: mapId,
19452
19906
  sourceId: sourceId
@@ -23529,12 +23983,11 @@
23529
23983
  var handleKeyPress = function handleKeyPress(event) {
23530
23984
  var target = event.target;
23531
23985
  var map = getWMJSMapById(mapId);
23986
+ var key = event.key,
23987
+ type = event.type;
23988
+ keysPressedDown[key] = type === 'keydown';
23532
23989
 
23533
23990
  if (map && target.tagName !== 'INPUT' && mapIsActive) {
23534
- var key = event.key,
23535
- type = event.type;
23536
- keysPressedDown[key] = type === 'keydown';
23537
-
23538
23991
  if (keysPressedDown['+']) {
23539
23992
  map.zoomIn(1);
23540
23993
  } else if (keysPressedDown['-']) {
@@ -23911,6 +24364,9 @@
23911
24364
  mapId: mapId,
23912
24365
  sourceId: sourceId
23913
24366
  }),
24367
+ animationLengthBtn: /*#__PURE__*/React__default["default"].createElement(AnimationLengthButtonConnect, {
24368
+ mapId: mapId
24369
+ }),
23914
24370
  autoUpdateBtn: /*#__PURE__*/React__default["default"].createElement(AutoUpdateButtonConnect, {
23915
24371
  mapId: mapId
23916
24372
  }),
@@ -24352,6 +24808,398 @@
24352
24808
  });
24353
24809
  };
24354
24810
 
24811
+ /* *
24812
+ * Licensed under the Apache License, Version 2.0 (the "License");
24813
+ * you may not use this file except in compliance with the License.
24814
+ * You may obtain a copy of the License at
24815
+ *
24816
+ * http://www.apache.org/licenses/LICENSE-2.0
24817
+ *
24818
+ * Unless required by applicable law or agreed to in writing, software
24819
+ * distributed under the License is distributed on an "AS IS" BASIS,
24820
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24821
+ * See the License for the specific language governing permissions and
24822
+ * limitations under the License.
24823
+ *
24824
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
24825
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
24826
+ * */
24827
+ /**
24828
+ * Get the title for this WMS layer based on its layerId. If not defined, layerId is used instead.
24829
+ * @param layerId
24830
+ * @returns Title for the layer
24831
+ */
24832
+
24833
+ var getTitle = function getTitle(layerId) {
24834
+ var wmjsLayer = getWMLayerById(layerId);
24835
+ return wmjsLayer ? wmjsLayer.title || wmjsLayer.name : layerId;
24836
+ };
24837
+ /**
24838
+ * Make a list of GFI Layers to display.
24839
+ * @param layers
24840
+ * @param mapId
24841
+ * @returns
24842
+ */
24843
+
24844
+
24845
+ var getLayersToUpdate = function getLayersToUpdate(layers, mapId) {
24846
+ var wmjsMap = getWMJSMapById(mapId);
24847
+ if (!wmjsMap || !layers || layers.length === 0) return [];
24848
+ return layers.filter(function (layer) {
24849
+ return layer && layer.enabled && !!getWMLayerById(layer.id);
24850
+ }).map(function (layer) {
24851
+ /*
24852
+ We need a wmjsLayer to build the getfeatureinfo url (getWMSGetFeatureInfoRequestURL function).
24853
+ But it seems that its dimension are lazely updated (by ReactMapView).
24854
+ Therefore make a clone of this layer and set its dimensions based on the layer object.
24855
+ Otherwise we risk making a getfeatureinfo call with outdated dimension values.
24856
+ */
24857
+ var wmjsLayer = getWMLayerById(layer.id).cloneLayer();
24858
+ layer.dimensions && layer.dimensions.forEach(function (dim) {
24859
+ var wmDim = wmjsLayer.getDimension(dim.name);
24860
+
24861
+ if (wmDim && wmDim.getValue() !== dim.currentValue) {
24862
+ wmDim.setValue(dim.currentValue);
24863
+ }
24864
+ });
24865
+ return {
24866
+ layerId: layer.id,
24867
+ url: wmjsMap.getWMSGetFeatureInfoRequestURL(wmjsLayer, "" + wmjsMap.getMapPin().getXY().x, "" + wmjsMap.getMapPin().getXY().y, 'text/html'),
24868
+ title: getTitle(layer.id)
24869
+ };
24870
+ });
24871
+ };
24872
+
24873
+ /* *
24874
+ * Licensed under the Apache License, Version 2.0 (the "License");
24875
+ * you may not use this file except in compliance with the License.
24876
+ * You may obtain a copy of the License at
24877
+ *
24878
+ * http://www.apache.org/licenses/LICENSE-2.0
24879
+ *
24880
+ * Unless required by applicable law or agreed to in writing, software
24881
+ * distributed under the License is distributed on an "AS IS" BASIS,
24882
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24883
+ * See the License for the specific language governing permissions and
24884
+ * limitations under the License.
24885
+ *
24886
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
24887
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
24888
+ * */
24889
+
24890
+ var GetFeatureInfoDialog = function GetFeatureInfoDialog(_a) {
24891
+ var layers = _a.layers,
24892
+ isOpen = _a.isOpen,
24893
+ onClose = _a.onClose,
24894
+ _b = _a.onMouseDown,
24895
+ onMouseDown = _b === void 0 ? function () {} : _b,
24896
+ mapId = _a.mapId,
24897
+ _c = _a.showMapId,
24898
+ showMapId = _c === void 0 ? false : _c,
24899
+ _d = _a.order,
24900
+ order = _d === void 0 ? 0 : _d,
24901
+ _e = _a.source,
24902
+ source = _e === void 0 ? 'app' : _e,
24903
+ mapPinLocation = _a.mapPinLocation;
24904
+ /* Ref and state for maplocation */
24905
+
24906
+ var mapLocationWasChanged = React__default["default"].useRef(false);
24907
+
24908
+ var _f = __read(React__default["default"].useState(false), 2),
24909
+ isInitialMapLocationChanged = _f[0],
24910
+ setInitialMapLocationIsChanged = _f[1];
24911
+ /* Ref, state and update function for results per layer map */
24912
+
24913
+
24914
+ var gfiResultMap = React__default["default"].useRef(new Map()).current;
24915
+
24916
+ var _g = __read(React__default["default"].useState(), 2),
24917
+ triggerRerender = _g[1];
24918
+
24919
+ var updateLayerResult = function updateLayerResult(_a) {
24920
+ var layerId = _a.layerId,
24921
+ data = _a.data,
24922
+ isLoading = _a.isLoading;
24923
+ gfiResultMap.set(layerId, {
24924
+ data: data,
24925
+ isLoading: isLoading
24926
+ });
24927
+ triggerRerender("" + layerId + isLoading);
24928
+ };
24929
+ /* Build a layerlist array with a set of arguments per layer to do the query for */
24930
+
24931
+
24932
+ var layerToUpdateList = getLayersToUpdate(layers, mapId);
24933
+ /*
24934
+ Build a string based on the GFI urls. If this changes for whatever reason we need to update.
24935
+ These strings can change very often, therefore they need to be debounced and only use the most recent result must be used.
24936
+ */
24937
+
24938
+ var debouncedlayerListString = api.useDebounce(layerToUpdateList.map(function (layer) {
24939
+ return layer.url;
24940
+ }).join(','), 100);
24941
+ /* Do a GFI call to the server and use the updateLayerResult to provide the results. */
24942
+
24943
+ var fetchLayerInfo = function fetchLayerInfo(url, layerId) {
24944
+ return __awaiter(void 0, void 0, void 0, function () {
24945
+ var data, error_1, errorMessage;
24946
+ return __generator(this, function (_a) {
24947
+ switch (_a.label) {
24948
+ case 0:
24949
+ _a.trys.push([0, 2,, 3]);
24950
+
24951
+ updateLayerResult({
24952
+ layerId: layerId,
24953
+ data: '',
24954
+ isLoading: true
24955
+ });
24956
+ return [4
24957
+ /*yield*/
24958
+ , axios__default["default"].get(url)];
24959
+
24960
+ case 1:
24961
+ data = _a.sent().data;
24962
+ updateLayerResult({
24963
+ layerId: layerId,
24964
+ data: data,
24965
+ isLoading: false
24966
+ });
24967
+ return [3
24968
+ /*break*/
24969
+ , 3];
24970
+
24971
+ case 2:
24972
+ error_1 = _a.sent();
24973
+ errorMessage = error_1.message();
24974
+ updateLayerResult({
24975
+ layerId: layerId,
24976
+ data: errorMessage,
24977
+ isLoading: false
24978
+ });
24979
+ return [3
24980
+ /*break*/
24981
+ , 3];
24982
+
24983
+ case 3:
24984
+ return [2
24985
+ /*return*/
24986
+ ];
24987
+ }
24988
+ });
24989
+ });
24990
+ };
24991
+ /* Wait till the user has clicked the map. */
24992
+
24993
+
24994
+ React__default["default"].useEffect(function () {
24995
+ if (mapLocationWasChanged.current !== false) {
24996
+ setInitialMapLocationIsChanged(true);
24997
+ }
24998
+
24999
+ mapLocationWasChanged.current = true;
25000
+ }, [mapPinLocation]);
25001
+ /* For each changed getfeature url string, load new data using WMS GetFeatureInfo */
25002
+
25003
+ React__default["default"].useEffect(function () {
25004
+ if (isInitialMapLocationChanged && isOpen) {
25005
+ layerToUpdateList.forEach(function (_a) {
25006
+ var url = _a.url,
25007
+ layerId = _a.layerId;
25008
+ fetchLayerInfo(url, layerId);
25009
+ });
25010
+ } // eslint-disable-next-line react-hooks/exhaustive-deps
25011
+
25012
+ }, [debouncedlayerListString]);
25013
+ var hasLayers = layers && layers.length > 0;
25014
+ return /*#__PURE__*/React__default["default"].createElement(shared.ToolContainerDraggable, {
25015
+ startPosition: {
25016
+ right: 10,
25017
+ top: 80
25018
+ },
25019
+ minWidth: 300,
25020
+ onClose: onClose,
25021
+ title: showMapId ? "Event marker info " + mapId : 'Event marker info',
25022
+ headerSize: "small",
25023
+ initialMaxHeight: 440,
25024
+ isOpen: isOpen,
25025
+ "data-testid": "moveable-getfeatureinfo",
25026
+ bounds: "parent",
25027
+ onMouseDown: onMouseDown,
25028
+ order: order,
25029
+ source: source
25030
+ }, /*#__PURE__*/React__default["default"].createElement(material.Box, {
25031
+ sx: {
25032
+ padding: 0
25033
+ }
25034
+ }, isOpen && hasLayers && isInitialMapLocationChanged && /*#__PURE__*/React__default["default"].createElement(material.Box, {
25035
+ "data-testid": "GetFeatureInfoList"
25036
+ }, layerToUpdateList.map(function (layer) {
25037
+ var layerId = layer.layerId,
25038
+ title = layer.title,
25039
+ url = layer.url;
25040
+ var result = gfiResultMap.get(layerId);
25041
+ if (!result) return null;
25042
+ return /*#__PURE__*/React__default["default"].createElement(material.Grid, {
25043
+ key: layerId,
25044
+ sx: {
25045
+ margin: '4px 6px 4px 6px',
25046
+ padding: '6px',
25047
+ backgroundColor: 'geowebColors.cards.cardContainer',
25048
+ border: 'solid 1px',
25049
+ borderColor: 'geowebColors.cards.cardContainerBorder'
25050
+ }
25051
+ }, /*#__PURE__*/React__default["default"].createElement(material.Typography, {
25052
+ variant: "subtitle1"
25053
+ }, title, "\xA0", /*#__PURE__*/React__default["default"].createElement(material.IconButton, {
25054
+ sx: {
25055
+ "float": 'right'
25056
+ },
25057
+ size: "small",
25058
+ "aria-label": "Open layer featureinfo in another page",
25059
+ onClick: function onClick() {
25060
+ window.open(url);
25061
+ }
25062
+ }, /*#__PURE__*/React__default["default"].createElement(theme.ExitDomain, null))), !result.isLoading ? /*#__PURE__*/React__default["default"].createElement("div", {
25063
+ style: {
25064
+ fontSize: '11px',
25065
+ padding: '6px',
25066
+ margin: '0',
25067
+ fontFamily: 'Roboto,Helvetica,Arial,sans-serif',
25068
+ fontWeight: '400',
25069
+ lineHeight: '1.75',
25070
+ letterSpacing: '0.25px'
25071
+ },
25072
+ "data-testid": "layer-result-ready-" + layerId,
25073
+ // eslint-disable-next-line react/no-danger
25074
+ dangerouslySetInnerHTML: {
25075
+ __html: result.data.replace(/<hr\/>/g, '')
25076
+ }
25077
+ }) : /*#__PURE__*/React__default["default"].createElement("div", {
25078
+ "data-testid": "layer-result-loading-" + layerId
25079
+ }, /*#__PURE__*/React__default["default"].createElement(material.CircularProgress, {
25080
+ "data-testid": "spinner",
25081
+ color: "inherit"
25082
+ })));
25083
+ })), hasLayers && !isInitialMapLocationChanged && /*#__PURE__*/React__default["default"].createElement(material.Typography, {
25084
+ "data-testid": "click-on-map-for-info",
25085
+ variant: "subtitle1",
25086
+ sx: {
25087
+ padding: '10px'
25088
+ }
25089
+ }, "Click on the map for info."), !hasLayers && /*#__PURE__*/React__default["default"].createElement(material.Typography, {
25090
+ "data-testid": "NoLayers",
25091
+ variant: "subtitle1",
25092
+ sx: {
25093
+ padding: '10px'
25094
+ }
25095
+ }, "No layers added to the map.")));
25096
+ };
25097
+
25098
+ /* *
25099
+ * Licensed under the Apache License, Version 2.0 (the "License");
25100
+ * you may not use this file except in compliance with the License.
25101
+ * You may obtain a copy of the License at
25102
+ *
25103
+ * http://www.apache.org/licenses/LICENSE-2.0
25104
+ *
25105
+ * Unless required by applicable law or agreed to in writing, software
25106
+ * distributed under the License is distributed on an "AS IS" BASIS,
25107
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25108
+ * See the License for the specific language governing permissions and
25109
+ * limitations under the License.
25110
+ *
25111
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
25112
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
25113
+ * */
25114
+
25115
+ var GetFeatureInfoConnect = function GetFeatureInfoConnect(_a) {
25116
+ var _b = _a.showMapId,
25117
+ showMapId = _b === void 0 ? false : _b,
25118
+ mapId = _a.mapId;
25119
+ var dispatch = reactRedux.useDispatch();
25120
+ var getFeatureInfoType = "getfeatureinfo-" + mapId;
25121
+ var isMapPinVisible = reactRedux.useSelector(function (store) {
25122
+ return getDisplayMapPin(store, mapId);
25123
+ });
25124
+ var mapPinLocation = reactRedux.useSelector(function (store) {
25125
+ return getPinLocation(store, mapId);
25126
+ });
25127
+ var toggleMapPinIsVisible = React__namespace.useCallback(function (displayMapPin) {
25128
+ dispatch(mapActions$1.toggleMapPinIsVisible({
25129
+ mapId: mapId,
25130
+ displayMapPin: displayMapPin
25131
+ }));
25132
+ }, [dispatch, mapId]);
25133
+ var mapLayers = reactRedux.useSelector(function (store) {
25134
+ return getMapLayers(store, mapId);
25135
+ });
25136
+
25137
+ var _c = useSetupDialog(getFeatureInfoType),
25138
+ dialogOrder = _c.dialogOrder,
25139
+ isDialogOpen = _c.isDialogOpen,
25140
+ uiSource = _c.uiSource,
25141
+ setDialogOrder = _c.setDialogOrder,
25142
+ onCloseDialog = _c.onCloseDialog;
25143
+
25144
+ React__namespace.useEffect(function () {
25145
+ toggleMapPinIsVisible(isDialogOpen);
25146
+ }, [isDialogOpen, toggleMapPinIsVisible, isMapPinVisible]);
25147
+ return /*#__PURE__*/React__namespace.createElement(GetFeatureInfoDialog, {
25148
+ layers: mapLayers,
25149
+ isOpen: isDialogOpen,
25150
+ onClose: onCloseDialog,
25151
+ mapId: mapId,
25152
+ showMapId: showMapId,
25153
+ onMouseDown: setDialogOrder,
25154
+ order: dialogOrder,
25155
+ source: uiSource,
25156
+ mapPinLocation: mapPinLocation
25157
+ });
25158
+ };
25159
+
25160
+ /* *
25161
+ * Licensed under the Apache License, Version 2.0 (the "License");
25162
+ * you may not use this file except in compliance with the License.
25163
+ * You may obtain a copy of the License at
25164
+ *
25165
+ * http://www.apache.org/licenses/LICENSE-2.0
25166
+ *
25167
+ * Unless required by applicable law or agreed to in writing, software
25168
+ * distributed under the License is distributed on an "AS IS" BASIS,
25169
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25170
+ * See the License for the specific language governing permissions and
25171
+ * limitations under the License.
25172
+ *
25173
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
25174
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
25175
+ * */
25176
+
25177
+ var GetFeatureInfoButtonConnect = function GetFeatureInfoButtonConnect(_a) {
25178
+ var mapId = _a.mapId,
25179
+ _b = _a.source,
25180
+ source = _b === void 0 ? 'app' : _b;
25181
+ var dispatch = reactRedux.useDispatch();
25182
+ var gfiType = "getfeatureinfo-" + mapId;
25183
+ var isOpenInStore = reactRedux.useSelector(function (store) {
25184
+ return getisDialogOpen(store, gfiType);
25185
+ });
25186
+ var openGfiDialog = React__namespace.useCallback(function () {
25187
+ dispatch(uiActions.setActiveMapIdForDialog({
25188
+ type: gfiType,
25189
+ mapId: mapId,
25190
+ setOpen: !isOpenInStore,
25191
+ source: source,
25192
+ origin: MapActionOrigin.map
25193
+ }));
25194
+ }, [mapId, dispatch, isOpenInStore, source, gfiType]);
25195
+ return /*#__PURE__*/React__namespace.createElement(MapControlButton, {
25196
+ title: "Get information for a specific location",
25197
+ "data-testid": "open-getfeatureinfo",
25198
+ onClick: openGfiDialog,
25199
+ isActive: isOpenInStore
25200
+ }, /*#__PURE__*/React__namespace.createElement(theme.Info, null));
25201
+ };
25202
+
24355
25203
  /* *
24356
25204
  * Licensed under the Apache License, Version 2.0 (the "License");
24357
25205
  * you may not use this file except in compliance with the License.
@@ -24375,7 +25223,8 @@
24375
25223
  padding: '5px',
24376
25224
  zIndex: 50,
24377
25225
  color: theme.palette.common.black,
24378
- whiteSpace: 'nowrap'
25226
+ whiteSpace: 'nowrap',
25227
+ userSelect: 'none'
24379
25228
  };
24380
25229
  };
24381
25230
 
@@ -24420,8 +25269,10 @@
24420
25269
  shouldShowLayerManager = _a.shouldShowLayerManager,
24421
25270
  _q = _a.showClock,
24422
25271
  showClock = _q === void 0 ? true : _q,
25272
+ _r = _a.displayGetFeatureInfoButtonInMap,
25273
+ displayGetFeatureInfoButtonInMap = _r === void 0 ? false : _r,
24423
25274
  children = _a.children,
24424
- props = __rest(_a, ["id", "title", "layers", "shouldAutoUpdate", "shouldAnimate", "bbox", "srs", "shouldShowZoomControls", "displayMapPin", "showTimeSlider", "disableTimeSlider", "displayTimeInMap", "displayLayerManagerAndLegendButtonInMap", "displayDimensionSelectButtonInMap", "multiLegend", "shouldShowLayerManager", "showClock", "children"]);
25275
+ props = __rest(_a, ["id", "title", "layers", "shouldAutoUpdate", "shouldAnimate", "bbox", "srs", "shouldShowZoomControls", "displayMapPin", "showTimeSlider", "disableTimeSlider", "displayTimeInMap", "displayLayerManagerAndLegendButtonInMap", "displayDimensionSelectButtonInMap", "multiLegend", "shouldShowLayerManager", "showClock", "displayGetFeatureInfoButtonInMap", "children"]);
24425
25276
 
24426
25277
  var dispatch = reactRedux.useDispatch();
24427
25278
  var mapId = React__default["default"].useRef(id || generateMapId()).current;
@@ -24489,6 +25340,8 @@
24489
25340
  multiLegend: multiLegend
24490
25341
  }), displayDimensionSelectButtonInMap && /*#__PURE__*/React__default["default"].createElement(MultiDimensionSelectMapButtonsConnect, {
24491
25342
  mapId: mapId
25343
+ }), displayGetFeatureInfoButtonInMap && /*#__PURE__*/React__default["default"].createElement(GetFeatureInfoButtonConnect, {
25344
+ mapId: mapId
24492
25345
  })), !disableTimeSlider && /*#__PURE__*/React__default["default"].createElement(material.Box, {
24493
25346
  sx: {
24494
25347
  position: 'absolute',
@@ -24511,6 +25364,9 @@
24511
25364
  multiLegend: multiLegend
24512
25365
  }), showClock && /*#__PURE__*/React__default["default"].createElement(TimeSliderClockConnect, {
24513
25366
  mapId: mapId
25367
+ }), displayGetFeatureInfoButtonInMap && /*#__PURE__*/React__default["default"].createElement(GetFeatureInfoConnect, {
25368
+ showMapId: true,
25369
+ mapId: mapId
24514
25370
  }), /*#__PURE__*/React__default["default"].createElement(DockedLayerManagerConnect, {
24515
25371
  mapId: mapId,
24516
25372
  bounds: "parent"
@@ -24880,7 +25736,8 @@
24880
25736
  var mapPreset = initialProps.mapPreset;
24881
25737
  return /*#__PURE__*/React__default["default"].createElement(ConfigurableMapConnect, __assign({}, mapPreset, {
24882
25738
  id: id,
24883
- "data-testid": "coreConfigurableMapConnect"
25739
+ "data-testid": "coreConfigurableMapConnect",
25740
+ displayGetFeatureInfoButtonInMap: true
24884
25741
  }));
24885
25742
  }
24886
25743
 
@@ -25594,21 +26451,29 @@
25594
26451
  * */
25595
26452
  var MapWarningProperties = function MapWarningProperties(_a) {
25596
26453
  var selectedFeatureProperties = _a.selectedFeatureProperties,
25597
- languageIndex = _a.languageIndex;
26454
+ languageIndex = _a.languageIndex,
26455
+ parentSize = _a.parentSize;
25598
26456
  var language = languageIndex || 0;
26457
+ var newWidth = parentSize ? parentSize - 100 : 350;
25599
26458
  return /*#__PURE__*/React__default["default"].createElement("div", {
26459
+ style: {
26460
+ position: 'fixed',
26461
+ width: newWidth + "px",
26462
+ height: '1px',
26463
+ display: 'flex',
26464
+ justifyContent: 'center',
26465
+ left: '50px'
26466
+ }
26467
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
25600
26468
  "data-testid": "map-warning-properties",
25601
26469
  style: {
25602
- width: '100%',
25603
- height: '15%',
25604
- marginTop: '30px',
25605
- marginLeft: '100px',
25606
- position: 'relative',
25607
- zIndex: 10000,
25608
- backgroundColor: '#CCCCCCC0',
26470
+ marginTop: '50px',
26471
+ width: '350px',
26472
+ height: '190px',
25609
26473
  padding: '0px 20px 20px',
25610
26474
  overflow: 'auto',
25611
- fontSize: '11px'
26475
+ fontSize: '11px',
26476
+ backgroundColor: '#CCCCCCC0'
25612
26477
  }
25613
26478
  }, /*#__PURE__*/React__default["default"].createElement("h1", {
25614
26479
  "data-testid": "map-warning-properties-title"
@@ -25622,7 +26487,7 @@
25622
26487
  "data-testid": "map-warning-properties-row"
25623
26488
  }, "Sender: ", selectedFeatureProperties.languages[language].senderName), selectedFeatureProperties.identifier && /*#__PURE__*/React__default["default"].createElement("pre", {
25624
26489
  "data-testid": "map-warning-properties-row"
25625
- }, "Identifier: ", selectedFeatureProperties.identifier));
26490
+ }, "Identifier: ", selectedFeatureProperties.identifier)));
25626
26491
  };
25627
26492
 
25628
26493
  /* *