@opengeoweb/core 2.1.1 → 2.1.2

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 (75) hide show
  1. package/core.esm.js +965 -493
  2. package/core.umd.js +951 -419
  3. package/lib/components/ComponentsLookUp/componentsLookUp.d.ts +1 -0
  4. package/lib/components/ConfigurableConnectedMap/ConfigurableConnectedMap.d.ts +1 -0
  5. package/lib/components/ConfigurableMapWithSlider/ConfigurableMapWithSliderConnect.d.ts +1 -0
  6. package/lib/components/CustomSwitch/CustomSwitch.d.ts +3 -0
  7. package/lib/components/CustomSwitch/CustomSwitch.spec.d.ts +1 -0
  8. package/lib/components/CustomSwitch/CustomSwitch.stories.d.ts +3 -0
  9. package/lib/components/CustomSwitch/index.d.ts +1 -0
  10. package/lib/components/LayerManager/LayerContainerRow/LayerRow/DimensionSelect/DimensionSelect.d.ts +4 -5
  11. package/lib/components/LayerManager/LayerContainerRow/LayerRow/DimensionSelect/DimensionSelectConnect.d.ts +0 -1
  12. package/lib/components/LayerManager/LayerContainerRow/LayerRow/RenderStyles/RenderStyles.d.ts +5 -5
  13. package/lib/components/LayerManager/LayerContainerRow/LayerRow/RenderStyles/RenderStylesConnect.d.ts +0 -1
  14. package/lib/components/LayerManager/LayerSelect/KeywordFilterButton/KeywordFilterButton.d.ts +3 -0
  15. package/lib/components/LayerManager/LayerSelect/KeywordFilterButton/KeywordFilterButton.spec.d.ts +1 -0
  16. package/lib/components/LayerManager/LayerSelect/KeywordFilterButton/KeywordFilterButton.stories.d.ts +7 -0
  17. package/lib/components/LayerManager/LayerSelect/KeywordFilterResults/KeywordFilterResults.d.ts +11 -0
  18. package/lib/components/LayerManager/LayerSelect/KeywordFilterResults/KeywordFilterResults.spec.d.ts +1 -0
  19. package/lib/components/LayerManager/LayerSelect/KeywordFilterResults/KeywordFilterResultsConnect.d.ts +3 -0
  20. package/lib/components/LayerManager/LayerSelect/KeywordFilterResults/KeywordFilterResultsConnect.stories.d.ts +7 -0
  21. package/lib/components/LayerManager/LayerSelect/KeywordFilterResults/KeywordFilterResultsListItem.d.ts +10 -0
  22. package/lib/components/LayerManager/LayerSelect/KeywordFilterResults/KeywordFilterResultsListItem.spec.d.ts +1 -0
  23. package/lib/components/LayerManager/LayerSelect/KeywordFilterResults/mockServices.d.ts +42 -0
  24. package/lib/components/LayerManager/LayerSelect/LayerSelect.stories.d.ts +7 -7
  25. package/lib/components/LayerManager/LayerSelect/LayerSelectConnect.stories.d.ts +3 -0
  26. package/lib/components/LayerManager/LayerSelect/LayerSelectStories.stories.d.ts +6 -0
  27. package/lib/components/LayerManager/LayerSelect/SearchField/SearchField.d.ts +3 -0
  28. package/lib/components/LayerManager/LayerSelect/SearchField/SearchField.spec.d.ts +1 -0
  29. package/lib/components/LayerManager/LayerSelect/ServiceList/ServiceChip.d.ts +8 -0
  30. package/lib/components/LayerManager/LayerSelect/ServiceList/ServiceChip.spec.d.ts +1 -0
  31. package/lib/components/LayerManager/LayerSelect/ServiceList/ServiceList.d.ts +8 -0
  32. package/lib/components/LayerManager/LayerSelect/ServiceList/ServiceList.spec.d.ts +1 -0
  33. package/lib/components/LayerManager/LayerSelect/ServiceList/ServiceListConnect.d.ts +6 -0
  34. package/lib/components/LayerManager/LayerSelect/ServiceList/ServiceListConnect.spec.d.ts +1 -0
  35. package/lib/components/LayerManager/LayerSelect/ServiceOptionsButton/ServiceOptionsButton.d.ts +3 -0
  36. package/lib/components/LayerManager/LayerSelect/ServiceOptionsButton/ServiceOptionsButton.spec.d.ts +1 -0
  37. package/lib/components/LayerManager/LayerSelect/ServiceOptionsButton/ServiceOptionsButton.stories.d.ts +7 -0
  38. package/lib/components/LayerManager/LayerSelect/ServicePopup/ServicePopup.d.ts +0 -1
  39. package/lib/components/MapView/{MapView.MapCursor.stories.d.ts → MapView.MapPin.stories.d.ts} +1 -1
  40. package/lib/components/MapView/MapView.ShowLayerInfo.stories.d.ts +5 -0
  41. package/lib/components/MapView/MapView.stories.d.ts +2 -1
  42. package/lib/components/MapView/MapViewConnect.MapPin.stories.d.ts +5 -0
  43. package/lib/components/MapView/MapViewConnect.d.ts +5 -3
  44. package/lib/components/MapView/MapViewConnect.stories.d.ts +1 -0
  45. package/lib/components/ReactMapView/ReactMapView.d.ts +5 -1
  46. package/lib/components/ReactMapView/ReactMapViewParseLayer.d.ts +2 -2
  47. package/lib/components/ReactMapView/types.d.ts +6 -11
  48. package/lib/components/TimeSlider/TimeSliderButtons/PlayButton/PlayButtonConnect.d.ts +2 -3
  49. package/lib/components/TimeSlider/TimeSliderRail/TimeSliderRail.d.ts +4 -4
  50. package/lib/components/TimeSlider/TimeSliderUtils.d.ts +3 -1
  51. package/lib/store/coreModuleConfig.d.ts +1 -1
  52. package/lib/store/layerSelect/actions.d.ts +8 -0
  53. package/lib/store/layerSelect/config.d.ts +4 -0
  54. package/lib/store/layerSelect/constants.d.ts +1 -0
  55. package/lib/store/layerSelect/reducer.d.ts +3 -0
  56. package/lib/store/layerSelect/reducer.spec.d.ts +1 -0
  57. package/lib/store/layerSelect/selectors.d.ts +2 -0
  58. package/lib/store/layerSelect/selectors.spec.d.ts +1 -0
  59. package/lib/store/layerSelect/types.d.ts +19 -0
  60. package/lib/store/mapStore/layers/actions.d.ts +8 -1
  61. package/lib/store/mapStore/layers/constants.d.ts +1 -0
  62. package/lib/store/mapStore/layers/selectors.d.ts +18 -0
  63. package/lib/store/mapStore/layers/types.d.ts +21 -10
  64. package/lib/store/mapStore/map/actions.d.ts +11 -4
  65. package/lib/store/mapStore/map/constants.d.ts +1 -0
  66. package/lib/store/mapStore/map/selectors.d.ts +14 -6
  67. package/lib/store/mapStore/map/types.d.ts +19 -7
  68. package/lib/store/mapStore/service/actions.d.ts +1 -8
  69. package/lib/store/mapStore/service/constants.d.ts +0 -1
  70. package/lib/store/mapStore/service/selectors.d.ts +8 -0
  71. package/lib/store/mapStore/service/types.d.ts +8 -17
  72. package/lib/store/mapStore/utils/helpers.d.ts +4 -3
  73. package/lib/types/types.d.ts +2 -1
  74. package/lib/utils/defaultTestSettings.d.ts +45 -187
  75. package/package.json +6 -6
package/core.umd.js CHANGED
@@ -69,6 +69,7 @@
69
69
  var WEBMAP_SET_TIME_SLIDER_CENTER_TIME = 'WEBMAP_SET_TIME_SLIDER_CENTER_TIME';
70
70
  var WEBMAP_SET_TIME_SLIDER_SECONDS_PER_PX = 'WEBMAP_SET_TIME_SLIDER_SECONDS_PER_PX';
71
71
  var WEBMAP_SET_TIME_SLIDER_DATA_SCALE_TO_SECONDS_PER_PX = 'WEBMAP_SET_TIME_SLIDER_DATA_SCALE_TO_SECONDS_PER_PX';
72
+ var WEBMAP_SET_PIN = 'WEBMAP_SET_PIN';
72
73
 
73
74
  /* *
74
75
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -160,7 +161,7 @@
160
161
  * Starts the animation for a map.
161
162
  *
162
163
  * Example: mapStartAnimation({mapId:'mapId1', start: 'someISOTime', end: 'someISOTime', interval: 15})
163
- * @param {object} payload Object with mapId: string, start: Moment, end: Moment and interval: number (in minutes), timeList?: TimeListType[]
164
+ * @param {object} payload Object with mapId: string, start: string, end: string and interval: number (in minutes), timeList?: TimeListType[]
164
165
  */
165
166
 
166
167
  var mapStartAnimation = function mapStartAnimation(payload) {
@@ -277,7 +278,7 @@
277
278
  *Sets the animation start time with id for a map
278
279
  *
279
280
  * Example: setAnimationStartTime({ mapId: 'mapId1'})
280
- * @param {object} payload object with mapId: string, animationStartTime: Moment
281
+ * @param {object} payload object with mapId: string, animationStartTime: string
281
282
  */
282
283
 
283
284
  var setAnimationStartTime = function setAnimationStartTime(payload) {
@@ -290,7 +291,7 @@
290
291
  *Sets the animation end time with id for a map
291
292
  *
292
293
  * Example: setAnimationEndTime({ mapId: 'mapId1'})
293
- * @param {object} payload object with mapId: string, animationEndTime: Moment
294
+ * @param {object} payload object with mapId: string, animationEndTime: string
294
295
  */
295
296
 
296
297
  var setAnimationEndTime = function setAnimationEndTime(payload) {
@@ -364,6 +365,19 @@
364
365
  payload: payload
365
366
  };
366
367
  };
368
+ /**
369
+ * Sets current curser location for a map to display the point marker
370
+ *
371
+ * Example: setMapPinLocation({ mapId: 'mapId1', mapPinLocation: {lon: 1.2, lat: 3.4} })
372
+ * @param {object} payload object with mapId: string, mapPinLocation: MapLocation
373
+ */
374
+
375
+ var setMapPinLocation = function setMapPinLocation(payload) {
376
+ return {
377
+ type: WEBMAP_SET_PIN,
378
+ payload: payload
379
+ };
380
+ };
367
381
 
368
382
  /* *
369
383
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -386,6 +400,7 @@
386
400
  var WEBMAP_LAYER_CHANGE_STYLE = 'WEBMAP_LAYER_CHANGE_STYLE';
387
401
  var WEBMAP_LAYER_CHANGE_DIMENSION = 'WEBMAP_LAYER_CHANGE_DIMENSION';
388
402
  var WEBMAP_LAYER_SET_DIMENSIONS = 'WEBMAP_LAYER_SET_DIMENSIONS';
403
+ var WEBMAP_LAYER_SET_STYLES = 'WEBMAP_LAYER_SET_STYLES';
389
404
  var WEBMAP_LAYER_CHANGE_ENABLED = 'WEBMAP_LAYER_CHANGE_ENABLED';
390
405
  var WEBMAP_LAYER_DELETE = 'WEBMAP_LAYER_DELETE';
391
406
  var WEBMAP_LAYER_ERROR = 'WEBMAP_LAYER_ERROR';
@@ -534,6 +549,19 @@
534
549
  payload: payload
535
550
  };
536
551
  };
552
+ /**
553
+ * Action layerSetStyles is used automatically after calling the setLayers action. Contents is based on WMS GetCapabilities
554
+ *
555
+ * Example: layerSetStyles({service: someService, name: 'layerName', styles: styleArray})
556
+ * @param {object} payload consisting of service: string, name: string, styles: Style[]
557
+ */
558
+
559
+ var layerSetStyles = function layerSetStyles(payload) {
560
+ return {
561
+ type: WEBMAP_LAYER_SET_STYLES,
562
+ payload: payload
563
+ };
564
+ };
537
565
  /**
538
566
  * Changes the name of the layer
539
567
  *
@@ -647,7 +675,6 @@
647
675
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
648
676
  * */
649
677
  var MAP_SERVICES_SET_LAYERS = 'MAP_SERVICES_SET_LAYERS';
650
- var MAP_SERVICES_LAYER_SET_STYLES = 'MAP_SERVICES_LAYER_SET_STYLES';
651
678
 
652
679
  /* *
653
680
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -678,19 +705,6 @@
678
705
  payload: payload
679
706
  };
680
707
  };
681
- /**
682
- * Action layerSetStyles is used automatically after calling the setLayers action. Contents is based on WMS GetCapabilities
683
- *
684
- * Example: layerSetStyles({service: someService, name: 'layerName', styles: styleArray})
685
- * @param {object} payload consisting of service: string, name: string, styles: Style[]
686
- */
687
-
688
- var layerSetStyles = function layerSetStyles(payload) {
689
- return {
690
- type: MAP_SERVICES_LAYER_SET_STYLES,
691
- payload: payload
692
- };
693
- };
694
708
 
695
709
  /* *
696
710
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -732,6 +746,7 @@
732
746
  setTimeSliderCenterTime: setTimeSliderCenterTime,
733
747
  setTimeSliderSecondsPerPx: setTimeSliderSecondsPerPx,
734
748
  setTimeSliderDataScaleToSecondsPerPx: setTimeSliderDataScaleToSecondsPerPx,
749
+ setMapPinLocation: setMapPinLocation,
735
750
  setLayers: setLayers,
736
751
  setBaseLayers: setBaseLayers,
737
752
  addBaseLayer: addBaseLayer,
@@ -740,6 +755,7 @@
740
755
  layerChangeEnabled: layerChangeEnabled,
741
756
  layerChangeDimension: layerChangeDimension,
742
757
  layerSetDimensions: layerSetDimensions,
758
+ layerSetStyles: layerSetStyles,
743
759
  layerChangeName: layerChangeName,
744
760
  layerChangeStyle: layerChangeStyle,
745
761
  layerDelete: layerDelete,
@@ -747,8 +763,7 @@
747
763
  layerError: layerError,
748
764
  addAvailableBaseLayer: addAvailableBaseLayer,
749
765
  addAvailableBaseLayers: addAvailableBaseLayers,
750
- serviceSetLayers: serviceSetLayers,
751
- layerSetStyles: layerSetStyles
766
+ serviceSetLayers: serviceSetLayers
752
767
  });
753
768
 
754
769
  /* *
@@ -797,6 +812,7 @@
797
812
  * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
798
813
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
799
814
  * */
815
+ var dateFormat = 'YYYY-MM-DDTHH:mm:ss[Z]';
800
816
  var generatedLayerIds = 0;
801
817
  var generateLayerId = function generateLayerId() {
802
818
  generatedLayerIds += 1;
@@ -862,19 +878,19 @@
862
878
  return registeredWMMapForReactMapId[wmjsMapId];
863
879
  };
864
880
  /**
865
- * Returns the WMJSDimension object for given layerId and Dimension
881
+ * Returns the WMJSDimension object for given layerId and dimension name
866
882
  * @param layerId The layerId
867
- * @param dimension The dimension to lookup
883
+ * @param dimensionName The dimension to lookup
868
884
  */
869
885
 
870
- var getWMJSDimensionForLayerAndDimension = function getWMJSDimensionForLayerAndDimension(layerId, dimension) {
886
+ var getWMJSDimensionForLayerAndDimension = function getWMJSDimensionForLayerAndDimension(layerId, dimensionName) {
871
887
  var wmLayer = getWMLayerById(layerId);
872
888
 
873
- if (!wmLayer || !dimension) {
889
+ if (!wmLayer || !dimensionName) {
874
890
  return null;
875
891
  }
876
892
 
877
- var wmjsDimension = wmLayer.getDimension(dimension.name);
893
+ var wmjsDimension = wmLayer.getDimension(dimensionName);
878
894
 
879
895
  if (!wmjsDimension) {
880
896
  return null;
@@ -1094,6 +1110,18 @@
1094
1110
  return layer.layerType === LayerType.overLayer;
1095
1111
  });
1096
1112
  });
1113
+ /**
1114
+ * Gets styles of the passed layer
1115
+ *
1116
+ * Example: layerStyles = getLayerStyles(store, 'layerId_1')
1117
+ * @param {object} store store: object - object from which the layers state will be extracted
1118
+ * @param {string} layerId layerId: string - Id of the layer
1119
+ * @returns {array} returnType: Style[] - array containing layer styles
1120
+ */
1121
+
1122
+ var getLayerStyles = reselect.createSelector(getLayerById, function (layer) {
1123
+ return layer && layer.styles ? layer.styles : [];
1124
+ });
1097
1125
  /**
1098
1126
  * Gets dimensions of the passed layer
1099
1127
  *
@@ -1197,6 +1225,18 @@
1197
1225
  var getLayerService = reselect.createSelector(getLayerById, function (layer) {
1198
1226
  return layer && layer.service ? layer.service : '';
1199
1227
  });
1228
+ /**
1229
+ * Gets selected style of the passed layer
1230
+ *
1231
+ * Example: layerStyle = getLayerStyle(store, 'layerId_1')
1232
+ * @param {object} store store: object - object from which the layers state will be extracted
1233
+ * @param {string} layerId layerId: string - Id of the layer
1234
+ * @returns {string} returnType: string - style that is currently selected
1235
+ */
1236
+
1237
+ var getLayerStyle = reselect.createSelector(getLayerById, function (layer) {
1238
+ return layer && layer.style ? layer.style : '';
1239
+ });
1200
1240
  /**
1201
1241
  * Gets layer status
1202
1242
  *
@@ -1500,10 +1540,29 @@
1500
1540
  */
1501
1541
  [2147483647, 0]);
1502
1542
  };
1503
- var getValueFromEvent = function getValueFromEvent(event, newValue, sliderChangeFunction, sliderSetFunction) {
1504
- if (event.type === 'touchstart' || event.type === 'touchmove' || event.type === 'mousedown' || event.type === 'mousemove' || (event.ctrlKey || event.metaKey) && (event.key === 'ArrowDown' || event.key === 'ArrowUp')) {
1505
- sliderSetFunction(sliderChangeFunction(newValue));
1543
+ var getNextTimeStepvalue = function getNextTimeStepvalue(value, max) {
1544
+ var newValue = value + 1;
1545
+ return newValue > max ? max : newValue;
1546
+ };
1547
+ var getPreviousTimeStepvalue = function getPreviousTimeStepvalue(value, min) {
1548
+ var newValue = value - 1;
1549
+ return newValue < min ? min : newValue;
1550
+ };
1551
+ var getValueFromKeyboardEvent = function getValueFromKeyboardEvent(event, value, min, max) {
1552
+ if (event.ctrlKey || event.metaKey) {
1553
+ switch (event.key) {
1554
+ case 'ArrowDown':
1555
+ return getPreviousTimeStepvalue(value, min);
1556
+
1557
+ case 'ArrowUp':
1558
+ return getNextTimeStepvalue(value, max);
1559
+
1560
+ default:
1561
+ return null;
1562
+ }
1506
1563
  }
1564
+
1565
+ return null;
1507
1566
  };
1508
1567
  var getTimeStepFromDataInterval = function getTimeStepFromDataInterval(timeInterval) {
1509
1568
  switch (timeInterval.isRegularInterval) {
@@ -1668,9 +1727,9 @@
1668
1727
  _b = _a.isAnimating,
1669
1728
  isAnimating = _b === void 0 ? false : _b,
1670
1729
  _c = _a.animationStartTime,
1671
- animationStartTime = _c === void 0 ? moment__default["default"].utc(moment__default["default"]().unix() * 1000).subtract(5, 'h').toISOString() : _c,
1730
+ animationStartTime = _c === void 0 ? moment__default["default"].utc(moment__default["default"]().unix() * 1000).subtract(5, 'h').format(dateFormat) : _c,
1672
1731
  _d = _a.animationEndTime,
1673
- animationEndTime = _d === void 0 ? moment__default["default"].utc(moment__default["default"]().unix() * 1000).subtract(10, 'm').toISOString() : _d,
1732
+ animationEndTime = _d === void 0 ? moment__default["default"].utc(moment__default["default"]().unix() * 1000).subtract(10, 'm').format(dateFormat) : _d,
1674
1733
  _e = _a.isAutoUpdating,
1675
1734
  isAutoUpdating = _e === void 0 ? false : _e,
1676
1735
  _f = _a.isLooping,
@@ -1840,7 +1899,7 @@
1840
1899
  */
1841
1900
 
1842
1901
  var produceDraftStateSetMapDimensionFromLayerChangeDimension = function produceDraftStateSetMapDimensionFromLayerChangeDimension(draft, layerId, dimension) {
1843
- var wmjsDimension = getWMJSDimensionForLayerAndDimension(layerId, dimension);
1902
+ var wmjsDimension = getWMJSDimensionForLayerAndDimension(layerId, dimension.name);
1844
1903
 
1845
1904
  if (!wmjsDimension) {
1846
1905
  return;
@@ -2129,23 +2188,23 @@
2129
2188
  * Example: endTimeOfAnimetion = getAnimationStartTime(store, 'mapid_1')
2130
2189
  * @param {object} store store: object - store object
2131
2190
  * @param {string} mapId mapId: string - Id of the map
2132
- * @returns {moment} returnType: Moment
2191
+ * @returns {string} returnType: string
2133
2192
  */
2134
2193
 
2135
2194
  var getAnimationStartTime = reselect.createSelector(getMapById, function (store) {
2136
- return store ? moment__default["default"](store.animationStartTime) : moment__default["default"].utc().subtract(6, 'h');
2195
+ return store ? store.animationStartTime : moment__default["default"].utc().subtract(6, 'h').format(dateFormat);
2137
2196
  });
2138
2197
  /**
2139
2198
  * Gets end time of animation
2140
2199
  *
2141
- * Example: endTimeOfAnimetion = getAnimationEndTime(store, 'mapid_1')
2200
+ * Example: endTimeOfAnimation = getAnimationEndTime(store, 'mapid_1')
2142
2201
  * @param {object} store store: object - store object
2143
2202
  * @param {string} mapId mapId: string - Id of the map
2144
- * @returns {moment} returnType: Moment
2203
+ * @returns {string} returnType: string
2145
2204
  */
2146
2205
 
2147
2206
  var getAnimationEndTime = reselect.createSelector(getMapById, function (store) {
2148
- return store ? moment__default["default"](store.animationEndTime) : moment__default["default"].utc().subtract(10, 'm');
2207
+ return store ? store.animationEndTime : moment__default["default"].utc().subtract(10, 'm').format(dateFormat);
2149
2208
  });
2150
2209
  /**
2151
2210
  * Returns map is auto updating
@@ -2389,6 +2448,18 @@
2389
2448
  return uniqueMapDims;
2390
2449
  }, []);
2391
2450
  });
2451
+ /**
2452
+ * Returns the mapPinLocation for the current map
2453
+ *
2454
+ * Example getAllUniqueDimensions(store);
2455
+ * @param {object} store store: object - store object
2456
+ * @param {string} mapId mapId: string - Id of the map
2457
+ * @returns {object} returnType: latitude and longitude of pin
2458
+ */
2459
+
2460
+ var getPinLocation = reselect.createSelector(getMapById, function (store) {
2461
+ return store ? store.mapPinLocation : {};
2462
+ });
2392
2463
 
2393
2464
  /* *
2394
2465
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -2448,6 +2519,25 @@
2448
2519
 
2449
2520
  return null;
2450
2521
  };
2522
+ /**
2523
+ * Gets all keywords from services
2524
+ *
2525
+ * const keywords = useSelector((store) => mapSelectors.getKeywords(store));
2526
+ * @param {object} store store: object - Store object
2527
+ * @returns {array} returnType: Keyword[]
2528
+ */
2529
+
2530
+ var getKeywords = reselect.createSelector(servicesStore, function (store) {
2531
+ var keywords = store ? store.allIds.flatMap(function (id) {
2532
+ return store.byId[id].layers.flatMap(function (layer) {
2533
+ return layer.keywords;
2534
+ });
2535
+ }) : null;
2536
+
2537
+ var uniqueKeywords = __spreadArray([], __read(new Set(keywords)));
2538
+
2539
+ return uniqueKeywords;
2540
+ });
2451
2541
 
2452
2542
  /* *
2453
2543
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -2503,6 +2593,7 @@
2503
2593
  getLayerIndexByLayerId: getLayerIndexByLayerId,
2504
2594
  getLayerByLayerIndex: getLayerByLayerIndex,
2505
2595
  getAllUniqueDimensions: getAllUniqueDimensions,
2596
+ getPinLocation: getPinLocation,
2506
2597
  getLayerById: getLayerById,
2507
2598
  getLayersById: getLayersById,
2508
2599
  getLayersIds: getLayersIds,
@@ -2510,6 +2601,7 @@
2510
2601
  getLayers: getLayers,
2511
2602
  getBaseLayers: getBaseLayers,
2512
2603
  getOverLayers: getOverLayers,
2604
+ getLayerStyles: getLayerStyles,
2513
2605
  getLayerDimensions: getLayerDimensions,
2514
2606
  getLayerNonTimeDimensions: getLayerNonTimeDimensions,
2515
2607
  getLayerTimeDimension: getLayerTimeDimension,
@@ -2518,11 +2610,13 @@
2518
2610
  getLayerEnabled: getLayerEnabled,
2519
2611
  getLayerName: getLayerName,
2520
2612
  getLayerService: getLayerService,
2613
+ getLayerStyle: getLayerStyle,
2521
2614
  getLayerStatus: getLayerStatus,
2522
2615
  getAvailableBaseLayersForMap: getAvailableBaseLayersForMap,
2523
2616
  getServiceIds: getServiceIds,
2524
2617
  getServices: getServices,
2525
- getServiceLayersByName: getServiceLayersByName
2618
+ getServiceLayersByName: getServiceLayersByName,
2619
+ getKeywords: getKeywords
2526
2620
  });
2527
2621
 
2528
2622
  /* *
@@ -2565,11 +2659,13 @@
2565
2659
  WEBMAP_SET_TIME_SLIDER_CENTER_TIME: WEBMAP_SET_TIME_SLIDER_CENTER_TIME,
2566
2660
  WEBMAP_SET_TIME_SLIDER_SECONDS_PER_PX: WEBMAP_SET_TIME_SLIDER_SECONDS_PER_PX,
2567
2661
  WEBMAP_SET_TIME_SLIDER_DATA_SCALE_TO_SECONDS_PER_PX: WEBMAP_SET_TIME_SLIDER_DATA_SCALE_TO_SECONDS_PER_PX,
2662
+ WEBMAP_SET_PIN: WEBMAP_SET_PIN,
2568
2663
  WEBMAP_LAYER_CHANGE_OPACITY: WEBMAP_LAYER_CHANGE_OPACITY,
2569
2664
  WEBMAP_LAYER_CHANGE_NAME: WEBMAP_LAYER_CHANGE_NAME,
2570
2665
  WEBMAP_LAYER_CHANGE_STYLE: WEBMAP_LAYER_CHANGE_STYLE,
2571
2666
  WEBMAP_LAYER_CHANGE_DIMENSION: WEBMAP_LAYER_CHANGE_DIMENSION,
2572
2667
  WEBMAP_LAYER_SET_DIMENSIONS: WEBMAP_LAYER_SET_DIMENSIONS,
2668
+ WEBMAP_LAYER_SET_STYLES: WEBMAP_LAYER_SET_STYLES,
2573
2669
  WEBMAP_LAYER_CHANGE_ENABLED: WEBMAP_LAYER_CHANGE_ENABLED,
2574
2670
  WEBMAP_LAYER_DELETE: WEBMAP_LAYER_DELETE,
2575
2671
  WEBMAP_LAYER_ERROR: WEBMAP_LAYER_ERROR,
@@ -2580,8 +2676,7 @@
2580
2676
  WEBMAP_ADD_BASELAYER: WEBMAP_ADD_BASELAYER,
2581
2677
  WEBMAP_ADD_AVAILABLE_BASELAYER: WEBMAP_ADD_AVAILABLE_BASELAYER,
2582
2678
  WEBMAP_ADD_AVAILABLE_BASELAYERS: WEBMAP_ADD_AVAILABLE_BASELAYERS,
2583
- MAP_SERVICES_SET_LAYERS: MAP_SERVICES_SET_LAYERS,
2584
- MAP_SERVICES_LAYER_SET_STYLES: MAP_SERVICES_LAYER_SET_STYLES
2679
+ MAP_SERVICES_SET_LAYERS: MAP_SERVICES_SET_LAYERS
2585
2680
  });
2586
2681
 
2587
2682
  /* *
@@ -3127,7 +3222,7 @@
3127
3222
  var layer = draft.byId[layerId];
3128
3223
 
3129
3224
  if (layer && layer.mapId === mapId) {
3130
- var wmjsDimension = getWMJSDimensionForLayerAndDimension(layerId, dimension);
3225
+ var wmjsDimension = getWMJSDimensionForLayerAndDimension(layerId, dimension.name);
3131
3226
 
3132
3227
  if (wmjsDimension && wmjsDimension.linked && wmjsDimension.name === 'reference_time') {
3133
3228
  wmjsDimension.linked = false;
@@ -3213,7 +3308,7 @@
3213
3308
  status: status
3214
3309
  });
3215
3310
  };
3216
- var initialState$4 = {
3311
+ var initialState$5 = {
3217
3312
  byId: {},
3218
3313
  allIds: [],
3219
3314
  availableBaseLayers: {
@@ -3221,9 +3316,9 @@
3221
3316
  allIds: []
3222
3317
  }
3223
3318
  };
3224
- var reducer$4 = function reducer(state, action) {
3319
+ var reducer$5 = function reducer(state, action) {
3225
3320
  if (state === void 0) {
3226
- state = initialState$4;
3321
+ state = initialState$5;
3227
3322
  }
3228
3323
 
3229
3324
  switch (action.type) {
@@ -3505,6 +3600,18 @@
3505
3600
  });
3506
3601
  }
3507
3602
 
3603
+ case WEBMAP_LAYER_SET_STYLES:
3604
+ {
3605
+ var _m = action.payload,
3606
+ styles_1 = _m.styles,
3607
+ layerId_10 = _m.layerId;
3608
+ return produce__default["default"](state, function (draft) {
3609
+ if (draft.byId[layerId_10]) {
3610
+ draft.byId[layerId_10].styles = styles_1;
3611
+ }
3612
+ });
3613
+ }
3614
+
3508
3615
  case WEBMAP_ADD_AVAILABLE_BASELAYER:
3509
3616
  {
3510
3617
  var layer_3 = action.payload.layer;
@@ -3541,11 +3648,11 @@
3541
3648
  }
3542
3649
  };
3543
3650
 
3544
- var reducer$5 = /*#__PURE__*/Object.freeze({
3651
+ var reducer$6 = /*#__PURE__*/Object.freeze({
3545
3652
  __proto__: null,
3546
3653
  createLayer: createLayer,
3547
- initialState: initialState$4,
3548
- reducer: reducer$4
3654
+ initialState: initialState$5,
3655
+ reducer: reducer$5
3549
3656
  });
3550
3657
 
3551
3658
  /* *
@@ -3602,7 +3709,7 @@
3602
3709
  * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3603
3710
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
3604
3711
  * */
3605
- var initialState$3 = {
3712
+ var initialState$4 = {
3606
3713
  sources: {
3607
3714
  byId: {},
3608
3715
  allIds: []
@@ -3612,9 +3719,9 @@
3612
3719
  allIds: []
3613
3720
  }
3614
3721
  };
3615
- var reducer$3 = function reducer(state, action) {
3722
+ var reducer$4 = function reducer(state, action) {
3616
3723
  if (state === void 0) {
3617
- state = initialState$3;
3724
+ state = initialState$4;
3618
3725
  }
3619
3726
 
3620
3727
  switch (action.type) {
@@ -3822,7 +3929,7 @@
3822
3929
  });
3823
3930
 
3824
3931
  case SYNCGROUPS_CLEAR:
3825
- return initialState$3;
3932
+ return initialState$4;
3826
3933
 
3827
3934
  default:
3828
3935
  return state;
@@ -4240,6 +4347,8 @@
4240
4347
 
4241
4348
  var done = function done(layers) {
4242
4349
  onServiceSetLayers && onServiceSetLayers({
4350
+ id: wmLayer.service,
4351
+ name: wmLayer.title,
4243
4352
  service: wmLayer.service,
4244
4353
  layers: layers
4245
4354
  });
@@ -4247,8 +4356,7 @@
4247
4356
 
4248
4357
  onLayerSetStyles && onLayerSetStyles({
4249
4358
  origin: origin,
4250
- service: wmLayer.service,
4251
- name: wmLayer.name,
4359
+ layerId: wmLayer.id,
4252
4360
  styles: wmLayer.getStyles()
4253
4361
  });
4254
4362
  /* Select first style in service for a layer */
@@ -4259,35 +4367,8 @@
4259
4367
  style: wmLayer.currentStyle // || wmjsLayer.getStyles().length > 0 ? wmjsLayer.getStyles()[0].Name.value : 'default'
4260
4368
 
4261
4369
  });
4262
- var mapNeedsUpdate = false;
4263
-
4264
- var _loop_1 = function _loop_1(d) {
4265
- if (wmLayer.reactWebMapJSLayer && wmLayer.reactWebMapJSLayer.props.dimensions) {
4266
- /* Try to set the dimension according to the react layer properties */
4267
- var reactLayerDimension = wmLayer.reactWebMapJSLayer.props.dimensions.find(function (dim) {
4268
- return dim.name === wmLayer.dimensions[d].name;
4269
- });
4270
-
4271
- if (reactLayerDimension && reactLayerDimension.currentValue) {
4272
- if (reactLayerDimension.currentValue !== wmLayer.dimensions[d].currentValue) {
4273
- // eslint-disable-next-line no-param-reassign
4274
- wmLayer.dimensions[d].currentValue = reactLayerDimension.currentValue; // eslint-disable-next-line no-param-reassign
4275
-
4276
- wmLayer.dimensions[d].synced = reactLayerDimension.synced;
4277
- mapNeedsUpdate = true;
4278
- }
4279
- }
4280
- }
4281
- };
4282
- /* Synchronize layer dimension properties to wmjslayer dimension values */
4283
-
4284
-
4285
- for (var d = 0; d < wmLayer.dimensions.length; d += 1) {
4286
- _loop_1(d);
4287
- }
4288
4370
  /* Trigger update of all map dimensions */
4289
4371
 
4290
-
4291
4372
  onMapUpdateAllDimensions && onMapUpdateAllDimensions({
4292
4373
  origin: origin,
4293
4374
  mapId: mapId,
@@ -4335,12 +4416,6 @@
4335
4416
  };
4336
4417
  })
4337
4418
  });
4338
-
4339
- if (mapNeedsUpdate) {
4340
- if (wmLayer.parentMaps && wmLayer.parentMaps.length > 0) {
4341
- wmLayer.parentMaps[0].draw();
4342
- }
4343
- }
4344
4419
  };
4345
4420
 
4346
4421
  service.getLayerObjectsFlat(done, function () {// do nothing
@@ -4942,7 +5017,7 @@
4942
5017
  var synchronizationGroupConfig = {
4943
5018
  id: 'syncronizationGroupStore-module',
4944
5019
  reducerMap: {
4945
- syncronizationGroupStore: reducer$3
5020
+ syncronizationGroupStore: reducer$4
4946
5021
  },
4947
5022
  sagas: [rootSaga$3, rootSaga$2]
4948
5023
  };
@@ -4963,7 +5038,7 @@
4963
5038
  * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
4964
5039
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
4965
5040
  * */
4966
- var useStyles$A = core.makeStyles(function (theme) {
5041
+ var useStyles$E = core.makeStyles(function (theme) {
4967
5042
  return {
4968
5043
  select: {
4969
5044
  '& ul': {
@@ -5016,7 +5091,21 @@
5016
5091
  tooltipOpen = _f[0],
5017
5092
  setTooltipOpen = _f[1];
5018
5093
 
5019
- var classes = useStyles$A();
5094
+ var classes = useStyles$E();
5095
+
5096
+ var preventDefault = function preventDefault(event) {
5097
+ event.preventDefault();
5098
+ event.stopPropagation();
5099
+ };
5100
+
5101
+ var enableScroll = React__namespace.useCallback(function () {
5102
+ document.removeEventListener('wheel', preventDefault, false);
5103
+ }, []);
5104
+ var disableScroll = React__namespace.useCallback(function () {
5105
+ document.addEventListener('wheel', preventDefault, {
5106
+ passive: false
5107
+ });
5108
+ }, []);
5020
5109
  var onWheel = React__namespace.useCallback(function (event) {
5021
5110
  if (selectOpen) return;
5022
5111
  var direction = event.deltaY < 0 ? 1 : -1;
@@ -5031,22 +5120,21 @@
5031
5120
  setSelectOpen(false);
5032
5121
  }, []);
5033
5122
  var onMouseEnter = React__namespace.useCallback(function () {
5123
+ disableScroll();
5034
5124
  if (!selectOpen) setTooltipOpen(true);
5035
- }, [selectOpen]);
5125
+ }, [selectOpen, disableScroll]);
5036
5126
  var onMouseLeave = React__namespace.useCallback(function () {
5127
+ enableScroll();
5037
5128
  setTooltipOpen(false);
5038
- }, []);
5129
+ }, [enableScroll]);
5039
5130
  var onFocus = React__namespace.useCallback(function () {
5131
+ disableScroll();
5040
5132
  setTooltipOpen(true);
5041
- }, []);
5133
+ }, [disableScroll]);
5042
5134
  var onBlur = React__namespace.useCallback(function () {
5135
+ enableScroll();
5043
5136
  setTooltipOpen(false);
5044
- }, []);
5045
- React__namespace.useEffect(function () {
5046
- if (selectOpen === false) {
5047
- setTooltipOpen(false);
5048
- }
5049
- }, [selectOpen]);
5137
+ }, [enableScroll]);
5050
5138
  return /*#__PURE__*/React__namespace.createElement(core.Tooltip, {
5051
5139
  title: tooltip,
5052
5140
  placement: "top",
@@ -5110,7 +5198,7 @@
5110
5198
  actions: actions$1,
5111
5199
  constants: constants,
5112
5200
  types: types,
5113
- initialState: initialState$3
5201
+ initialState: initialState$4
5114
5202
  });
5115
5203
 
5116
5204
  /* *
@@ -5151,13 +5239,13 @@
5151
5239
  source: source
5152
5240
  };
5153
5241
  };
5154
- var initialState$2 = {
5242
+ var initialState$3 = {
5155
5243
  order: [],
5156
5244
  dialogs: {}
5157
5245
  };
5158
- var reducer$2 = function reducer(state, action) {
5246
+ var reducer$3 = function reducer(state, action) {
5159
5247
  if (state === void 0) {
5160
- state = initialState$2;
5248
+ state = initialState$3;
5161
5249
  }
5162
5250
 
5163
5251
  switch (action.type) {
@@ -5522,7 +5610,7 @@
5522
5610
  var uiModuleConfig = {
5523
5611
  id: 'ui-module',
5524
5612
  reducerMap: {
5525
- ui: reducer$2
5613
+ ui: reducer$3
5526
5614
  },
5527
5615
  sagas: [rootSaga$1]
5528
5616
  };
@@ -5584,13 +5672,13 @@
5584
5672
  });
5585
5673
  };
5586
5674
 
5587
- var initialState$1 = {
5675
+ var initialState$2 = {
5588
5676
  byId: {},
5589
5677
  allIds: []
5590
5678
  };
5591
- var reducer$1 = function reducer(state, action) {
5679
+ var reducer$2 = function reducer(state, action) {
5592
5680
  if (state === void 0) {
5593
- state = initialState$1;
5681
+ state = initialState$2;
5594
5682
  }
5595
5683
 
5596
5684
  switch (action.type) {
@@ -5702,11 +5790,11 @@
5702
5790
  draft.byId[mapId_7].isAnimating = true;
5703
5791
 
5704
5792
  if (action.payload.start) {
5705
- draft.byId[mapId_7].animationStartTime = action.payload.start.toISOString();
5793
+ draft.byId[mapId_7].animationStartTime = action.payload.start;
5706
5794
  }
5707
5795
 
5708
5796
  if (action.payload.end) {
5709
- draft.byId[mapId_7].animationEndTime = action.payload.end.toISOString();
5797
+ draft.byId[mapId_7].animationEndTime = action.payload.end;
5710
5798
  }
5711
5799
 
5712
5800
  if (action.payload.interval && action.payload.interval !== draft.byId[mapId_7].timeStep) {
@@ -5803,7 +5891,7 @@
5803
5891
  }
5804
5892
 
5805
5893
  return produce.produce(state, function (draft) {
5806
- draft.byId[mapId_12].animationStartTime = animationStartTime_1.toISOString();
5894
+ draft.byId[mapId_12].animationStartTime = animationStartTime_1;
5807
5895
  });
5808
5896
  }
5809
5897
 
@@ -5818,7 +5906,7 @@
5818
5906
  }
5819
5907
 
5820
5908
  return produce.produce(state, function (draft) {
5821
- draft.byId[mapId_13].animationEndTime = animationEndTime_1.toISOString();
5909
+ draft.byId[mapId_13].animationEndTime = animationEndTime_1;
5822
5910
  });
5823
5911
  }
5824
5912
  // LAYER actions
@@ -6153,6 +6241,21 @@
6153
6241
  });
6154
6242
  }
6155
6243
 
6244
+ case WEBMAP_SET_PIN:
6245
+ {
6246
+ var _0 = action.payload,
6247
+ mapId_28 = _0.mapId,
6248
+ mapPinLocation_1 = _0.mapPinLocation;
6249
+
6250
+ if (!state.byId[mapId_28]) {
6251
+ return state;
6252
+ }
6253
+
6254
+ return produce.produce(state, function (draft) {
6255
+ draft.byId[mapId_28].mapPinLocation = mapPinLocation_1;
6256
+ });
6257
+ }
6258
+
6156
6259
  case GENERIC_SYNC_SETLAYERACTIONS:
6157
6260
  {
6158
6261
  /*
@@ -6161,9 +6264,9 @@
6161
6264
  * These targets can be used as payloads in new Layer actions.
6162
6265
  * These actions are here handled via the layer reducer, as it is the same logic
6163
6266
  */
6164
- var _0 = action.payload,
6165
- targets = _0.targets,
6166
- source_1 = _0.source;
6267
+ var _1 = action.payload,
6268
+ targets = _1.targets,
6269
+ source_1 = _1.source;
6167
6270
  return targets.reduce(function (prevState, target) {
6168
6271
  var action = {
6169
6272
  payload: target,
@@ -6196,31 +6299,26 @@
6196
6299
  * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
6197
6300
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
6198
6301
  * */
6199
- var initialState = {
6302
+ var initialState$1 = {
6200
6303
  byId: {},
6201
6304
  allIds: []
6202
6305
  };
6203
- var reducer = function reducer(state, action) {
6306
+ var reducer$1 = function reducer(state, action) {
6204
6307
  if (state === void 0) {
6205
- state = initialState;
6308
+ state = initialState$1;
6206
6309
  }
6207
6310
 
6208
6311
  switch (action.type) {
6209
6312
  case MAP_SERVICES_SET_LAYERS:
6210
6313
  return produce__default["default"](state, function (draft) {
6211
6314
  if (!draft.byId[action.payload.service]) draft.byId[action.payload.service] = {};
6315
+ draft.byId[action.payload.service].id = action.payload.id;
6316
+ draft.byId[action.payload.service].name = action.payload.name;
6317
+ draft.byId[action.payload.service].service = action.payload.service;
6212
6318
  draft.byId[action.payload.service].layers = action.payload.layers;
6213
6319
  if (!draft.allIds.includes(action.payload.service)) draft.allIds.push(action.payload.service);
6214
6320
  });
6215
6321
 
6216
- case MAP_SERVICES_LAYER_SET_STYLES:
6217
- return produce__default["default"](state, function (draft) {
6218
- if (!draft.byId[action.payload.service]) draft.byId[action.payload.service] = {};
6219
- if (!draft.byId[action.payload.service].layer) draft.byId[action.payload.service].layer = {};
6220
- if (!draft.byId[action.payload.service].layer[action.payload.name]) draft.byId[action.payload.service].layer[action.payload.name] = {};
6221
- draft.byId[action.payload.service].layer[action.payload.name].styles = action.payload.styles;
6222
- });
6223
-
6224
6322
  default:
6225
6323
  return state;
6226
6324
  }
@@ -6275,8 +6373,8 @@
6275
6373
  switch (_b.label) {
6276
6374
  case 0:
6277
6375
  mapId = payload.mapId, start = payload.start, end = payload.end, interval = payload.interval, timeList = payload.timeList;
6278
- roundedStart = roundWithTimeStep(start && start.unix(), interval, 'ceil');
6279
- roundedEnd = roundWithTimeStep(end && end.unix(), interval, 'floor');
6376
+ roundedStart = roundWithTimeStep(start && moment__default["default"].utc(start).unix(), interval, 'ceil');
6377
+ roundedEnd = roundWithTimeStep(end && moment__default["default"].utc(end).unix(), interval, 'floor');
6280
6378
  return [4
6281
6379
  /*yield*/
6282
6380
  , timeList || generateTimeList(moment__default["default"].utc(roundedStart * 1000), moment__default["default"].utc(roundedEnd * 1000), interval)];
@@ -6351,7 +6449,7 @@
6351
6449
  });
6352
6450
  }
6353
6451
  function updateAnimation(mapId, maxValue) {
6354
- var animationStart, animationEnd, t, deltaT, start, end, isAnimating$1, timeStep;
6452
+ var animationStart, animationStartUnix, animationEnd, animationEndUnix, t, deltaT, start, end, isAnimating$1, timeStep;
6355
6453
  return __generator(this, function (_a) {
6356
6454
  switch (_a.label) {
6357
6455
  case 0:
@@ -6361,16 +6459,18 @@
6361
6459
 
6362
6460
  case 1:
6363
6461
  animationStart = _a.sent();
6462
+ animationStartUnix = moment__default["default"].utc(animationStart).unix();
6364
6463
  return [4
6365
6464
  /*yield*/
6366
6465
  , effects.select(getAnimationEndTime, mapId)];
6367
6466
 
6368
6467
  case 2:
6369
6468
  animationEnd = _a.sent();
6469
+ animationEndUnix = moment__default["default"].utc(animationEnd).unix();
6370
6470
  t = moment__default["default"].utc(maxValue).unix();
6371
- deltaT = t - animationEnd.unix();
6372
- start = moment__default["default"].unix(animationStart.unix() + deltaT).utc();
6373
- end = moment__default["default"].unix(animationEnd.unix() + deltaT).utc();
6471
+ deltaT = t - animationEndUnix;
6472
+ start = moment__default["default"].unix(animationStartUnix + deltaT).utc().format(dateFormat);
6473
+ end = moment__default["default"].unix(animationEndUnix + deltaT).utc().format(dateFormat);
6374
6474
  return [4
6375
6475
  /*yield*/
6376
6476
  , effects.put(setAnimationEndTime({
@@ -6433,7 +6533,7 @@
6433
6533
  return __generator(this, function (_b) {
6434
6534
  switch (_b.label) {
6435
6535
  case 0:
6436
- _b.trys.push([0, 11,, 12]);
6536
+ _b.trys.push([0, 12,, 13]);
6437
6537
 
6438
6538
  dimensions = payload.dimensions, layerId = payload.layerId;
6439
6539
  return [4
@@ -6477,7 +6577,10 @@
6477
6577
  if (!(layerId === activeLayerId && // only update the active layer
6478
6578
  shouldAutoUpdate && newTimeDimension && newTimeDimension.maxValue && prevTimeDimension && prevTimeDimension.currentValue && prevTimeDimension.currentValue !== newTimeDimension.maxValue)) return [3
6479
6579
  /*break*/
6480
- , 8];
6580
+ , 9];
6581
+ if (!!isAnimating$1) return [3
6582
+ /*break*/
6583
+ , 7];
6481
6584
  return [4
6482
6585
  /*yield*/
6483
6586
  , effects.put(layerChangeDimension({
@@ -6492,44 +6595,47 @@
6492
6595
  case 6:
6493
6596
  _b.sent();
6494
6597
 
6598
+ _b.label = 7;
6599
+
6600
+ case 7:
6495
6601
  return [4
6496
6602
  /*yield*/
6497
6603
  , effects.call(updateAnimation, mapId, newTimeDimension.maxValue)];
6498
6604
 
6499
- case 7:
6605
+ case 8:
6500
6606
  _b.sent();
6501
6607
 
6502
6608
  return [3
6503
6609
  /*break*/
6504
- , 10];
6610
+ , 11];
6505
6611
 
6506
- case 8:
6612
+ case 9:
6507
6613
  if (!(isAnimating$1 && !webmapInstance.isAnimating && newTimeDimension && newTimeDimension.maxValue)) return [3
6508
6614
  /*break*/
6509
- , 10];
6615
+ , 11];
6510
6616
  return [4
6511
6617
  /*yield*/
6512
6618
  , effects.call(updateAnimation, mapId, newTimeDimension.maxValue)];
6513
6619
 
6514
- case 9:
6620
+ case 10:
6515
6621
  _b.sent();
6516
6622
 
6517
- _b.label = 10;
6623
+ _b.label = 11;
6518
6624
 
6519
- case 10:
6625
+ case 11:
6520
6626
  return [3
6521
6627
  /*break*/
6522
- , 12];
6628
+ , 13];
6523
6629
 
6524
- case 11:
6630
+ case 12:
6525
6631
  error_1 = _b.sent(); // eslint-disable-next-line no-console
6526
6632
 
6527
6633
  console.warn(error_1);
6528
6634
  return [3
6529
6635
  /*break*/
6530
- , 12];
6636
+ , 13];
6531
6637
 
6532
- case 12:
6638
+ case 13:
6533
6639
  return [2
6534
6640
  /*return*/
6535
6641
  ];
@@ -6671,9 +6777,9 @@
6671
6777
  var moduleConfig = {
6672
6778
  id: 'webmap-module',
6673
6779
  reducerMap: {
6674
- webmap: reducer$1,
6675
- services: reducer,
6676
- layers: reducer$4
6780
+ webmap: reducer$2,
6781
+ services: reducer$1,
6782
+ layers: reducer$5
6677
6783
  },
6678
6784
  sagas: [rootSaga]
6679
6785
  };
@@ -6694,7 +6800,70 @@
6694
6800
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
6695
6801
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
6696
6802
  * */
6697
- var coreModuleConfig = [moduleConfig, synchronizationGroupConfig, uiModuleConfig];
6803
+ var initialState = {
6804
+ filters: {
6805
+ searchFilter: ''
6806
+ }
6807
+ };
6808
+ var reducer = function reducer(state, action) {
6809
+ if (state === void 0) {
6810
+ state = initialState;
6811
+ }
6812
+
6813
+ switch (action.type) {
6814
+ case 'LAYER_SELECT_SET_SEARCH_FILTER':
6815
+ {
6816
+ var filterText_1 = action.payload.filterText;
6817
+ return produce__default["default"](state, function (draft) {
6818
+ draft.filters.searchFilter = filterText_1;
6819
+ });
6820
+ }
6821
+
6822
+ default:
6823
+ return state;
6824
+ }
6825
+ };
6826
+
6827
+ /* *
6828
+ * Licensed under the Apache License, Version 2.0 (the "License");
6829
+ * you may not use this file except in compliance with the License.
6830
+ * You may obtain a copy of the License at
6831
+ *
6832
+ * http://www.apache.org/licenses/LICENSE-2.0
6833
+ *
6834
+ * Unless required by applicable law or agreed to in writing, software
6835
+ * distributed under the License is distributed on an "AS IS" BASIS,
6836
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6837
+ * See the License for the specific language governing permissions and
6838
+ * limitations under the License.
6839
+ *
6840
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
6841
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
6842
+ * */
6843
+ var layerSelectConfig = {
6844
+ id: 'layerSelect-module',
6845
+ reducerMap: {
6846
+ layerSelect: reducer
6847
+ }
6848
+ };
6849
+
6850
+ /* *
6851
+ * Licensed under the Apache License, Version 2.0 (the "License");
6852
+ * you may not use this file except in compliance with the License.
6853
+ * You may obtain a copy of the License at
6854
+ *
6855
+ * http://www.apache.org/licenses/LICENSE-2.0
6856
+ *
6857
+ * Unless required by applicable law or agreed to in writing, software
6858
+ * distributed under the License is distributed on an "AS IS" BASIS,
6859
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6860
+ * See the License for the specific language governing permissions and
6861
+ * limitations under the License.
6862
+ *
6863
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
6864
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
6865
+ * */
6866
+ var coreModuleConfig = [moduleConfig, synchronizationGroupConfig, uiModuleConfig, layerSelectConfig];
6698
6867
 
6699
6868
  /* *
6700
6869
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -7710,7 +7879,7 @@
7710
7879
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
7711
7880
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
7712
7881
  * */
7713
- var useStyles$z = core.makeStyles({
7882
+ var useStyles$D = core.makeStyles({
7714
7883
  buttonDiv: {
7715
7884
  position: 'relative'
7716
7885
  },
@@ -7746,7 +7915,7 @@
7746
7915
  handleClose = _a.handleClose,
7747
7916
  _e = _a.layerType,
7748
7917
  layerType = _e === void 0 ? LayerType.mapLayer : _e;
7749
- var classes = useStyles$z();
7918
+ var classes = useStyles$D();
7750
7919
 
7751
7920
  var _f = __read(React__namespace.useState(''), 2),
7752
7921
  serviceURL = _f[0],
@@ -7909,7 +8078,7 @@
7909
8078
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
7910
8079
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
7911
8080
  * */
7912
- var useStyles$y = core.makeStyles(function (theme) {
8081
+ var useStyles$C = core.makeStyles(function (theme) {
7913
8082
  return {
7914
8083
  buttonDiv: {
7915
8084
  position: 'relative'
@@ -7944,7 +8113,7 @@
7944
8113
  _f = _a.shouldFocus,
7945
8114
  shouldFocus = _f === void 0 ? false : _f;
7946
8115
  var ref = React__namespace.useRef(null);
7947
- var classes = useStyles$y();
8116
+ var classes = useStyles$C();
7948
8117
 
7949
8118
  var _g = __read(React__namespace.useState(false), 2),
7950
8119
  open = _g[0],
@@ -8068,7 +8237,7 @@
8068
8237
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8069
8238
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
8070
8239
  * */
8071
- var useStyles$x = core.makeStyles(function (theme) {
8240
+ var useStyles$B = core.makeStyles(function (theme) {
8072
8241
  return {
8073
8242
  button: {
8074
8243
  width: '24px',
@@ -8085,7 +8254,7 @@
8085
8254
  _b = _a.source,
8086
8255
  source = _b === void 0 ? 'app' : _b;
8087
8256
  var dispatch = reactRedux.useDispatch();
8088
- var classes = useStyles$x();
8257
+ var classes = useStyles$B();
8089
8258
  var currentActiveMapId = reactRedux.useSelector(function (store) {
8090
8259
  return getDialogMapId(store, 'layerSelect');
8091
8260
  });
@@ -8127,7 +8296,7 @@
8127
8296
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8128
8297
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
8129
8298
  * */
8130
- var useStyles$w = core.makeStyles({
8299
+ var useStyles$A = core.makeStyles({
8131
8300
  row: {
8132
8301
  height: '32px'
8133
8302
  },
@@ -8151,7 +8320,7 @@
8151
8320
  layerManagerWidth = _a.layerManagerWidth,
8152
8321
  _e = _a.layerSelect,
8153
8322
  layerSelect = _e === void 0 ? false : _e;
8154
- var classes = useStyles$w();
8323
+ var classes = useStyles$A();
8155
8324
  var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
8156
8325
  return /*#__PURE__*/React__namespace.createElement(core.Grid, {
8157
8326
  container: true,
@@ -8266,38 +8435,30 @@
8266
8435
  * */
8267
8436
 
8268
8437
  var DimensionSelect = function DimensionSelect(_a) {
8269
- var layer = _a.layer,
8270
- mapId = _a.mapId,
8438
+ var layerId = _a.layerId,
8271
8439
  onLayerChangeDimension = _a.onLayerChangeDimension,
8272
- _b = _a.availableLayerDimensions,
8273
- availableLayerDimensions = _b === void 0 ? [] : _b,
8440
+ _b = _a.layerDimensions,
8441
+ layerDimensions = _b === void 0 ? [] : _b,
8274
8442
  isEnabled = _a.isEnabled;
8275
8443
  var classes = useTooltipContainerStyles(isEnabled);
8276
- var defaultDimName = availableLayerDimensions.length ? availableLayerDimensions[0].name : '';
8277
- /* Use state */
8278
8444
 
8279
- var _c = __read(React__namespace.useState(defaultDimName), 2),
8445
+ var _c = __read(React__namespace.useState(layerDimensions.length ? layerDimensions[0].name : ''), 2),
8280
8446
  activeDimName = _c[0],
8281
8447
  setActiveDimName = _c[1];
8282
- /* Use effect to update the active dimension */
8283
-
8284
8448
 
8285
8449
  React__namespace.useEffect(function () {
8286
- var activeDim = availableLayerDimensions.find(function (d) {
8450
+ var activeDim = layerDimensions.find(function (d) {
8287
8451
  return d.name === activeDimName;
8288
8452
  });
8289
8453
 
8290
8454
  if (!activeDim) {
8291
- setActiveDimName(availableLayerDimensions.length ? availableLayerDimensions[0].name : '');
8455
+ setActiveDimName(layerDimensions.length ? layerDimensions[0].name : '');
8292
8456
  }
8293
- }, [availableLayerDimensions, activeDimName]);
8294
- if (!availableLayerDimensions.length) return null;
8295
- if (!layer || !layer.id) return null;
8457
+ }, [layerDimensions, activeDimName]);
8458
+ if (!layerDimensions.length || !layerId) return null;
8296
8459
 
8297
8460
  var getValuesToDisplay = function getValuesToDisplay() {
8298
- var wmjsLayer = getWMLayerById(layer.id);
8299
- if (!wmjsLayer) return null;
8300
- var activeWMJSDim = wmjsLayer.getDimension(activeDimName) || wmjsLayer.getDimension(availableLayerDimensions[0].name);
8461
+ var activeWMJSDim = getWMJSDimensionForLayerAndDimension(layerId, activeDimName) || getWMJSDimensionForLayerAndDimension(layerId, layerDimensions[0].name);
8301
8462
  if (!activeWMJSDim) return null;
8302
8463
  var availableDimValues = [];
8303
8464
 
@@ -8313,17 +8474,16 @@
8313
8474
 
8314
8475
  var valuesToDisplay = getValuesToDisplay();
8315
8476
  if (valuesToDisplay === null) return null;
8316
- var activeDimIndex = layer.dimensions.findIndex(function (dim) {
8477
+ var activeDim = layerDimensions.find(function (dim) {
8317
8478
  return dim.name === activeDimName;
8318
8479
  });
8319
- if (activeDimIndex === -1) return null;
8320
- var activeDim = layer.dimensions[activeDimIndex];
8480
+ if (!activeDim) return null;
8321
8481
 
8322
8482
  var selectDimensionValue = function selectDimensionValue(event) {
8323
8483
  event.stopPropagation();
8324
8484
 
8325
8485
  if (activeDim) {
8326
- onLayerChangeDimension(mapId, layer.id, activeDim.name, event.target.value);
8486
+ onLayerChangeDimension(activeDim.name, event.target.value);
8327
8487
  }
8328
8488
  };
8329
8489
 
@@ -8332,12 +8492,12 @@
8332
8492
  setActiveDimName(event.target.value);
8333
8493
  };
8334
8494
 
8335
- var dimNameList = availableLayerDimensions.map(function (dimension) {
8495
+ var dimNameList = layerDimensions.map(function (dimension) {
8336
8496
  return {
8337
8497
  value: dimension.name
8338
8498
  };
8339
8499
  });
8340
- var dimNameCurrentIndex = availableLayerDimensions.findIndex(function (value) {
8500
+ var dimNameCurrentIndex = layerDimensions.findIndex(function (value) {
8341
8501
  return value.name === activeDim.name;
8342
8502
  });
8343
8503
  var dimValueList = valuesToDisplay.map(function (value) {
@@ -8348,6 +8508,7 @@
8348
8508
  var dimValueCurrentIndex = valuesToDisplay.findIndex(function (value) {
8349
8509
  return value === activeDim.currentValue;
8350
8510
  });
8511
+ if (dimValueCurrentIndex === -1) return null;
8351
8512
  return /*#__PURE__*/React__namespace.createElement(core.Grid, {
8352
8513
  container: true,
8353
8514
  direction: "row",
@@ -8377,7 +8538,7 @@
8377
8538
  }
8378
8539
  }, /*#__PURE__*/React__namespace.createElement(core.MenuItem, {
8379
8540
  disabled: true
8380
- }, "Select dimension"), availableLayerDimensions.map(function (dimension) {
8541
+ }, "Select dimension"), layerDimensions.map(function (dimension) {
8381
8542
  return /*#__PURE__*/React__namespace.createElement(core.MenuItem, {
8382
8543
  key: dimension.name,
8383
8544
  value: dimension.name
@@ -8396,7 +8557,7 @@
8396
8557
  currentIndex: dimValueCurrentIndex,
8397
8558
  onChange: selectDimensionValue,
8398
8559
  onChangeMouseWheel: function onChangeMouseWheel(e) {
8399
- return onLayerChangeDimension(mapId, layer.id, activeDim.name, e.value);
8560
+ return onLayerChangeDimension(activeDim.name, e.value);
8400
8561
  },
8401
8562
  style: {
8402
8563
  maxWidth: '50%'
@@ -8427,7 +8588,7 @@
8427
8588
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8428
8589
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
8429
8590
  * */
8430
- var useStyles$v = core.makeStyles(function (theme) {
8591
+ var useStyles$z = core.makeStyles(function (theme) {
8431
8592
  return core.createStyles({
8432
8593
  button: {
8433
8594
  height: 28,
@@ -8486,7 +8647,7 @@
8486
8647
  testId = _a.testId,
8487
8648
  props = __rest(_a, ["tooltipTitle", "onClick", "isActive", "isEnabled", "icon", "testId"]);
8488
8649
 
8489
- var classes = useStyles$v({
8650
+ var classes = useStyles$z({
8490
8651
  isActive: isActive,
8491
8652
  isEnabled: isEnabled
8492
8653
  });
@@ -8523,7 +8684,7 @@
8523
8684
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8524
8685
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
8525
8686
  * */
8526
- var useStyles$u = core.makeStyles(function (theme) {
8687
+ var useStyles$y = core.makeStyles(function (theme) {
8527
8688
  return core.createStyles({
8528
8689
  checkbox: {
8529
8690
  color: 'inherit',
@@ -8546,7 +8707,7 @@
8546
8707
  var isEnabled = _a.isEnabled,
8547
8708
  title = _a.title,
8548
8709
  onChangeEnableLayer = _a.onChangeEnableLayer;
8549
- var classes = useStyles$u(isEnabled);
8710
+ var classes = useStyles$y(isEnabled);
8550
8711
 
8551
8712
  var onClick = function onClick() {
8552
8713
  onChangeEnableLayer(!isEnabled);
@@ -8602,7 +8763,7 @@
8602
8763
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8603
8764
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
8604
8765
  * */
8605
- var useStyles$t = core.makeStyles(function (theme) {
8766
+ var useStyles$x = core.makeStyles(function (theme) {
8606
8767
  return core.createStyles({
8607
8768
  dropdownEmpty: {
8608
8769
  paddingLeft: 8,
@@ -8625,7 +8786,7 @@
8625
8786
  layers = _b === void 0 ? [] : _b,
8626
8787
  _c = _a.isEnabled,
8627
8788
  isEnabled = _c === void 0 ? true : _c;
8628
- var classes = useStyles$t();
8789
+ var classes = useStyles$x();
8629
8790
  var containerClass = useTooltipContainerStyles(isEnabled);
8630
8791
 
8631
8792
  if (!layers || !layers.length) {
@@ -8698,7 +8859,7 @@
8698
8859
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8699
8860
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
8700
8861
  * */
8701
- var useStyles$s = core.makeStyles(function (theme) {
8862
+ var useStyles$w = core.makeStyles(function (theme) {
8702
8863
  return {
8703
8864
  opacityDiv: {
8704
8865
  height: 'calc(100% - 5px)',
@@ -8759,28 +8920,10 @@
8759
8920
  onLayerChangeOpacity = _a.onLayerChangeOpacity,
8760
8921
  _b = _a.isEnabled,
8761
8922
  isEnabled = _b === void 0 ? true : _b;
8762
- var classes = useStyles$s();
8923
+ var classes = useStyles$w();
8763
8924
  var sliderClasses = shared.sliderStyles();
8764
8925
  var containerClass = useTooltipContainerStyles(isEnabled);
8765
8926
 
8766
- var useOutsideAlerter = function useOutsideAlerter(ref) {
8767
- React__namespace.useEffect(function () {
8768
- var handleClickOutside = function handleClickOutside(event) {
8769
- if (ref.current && !ref.current.contains(event.target)) {
8770
- setOpen(false);
8771
- }
8772
- };
8773
-
8774
- document.addEventListener('mousedown', handleClickOutside);
8775
- return function () {
8776
- document.removeEventListener('mousedown', handleClickOutside);
8777
- };
8778
- }, [ref]);
8779
- };
8780
-
8781
- var wrapperRef = React__namespace.useRef(null);
8782
- useOutsideAlerter(wrapperRef);
8783
-
8784
8927
  var _c = __read(React__namespace.useState(false), 2),
8785
8928
  open = _c[0],
8786
8929
  setOpen = _c[1];
@@ -8789,6 +8932,19 @@
8789
8932
  tooltipOpen = _d[0],
8790
8933
  setTooltipOpen = _d[1];
8791
8934
 
8935
+ var preventDefault = function preventDefault(event) {
8936
+ event.preventDefault();
8937
+ event.stopPropagation();
8938
+ };
8939
+
8940
+ var enableScroll = React__namespace.useCallback(function () {
8941
+ document.removeEventListener('wheel', preventDefault, false);
8942
+ }, []);
8943
+ var disableScroll = React__namespace.useCallback(function () {
8944
+ document.addEventListener('wheel', preventDefault, {
8945
+ passive: false
8946
+ });
8947
+ }, []);
8792
8948
  var onWheel = React__namespace.useCallback(function (event) {
8793
8949
  var multiplier = event.altKey ? 10 : 1;
8794
8950
  var direction = event.deltaY > 0 ? 0.01 * multiplier : -0.01 * multiplier;
@@ -8804,21 +8960,25 @@
8804
8960
  }
8805
8961
  }, [open]);
8806
8962
  var onMouseEnter = React__namespace.useCallback(function () {
8963
+ disableScroll();
8807
8964
  if (!open) setTooltipOpen(true);
8808
- }, [open]);
8965
+ }, [open, disableScroll]);
8809
8966
  var onMouseLeave = React__namespace.useCallback(function () {
8967
+ enableScroll();
8810
8968
  setTooltipOpen(false);
8811
- }, []);
8969
+ }, [enableScroll]);
8812
8970
  var onFocus = React__namespace.useCallback(function () {
8971
+ disableScroll();
8813
8972
  setTooltipOpen(true);
8814
- }, []);
8973
+ }, [disableScroll]);
8815
8974
  var onBlur = React__namespace.useCallback(function () {
8975
+ enableScroll();
8816
8976
  setTooltipOpen(false);
8817
- }, []);
8977
+ }, [enableScroll]);
8818
8978
  return /*#__PURE__*/React__namespace.createElement("div", {
8819
8979
  className: classes.opacityDiv,
8820
- ref: wrapperRef,
8821
- onWheel: onWheel
8980
+ onWheel: onWheel,
8981
+ "data-testid": "scrollOpacity"
8822
8982
  }, /*#__PURE__*/React__namespace.createElement(core.Tooltip, {
8823
8983
  title: tooltipTitle,
8824
8984
  className: containerClass.textContainer,
@@ -8870,7 +9030,7 @@
8870
9030
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8871
9031
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
8872
9032
  * */
8873
- var useStyles$r = core.makeStyles(function (theme) {
9033
+ var useStyles$v = core.makeStyles(function (theme) {
8874
9034
  return core.createStyles({
8875
9035
  icon: {
8876
9036
  minWidth: 32,
@@ -8887,7 +9047,7 @@
8887
9047
  var title = _a.title,
8888
9048
  tooltipTitle = _a.tooltipTitle,
8889
9049
  icon = _a.icon;
8890
- var classes = useStyles$r();
9050
+ var classes = useStyles$v();
8891
9051
  return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(core.ListItemIcon, {
8892
9052
  className: classes.icon + " icon"
8893
9053
  }, icon), /*#__PURE__*/React__namespace.createElement(core.Tooltip, {
@@ -8915,7 +9075,7 @@
8915
9075
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8916
9076
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
8917
9077
  * */
8918
- var useStyles$q = core.makeStyles(function (theme) {
9078
+ var useStyles$u = core.makeStyles(function (theme) {
8919
9079
  return {
8920
9080
  menu: {
8921
9081
  backgroundColor: theme.palette.geowebColors.background.surface,
@@ -8933,7 +9093,7 @@
8933
9093
  onLayerDuplicate = _a.onLayerDuplicate,
8934
9094
  _b = _a.isEnabled,
8935
9095
  isEnabled = _b === void 0 ? true : _b;
8936
- var classes = useStyles$q();
9096
+ var classes = useStyles$u();
8937
9097
 
8938
9098
  var _c = __read(React__namespace.useState(null), 2),
8939
9099
  anchorEl = _c[0],
@@ -8982,9 +9142,9 @@
8982
9142
  };
8983
9143
 
8984
9144
  var RenderStyles = function RenderStyles(_a) {
8985
- var services = _a.services,
8986
- layer = _a.layer,
8987
- mapId = _a.mapId,
9145
+ var layerName = _a.layerName,
9146
+ layerStyles = _a.layerStyles,
9147
+ currentLayerStyle = _a.currentLayerStyle,
8988
9148
  onChangeLayerStyle = _a.onChangeLayerStyle,
8989
9149
  _b = _a.isEnabled,
8990
9150
  isEnabled = _b === void 0 ? true : _b;
@@ -8996,22 +9156,15 @@
8996
9156
  legendURL: ''
8997
9157
  }];
8998
9158
 
8999
- if (services && layer && layer.service && services[layer.service] && services[layer.service].layer) {
9000
- var serviceLayer = services[layer.service].layer[layer.name];
9001
-
9002
- if (serviceLayer && serviceLayer.styles && serviceLayer.styles.length > 0) {
9003
- styles.push.apply(styles, __spreadArray([], __read(serviceLayer.styles)));
9004
- }
9159
+ if (layerStyles && layerStyles.length > 0) {
9160
+ styles.push.apply(styles, __spreadArray([], __read(layerStyles)));
9005
9161
  }
9006
9162
 
9007
- var currentStyle = styles.filter(function (l) {
9008
- return l.name === layer.style;
9009
- })[0];
9010
- var styleValue = currentStyle || styles[0];
9163
+ var currentStyle = currentLayerStyle !== '' ? currentLayerStyle : styles[0].name;
9011
9164
 
9012
9165
  var selectStyle = function selectStyle(event) {
9013
9166
  event.stopPropagation();
9014
- onChangeLayerStyle(mapId, layer.id, event.target.value);
9167
+ onChangeLayerStyle(event.target.value);
9015
9168
  };
9016
9169
 
9017
9170
  var list = styles.map(function (style) {
@@ -9019,24 +9172,24 @@
9019
9172
  value: style.name
9020
9173
  };
9021
9174
  });
9022
- var currentIndex = styles.findIndex(function (layer) {
9023
- return styleValue.name === layer.name;
9175
+ var currentIndex = styles.findIndex(function (style) {
9176
+ return currentStyle === style.name;
9024
9177
  });
9025
9178
  return /*#__PURE__*/React__namespace.createElement(TooltipSelect, {
9026
9179
  disableUnderline: true,
9027
- tooltip: "Select a style for layer " + layer.name,
9180
+ tooltip: "Select a style for layer " + layerName,
9028
9181
  inputProps: {
9029
9182
  SelectDisplayProps: {
9030
9183
  'data-testid': 'selectStyle'
9031
9184
  }
9032
9185
  },
9033
9186
  className: classes.textContainer,
9034
- value: styleValue.name,
9187
+ value: currentStyle,
9035
9188
  list: list,
9036
9189
  currentIndex: currentIndex,
9037
9190
  onChange: selectStyle,
9038
9191
  onChangeMouseWheel: function onChangeMouseWheel(e) {
9039
- return onChangeLayerStyle(mapId, layer.id, e.value);
9192
+ return onChangeLayerStyle(e.value);
9040
9193
  }
9041
9194
  }, /*#__PURE__*/React__namespace.createElement(core.MenuItem, {
9042
9195
  disabled: true
@@ -9064,7 +9217,7 @@
9064
9217
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9065
9218
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
9066
9219
  * */
9067
- var useStyles$p = core.makeStyles(function () {
9220
+ var useStyles$t = core.makeStyles(function () {
9068
9221
  return core.createStyles({
9069
9222
  icon: {
9070
9223
  width: 20,
@@ -9078,7 +9231,7 @@
9078
9231
  onClickDelete = _a.onClickDelete,
9079
9232
  _b = _a.isEnabled,
9080
9233
  isEnabled = _b === void 0 ? true : _b;
9081
- var classes = useStyles$p();
9234
+ var classes = useStyles$t();
9082
9235
  return /*#__PURE__*/React__namespace.createElement(LayerManagerButton, {
9083
9236
  tooltipTitle: tooltipTitle,
9084
9237
  onClick: onClickDelete,
@@ -9106,7 +9259,7 @@
9106
9259
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9107
9260
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
9108
9261
  * */
9109
- var useStyles$o = core.makeStyles(function (theme) {
9262
+ var useStyles$s = core.makeStyles(function (theme) {
9110
9263
  return core.createStyles({
9111
9264
  icon: {
9112
9265
  width: 18,
@@ -9143,7 +9296,7 @@
9143
9296
  isActive = _c === void 0 ? false : _c,
9144
9297
  _d = _a.isEnabled,
9145
9298
  isEnabled = _d === void 0 ? true : _d;
9146
- var classes = useStyles$o({
9299
+ var classes = useStyles$s({
9147
9300
  isActive: isActive,
9148
9301
  isEnabled: isEnabled
9149
9302
  });
@@ -9192,7 +9345,7 @@
9192
9345
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9193
9346
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
9194
9347
  * */
9195
- var useStyles$n = core.makeStyles(function (theme) {
9348
+ var useStyles$r = core.makeStyles(function (theme) {
9196
9349
  return core.createStyles({
9197
9350
  row: {
9198
9351
  background: function background(isEnabled) {
@@ -9244,7 +9397,7 @@
9244
9397
  layerActiveLayout = _a.layerActiveLayout,
9245
9398
  layerManagerWidth = _a.layerManagerWidth,
9246
9399
  dragHandle = _a.dragHandle;
9247
- var classes = useStyles$n(isEnabled);
9400
+ var classes = useStyles$r(isEnabled);
9248
9401
  var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
9249
9402
 
9250
9403
  var onClickRow = function onClickRow() {
@@ -9286,12 +9439,12 @@
9286
9439
  item: true,
9287
9440
  className: "" + columnSizes.column3
9288
9441
  }, layerStylesLayout || /*#__PURE__*/React__default["default"].createElement(RenderStyles, {
9289
- services: services,
9290
- mapId: mapId,
9291
- layer: layer,
9292
- onChangeLayerStyle: function onChangeLayerStyle(_mapId, _layerId, style) {
9442
+ layerStyles: layer.styles,
9443
+ layerName: layer.name,
9444
+ currentLayerStyle: layer.style,
9445
+ onChangeLayerStyle: function onChangeLayerStyle(style) {
9293
9446
  onLayerChangeStyle({
9294
- layerId: _layerId,
9447
+ layerId: layerId,
9295
9448
  style: style
9296
9449
  });
9297
9450
  }
@@ -9311,10 +9464,9 @@
9311
9464
  item: true,
9312
9465
  className: "" + columnSizes.column5
9313
9466
  }, layerDimensionLayout || /*#__PURE__*/React__default["default"].createElement(DimensionSelect, {
9314
- layer: layer,
9315
- mapId: mapId,
9316
- availableLayerDimensions: filterNonTimeDimensions(layer.dimensions),
9317
- onLayerChangeDimension: function onLayerChangeDimension(_mapId, _layerId, dimensionName, dimensionValue) {
9467
+ layerId: layerId,
9468
+ layerDimensions: filterNonTimeDimensions(layer.dimensions),
9469
+ onLayerChangeDimension: function onLayerChangeDimension(dimensionName, dimensionValue) {
9318
9470
  var dimension = {
9319
9471
  name: dimensionName,
9320
9472
  currentValue: dimensionValue
@@ -9494,40 +9646,33 @@
9494
9646
  * */
9495
9647
 
9496
9648
  var DimensionSelectConnect = function DimensionSelectConnect(_a) {
9497
- var layerId = _a.layerId,
9498
- mapId = _a.mapId;
9649
+ var layerId = _a.layerId;
9499
9650
  var dispatch = reactRedux.useDispatch();
9500
- var layer = reactRedux.useSelector(function (store) {
9501
- return getLayerById(store, layerId);
9502
- });
9503
- var availableLayerDimensions = reactRedux.useSelector(function (store) {
9651
+ var layerDimensions = reactRedux.useSelector(function (store) {
9504
9652
  return getLayerNonTimeDimensions(store, layerId);
9505
9653
  });
9654
+ var isLayerEnabled = reactRedux.useSelector(function (store) {
9655
+ return getLayerEnabled(store, layerId);
9656
+ });
9506
9657
  var layerChangeDimension$1 = React__namespace.useCallback(function (_a) {
9507
9658
  var origin = _a.origin,
9508
- layerId = _a.layerId,
9509
9659
  dimension = _a.dimension;
9510
9660
  return dispatch(layerChangeDimension({
9511
9661
  origin: origin,
9512
9662
  layerId: layerId,
9513
9663
  dimension: dimension
9514
9664
  }));
9515
- }, [dispatch]);
9516
- var isLayerEnabled = reactRedux.useSelector(function (store) {
9517
- return getLayerEnabled(store, layerId);
9518
- });
9665
+ }, [layerId, dispatch]);
9519
9666
  return /*#__PURE__*/React__namespace.createElement(DimensionSelect, {
9520
- layer: layer,
9521
- mapId: mapId,
9522
- availableLayerDimensions: availableLayerDimensions,
9523
- onLayerChangeDimension: function onLayerChangeDimension(_mapId, _layerId, dimensionName, dimensionValue) {
9667
+ layerId: layerId,
9668
+ layerDimensions: layerDimensions,
9669
+ onLayerChangeDimension: function onLayerChangeDimension(dimensionName, dimensionValue) {
9524
9670
  var dimension = {
9525
9671
  name: dimensionName,
9526
9672
  currentValue: dimensionValue
9527
9673
  };
9528
9674
  layerChangeDimension$1({
9529
9675
  origin: 'layerrow',
9530
- layerId: layerId,
9531
9676
  dimension: dimension
9532
9677
  });
9533
9678
  },
@@ -9553,37 +9698,31 @@
9553
9698
  * */
9554
9699
 
9555
9700
  var RenderStylesConnect = function RenderStylesConnect(_a) {
9556
- var mapId = _a.mapId,
9557
- layerId = _a.layerId;
9558
- var dispatch = reactRedux.useDispatch(); // TODO: (Sander de Snaijer 2020-03-30 make specific selectors with layerId to prevent rerenders)
9559
-
9560
- var services = reactRedux.useSelector(function (store) {
9561
- return getServices(store);
9701
+ var layerId = _a.layerId;
9702
+ var dispatch = reactRedux.useDispatch();
9703
+ var layerName = reactRedux.useSelector(function (store) {
9704
+ return getLayerName(store, layerId);
9562
9705
  });
9563
- var layer = reactRedux.useSelector(function (store) {
9564
- return getLayerById(store, layerId);
9706
+ var layerStyles = reactRedux.useSelector(function (store) {
9707
+ return getLayerStyles(store, layerId);
9708
+ });
9709
+ var currentLayerStyle = reactRedux.useSelector(function (store) {
9710
+ return getLayerStyle(store, layerId);
9565
9711
  });
9566
- var layerChangeStyle$1 = React__namespace.useCallback(function (_a) {
9567
- var layerId = _a.layerId,
9568
- style = _a.style;
9569
- return dispatch(layerChangeStyle({
9570
- layerId: layerId,
9571
- style: style
9572
- }));
9573
- }, [dispatch]);
9574
9712
  var isLayerEnabled = reactRedux.useSelector(function (store) {
9575
9713
  return getLayerEnabled(store, layerId);
9576
9714
  });
9577
- return /*#__PURE__*/React__namespace.createElement(RenderStyles, {
9578
- mapId: mapId,
9579
- layer: layer,
9580
- services: services,
9581
- onChangeLayerStyle: function onChangeLayerStyle(_, layerId, style) {
9582
- layerChangeStyle$1({
9583
- layerId: layerId,
9584
- style: style
9585
- });
9586
- },
9715
+ var layerChangeStyle$1 = React__namespace.useCallback(function (style) {
9716
+ return dispatch(layerChangeStyle({
9717
+ layerId: layerId,
9718
+ style: style
9719
+ }));
9720
+ }, [layerId, dispatch]);
9721
+ return /*#__PURE__*/React__namespace.createElement(RenderStyles, {
9722
+ layerStyles: layerStyles,
9723
+ layerName: layerName,
9724
+ currentLayerStyle: currentLayerStyle,
9725
+ onChangeLayerStyle: layerChangeStyle$1,
9587
9726
  isEnabled: isLayerEnabled
9588
9727
  });
9589
9728
  };
@@ -9796,12 +9935,10 @@
9796
9935
  layerServicesLayout: /*#__PURE__*/React__namespace.createElement(RenderLayersConnect, {
9797
9936
  layerId: layerId
9798
9937
  }),
9799
- layerStylesLayout: /*#__PURE__*/React__namespace.createElement(RenderStylesConnect, {
9800
- mapId: mapId,
9938
+ layerDimensionLayout: /*#__PURE__*/React__namespace.createElement(DimensionSelectConnect, {
9801
9939
  layerId: layerId
9802
9940
  }),
9803
- layerDimensionLayout: /*#__PURE__*/React__namespace.createElement(DimensionSelectConnect, {
9804
- mapId: mapId,
9941
+ layerStylesLayout: /*#__PURE__*/React__namespace.createElement(RenderStylesConnect, {
9805
9942
  layerId: layerId
9806
9943
  }),
9807
9944
  layerDeleteLayout: /*#__PURE__*/React__namespace.createElement(DeleteLayerConnect, {
@@ -9839,7 +9976,7 @@
9839
9976
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
9840
9977
  * */
9841
9978
  var TOOLTIP_TITLE = 'Drag a layer up or down';
9842
- var useStyles$m = core.makeStyles(function (theme) {
9979
+ var useStyles$q = core.makeStyles(function (theme) {
9843
9980
  return {
9844
9981
  dragHandle: {
9845
9982
  cursor: 'grab',
@@ -9862,7 +9999,7 @@
9862
9999
  index = _c === void 0 ? undefined : _c,
9863
10000
  _d = _a.hideTooltip,
9864
10001
  hideTooltip = _d === void 0 ? false : _d;
9865
- var classes = useStyles$m({
10002
+ var classes = useStyles$q({
9866
10003
  isDisabled: isDisabled
9867
10004
  });
9868
10005
  var tooltipTitle = hideTooltip ? '' : TOOLTIP_TITLE;
@@ -9895,7 +10032,7 @@
9895
10032
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9896
10033
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
9897
10034
  * */
9898
- var useStyles$l = core.makeStyles(function () {
10035
+ var useStyles$p = core.makeStyles(function () {
9899
10036
  return {
9900
10037
  layerRows: {
9901
10038
  width: '100%',
@@ -9961,7 +10098,7 @@
9961
10098
 
9962
10099
  var isSorting = activeDragIndex !== null;
9963
10100
  var isDragDisabled = layerIds.length === 1;
9964
- var classes = useStyles$l(isSorting);
10101
+ var classes = useStyles$p(isSorting);
9965
10102
  return /*#__PURE__*/React__namespace.createElement(core.Grid, {
9966
10103
  container: true,
9967
10104
  item: true,
@@ -10171,7 +10308,7 @@
10171
10308
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10172
10309
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
10173
10310
  * */
10174
- var useStyles$k = core.makeStyles({
10311
+ var useStyles$o = core.makeStyles({
10175
10312
  layerRow: {
10176
10313
  width: '100%',
10177
10314
  height: '36px'
@@ -10194,7 +10331,7 @@
10194
10331
  layerManagerWidth = _a.layerManagerWidth,
10195
10332
  _d = _a.tooltip,
10196
10333
  tooltip = _d === void 0 ? '' : _d;
10197
- var classes = useStyles$k();
10334
+ var classes = useStyles$o();
10198
10335
  var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
10199
10336
  return /*#__PURE__*/React__namespace.createElement(core.Grid, {
10200
10337
  container: true,
@@ -10239,7 +10376,7 @@
10239
10376
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10240
10377
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
10241
10378
  * */
10242
- var useStyles$j = core.makeStyles({
10379
+ var useStyles$n = core.makeStyles({
10243
10380
  layerRowContainer: {
10244
10381
  position: 'relative',
10245
10382
  width: '100%',
@@ -10274,7 +10411,7 @@
10274
10411
  layerSelect = _e === void 0 ? false : _e,
10275
10412
  _f = _a.showAddLayersTooltip,
10276
10413
  showAddLayersTooltip = _f === void 0 ? true : _f;
10277
- var classes = useStyles$j();
10414
+ var classes = useStyles$n();
10278
10415
 
10279
10416
  var _g = __read(React__namespace.useState(LayerManagerWidth.lg), 2),
10280
10417
  layerManagerWidth = _g[0],
@@ -10346,6 +10483,290 @@
10346
10483
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10347
10484
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
10348
10485
  * */
10486
+ var useStyles$m = core.makeStyles(function (theme) {
10487
+ return {
10488
+ iconButton: {
10489
+ color: theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat
10490
+ }
10491
+ };
10492
+ });
10493
+ var clearIconPath = 'M12,2 C17.5228475,2 22,6.4771525 22,12 C22,17.5228475 17.5228475,22 12,22 C6.4771525,22 2,17.5228475 2,12 C2,6.4771525 6.4771525,2 12,2 Z M15.44426,7.26697571 L12.0002861,10.7110482 L8.55573996,7.26697571 C8.19978253,6.9110081 7.62292549,6.9110081 7.26696807,7.26697571 C6.91101064,7.62294331 6.91101064,8.19981687 7.26696807,8.55578447 L10.7115142,11.9998569 L7.26696807,15.4445017 C6.91101064,15.8004693 6.91101064,16.3767705 7.26696807,16.7333104 C7.44494678,16.910722 7.67843653,17 7.91192629,17 C8.14484377,17 8.37776125,16.910722 8.55573996,16.7333104 L12.0002861,13.289238 L15.44426,16.7333104 C15.6222388,16.910722 15.8551562,17 16.088646,17 C16.3221357,17 16.5550532,16.910722 16.7330319,16.7333104 C17.0889894,16.3767705 17.0889894,15.8004693 16.7330319,15.4445017 L13.289058,11.9998569 L16.7330319,8.55578447 C17.0889894,8.19981687 17.0889894,7.62294331 16.7330319,7.26697571 C16.3770745,6.9110081 15.8002175,6.9110081 15.44426,7.26697571 Z';
10494
+ var clearIcon = /*#__PURE__*/React__namespace.createElement(core.SvgIcon, {
10495
+ style: {
10496
+ width: '24px',
10497
+ height: '24px'
10498
+ },
10499
+ viewBox: "0 0 24 24",
10500
+ xmlns: "http://www.w3.org/2000/svg"
10501
+ }, /*#__PURE__*/React__namespace.createElement("path", {
10502
+ d: clearIconPath
10503
+ }));
10504
+ var searchIconPath = 'M7.81701445,12.5845372 L7.81701445,12.5845372 C7.17924024,11.946763 6.82932049,11.100321 6.82932049,10.1993044 C6.82932049,9.29828785 7.17924024,8.45077582 7.81701445,7.8140717 C8.47405029,7.15703585 9.3376137,6.82851792 10.2022472,6.82851792 C11.0658106,6.82851792 11.929374,7.15703585 12.5874799,7.8140717 C13.9026217,9.12921348 13.9026217,11.2693954 12.5874799,12.5845372 C11.9497057,13.2212413 11.1021937,13.5722311 10.2022472,13.5722311 C9.3012306,13.5722311 8.45371857,13.2212413 7.81701445,12.5845372 M19.5858748,17.581862 L15.4681648,13.465222 C16.9513109,11.0735688 16.6613162,7.88683788 14.5874799,5.81300161 C12.1690744,3.39566613 8.23434992,3.39566613 5.81594436,5.81300161 C4.64419476,6.9847512 4,8.54280364 4,10.1993044 C4,11.8558052 4.64419476,13.4138577 5.81594436,14.5845372 C6.98769395,15.7562868 8.5446763,16.4015516 10.2022472,16.4015516 C11.376137,16.4015516 12.4965222,16.0719636 13.4681648,15.4662921 L17.5837346,19.582932 C17.8608882,19.8590155 18.2225789,19.9970572 18.5853398,19.9970572 C18.9470305,19.9970572 19.3087212,19.8590155 19.5858748,19.582932 C20.1380417,19.029695 20.1380417,18.135099 19.5858748,17.581862';
10505
+ var searchIcon = /*#__PURE__*/React__namespace.createElement(core.SvgIcon, {
10506
+ style: {
10507
+ width: '24px',
10508
+ height: '24px'
10509
+ },
10510
+ viewBox: "0 0 24 24",
10511
+ xmlns: "http://www.w3.org/2000/svg"
10512
+ }, /*#__PURE__*/React__namespace.createElement("path", {
10513
+ d: searchIconPath
10514
+ }));
10515
+
10516
+ var SearchField = function SearchField() {
10517
+ var _a = __read(React__namespace.useState(''), 2),
10518
+ searchString = _a[0],
10519
+ setSearchString = _a[1];
10520
+
10521
+ var classes = useStyles$m();
10522
+ return /*#__PURE__*/React__namespace.createElement(core.TextField, {
10523
+ variant: "filled",
10524
+ label: "Search through services or enter a service URL",
10525
+ value: searchString,
10526
+ onChange: function onChange(e) {
10527
+ return setSearchString(e.target.value);
10528
+ },
10529
+ autoFocus: true,
10530
+ fullWidth: true,
10531
+ InputProps: {
10532
+ endAdornment: /*#__PURE__*/React__namespace.createElement(core.InputAdornment, {
10533
+ position: "end"
10534
+ }, searchString ? /*#__PURE__*/React__namespace.createElement(core.Tooltip, {
10535
+ title: "Clear",
10536
+ placement: "top"
10537
+ }, /*#__PURE__*/React__namespace.createElement(core.IconButton, {
10538
+ className: classes.iconButton,
10539
+ edge: "end",
10540
+ onClick: function onClick() {
10541
+ return setSearchString('');
10542
+ }
10543
+ }, clearIcon)) : /*#__PURE__*/React__namespace.createElement(core.Tooltip, {
10544
+ title: "Search",
10545
+ placement: "top"
10546
+ }, /*#__PURE__*/React__namespace.createElement(core.IconButton, {
10547
+ className: classes.iconButton,
10548
+ edge: "end"
10549
+ }, searchIcon)))
10550
+ }
10551
+ });
10552
+ };
10553
+
10554
+ /* *
10555
+ * Licensed under the Apache License, Version 2.0 (the "License");
10556
+ * you may not use this file except in compliance with the License.
10557
+ * You may obtain a copy of the License at
10558
+ *
10559
+ * http://www.apache.org/licenses/LICENSE-2.0
10560
+ *
10561
+ * Unless required by applicable law or agreed to in writing, software
10562
+ * distributed under the License is distributed on an "AS IS" BASIS,
10563
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10564
+ * See the License for the specific language governing permissions and
10565
+ * limitations under the License.
10566
+ *
10567
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10568
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
10569
+ * */
10570
+ var useStyles$l = core.makeStyles(function (theme) {
10571
+ return core.createStyles({
10572
+ chip: {
10573
+ height: '32px',
10574
+ margin: '0 8px 0 0',
10575
+ padding: '5px 12px 7px',
10576
+ borderRadius: '20px',
10577
+ border: "solid 1px " + theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat,
10578
+ backgroundColor: theme.palette.geowebColors.buttons.surfaceIconDefault.fill,
10579
+ color: theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat,
10580
+ "float": 'left',
10581
+ whiteSpace: 'nowrap',
10582
+ '&:hover': {
10583
+ backgroundColor: theme.palette.geowebColors.buttons.flatMouseover.fill,
10584
+ cursor: 'pointer'
10585
+ }
10586
+ }
10587
+ });
10588
+ });
10589
+
10590
+ var ServiceChip = function ServiceChip(_a) {
10591
+ var _b = _a.all,
10592
+ all = _b === void 0 ? false : _b,
10593
+ service = _a.service;
10594
+ var classes = useStyles$l();
10595
+
10596
+ if (all) {
10597
+ return /*#__PURE__*/React__namespace.createElement("div", {
10598
+ className: classes.chip,
10599
+ "data-testid": "serviceChipAll"
10600
+ }, "All");
10601
+ }
10602
+
10603
+ if (service && service.name) {
10604
+ return /*#__PURE__*/React__namespace.createElement("div", {
10605
+ className: classes.chip,
10606
+ "data-testid": "serviceChip"
10607
+ }, service.name);
10608
+ }
10609
+
10610
+ return /*#__PURE__*/React__namespace.createElement("div", {
10611
+ className: classes.chip
10612
+ });
10613
+ };
10614
+
10615
+ /* *
10616
+ * Licensed under the Apache License, Version 2.0 (the "License");
10617
+ * you may not use this file except in compliance with the License.
10618
+ * You may obtain a copy of the License at
10619
+ *
10620
+ * http://www.apache.org/licenses/LICENSE-2.0
10621
+ *
10622
+ * Unless required by applicable law or agreed to in writing, software
10623
+ * distributed under the License is distributed on an "AS IS" BASIS,
10624
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10625
+ * See the License for the specific language governing permissions and
10626
+ * limitations under the License.
10627
+ *
10628
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10629
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
10630
+ * */
10631
+ var useStyles$k = core.makeStyles(function (theme) {
10632
+ return core.createStyles({
10633
+ serviceChips: {
10634
+ width: '100%',
10635
+ display: 'inline-flex',
10636
+ alignItems: 'center',
10637
+ overflowX: 'visible',
10638
+ "float": 'left',
10639
+ paddingLeft: '32px'
10640
+ },
10641
+ scrollArrowLeft: {
10642
+ width: '120px',
10643
+ marginBottom: '-12px',
10644
+ height: '34px',
10645
+ backgroundImage: "linear-gradient(to left, rgba(0, 0, 0, 0), " + theme.palette.geowebColors.background.surfaceApp + " 51%)",
10646
+ marginLeft: '-100%',
10647
+ cursor: 'pointer'
10648
+ },
10649
+ serviceList: {
10650
+ height: '32px',
10651
+ marginTop: '8px',
10652
+ width: '100%',
10653
+ overflowX: 'hidden',
10654
+ marginRight: '-120px'
10655
+ },
10656
+ scrollArrowRight: {
10657
+ width: '120px',
10658
+ marginBottom: '-12px',
10659
+ height: '34px',
10660
+ backgroundImage: "linear-gradient(to right, rgba(0, 0, 0, 0), " + theme.palette.geowebColors.background.surfaceApp + " 51%)",
10661
+ right: '0px',
10662
+ position: 'fixed',
10663
+ cursor: 'pointer'
10664
+ }
10665
+ });
10666
+ });
10667
+
10668
+ var ServiceList = function ServiceList(_a) {
10669
+ var layerSelectWidth = _a.layerSelectWidth,
10670
+ services = _a.services;
10671
+ var classes = useStyles$k();
10672
+
10673
+ var _b = __read(React__namespace.useState(0), 2),
10674
+ margin = _b[0],
10675
+ setMargin = _b[1];
10676
+
10677
+ var _c = __read(React__namespace.useState(0), 2),
10678
+ width = _c[0],
10679
+ setWidth = _c[1];
10680
+
10681
+ var ref = React__namespace.useRef(null);
10682
+ var onLeftArrowClick = React__namespace.useCallback(function () {
10683
+ setMargin(Math.max(0, margin - 100));
10684
+ }, [margin]);
10685
+ var onRightArrowClick = React__namespace.useCallback(function () {
10686
+ setMargin(Math.min(width - layerSelectWidth, margin + 100));
10687
+ }, [margin, layerSelectWidth, width]);
10688
+ var gapRight = 35;
10689
+ React__namespace.useEffect(function () {
10690
+ setWidth(ref.current.scrollWidth + gapRight);
10691
+ }, [services, layerSelectWidth]);
10692
+ return /*#__PURE__*/React__namespace.createElement("div", {
10693
+ className: classes.serviceList,
10694
+ "data-testid": "serviceList"
10695
+ }, margin !== 0 && /*#__PURE__*/React__namespace.createElement(icons.ChevronLeft, {
10696
+ className: classes.scrollArrowLeft,
10697
+ onClick: onLeftArrowClick,
10698
+ "data-testid": "leftScrollArrow"
10699
+ }), /*#__PURE__*/React__namespace.createElement("div", {
10700
+ className: classes.serviceChips,
10701
+ style: {
10702
+ marginLeft: -margin + "px",
10703
+ marginRight: margin + "px"
10704
+ },
10705
+ ref: ref
10706
+ }, services && Object.keys(services) && Object.keys(services).length > 0 && /*#__PURE__*/React__namespace.createElement(ServiceChip, {
10707
+ key: "All",
10708
+ all: true
10709
+ }), Object.keys(services).map(function (service) {
10710
+ return /*#__PURE__*/React__namespace.createElement(ServiceChip, {
10711
+ key: services[service].id,
10712
+ service: services[service]
10713
+ });
10714
+ })), margin < width - layerSelectWidth - gapRight && /*#__PURE__*/React__namespace.createElement(icons.ChevronRight, {
10715
+ className: classes.scrollArrowRight,
10716
+ onClick: onRightArrowClick,
10717
+ "data-testid": "rightScrollArrow"
10718
+ }));
10719
+ };
10720
+
10721
+ /* *
10722
+ * Licensed under the Apache License, Version 2.0 (the "License");
10723
+ * you may not use this file except in compliance with the License.
10724
+ * You may obtain a copy of the License at
10725
+ *
10726
+ * http://www.apache.org/licenses/LICENSE-2.0
10727
+ *
10728
+ * Unless required by applicable law or agreed to in writing, software
10729
+ * distributed under the License is distributed on an "AS IS" BASIS,
10730
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10731
+ * See the License for the specific language governing permissions and
10732
+ * limitations under the License.
10733
+ *
10734
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10735
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
10736
+ * */
10737
+
10738
+ var ServiceListConnect = function ServiceListConnect(_a) {
10739
+ var layerSelectWidth = _a.layerSelectWidth;
10740
+ var services = reactRedux.useSelector(function (store) {
10741
+ return getServices(store);
10742
+ });
10743
+ return /*#__PURE__*/React__namespace.createElement(ServiceList, {
10744
+ layerSelectWidth: layerSelectWidth,
10745
+ services: services
10746
+ });
10747
+ };
10748
+
10749
+ /* *
10750
+ * Licensed under the Apache License, Version 2.0 (the "License");
10751
+ * you may not use this file except in compliance with the License.
10752
+ * You may obtain a copy of the License at
10753
+ *
10754
+ * http://www.apache.org/licenses/LICENSE-2.0
10755
+ *
10756
+ * Unless required by applicable law or agreed to in writing, software
10757
+ * distributed under the License is distributed on an "AS IS" BASIS,
10758
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10759
+ * See the License for the specific language governing permissions and
10760
+ * limitations under the License.
10761
+ *
10762
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10763
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
10764
+ * */
10765
+ var useStyles$j = core.makeStyles({
10766
+ serviceList: {
10767
+ height: '48px'
10768
+ }
10769
+ });
10349
10770
 
10350
10771
  var LayerSelect = function LayerSelect(_a) {
10351
10772
  var mapId = _a.mapId,
@@ -10360,20 +10781,31 @@
10360
10781
  order = _d === void 0 ? 0 : _d,
10361
10782
  _e = _a.source,
10362
10783
  source = _e === void 0 ? 'module' : _e;
10784
+ var classes = useStyles$j();
10785
+
10786
+ var _f = __read(React__namespace.useState(750), 2),
10787
+ width = _f[0],
10788
+ setWidth = _f[1];
10789
+
10790
+ var onChangeSize = function onChangeSize(_a) {
10791
+ var width = _a.width;
10792
+ setWidth(width);
10793
+ };
10794
+
10363
10795
  return /*#__PURE__*/React__namespace.createElement(shared.ToolContainerDraggable, {
10364
10796
  title: showTitle ? "Layer Select " + mapId : 'Layer Select',
10365
10797
  startSize: {
10366
- width: 500,
10798
+ width: width,
10367
10799
  height: 500
10368
10800
  },
10369
10801
  minWidth: 300,
10370
10802
  minHeight: 126,
10371
10803
  startPosition: {
10372
- top: 100,
10804
+ top: 150,
10373
10805
  left: 100
10374
10806
  },
10375
10807
  isOpen: isOpen,
10376
- onChangeSize: function onChangeSize() {},
10808
+ onChangeSize: onChangeSize,
10377
10809
  onClose: onClose,
10378
10810
  headerSize: "small",
10379
10811
  bounds: bounds,
@@ -10381,7 +10813,15 @@
10381
10813
  onMouseDown: onMouseDown,
10382
10814
  order: order,
10383
10815
  source: source
10384
- }, /*#__PURE__*/React__namespace.createElement("div", null));
10816
+ }, /*#__PURE__*/React__namespace.createElement("div", {
10817
+ style: {
10818
+ padding: '6px'
10819
+ }
10820
+ }, /*#__PURE__*/React__namespace.createElement(SearchField, null), /*#__PURE__*/React__namespace.createElement("div", {
10821
+ className: classes.serviceList
10822
+ }, /*#__PURE__*/React__namespace.createElement(ServiceListConnect, {
10823
+ layerSelectWidth: width
10824
+ }))));
10385
10825
  };
10386
10826
 
10387
10827
  /* *
@@ -10480,6 +10920,8 @@
10480
10920
  getLayerNodesFromService(service.url).then(function (layers) {
10481
10921
  if (isMounted.current) {
10482
10922
  serviceSetLayers$1({
10923
+ id: service.id,
10924
+ name: service.name,
10483
10925
  service: service.url,
10484
10926
  layers: layers
10485
10927
  });
@@ -11745,6 +12187,11 @@
11745
12187
  text: speedFactor + "x"
11746
12188
  };
11747
12189
  });
12190
+ var max = marks.length - 1;
12191
+ var min = 0;
12192
+ var currentValue = marks.findIndex(function (info) {
12193
+ return info.delay === animationDelay;
12194
+ });
11748
12195
 
11749
12196
  var getAnimationDelayValue = function getAnimationDelayValue(markPos) {
11750
12197
  return marks[markPos].delay || marks[0].delay;
@@ -11754,19 +12201,26 @@
11754
12201
  setOpen(!open);
11755
12202
  };
11756
12203
 
11757
- var onChangeSlider = function onChangeSlider(event, newValue) {
11758
- getValueFromEvent(event, newValue, getAnimationDelayValue, setMapAnimationDelay);
12204
+ var onChangeSlider = function onChangeSlider(event, value) {
12205
+ var newValue = getAnimationDelayValue(value);
12206
+
12207
+ if (event.type !== 'keydown') {
12208
+ setMapAnimationDelay(newValue);
12209
+ }
11759
12210
  };
11760
12211
 
11761
12212
  var onKeyDown = function onKeyDown(event) {
11762
12213
  if (event.key === 'Tab') {
11763
12214
  setOpen(!open);
11764
12215
  }
12216
+
12217
+ var newValue = getValueFromKeyboardEvent(event, currentValue, min, max);
12218
+
12219
+ if (newValue !== null) {
12220
+ setMapAnimationDelay(getAnimationDelayValue(newValue));
12221
+ }
11765
12222
  };
11766
12223
 
11767
- var currentValue = marks.findIndex(function (info) {
11768
- return info.delay === animationDelay;
11769
- });
11770
12224
  var text = marks[currentValue].text;
11771
12225
  return /*#__PURE__*/React__namespace.createElement("div", {
11772
12226
  className: classes.speedButtonDiv
@@ -11796,7 +12250,8 @@
11796
12250
  orientation: "vertical",
11797
12251
  value: currentValue,
11798
12252
  step: null,
11799
- max: marks.length - 1,
12253
+ max: max,
12254
+ min: min,
11800
12255
  marks: marks.map(function (_a) {
11801
12256
  var markPos = _a.markPos,
11802
12257
  text = _a.text;
@@ -12022,19 +12477,32 @@
12022
12477
  var currentMark = timeStepMarks.find(function (mark) {
12023
12478
  return mark.timeStepValue === timeStep;
12024
12479
  });
12480
+ var value = currentMark && currentMark.value ? currentMark.value : 0;
12481
+ var min = timeStepMarks[0].value;
12482
+ var max = timeStepMarks[timeStepMarks.length - 1].value;
12025
12483
 
12026
12484
  var getTimeStepValue = function getTimeStepValue(value) {
12027
12485
  return timeStepMarks[Math.round(value - 1)].timeStepValue;
12028
12486
  };
12029
12487
 
12030
- var onChangeSlider = function onChangeSlider(event, newValue) {
12031
- getValueFromEvent(event, newValue, getTimeStepValue, onChangeTimeStep);
12488
+ var onChangeSlider = function onChangeSlider(event, value) {
12489
+ var newValue = getTimeStepValue(value);
12490
+
12491
+ if (event.type !== 'keydown') {
12492
+ onChangeTimeStep(newValue);
12493
+ }
12032
12494
  };
12033
12495
 
12034
12496
  var onKeyDown = function onKeyDown(event) {
12035
12497
  if (event.key === 'Tab') {
12036
12498
  setOpen(!open);
12037
12499
  }
12500
+
12501
+ var newValue = getValueFromKeyboardEvent(event, value, min, max);
12502
+
12503
+ if (newValue !== null) {
12504
+ onChangeTimeStep(getTimeStepValue(newValue));
12505
+ }
12038
12506
  };
12039
12507
 
12040
12508
  React__namespace.useEffect(function () {
@@ -12071,10 +12539,10 @@
12071
12539
  }, "Time step"), /*#__PURE__*/React__namespace.createElement(shared.CustomSlider, {
12072
12540
  "data-testid": "timeStepButtonSlider",
12073
12541
  orientation: "vertical",
12074
- value: currentMark && currentMark.value ? currentMark.value : 0,
12542
+ value: value,
12075
12543
  step: null,
12076
- min: timeStepMarks[0].value,
12077
- max: timeStepMarks[timeStepMarks.length - 1].value,
12544
+ min: min,
12545
+ max: max,
12078
12546
  marks: timeStepMarks,
12079
12547
  disabled: disabledSlider,
12080
12548
  onChange: onChangeSlider,
@@ -14048,28 +14516,28 @@
14048
14516
  var ZOOM_RATIO = 1.1;
14049
14517
 
14050
14518
  var zoomOut = function zoomOut(relativeX) {
14051
- var su = animationStartTime.unix();
14052
- var eu = animationEndTime.unix();
14519
+ var su = moment__default["default"].utc(animationStartTime).unix();
14520
+ var eu = moment__default["default"].utc(animationEndTime).unix();
14053
14521
  var targetTime = su + (eu - su) * relativeX;
14054
- onSetAnimationStartTime(moment__default["default"].utc(((su - targetTime) * ZOOM_RATIO + targetTime) * 1000));
14055
- onSetAnimationEndTime(moment__default["default"].utc(((eu - targetTime) * ZOOM_RATIO + targetTime) * 1000));
14522
+ onSetAnimationStartTime(moment__default["default"].utc(((su - targetTime) * ZOOM_RATIO + targetTime) * 1000).format(dateFormat));
14523
+ onSetAnimationEndTime(moment__default["default"].utc(((eu - targetTime) * ZOOM_RATIO + targetTime) * 1000).format(dateFormat));
14056
14524
  };
14057
14525
 
14058
14526
  var zoomIn = function zoomIn(relativeX) {
14059
- var su = animationStartTime.unix();
14060
- var eu = animationEndTime.unix();
14527
+ var su = moment__default["default"].utc(animationStartTime).unix();
14528
+ var eu = moment__default["default"].utc(animationEndTime).unix();
14061
14529
  var targetTime = su + (eu - su) * relativeX;
14062
- onSetAnimationStartTime(moment__default["default"].utc(((su - targetTime) / ZOOM_RATIO + targetTime) * 1000));
14063
- onSetAnimationEndTime(moment__default["default"].utc(((eu - targetTime) / ZOOM_RATIO + targetTime) * 1000));
14530
+ onSetAnimationStartTime(moment__default["default"].utc(((su - targetTime) / ZOOM_RATIO + targetTime) * 1000).format(dateFormat));
14531
+ onSetAnimationEndTime(moment__default["default"].utc(((eu - targetTime) / ZOOM_RATIO + targetTime) * 1000).format(dateFormat));
14064
14532
  };
14065
14533
 
14066
14534
  var curTime = selectedTime !== undefined ? selectedTime.toISOString() : moment__default["default"].utc().toISOString();
14067
14535
 
14068
- var _e = __read(React__namespace.useState(animationStartTime && animationStartTime.unix()), 2),
14536
+ var _e = __read(React__namespace.useState(animationStartTime && moment__default["default"].utc(animationStartTime).unix()), 2),
14069
14537
  localAnimationStartTime = _e[0],
14070
14538
  setLocalAnimationStartTime = _e[1];
14071
14539
 
14072
- var _f = __read(React__namespace.useState(animationEndTime && animationEndTime.unix()), 2),
14540
+ var _f = __read(React__namespace.useState(animationEndTime && moment__default["default"].utc(animationEndTime).unix()), 2),
14073
14541
  localAnimationEndTime = _f[0],
14074
14542
  setLocalAnimationEndTime = _f[1];
14075
14543
 
@@ -14143,12 +14611,12 @@
14143
14611
  var onMouseUpTouchEnd = function onMouseUpTouchEnd() {
14144
14612
  // Dispatch changes when releasing mouse
14145
14613
  if (isLeftMarkerDragging) {
14146
- onSetAnimationStartTime(moment__default["default"].utc(localAnimationStartTime * 1000));
14614
+ onSetAnimationStartTime(moment__default["default"].utc(localAnimationStartTime * 1000).format(dateFormat));
14147
14615
  setAnimationDragged(true);
14148
14616
  }
14149
14617
 
14150
14618
  if (isRightMarkerDragging) {
14151
- onSetAnimationEndTime(moment__default["default"].utc(localAnimationEndTime * 1000));
14619
+ onSetAnimationEndTime(moment__default["default"].utc(localAnimationEndTime * 1000).format(dateFormat));
14152
14620
  setAnimationDragged(true);
14153
14621
  }
14154
14622
 
@@ -14204,8 +14672,8 @@
14204
14672
  };
14205
14673
 
14206
14674
  React__namespace.useEffect(function () {
14207
- setLocalAnimationStartTime(animationStartTime && animationStartTime.unix());
14208
- setLocalAnimationEndTime(animationEndTime && animationEndTime.unix());
14675
+ setLocalAnimationStartTime(animationStartTime && moment__default["default"].utc(animationStartTime).unix());
14676
+ setLocalAnimationEndTime(animationEndTime && moment__default["default"].utc(animationEndTime).unix());
14209
14677
  }, [animationStartTime, animationEndTime]);
14210
14678
  var handleKeyDown = React__namespace.useCallback(function (event) {
14211
14679
  if (event.ctrlKey && dataStartTime && dataEndTime) {
@@ -14996,16 +15464,16 @@
14996
15464
  dataStartTime: dataStartTime,
14997
15465
  dataEndTime: dataEndTime,
14998
15466
  scale: scale,
14999
- onSetAnimationStartTime: function onSetAnimationStartTime(time) {
15467
+ onSetAnimationStartTime: function onSetAnimationStartTime(animationStartTime) {
15000
15468
  setAnimationStartTime({
15001
15469
  mapId: mapId,
15002
- animationStartTime: time
15470
+ animationStartTime: animationStartTime
15003
15471
  });
15004
15472
  },
15005
- onSetAnimationEndTime: function onSetAnimationEndTime(time) {
15473
+ onSetAnimationEndTime: function onSetAnimationEndTime(animationEndTime) {
15006
15474
  setAnimationEndTime({
15007
15475
  mapId: mapId,
15008
- animationEndTime: time
15476
+ animationEndTime: animationEndTime
15009
15477
  });
15010
15478
  },
15011
15479
  onSetNewDate: function onSetNewDate(newDate) {
@@ -17839,6 +18307,7 @@
17839
18307
  return adagucTimeFormatted;
17840
18308
  };
17841
18309
 
18310
+ var ORIGIN_REACTMAPVIEW_ONMAPCHANGEDIMENSION = 'ORIGIN_REACTMAPVIEW_ONMAPCHANGEDIMENSION';
17842
18311
  var defaultxml2jsonrequestURL = 'http://localhost:10000/XML2JSON?';
17843
18312
 
17844
18313
  var ReactMapView =
@@ -17895,22 +18364,25 @@
17895
18364
  };
17896
18365
 
17897
18366
  _this.parseWMJSLayer = function (wmLayer, forceReload, updateStrategy, child) {
17898
- var _a = _this.props,
17899
- onMapUpdateAllDimensions = _a.onMapUpdateAllDimensions,
17900
- onLayerChangeStyle = _a.onLayerChangeStyle,
17901
- onLayerSetDimensions = _a.onLayerSetDimensions,
17902
- onServiceSetLayers = _a.onServiceSetLayers,
17903
- onLayerSetStyles = _a.onLayerSetStyles,
17904
- xml2jsonrequestURL = _a.xml2jsonrequestURL,
17905
- mapId = _a.mapId;
17906
-
17907
18367
  var callback = function callback() {
17908
18368
  if (updateStrategy === 'all') {
17909
- setServiceMetadata(wmLayer, mapId, xml2jsonrequestURL, _this.adaguc.webMapJS, _this.props, onMapUpdateAllDimensions, onLayerChangeStyle, onServiceSetLayers, onLayerSetStyles, onLayerSetDimensions);
18369
+ var _a = _this.props,
18370
+ onMapUpdateAllDimensions = _a.onMapUpdateAllDimensions,
18371
+ onLayerChangeStyle = _a.onLayerChangeStyle,
18372
+ onLayerSetDimensions = _a.onLayerSetDimensions,
18373
+ onServiceSetLayers = _a.onServiceSetLayers,
18374
+ onLayerSetStyles = _a.onLayerSetStyles,
18375
+ xml2jsonrequestURL_1 = _a.xml2jsonrequestURL,
18376
+ mapId = _a.mapId;
18377
+ setServiceMetadata(wmLayer, mapId, xml2jsonrequestURL_1, _this.adaguc.webMapJS, _this.props, onMapUpdateAllDimensions, onLayerChangeStyle, onServiceSetLayers, onLayerSetStyles, onLayerSetDimensions);
17910
18378
  }
17911
18379
 
17912
18380
  if (updateStrategy === 'onlydims') {
17913
- setServiceMetadata(wmLayer, mapId, xml2jsonrequestURL, _this.adaguc.webMapJS, _this.props, null, null, null, null, onLayerSetDimensions);
18381
+ var _b = _this.props,
18382
+ onLayerSetDimensions = _b.onLayerSetDimensions,
18383
+ xml2jsonrequestURL_2 = _b.xml2jsonrequestURL,
18384
+ mapId = _b.mapId;
18385
+ setServiceMetadata(wmLayer, mapId, xml2jsonrequestURL_2, _this.adaguc.webMapJS, _this.props, null, null, null, null, onLayerSetDimensions);
17914
18386
  }
17915
18387
 
17916
18388
  if (child) {
@@ -17924,6 +18396,7 @@
17924
18396
  }
17925
18397
  };
17926
18398
 
18399
+ var xml2jsonrequestURL = _this.props.xml2jsonrequestURL;
17927
18400
  wmLayer.parseLayer(callback, forceReload, xml2jsonrequestURL);
17928
18401
  };
17929
18402
 
@@ -17935,6 +18408,9 @@
17935
18408
  _this.drawDebounced = throttleDebounce.debounce(600, _this.drawDebounced);
17936
18409
  _this.checkNewProps = _this.checkNewProps.bind(_this);
17937
18410
  _this.checkAdaguc = _this.checkAdaguc.bind(_this);
18411
+ _this.onAfterSetBBoxListener = _this.onAfterSetBBoxListener.bind(_this);
18412
+ _this.onUpdateBBoxListener = _this.onUpdateBBoxListener.bind(_this);
18413
+ _this.onDimChangeListener = _this.onDimChangeListener.bind(_this);
17938
18414
  _this.currentMapProps = {};
17939
18415
  _this.adagucContainerRef = /*#__PURE__*/React__namespace.createRef();
17940
18416
  _this.adagucWebMapJSRef = /*#__PURE__*/React__namespace.createRef();
@@ -17982,6 +18458,69 @@
17982
18458
  this.clearRefetchTimer();
17983
18459
  };
17984
18460
 
18461
+ ReactMapView.prototype.onDimChangeListener = function () {
18462
+ var _a = this.props,
18463
+ mapId = _a.mapId,
18464
+ onMapChangeDimension = _a.onMapChangeDimension;
18465
+
18466
+ if (this.adaguc && this.adaguc.webMapJS) {
18467
+ var timeDimension = this.adaguc.webMapJS.getDimension('time');
18468
+
18469
+ if (timeDimension) {
18470
+ onMapChangeDimension({
18471
+ mapId: mapId,
18472
+ origin: ORIGIN_REACTMAPVIEW_ONMAPCHANGEDIMENSION,
18473
+ dimension: {
18474
+ name: 'time',
18475
+ currentValue: timeDimension.currentValue
18476
+ }
18477
+ });
18478
+ }
18479
+ }
18480
+ };
18481
+
18482
+ ReactMapView.prototype.onAfterSetBBoxListener = function (wmjsMap) {
18483
+ var _this = this;
18484
+
18485
+ var _a = this.props,
18486
+ mapId = _a.mapId,
18487
+ onMapZoomEnd = _a.onMapZoomEnd;
18488
+ /* Update the map after 100 ms */
18489
+
18490
+ window.setTimeout(function () {
18491
+ var MapViewBBOX = _this.props.bbox;
18492
+ var projectionInfo = wmjsMap.getProjection();
18493
+ /* Trigger onMapZoomEnd callback */
18494
+
18495
+ var mapBBOX = projectionInfo.bbox;
18496
+
18497
+ if (MapViewBBOX.left !== mapBBOX.left || MapViewBBOX.right !== mapBBOX.right || MapViewBBOX.bottom !== mapBBOX.bottom || MapViewBBOX.top !== mapBBOX.top) {
18498
+ onMapZoomEnd({
18499
+ mapId: mapId,
18500
+ bbox: {
18501
+ left: projectionInfo.bbox.left,
18502
+ bottom: projectionInfo.bbox.bottom,
18503
+ right: projectionInfo.bbox.right,
18504
+ top: projectionInfo.bbox.top
18505
+ },
18506
+ srs: projectionInfo.srs
18507
+ });
18508
+ }
18509
+ }, 100);
18510
+ };
18511
+
18512
+ ReactMapView.prototype.onUpdateBBoxListener = function (newBbox) {
18513
+ var oldbbox = this.adaguc.oldbbox || new webmap.WMBBOX(ReactMapView.defaultProps.bbox);
18514
+
18515
+ if (oldbbox.left !== newBbox.left || oldbbox.right !== newBbox.right || oldbbox.top !== newBbox.top || oldbbox.bottom !== newBbox.bottom) {
18516
+ oldbbox.left = newBbox.left;
18517
+ oldbbox.right = newBbox.right;
18518
+ oldbbox.top = newBbox.top;
18519
+ oldbbox.bottom = newBbox.bottom;
18520
+ this.adaguc.oldbbox = new webmap.WMBBOX(oldbbox);
18521
+ }
18522
+ };
18523
+
17985
18524
  ReactMapView.prototype.getWMJSLayerFromReactLayer = function (wmLayers, reactWebMapJSLayer, index) {
17986
18525
  var foundLayer = null;
17987
18526
 
@@ -18019,8 +18558,9 @@
18019
18558
  if (!props) {
18020
18559
  return;
18021
18560
  }
18022
- /* Check map props */
18023
18561
 
18562
+ var needsRedraw = false;
18563
+ /* Check map props */
18024
18564
 
18025
18565
  if (!prevProps || prevProps.showLegend !== props.showLegend) {
18026
18566
  this.adaguc.webMapJS.displayLegendInMap(props.showLegend !== false);
@@ -18028,11 +18568,11 @@
18028
18568
 
18029
18569
  if (!prevProps || prevProps.showScaleBar !== props.showScaleBar) {
18030
18570
  this.adaguc.webMapJS.displayScaleBarInMap(props.showScaleBar !== false);
18571
+ needsRedraw = true;
18031
18572
  }
18032
-
18033
- var needsRedraw = false;
18034
18573
  /* Check map dimensions */
18035
18574
 
18575
+
18036
18576
  if (!prevProps || prevProps.dimensions !== props.dimensions) {
18037
18577
  if (props.dimensions) {
18038
18578
  for (var d = 0; d < props.dimensions.length; d += 1) {
@@ -18070,21 +18610,21 @@
18070
18610
  /* Check display/hide map cursor */
18071
18611
 
18072
18612
 
18073
- if (!prevProps || prevProps.showCursor !== props.showCursor) {
18074
- if (props.showCursor === true) {
18613
+ if (!prevProps || prevProps.displayMapPin !== props.displayMapPin) {
18614
+ if (props.displayMapPin === true) {
18075
18615
  this.adaguc.webMapJS.getMapPin().showMapPin();
18076
- } else if (props.showCursor === false) {
18616
+ } else if (props.displayMapPin === false) {
18077
18617
  this.adaguc.webMapJS.getMapPin().hideMapPin();
18078
18618
  }
18079
18619
  }
18080
18620
  /* Set map cursor location */
18081
18621
 
18082
18622
 
18083
- if (!prevProps || prevProps.mapCursorLocation !== props.mapCursorLocation) {
18084
- if (props.mapCursorLocation) {
18623
+ if (!prevProps || prevProps.mapPinLocation !== props.mapPinLocation) {
18624
+ if (props.mapPinLocation) {
18085
18625
  this.adaguc.webMapJS.getMapPin().positionMapPinByLatLon({
18086
- x: props.mapCursorLocation.lon,
18087
- y: props.mapCursorLocation.lat
18626
+ x: props.mapPinLocation.lon,
18627
+ y: props.mapPinLocation.lat
18088
18628
  });
18089
18629
  }
18090
18630
  }
@@ -18098,6 +18638,14 @@
18098
18638
  }
18099
18639
  }
18100
18640
  }
18641
+ /* Check if layer metadata should be shown */
18642
+
18643
+
18644
+ if (!prevProps || prevProps.showLayerInfo !== props.showLayerInfo) {
18645
+ if (props.showLayerInfo) {
18646
+ this.adaguc.webMapJS.showLayerInfo = props.showLayerInfo;
18647
+ }
18648
+ }
18101
18649
  /* Check children */
18102
18650
 
18103
18651
 
@@ -18359,9 +18907,7 @@
18359
18907
  xml2jsonrequestURL = _a.xml2jsonrequestURL,
18360
18908
  srs = _a.srs,
18361
18909
  bbox = _a.bbox,
18362
- onMapChangeDimension = _a.onMapChangeDimension,
18363
- onMapZoomEnd = _a.onMapZoomEnd,
18364
- onMapCursorChangeLocation = _a.onMapCursorChangeLocation;
18910
+ onMapPinChangeLocation = _a.onMapPinChangeLocation;
18365
18911
 
18366
18912
  if (this.adaguc.webMapJSCreated) {
18367
18913
  return;
@@ -18369,6 +18915,9 @@
18369
18915
 
18370
18916
  this.adaguc.webMapJSCreated = true;
18371
18917
  this.adaguc.webMapJS = new webmap.WMJSMap(this.adagucWebMapJSRef.current);
18918
+ this.adaguc.webMapJS.showLayerInfo = false;
18919
+ /* Enable to show actual layer properties in the map */
18920
+
18372
18921
  registerWMJSMap(this.adaguc.webMapJS, mapId);
18373
18922
  this.adaguc.webMapJS.removeAllLayers();
18374
18923
  this.adaguc.webMapJS.setXML2JSONURL(xml2jsonrequestURL);
@@ -18384,20 +18933,7 @@
18384
18933
  }
18385
18934
 
18386
18935
  this.adaguc.webMapJS.addListener('ondimchange', function () {
18387
- if (_this.adaguc && _this.adaguc.webMapJS) {
18388
- var timeDimension = _this.adaguc.webMapJS.getDimension('time');
18389
-
18390
- if (timeDimension) {
18391
- onMapChangeDimension({
18392
- mapId: mapId,
18393
- origin: 'ReactMapView, 663',
18394
- dimension: {
18395
- name: 'time',
18396
- currentValue: timeDimension.currentValue
18397
- }
18398
- });
18399
- }
18400
- }
18936
+ _this.onDimChangeListener();
18401
18937
  }, true);
18402
18938
  this.adaguc.webMapJS.addListener('onmapready', function () {
18403
18939
  _this.setState({
@@ -18405,42 +18941,20 @@
18405
18941
  });
18406
18942
  });
18407
18943
  this.adaguc.webMapJS.addListener('aftersetbbox', function (wmjsMap) {
18408
- /* Update the map after 1000 ms */
18409
- window.setTimeout(function () {
18410
- var MapViewBBOX = _this.props.bbox;
18411
- var projectionInfo = wmjsMap.getProjection();
18412
- /* Trigger onMapZoomEnd callback */
18413
-
18414
- var mapBBOX = projectionInfo.bbox;
18415
-
18416
- if (MapViewBBOX.left !== mapBBOX.left || MapViewBBOX.right !== mapBBOX.right || MapViewBBOX.bottom !== mapBBOX.bottom || MapViewBBOX.top !== mapBBOX.top) {
18417
- onMapZoomEnd({
18418
- mapId: mapId,
18419
- bbox: {
18420
- left: projectionInfo.bbox.left,
18421
- bottom: projectionInfo.bbox.bottom,
18422
- right: projectionInfo.bbox.right,
18423
- top: projectionInfo.bbox.top
18424
- },
18425
- srs: projectionInfo.srs
18426
- });
18427
- }
18428
- }, 100);
18944
+ _this.onAfterSetBBoxListener(wmjsMap);
18429
18945
  }, true);
18430
18946
  this.adaguc.webMapJS.addListener('onupdatebbox', function (newBbox) {
18431
- var oldbbox = _this.adaguc.oldbbox || new webmap.WMBBOX(ReactMapView.defaultProps.bbox);
18432
-
18433
- if (oldbbox.left !== newBbox.left || oldbbox.right !== newBbox.right || oldbbox.top !== newBbox.top || oldbbox.bottom !== newBbox.bottom) {
18434
- oldbbox.left = newBbox.left;
18435
- oldbbox.right = newBbox.right;
18436
- oldbbox.top = newBbox.top;
18437
- oldbbox.bottom = newBbox.bottom;
18438
- _this.adaguc.oldbbox = new webmap.WMBBOX(oldbbox);
18439
- }
18947
+ _this.onUpdateBBoxListener(newBbox);
18440
18948
  }, true);
18441
18949
  this.adaguc.webMapJS.addListener('onsetmappin', function (mapPinLatLonCoordinate) {
18442
- if (onMapCursorChangeLocation) {
18443
- onMapCursorChangeLocation(mapPinLatLonCoordinate);
18950
+ if (onMapPinChangeLocation) {
18951
+ onMapPinChangeLocation({
18952
+ mapPinLocation: {
18953
+ lat: mapPinLatLonCoordinate.lat,
18954
+ lon: mapPinLatLonCoordinate.lon
18955
+ },
18956
+ mapId: mapId
18957
+ });
18444
18958
  }
18445
18959
  }, true);
18446
18960
  this.resize();
@@ -18542,7 +19056,7 @@
18542
19056
  top: 11652109.058827976
18543
19057
  },
18544
19058
  shouldAutoFetch: true,
18545
- showCursor: false,
19059
+ displayMapPin: false,
18546
19060
  onMount: function onMount() {
18547
19061
  return null;
18548
19062
  },
@@ -18732,16 +19246,17 @@
18732
19246
  * @param {string} mapId mapId: string - Id of the map
18733
19247
  * @param {object} [controls.zoomControls] **optional** controls: object - toggle the map controls, zoomControls defaults to true
18734
19248
  * @param {boolean} [displayTimeInMap] **optional** displayTimeInMap: boolean, toggles the mapTime, defaults to true
19249
+ * @param {boolean} [displayMapPin] **optional** displayMapPin: boolean, toggle the display of pin on click, defaults to false
19250
+ * @param {boolean} [showScaleBar] **optional** showScaleBar: boolean, toggles the scaleBar, defaults to true
18735
19251
  * @example
18736
- * ```<MapViewConnect mapId={mapId} />```
18737
- * @example
18738
- * ```<MapViewConnect mapId={mapId} controls={{ zoomControls: false }} displayTimeInMap={false} />```
19252
+ * ```<MapViewConnect mapId={mapId} controls={{ zoomControls: false }} displayTimeInMap={false} showScaleBar={false}/>```
18739
19253
  */
18740
19254
 
18741
19255
  var MapViewConnect = function MapViewConnect(_a) {
18742
19256
  var mapId = _a.mapId,
18743
19257
  children = _a.children,
18744
- props = __rest(_a, ["mapId", "children"]);
19258
+ displayMapPin = _a.displayMapPin,
19259
+ props = __rest(_a, ["mapId", "children", "displayMapPin"]);
18745
19260
 
18746
19261
  var mapDimensions = reactRedux.useSelector(function (store) {
18747
19262
  return getMapDimensions(store, mapId);
@@ -18767,6 +19282,9 @@
18767
19282
  var animationDelay = reactRedux.useSelector(function (store) {
18768
19283
  return getMapAnimationDelay(store, mapId);
18769
19284
  });
19285
+ var mapPinLocation = reactRedux.useSelector(function (store) {
19286
+ return getPinLocation(store, mapId);
19287
+ });
18770
19288
  var dispatch = reactRedux.useDispatch();
18771
19289
  var mapChangeDimension$1 = React__namespace.useCallback(function (mapDimensionPayload) {
18772
19290
  return dispatch(mapChangeDimension(mapDimensionPayload));
@@ -18810,6 +19328,9 @@
18810
19328
  var layerError$1 = React__namespace.useCallback(function (payload) {
18811
19329
  return dispatch(layerError(payload));
18812
19330
  }, [dispatch]);
19331
+ var mapPinChangeLocation = React__namespace.useCallback(function (payload) {
19332
+ return dispatch(setMapPinLocation(payload));
19333
+ }, [dispatch]);
18813
19334
  return /*#__PURE__*/React__namespace.createElement("div", {
18814
19335
  style: {
18815
19336
  height: '100%'
@@ -18831,9 +19352,11 @@
18831
19352
  },
18832
19353
  srs: srs,
18833
19354
  bbox: bbox,
19355
+ mapPinLocation: displayMapPin && Object.keys(mapPinLocation).length ? mapPinLocation : null,
18834
19356
  dimensions: mapDimensions,
18835
19357
  activeLayerId: activeLayerId,
18836
19358
  animationDelay: animationDelay,
19359
+ displayMapPin: displayMapPin,
18837
19360
  onMapChangeDimension: function onMapChangeDimension(mapDimensionPayload) {
18838
19361
  if (mapDimensionPayload && mapDimensionPayload.dimension && mapDimensionPayload.dimension.name && mapDimensionPayload.dimension.name === 'time') {
18839
19362
  setTime$1({
@@ -18865,6 +19388,7 @@
18865
19388
  onLayerSetDimensions: layerSetDimensions$1,
18866
19389
  onServiceSetLayers: serviceSetLayers$1,
18867
19390
  onLayerSetStyles: layerSetStyles$1,
19391
+ onMapPinChangeLocation: mapPinChangeLocation,
18868
19392
  onMapZoomEnd: function onMapZoomEnd(a) {
18869
19393
  genericSetBbox({
18870
19394
  bbox: a.bbox,
@@ -19468,7 +19992,9 @@
19468
19992
  _h = _a.animationPayload,
19469
19993
  animationPayload = _h === void 0 ? undefined : _h,
19470
19994
  _j = _a.shouldShowZoomControls,
19471
- shouldShowZoomControls = _j === void 0 ? false : _j;
19995
+ shouldShowZoomControls = _j === void 0 ? false : _j,
19996
+ _k = _a.displayMapPin,
19997
+ displayMapPin = _k === void 0 ? false : _k;
19472
19998
  var classes = useStyles$4();
19473
19999
  var dispatch = reactRedux.useDispatch();
19474
20000
  var mapId = React__default["default"].useRef(id || generateMapId()).current;
@@ -19478,9 +20004,9 @@
19478
20004
  }); // make sure all layers have a unique id before going forward
19479
20005
 
19480
20006
 
19481
- var _k = generateUniqueLayerIds(layers, activeLayerId),
19482
- layersNewIds = _k.layersNewIds,
19483
- activeLayerNewId = _k.activeLayerNewId;
20007
+ var _l = generateUniqueLayerIds(layers, activeLayerId),
20008
+ layersNewIds = _l.layersNewIds,
20009
+ activeLayerNewId = _l.activeLayerNewId;
19484
20010
 
19485
20011
  React__default["default"].useEffect(function () {
19486
20012
  // set layers
@@ -19517,8 +20043,8 @@
19517
20043
 
19518
20044
  dispatch(mapStartAnimation({
19519
20045
  mapId: mapId,
19520
- start: moment__default["default"].utc().subtract(duration, 'minutes'),
19521
- end: moment__default["default"].utc(),
20046
+ start: moment__default["default"].utc().subtract(duration, 'minutes').format(dateFormat),
20047
+ end: moment__default["default"].utc().format(dateFormat),
19522
20048
  interval: animationPayload && animationPayload.interval ? animationPayload.interval : animationIntervalDefault
19523
20049
  }));
19524
20050
 
@@ -19551,6 +20077,7 @@
19551
20077
  })), /*#__PURE__*/React__default["default"].createElement(MapViewConnect, {
19552
20078
  controls: {},
19553
20079
  displayTimeInMap: displayTimeInMap,
20080
+ displayMapPin: displayMapPin,
19554
20081
  showScaleBar: false,
19555
20082
  mapId: mapId
19556
20083
  }));
@@ -19950,7 +20477,9 @@
19950
20477
  _f = _a.shouldShowZoomControls,
19951
20478
  shouldShowZoomControls = _f === void 0 ? true : _f,
19952
20479
  _g = _a.animationPayload,
19953
- animationPayload = _g === void 0 ? undefined : _g;
20480
+ animationPayload = _g === void 0 ? undefined : _g,
20481
+ _h = _a.displayMapPin,
20482
+ displayMapPin = _h === void 0 ? false : _h;
19954
20483
  var classes = useStyles$2();
19955
20484
  return /*#__PURE__*/React__default["default"].createElement("div", {
19956
20485
  className: classes.mapSliderConnect,
@@ -19975,7 +20504,8 @@
19975
20504
  shouldAutoUpdate: shouldAutoUpdate,
19976
20505
  shouldAnimate: shouldAnimate,
19977
20506
  animationPayload: animationPayload,
19978
- shouldShowZoomControls: shouldShowZoomControls
20507
+ shouldShowZoomControls: shouldShowZoomControls,
20508
+ displayMapPin: displayMapPin
19979
20509
  }));
19980
20510
  };
19981
20511
 
@@ -20010,6 +20540,7 @@
20010
20540
  return /*#__PURE__*/React__default["default"].createElement(ConfigurableMapWithSliderConnect, __assign({}, mapPreset, {
20011
20541
  id: id,
20012
20542
  bbox: mapPreset && mapPreset.proj && mapPreset.proj.bbox,
20543
+ displayMapPin: mapPreset && mapPreset.displayMapPin,
20013
20544
  srs: mapPreset && mapPreset.proj && mapPreset.proj.srs,
20014
20545
  shouldAutoUpdate: mapPreset && mapPreset.shouldAutoUpdate || false,
20015
20546
  shouldShowZoomControls: shouldShowZoomControls !== undefined ? shouldShowZoomControls : true,
@@ -20759,6 +21290,7 @@
20759
21290
  exports.ZoomControls = ZoomControls;
20760
21291
  exports.componentsLookUp = componentsLookUp;
20761
21292
  exports.coreModuleConfig = coreModuleConfig;
21293
+ exports.dateFormat = dateFormat;
20762
21294
  exports.defaultConfigurations = defaultConfigurations;
20763
21295
  exports.filterNonTimeDimensions = filterNonTimeDimensions;
20764
21296
  exports.generateLayerId = generateLayerId;
@@ -20773,7 +21305,7 @@
20773
21305
  exports.getWMJSMapById = getWMJSMapById;
20774
21306
  exports.getWMJSTimeDimensionForLayerId = getWMJSTimeDimensionForLayerId;
20775
21307
  exports.getWMLayerById = getWMLayerById;
20776
- exports.layerReducer = reducer$5;
21308
+ exports.layerReducer = reducer$6;
20777
21309
  exports.makeMapPreset = makeMapPreset;
20778
21310
  exports.mapActions = actions$3;
20779
21311
  exports.mapConstants = constants$1;