@opengeoweb/core 2.4.0 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/index.esm.js +815 -663
  2. package/index.umd.js +828 -675
  3. package/lib/components/LayerManager/LayerManager.d.ts +2 -1
  4. package/lib/components/LayerManager/LayerManagerConnect.d.ts +1 -0
  5. package/lib/components/LayerManager/LayerSelect/LayerList/LayerListRow.d.ts +18 -0
  6. package/lib/components/LayerManager/LayerSelect/LayerList/LayerListUtils.d.ts +2 -1
  7. package/lib/components/LayerManager/LayerSelect/LayerSelectUtils.d.ts +4 -0
  8. package/lib/components/{TimeSlider/TimeSliderButtons/LoopButton/LoopButton.spec.d.ts → LayerManager/LayerSelect/LayerSelectUtils.spec.d.ts} +0 -0
  9. package/lib/components/LayerManager/LayerSelect/ServiceList/ServiceChip.d.ts +2 -2
  10. package/lib/components/LayerManager/LayerSelect/ServiceList/ServiceChipConnect.d.ts +2 -2
  11. package/lib/components/LayerManager/LayerSelect/ServiceList/ServiceList.d.ts +2 -2
  12. package/lib/components/MapView/MapViewLayer.d.ts +3 -0
  13. package/lib/components/MapWarning/MapWarningProperties.d.ts +6 -0
  14. package/lib/components/{TimeSlider/TimeSliderButtons/LoopButton/LoopButtonConnect.spec.d.ts → MapWarning/MapWarningProperties.spec.d.ts} +0 -0
  15. package/lib/components/ReactMapView/AdagucMapDraw.d.ts +12 -7
  16. package/lib/components/ReactMapView/AdagucMapDraw.stories.d.ts +4 -0
  17. package/lib/components/ReactMapView/AdagucMapDrawContainer.d.ts +2 -1
  18. package/lib/components/ReactMapView/AdagucMapDrawTools.d.ts +9 -0
  19. package/lib/components/{TooltipSelect/TooltipSelect.spec.d.ts → ReactMapView/AdagucMapDrawTools.spec.d.ts} +0 -0
  20. package/lib/components/TimeSlider/TimeSliderButtons/OptionsMenuButton/OptionsMenuButton.d.ts +0 -1
  21. package/lib/components/TimeSlider/TimeSliderButtons/TimeSliderButtons.d.ts +0 -1
  22. package/lib/index.d.ts +2 -2
  23. package/lib/store/layerSelect/sagas.d.ts +3 -1
  24. package/lib/store/mapStore/map/actions.d.ts +1 -8
  25. package/lib/store/mapStore/map/selectors.d.ts +0 -21
  26. package/lib/store/mapStore/service/reducer.d.ts +2 -8
  27. package/lib/store/mapStore/service/selectors.d.ts +6 -8
  28. package/lib/store/mapStore/service/types.d.ts +7 -9
  29. package/lib/store/mapStore/utils/helpers.d.ts +2 -0
  30. package/lib/store/ui/types.d.ts +1 -1
  31. package/lib/utils/defaultConfigurations.d.ts +2 -2
  32. package/lib/utils/defaultTestSettings.d.ts +10 -199
  33. package/lib/utils/jsonPresetFilter.d.ts +2 -1
  34. package/lib/utils/localStorage.d.ts +3 -0
  35. package/lib/utils/localStorage.spec.d.ts +1 -0
  36. package/lib/utils/types.d.ts +4 -5
  37. package/package.json +10 -9
  38. package/lib/components/LayerManager/tooltipContainerStyles.d.ts +0 -2
  39. package/lib/components/TimeSlider/TimeSliderButtons/LoopButton/LoopButton.d.ts +0 -8
  40. package/lib/components/TimeSlider/TimeSliderButtons/LoopButton/LoopButtonConnect.d.ts +0 -10
  41. package/lib/components/TooltipSelect/TooltipSelect.d.ts +0 -14
package/index.esm.js CHANGED
@@ -6,10 +6,10 @@ import React__default, { useState, Component, useRef, useEffect } from 'react';
6
6
  import produce, { produce as produce$1 } from 'immer';
7
7
  import { takeLatest, put, select, call, takeEvery } from 'redux-saga/effects';
8
8
  import { WMGetServiceFromStore, LayerType as LayerType$1, getMapImageStore, WMBBOX, debug, DebugType, WMJSMap, WMLayer, legendImageStore, WMImageEventType, getLegendGraphicURLForLayer } from '@opengeoweb/webmap';
9
- import { Tooltip, Select, Grid, InputLabel, IconButton, Paper, Box, Typography, CircularProgress, List, ListSubheader, ListItem, ListItemText, Dialog, DialogTitle, DialogContent, DialogContentText, TextField, DialogActions, Button, MenuItem, SvgIcon, FormControl, InputAdornment, ListItemSecondaryAction, ListItemIcon, Checkbox, Switch, Slider, FormControlLabel, Popover, useMediaQuery, useTheme, SliderThumb } from '@mui/material';
10
9
  import { connect, useDispatch, useSelector, Provider } from 'react-redux';
10
+ import { Grid, InputLabel, Tooltip, IconButton, Paper, Box, Typography, CircularProgress, List, ListSubheader, ListItem, ListItemText, Dialog, DialogTitle, DialogContent, DialogContentText, TextField, DialogActions, Button, MenuItem, SvgIcon, FormControl, InputAdornment, ListItemSecondaryAction, ListItemIcon, Checkbox, Switch, Slider, FormControlLabel, Popover, useMediaQuery, useTheme, SliderThumb } from '@mui/material';
11
+ import { TooltipSelect, AlertIcon, sliderStyles, tooltipContainerStyles, CustomSlider, ToggleMenu, ManagerButton, EnableButton, AlertBanner, ManagerDeleteButton, ToolContainerDraggable, ToolButton, CustomToggleButton, useIsMounted } from '@opengeoweb/shared';
11
12
  import makeStyles from '@mui/styles/makeStyles';
12
- import { sliderStyles, CustomSlider, ToggleMenu, ManagerButton, EnableButton, AlertBanner, ManagerDeleteButton, ToolContainerDraggable, ToolButton, CustomToggleButton, useIsMounted } from '@opengeoweb/shared';
13
13
  import { Cached, Add, DragIndicator, Close, ChevronLeft, ChevronRight, Link, LinkOff, MoreVert, DeleteForever } from '@mui/icons-material';
14
14
  import { Sortable, ReactSortable } from 'react-sortablejs';
15
15
  import createStyles from '@mui/styles/createStyles';
@@ -17,6 +17,7 @@ import withStyles from '@mui/styles/withStyles';
17
17
  import { debounce as debounce$1 } from 'throttle-debounce';
18
18
  import cloneDeep from 'lodash.clonedeep';
19
19
  import proj4 from 'proj4';
20
+ import * as turf from '@turf/turf';
20
21
  import { createStore, DynamicModuleLoader } from 'redux-dynamic-modules';
21
22
  import { getSagaExtension } from 'redux-dynamic-modules-saga';
22
23
  import { ThemeWrapper, lightTheme } from '@opengeoweb/theme';
@@ -212,19 +213,6 @@ var toggleAutoUpdate = function toggleAutoUpdate(payload) {
212
213
  payload: payload
213
214
  };
214
215
  };
215
- /**
216
- * Toggles loop state for map
217
- *
218
- * Example: toggleLoop({ mapId: 'mapId1', shouldLoop: true })
219
- * @param {object} payload object with mapId: string, shouldLoop: boolean
220
- */
221
-
222
- var toggleLoop = function toggleLoop(payload) {
223
- return {
224
- type: WEBMAP_TOGGLE_LOOP,
225
- payload: payload
226
- };
227
- };
228
216
  /**
229
217
  *Sets the scale of a time slider with id for a map
230
218
  *
@@ -745,7 +733,6 @@ var actions$3 = /*#__PURE__*/Object.freeze({
745
733
  layerMoveLayer: layerMoveLayer,
746
734
  setActiveLayerId: setActiveLayerId,
747
735
  toggleAutoUpdate: toggleAutoUpdate,
748
- toggleLoop: toggleLoop,
749
736
  setTimeSliderScale: setTimeSliderScale,
750
737
  setTimeStep: setTimeStep,
751
738
  setAnimationDelay: setAnimationDelay,
@@ -863,6 +850,16 @@ var generateTimesliderId = function generateTimesliderId() {
863
850
  generatedTimesliderIds += 1;
864
851
  return "timesliderid_".concat(generatedTimesliderIds);
865
852
  };
853
+ var generatedServiceIds = 0;
854
+ var generateServiceId = function generateServiceId() {
855
+ generatedServiceIds += 1;
856
+ return "serviceid_".concat(generatedServiceIds);
857
+ };
858
+ var generatedTimeseriesIds = 0;
859
+ var generateTimeSeriesId = function generateTimeSeriesId() {
860
+ generatedTimeseriesIds += 1;
861
+ return "timeseriesid_".concat(generatedTimeseriesIds);
862
+ };
866
863
  /**
867
864
  * Map for registering wmlayers with their id's
868
865
  */
@@ -2522,18 +2519,6 @@ var getAnimationEndTime = createSelector(getMapById, function (store) {
2522
2519
  var isAutoUpdating = createSelector(getMapById, function (store) {
2523
2520
  return store ? store.isAutoUpdating : false;
2524
2521
  });
2525
- /**
2526
- * Tells whether the "loop" behavior of animation is on/off
2527
- *
2528
- * Example: isLooping = isLooping(store, 'mapid_1')
2529
- * @param {object} store store: object - store object
2530
- * @param {string} mapId mapId: string - Id of the map
2531
- * @returns {boolean} returnType: boolean
2532
- */
2533
-
2534
- var isLooping = createSelector(getMapById, function (store) {
2535
- return store ? store.isLooping : false;
2536
- });
2537
2522
  /**
2538
2523
  * Gets activeLayerId for map
2539
2524
  *
@@ -2825,14 +2810,21 @@ var getServices = createSelector(servicesStore, function (store) {
2825
2810
  *
2826
2811
  * Example: service = getServiceByName(store, 'serviceName')
2827
2812
  * @param {object} store store: object - Store object
2828
- * @returns {Service} returnType: Service
2813
+ * @returns {ReduxService} returnType: Service
2829
2814
  */
2830
2815
 
2831
- var getServiceByName = createSelector([servicesStore, function (state, serviceName) {
2832
- return serviceName;
2833
- }], function (serviceState, serviceName) {
2834
- if (serviceState && serviceState.byId && serviceState.byId[serviceName]) {
2835
- return serviceState.byId[serviceName];
2816
+ var getServiceByName = createSelector([servicesStore, function (state, serviceUrl) {
2817
+ return serviceUrl;
2818
+ }], function (serviceState, serviceUrl) {
2819
+ var foundServiceIndex = serviceState.allIds.findIndex(function (id) {
2820
+ return serviceState.byId[id].serviceUrl === serviceUrl;
2821
+ });
2822
+ /* Add the service based on a url */
2823
+
2824
+ var id = foundServiceIndex !== -1 ? serviceState.allIds[foundServiceIndex] : null;
2825
+
2826
+ if (serviceState && serviceState.byId && serviceState.byId[id]) {
2827
+ return serviceState.byId[id];
2836
2828
  }
2837
2829
 
2838
2830
  return null;
@@ -2902,9 +2894,8 @@ var getServicesInArray = createSelector(servicesStore, function (store) {
2902
2894
  var services = store ? store.byId : {};
2903
2895
  var arrayOfServiceObjects = Object.keys(services).map(function (key) {
2904
2896
  return {
2905
- id: services[key].id,
2906
2897
  name: services[key].name,
2907
- service: services[key].service
2898
+ serviceUrl: services[key].serviceUrl
2908
2899
  };
2909
2900
  });
2910
2901
  return arrayOfServiceObjects;
@@ -2949,7 +2940,6 @@ var selectors$1 = /*#__PURE__*/Object.freeze({
2949
2940
  getAnimationStartTime: getAnimationStartTime,
2950
2941
  getAnimationEndTime: getAnimationEndTime,
2951
2942
  isAutoUpdating: isAutoUpdating,
2952
- isLooping: isLooping,
2953
2943
  getActiveLayerId: getActiveLayerId,
2954
2944
  getMapTimeSliderScale: getMapTimeSliderScale,
2955
2945
  getMapTimeStep: getMapTimeStep,
@@ -4863,10 +4853,10 @@ var setServiceMetadata = function setServiceMetadata(wmLayer, mapId, webMapJSIns
4863
4853
  var updateObject = {
4864
4854
  origin: ORIGIN_REACTMAPVIEWPARSELAYER,
4865
4855
  serviceLayers: {
4866
- id: wmLayer.service,
4867
4856
  name: wmLayer.title,
4868
- service: wmLayer.service,
4869
- layers: layers
4857
+ serviceUrl: wmLayer.service,
4858
+ layers: layers,
4859
+ isUserAddedService: false
4870
4860
  },
4871
4861
  layerStyle: {
4872
4862
  origin: origin,
@@ -5589,140 +5579,6 @@ var synchronizationGroupConfig = {
5589
5579
  sagas: [rootSaga$4, rootSaga$3]
5590
5580
  };
5591
5581
 
5592
- var TooltipSelect = function TooltipSelect(_a) {
5593
- var tooltip = _a.tooltip,
5594
- _a$list = _a.list,
5595
- list = _a$list === void 0 ? [] : _a$list,
5596
- _a$currentIndex = _a.currentIndex,
5597
- currentIndex = _a$currentIndex === void 0 ? -1 : _a$currentIndex,
5598
- _a$onChangeMouseWheel = _a.onChangeMouseWheel,
5599
- onChangeMouseWheel = _a$onChangeMouseWheel === void 0 ? function () {} : _a$onChangeMouseWheel,
5600
- _a$requiresCtrlToChan = _a.requiresCtrlToChange,
5601
- requiresCtrlToChange = _a$requiresCtrlToChan === void 0 ? false : _a$requiresCtrlToChan,
5602
- props = __rest(_a, ["tooltip", "list", "currentIndex", "onChangeMouseWheel", "requiresCtrlToChange"]);
5603
-
5604
- props.disableUnderline;
5605
- var otherProps = __rest(props, ["disableUnderline"]);
5606
-
5607
- var _React$useState = React.useState(false),
5608
- _React$useState2 = _slicedToArray(_React$useState, 2),
5609
- selectOpen = _React$useState2[0],
5610
- setSelectOpen = _React$useState2[1];
5611
-
5612
- var _React$useState3 = React.useState(false),
5613
- _React$useState4 = _slicedToArray(_React$useState3, 2),
5614
- tooltipOpen = _React$useState4[0],
5615
- setTooltipOpen = _React$useState4[1];
5616
-
5617
- var preventDefault = function preventDefault(event) {
5618
- event.preventDefault();
5619
- event.stopPropagation();
5620
- };
5621
-
5622
- var enableScroll = React.useCallback(function () {
5623
- document.removeEventListener('wheel', preventDefault, false);
5624
- }, []);
5625
- var disableScroll = React.useCallback(function () {
5626
- document.addEventListener('wheel', preventDefault, {
5627
- passive: false
5628
- });
5629
- }, []);
5630
- var onWheel = React.useCallback(function (event) {
5631
- if (requiresCtrlToChange && (event.ctrlKey || event.metaKey) || !requiresCtrlToChange) {
5632
- disableScroll();
5633
- if (selectOpen) return;
5634
- var direction = event.deltaY < 0 ? 1 : -1;
5635
- var newValue = list[Math.min(Math.max(currentIndex - direction, 0), list.length - 1)];
5636
- onChangeMouseWheel(newValue);
5637
- } else enableScroll();
5638
- }, [selectOpen, currentIndex, list, onChangeMouseWheel, enableScroll, disableScroll, requiresCtrlToChange]);
5639
- var onOpen = React.useCallback(function () {
5640
- setSelectOpen(true);
5641
- setTooltipOpen(false);
5642
- }, []);
5643
- var onClose = React.useCallback(function () {
5644
- setSelectOpen(false);
5645
- }, []);
5646
- var onMouseEnter = React.useCallback(function () {
5647
- if (!requiresCtrlToChange) {
5648
- disableScroll();
5649
- }
5650
-
5651
- if (!selectOpen) setTooltipOpen(true);
5652
- }, [selectOpen, disableScroll, requiresCtrlToChange]);
5653
- var onMouseLeave = React.useCallback(function () {
5654
- enableScroll();
5655
- setTooltipOpen(false);
5656
- }, [enableScroll]);
5657
- var onFocus = React.useCallback(function () {
5658
- if (!requiresCtrlToChange) {
5659
- disableScroll();
5660
- }
5661
-
5662
- setTooltipOpen(true);
5663
- }, [disableScroll, requiresCtrlToChange]);
5664
- var onBlur = React.useCallback(function () {
5665
- enableScroll();
5666
- setTooltipOpen(false);
5667
- }, [enableScroll]);
5668
- return /*#__PURE__*/React.createElement(Tooltip, {
5669
- title: tooltip,
5670
- placement: "top",
5671
- open: tooltipOpen
5672
- }, /*#__PURE__*/React.createElement(Select, Object.assign({
5673
- onOpen: onOpen,
5674
- onClose: onClose,
5675
- onMouseEnter: onMouseEnter,
5676
- onMouseLeave: onMouseLeave,
5677
- onFocus: onFocus,
5678
- onBlur: onBlur,
5679
- onWheel: onWheel,
5680
- MenuProps: {
5681
- BackdropProps: {
5682
- sx: {
5683
- '&.MuiBackdrop-root': {
5684
- backgroundColor: 'transparent'
5685
- }
5686
- }
5687
- },
5688
- sx: {
5689
- '& ul': {
5690
- backgroundColor: 'geowebColors.background.surface'
5691
- },
5692
- '& li': {
5693
- fontSize: '16px',
5694
- padding: '12px',
5695
- '&:hover': {
5696
- backgroundColor: 'geowebColors.buttons.tool.mouseOver.fill'
5697
- },
5698
- '&.Mui-selected': {
5699
- color: 'geowebColors.buttons.tool.active.color',
5700
- backgroundColor: 'geowebColors.buttons.tool.active.fill',
5701
- boxShadow: "none",
5702
- '&:hover': {
5703
- backgroundColor: 'geowebColors.buttons.tool.activeMouseOver.fill'
5704
- },
5705
- '&:focus': {
5706
- backgroundColor: 'geowebColors.buttons.tool.activeMouseOver.fill'
5707
- }
5708
- },
5709
- '&:after': {
5710
- background: 'none!important'
5711
- },
5712
- '&.Mui-disabled': {
5713
- fontSize: '12px',
5714
- opacity: 0.67,
5715
- padding: '0px 12px',
5716
- '&.MuiMenuItem-root': {
5717
- minHeight: '30px!important'
5718
- }
5719
- }
5720
- }
5721
- }
5722
- }
5723
- }, otherProps)));
5724
- };
5725
-
5726
5582
  /* *
5727
5583
  * Licensed under the Apache License, Version 2.0 (the "License");
5728
5584
  * you may not use this file except in compliance with the License.
@@ -6560,7 +6416,20 @@ var reducer$2 = function reducer() {
6560
6416
  case GENERIC_SYNC_SETBBOX:
6561
6417
  {
6562
6418
  return produce$1(state, function (draft) {
6563
- action.payload.targets.forEach(function (payload) {
6419
+ var _action$payload21 = action.payload,
6420
+ targetsFromAction = _action$payload21.targets,
6421
+ source = _action$payload21.source;
6422
+ /* Because we want backwards compatibility with the previous code, we also need to listen to the original source action */
6423
+
6424
+ var targets = [{
6425
+ targetId: source.payload.sourceId,
6426
+ bbox: source.payload.bbox,
6427
+ srs: source.payload.srs
6428
+ }];
6429
+ /* And then append the targets form the action */
6430
+
6431
+ targets.push.apply(targets, _toConsumableArray(targetsFromAction));
6432
+ targets.forEach(function (payload) {
6564
6433
  var targetId = payload.targetId,
6565
6434
  bbox = payload.bbox,
6566
6435
  srs = payload.srs;
@@ -6578,9 +6447,9 @@ var reducer$2 = function reducer() {
6578
6447
 
6579
6448
  case WEBMAP_TOGGLE_AUTO_UPDATE:
6580
6449
  {
6581
- var _action$payload21 = action.payload,
6582
- _mapId23 = _action$payload21.mapId,
6583
- shouldAutoUpdate = _action$payload21.shouldAutoUpdate;
6450
+ var _action$payload22 = action.payload,
6451
+ _mapId23 = _action$payload22.mapId,
6452
+ shouldAutoUpdate = _action$payload22.shouldAutoUpdate;
6584
6453
 
6585
6454
  if (!state.byId[_mapId23]) {
6586
6455
  return state;
@@ -6593,9 +6462,9 @@ var reducer$2 = function reducer() {
6593
6462
 
6594
6463
  case WEBMAP_TOGGLE_LOOP:
6595
6464
  {
6596
- var _action$payload22 = action.payload,
6597
- _mapId24 = _action$payload22.mapId,
6598
- shouldLoop = _action$payload22.shouldLoop;
6465
+ var _action$payload23 = action.payload,
6466
+ _mapId24 = _action$payload23.mapId,
6467
+ shouldLoop = _action$payload23.shouldLoop;
6599
6468
 
6600
6469
  if (!state.byId[_mapId24]) {
6601
6470
  return state;
@@ -6608,9 +6477,9 @@ var reducer$2 = function reducer() {
6608
6477
 
6609
6478
  case WEBMAP_TOGGLE_TIMESTEP_AUTO:
6610
6479
  {
6611
- var _action$payload23 = action.payload,
6612
- _mapId25 = _action$payload23.mapId,
6613
- timestepAuto = _action$payload23.timestepAuto;
6480
+ var _action$payload24 = action.payload,
6481
+ _mapId25 = _action$payload24.mapId,
6482
+ timestepAuto = _action$payload24.timestepAuto;
6614
6483
 
6615
6484
  if (!state.byId[_mapId25]) {
6616
6485
  return state;
@@ -6623,9 +6492,9 @@ var reducer$2 = function reducer() {
6623
6492
 
6624
6493
  case WEBMAP_TOGGLE_TIME_SLIDER_HOVER:
6625
6494
  {
6626
- var _action$payload24 = action.payload,
6627
- _mapId26 = _action$payload24.mapId,
6628
- isTimeSliderHoverOn = _action$payload24.isTimeSliderHoverOn;
6495
+ var _action$payload25 = action.payload,
6496
+ _mapId26 = _action$payload25.mapId,
6497
+ isTimeSliderHoverOn = _action$payload25.isTimeSliderHoverOn;
6629
6498
 
6630
6499
  if (!state.byId[_mapId26]) {
6631
6500
  return state;
@@ -6638,9 +6507,9 @@ var reducer$2 = function reducer() {
6638
6507
 
6639
6508
  case WEBMAP_SET_PIN:
6640
6509
  {
6641
- var _action$payload25 = action.payload,
6642
- _mapId27 = _action$payload25.mapId,
6643
- mapPinLocation = _action$payload25.mapPinLocation;
6510
+ var _action$payload26 = action.payload,
6511
+ _mapId27 = _action$payload26.mapId,
6512
+ mapPinLocation = _action$payload26.mapPinLocation;
6644
6513
 
6645
6514
  if (!state.byId[_mapId27]) {
6646
6515
  return state;
@@ -6653,9 +6522,9 @@ var reducer$2 = function reducer() {
6653
6522
 
6654
6523
  case WEBMAP_DISABLE_PIN:
6655
6524
  {
6656
- var _action$payload26 = action.payload,
6657
- _mapId28 = _action$payload26.mapId,
6658
- disableMapPin = _action$payload26.disableMapPin;
6525
+ var _action$payload27 = action.payload,
6526
+ _mapId28 = _action$payload27.mapId,
6527
+ disableMapPin = _action$payload27.disableMapPin;
6659
6528
 
6660
6529
  if (!state.byId[_mapId28]) {
6661
6530
  return state;
@@ -6674,9 +6543,9 @@ var reducer$2 = function reducer() {
6674
6543
  * These targets can be used as payloads in new Layer actions.
6675
6544
  * These actions are here handled via the layer reducer, as it is the same logic
6676
6545
  */
6677
- var _action$payload27 = action.payload,
6678
- targets = _action$payload27.targets,
6679
- source = _action$payload27.source;
6546
+ var _action$payload28 = action.payload,
6547
+ targets = _action$payload28.targets,
6548
+ source = _action$payload28.source;
6680
6549
  return targets.reduce(function (prevState, target) {
6681
6550
  var action = {
6682
6551
  payload: target,
@@ -6731,12 +6600,14 @@ var reducer$1 = function reducer() {
6731
6600
  switch (action.type) {
6732
6601
  case MAP_SERVICES_SET_LAYERS:
6733
6602
  return produce(state, function (draft) {
6734
- if (!draft.byId[action.payload.service]) draft.byId[action.payload.service] = {};
6735
- draft.byId[action.payload.service].id = action.payload.id;
6736
- draft.byId[action.payload.service].name = action.payload.name;
6737
- draft.byId[action.payload.service].service = action.payload.service;
6738
- draft.byId[action.payload.service].layers = action.payload.layers;
6739
- if (!draft.allIds.includes(action.payload.service)) draft.allIds.push(action.payload.service);
6603
+ var foundServiceIndex = draft.allIds.findIndex(function (id) {
6604
+ return draft.byId[id].serviceUrl === action.payload.serviceUrl;
6605
+ });
6606
+ /* Add the service based on a url */
6607
+
6608
+ var id = foundServiceIndex !== -1 ? draft.allIds[foundServiceIndex] : generateServiceId();
6609
+ draft.byId[id] = Object.assign({}, action.payload);
6610
+ if (!draft.allIds.includes(id)) draft.allIds.push(id);
6740
6611
  });
6741
6612
 
6742
6613
  case WEBMAP_UPDATE_LAYER_INFO:
@@ -6752,11 +6623,16 @@ var reducer$1 = function reducer() {
6752
6623
 
6753
6624
  case MAP_SERVICES_REMOVE_SERVICE:
6754
6625
  return produce(state, function (draft) {
6755
- if (draft.byId[action.payload.serviceUrl]) {
6626
+ var foundServiceIndex = draft.allIds.findIndex(function (id) {
6627
+ return draft.byId[id].serviceUrl === action.payload.serviceUrl;
6628
+ });
6629
+
6630
+ if (foundServiceIndex !== -1) {
6631
+ var serviceId = draft.allIds[foundServiceIndex];
6756
6632
  draft.allIds = draft.allIds.filter(function (id) {
6757
- return id !== action.payload.serviceUrl;
6633
+ return id !== serviceId;
6758
6634
  });
6759
- delete draft.byId[action.payload.serviceUrl];
6635
+ delete draft.byId[serviceId];
6760
6636
  }
6761
6637
  });
6762
6638
 
@@ -7504,23 +7380,77 @@ var enableOnlyOneKeyword = function enableOnlyOneKeyword(payload) {
7504
7380
  };
7505
7381
  };
7506
7382
 
7383
+ /* *
7384
+ * Licensed under the Apache License, Version 2.0 (the "License");
7385
+ * you may not use this file except in compliance with the License.
7386
+ * You may obtain a copy of the License at
7387
+ *
7388
+ * http://www.apache.org/licenses/LICENSE-2.0
7389
+ *
7390
+ * Unless required by applicable law or agreed to in writing, software
7391
+ * distributed under the License is distributed on an "AS IS" BASIS,
7392
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7393
+ * See the License for the specific language governing permissions and
7394
+ * limitations under the License.
7395
+ *
7396
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
7397
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
7398
+ * */
7399
+ var mergePresetsAndUserAddedServices = function mergePresetsAndUserAddedServices(presets, userAddedServices) {
7400
+ return Object.values(Object.assign(Object.assign({}, presets.reduce(function (byId, preset) {
7401
+ return Object.assign(Object.assign({}, byId), _defineProperty({}, preset.id, preset));
7402
+ }, {})), userAddedServices));
7403
+ };
7404
+ var isService = function isService(param) {
7405
+ var serviceParam = param;
7406
+ return !!((serviceParam === null || serviceParam === void 0 ? void 0 : serviceParam.id) && (serviceParam === null || serviceParam === void 0 ? void 0 : serviceParam.name) && (serviceParam === null || serviceParam === void 0 ? void 0 : serviceParam.url));
7407
+ };
7408
+
7409
+ var getUserAddedServices = function getUserAddedServices() {
7410
+ try {
7411
+ var storedString = window.localStorage.getItem('userAddedServices');
7412
+ var parsedData = JSON.parse(storedString);
7413
+
7414
+ if (parsedData && _typeof(parsedData) === 'object') {
7415
+ return Object.entries(parsedData).reduce(function (userServices, _ref) {
7416
+ var _ref2 = _slicedToArray(_ref, 2),
7417
+ serviceUrl = _ref2[0],
7418
+ service = _ref2[1];
7419
+
7420
+ return Object.assign(Object.assign({}, userServices), isService(service) ? _defineProperty({}, serviceUrl, service) : {});
7421
+ }, {});
7422
+ }
7423
+ } catch (e) {
7424
+ console.error('Unable to read services from localStorage: ', e);
7425
+ }
7426
+
7427
+ return {};
7428
+ };
7429
+ var setUserAddedServices = function setUserAddedServices(services) {
7430
+ try {
7431
+ window.localStorage.setItem('userAddedServices', JSON.stringify(services));
7432
+ } catch (e) {
7433
+ console.error('Unable to write services to localStorage: ', e);
7434
+ }
7435
+ };
7436
+
7507
7437
  var _marked = /*#__PURE__*/regeneratorRuntime.mark(newServiceAddedSaga),
7508
7438
  _marked2 = /*#__PURE__*/regeneratorRuntime.mark(layerSelectServiceRemovedSaga),
7509
7439
  _marked3 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga);
7510
7440
  function newServiceAddedSaga(capturedAction) {
7511
- var addedService, service, keywords;
7441
+ var addedService, serviceUrl, keywords;
7512
7442
  return regeneratorRuntime.wrap(function newServiceAddedSaga$(_context) {
7513
7443
  while (1) {
7514
7444
  switch (_context.prev = _context.next) {
7515
7445
  case 0:
7516
7446
  addedService = capturedAction.payload;
7517
- service = addedService.service;
7447
+ serviceUrl = addedService.serviceUrl;
7518
7448
  keywords = addedService.layers.reduce(function (keywordAccumulator, layer) {
7519
7449
  return keywordAccumulator.concat(layer.path, layer.keywords);
7520
7450
  }, []);
7521
7451
  _context.next = 5;
7522
7452
  return put(addKeywordsAndActiveServices({
7523
- serviceUrl: service,
7453
+ serviceUrl: serviceUrl,
7524
7454
  keywords: keywords
7525
7455
  }));
7526
7456
 
@@ -7551,6 +7481,28 @@ function layerSelectServiceRemovedSaga(capturedAction) {
7551
7481
  }
7552
7482
  }, _marked2);
7553
7483
  }
7484
+ function addServiceToLocalStorageSaga(_ref) {
7485
+ var payload = _ref.payload;
7486
+ var isUserAddedService = payload.isUserAddedService,
7487
+ name = payload.name,
7488
+ serviceUrl = payload.serviceUrl;
7489
+ if (!isUserAddedService) return;
7490
+ var localStorageServices = getUserAddedServices();
7491
+ setUserAddedServices(Object.assign(Object.assign({}, localStorageServices), _defineProperty({}, serviceUrl, {
7492
+ id: serviceUrl,
7493
+ name: name,
7494
+ url: serviceUrl
7495
+ })));
7496
+ }
7497
+ function removeServiceFromLocalStorageSaga(_ref2) {
7498
+ var payload = _ref2.payload;
7499
+ var serviceUrl = payload.serviceUrl;
7500
+ var localStorageServices = getUserAddedServices();
7501
+ if (!localStorageServices[serviceUrl]) return;
7502
+ var updatedServices = Object.assign({}, localStorageServices);
7503
+ delete updatedServices[serviceUrl];
7504
+ setUserAddedServices(updatedServices);
7505
+ }
7554
7506
  function rootSaga() {
7555
7507
  return regeneratorRuntime.wrap(function rootSaga$(_context3) {
7556
7508
  while (1) {
@@ -7564,6 +7516,14 @@ function rootSaga() {
7564
7516
  return takeEvery(MAP_SERVICES_REMOVE_SERVICE, layerSelectServiceRemovedSaga);
7565
7517
 
7566
7518
  case 4:
7519
+ _context3.next = 6;
7520
+ return takeEvery(MAP_SERVICES_SET_LAYERS, addServiceToLocalStorageSaga);
7521
+
7522
+ case 6:
7523
+ _context3.next = 8;
7524
+ return takeEvery(MAP_SERVICES_REMOVE_SERVICE, removeServiceFromLocalStorageSaga);
7525
+
7526
+ case 8:
7567
7527
  case "end":
7568
7528
  return _context3.stop();
7569
7529
  }
@@ -7903,7 +7863,7 @@ var WMSLayerTree = function WMSLayerTree(_ref) {
7903
7863
  * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
7904
7864
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
7905
7865
  * */
7906
- var connectRedux$7 = connect(function (store, props) {
7866
+ var connectRedux$6 = connect(function (store, props) {
7907
7867
  return {
7908
7868
  loadedLayers: getMapLayers(store, props.mapId)
7909
7869
  };
@@ -7966,7 +7926,7 @@ var ConnectedTree = function ConnectedTree(_ref) {
7966
7926
  });
7967
7927
  };
7968
7928
 
7969
- var WMSLayerTreeConnect = connectRedux$7(ConnectedTree);
7929
+ var WMSLayerTreeConnect = connectRedux$6(ConnectedTree);
7970
7930
 
7971
7931
  /* *
7972
7932
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -8325,7 +8285,7 @@ var defaultConfigurations = /*#__PURE__*/Object.freeze({
8325
8285
  preloadedDefaultMapServices: preloadedDefaultMapServices
8326
8286
  });
8327
8287
 
8328
- var useStyles$x = makeStyles({
8288
+ var useStyles$u = makeStyles({
8329
8289
  buttonDiv: {
8330
8290
  position: 'relative'
8331
8291
  },
@@ -8361,7 +8321,7 @@ var AddLayersPopup = function AddLayersPopup(_ref) {
8361
8321
  handleClose = _ref.handleClose,
8362
8322
  _ref$layerType = _ref.layerType,
8363
8323
  layerType = _ref$layerType === void 0 ? LayerType.mapLayer : _ref$layerType;
8364
- var classes = useStyles$x();
8324
+ var classes = useStyles$u();
8365
8325
 
8366
8326
  var _React$useState = React.useState(''),
8367
8327
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -8514,7 +8474,7 @@ var AddLayersPopup = function AddLayersPopup(_ref) {
8514
8474
  }, "Close")));
8515
8475
  };
8516
8476
 
8517
- var styles = {
8477
+ var styles$2 = {
8518
8478
  buttonDiv: {
8519
8479
  position: 'relative'
8520
8480
  },
@@ -8566,7 +8526,7 @@ var AddLayersButton = function AddLayersButton(_ref) {
8566
8526
  title: tooltip
8567
8527
  }, /*#__PURE__*/React.createElement(IconButton, {
8568
8528
  onClick: handleClose,
8569
- sx: styles.button,
8529
+ sx: styles$2.button,
8570
8530
  disableRipple: true,
8571
8531
  "data-testid": "addLayersButton",
8572
8532
  ref: ref,
@@ -8731,7 +8691,7 @@ var LayerSelectButtonConnect = function LayerSelectButtonConnect(_ref) {
8731
8691
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8732
8692
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
8733
8693
  * */
8734
- var useStyles$w = makeStyles({
8694
+ var useStyles$t = makeStyles({
8735
8695
  row: {
8736
8696
  height: '32px'
8737
8697
  },
@@ -8755,7 +8715,7 @@ var DescriptionRow = function DescriptionRow(_ref) {
8755
8715
  layerManagerWidth = _ref.layerManagerWidth,
8756
8716
  _ref$layerSelect = _ref.layerSelect,
8757
8717
  layerSelect = _ref$layerSelect === void 0 ? false : _ref$layerSelect;
8758
- var classes = useStyles$w();
8718
+ var classes = useStyles$t();
8759
8719
  var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
8760
8720
  return /*#__PURE__*/React.createElement(Grid, {
8761
8721
  container: true,
@@ -8799,72 +8759,12 @@ var DescriptionRow = function DescriptionRow(_ref) {
8799
8759
  }));
8800
8760
  };
8801
8761
 
8802
- /* *
8803
- * Licensed under the Apache License, Version 2.0 (the "License");
8804
- * you may not use this file except in compliance with the License.
8805
- * You may obtain a copy of the License at
8806
- *
8807
- * http://www.apache.org/licenses/LICENSE-2.0
8808
- *
8809
- * Unless required by applicable law or agreed to in writing, software
8810
- * distributed under the License is distributed on an "AS IS" BASIS,
8811
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8812
- * See the License for the specific language governing permissions and
8813
- * limitations under the License.
8814
- *
8815
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8816
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
8817
- * */
8818
- var useTooltipContainerStyles = makeStyles(function (theme) {
8819
- return createStyles({
8820
- textContainer: {
8821
- width: '100%',
8822
- height: 32,
8823
- fontWeight: 500,
8824
- fontSize: theme.palette.geowebColors.layerManager.tableRowDefaultText.fontSize,
8825
- color: function color(isEnabled) {
8826
- return isEnabled ? theme.palette.geowebColors.layerManager.tableRowDefaultText.rgba : theme.palette.geowebColors.layerManager.tableRowDisabledText.rgba;
8827
- },
8828
- '& .MuiOutlinedInput-input': {
8829
- padding: '6px 24px 6px 8px'
8830
- },
8831
- '& .MuiOutlinedInput-notchedOutline': {
8832
- borderColor: 'transparent!important'
8833
- },
8834
- '&:hover .MuiSelect-select': {
8835
- backgroundColor: theme.palette.geowebColors.buttons.tool.mouseOver.fill
8836
- },
8837
- '&.Mui-focused .MuiSelect-select': {
8838
- outline: theme.palette.geowebColors.buttons.focusDefault.outline,
8839
- backgroundColor: theme.palette.geowebColors.buttons.tool.mouseOver.fill
8840
- },
8841
- '&:hover&.MuiButton-root': {
8842
- backgroundColor: theme.palette.geowebColors.buttons.tool.mouseOver.fill
8843
- },
8844
- '&:focus&.MuiButton-root': {
8845
- outline: theme.palette.geowebColors.buttons.focusDefault.outline,
8846
- backgroundColor: theme.palette.geowebColors.buttons.tool.mouseOver.fill
8847
- },
8848
- '& .MuiSvgIcon-root': {
8849
- transition: 'none',
8850
- fill: function fill(isEnabled) {
8851
- return isEnabled ? theme.palette.geowebColors.buttons.flat["default"].color : theme.palette.geowebColors.buttons.flat.disabled.color;
8852
- }
8853
- },
8854
- '&>div': {
8855
- paddingLeft: 8
8856
- }
8857
- }
8858
- });
8859
- });
8860
-
8861
8762
  var DimensionSelect = function DimensionSelect(_ref) {
8862
8763
  var layerId = _ref.layerId,
8863
8764
  onLayerChangeDimension = _ref.onLayerChangeDimension,
8864
8765
  _ref$layerDimensions = _ref.layerDimensions,
8865
8766
  layerDimensions = _ref$layerDimensions === void 0 ? [] : _ref$layerDimensions,
8866
8767
  isEnabled = _ref.isEnabled;
8867
- var classes = useTooltipContainerStyles(isEnabled);
8868
8768
 
8869
8769
  var _React$useState = React.useState(layerDimensions.length ? layerDimensions[0].name : ''),
8870
8770
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -8950,7 +8850,7 @@ var DimensionSelect = function DimensionSelect(_ref) {
8950
8850
  'data-testid': 'selectDimension'
8951
8851
  }
8952
8852
  },
8953
- className: classes.textContainer,
8853
+ isEnabled: isEnabled,
8954
8854
  value: activeDimName,
8955
8855
  list: dimNameList,
8956
8856
  currentIndex: dimNameCurrentIndex,
@@ -8976,7 +8876,7 @@ var DimensionSelect = function DimensionSelect(_ref) {
8976
8876
  'data-testid': 'selectDimensionValue'
8977
8877
  }
8978
8878
  },
8979
- className: classes.textContainer,
8879
+ isEnabled: isEnabled,
8980
8880
  value: activeDim && activeDim.currentValue,
8981
8881
  list: dimValueList,
8982
8882
  currentIndex: dimValueCurrentIndex,
@@ -8997,7 +8897,7 @@ var DimensionSelect = function DimensionSelect(_ref) {
8997
8897
  }))));
8998
8898
  };
8999
8899
 
9000
- var useStyles$v = makeStyles(function (theme) {
8900
+ var useStyles$s = makeStyles(function (theme) {
9001
8901
  return createStyles({
9002
8902
  dropdownEmpty: {
9003
8903
  paddingLeft: 8,
@@ -9047,8 +8947,7 @@ var RenderLayers = function RenderLayers(_ref) {
9047
8947
  layers = _ref$layers === void 0 ? [] : _ref$layers,
9048
8948
  _ref$isEnabled = _ref.isEnabled,
9049
8949
  isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
9050
- var classes = useStyles$v();
9051
- var containerClass = useTooltipContainerStyles(isEnabled);
8950
+ var classes = useStyles$s();
9052
8951
 
9053
8952
  if (!layers || !layers.length) {
9054
8953
  return /*#__PURE__*/React.createElement("div", {
@@ -9082,7 +8981,7 @@ var RenderLayers = function RenderLayers(_ref) {
9082
8981
  'data-testid': 'selectLayer'
9083
8982
  }
9084
8983
  },
9085
- className: containerClass.textContainer,
8984
+ isEnabled: isEnabled,
9086
8985
  value: currentValue,
9087
8986
  list: list,
9088
8987
  currentIndex: currentIndex,
@@ -9090,19 +8989,31 @@ var RenderLayers = function RenderLayers(_ref) {
9090
8989
  onChangeMouseWheel: function onChangeMouseWheel(e) {
9091
8990
  return onChangeLayerName(e.value);
9092
8991
  },
9093
- requiresCtrlToChange: true
8992
+ requiresCtrlToChange: true,
8993
+ renderValue: function renderValue(value) {
8994
+ return extendedLayers.find(function (layer) {
8995
+ return layer.name === value;
8996
+ }).text;
8997
+ }
9094
8998
  }, /*#__PURE__*/React.createElement(MenuItem, {
9095
8999
  disabled: true
9096
- }, "Layer"), extendedLayers.map(function (layerFromServiceLayers) {
9000
+ }, "Layer"), extendedLayers.map(function (layerFromServiceLayers, currentIndex) {
9097
9001
  return /*#__PURE__*/React.createElement(MenuItem, {
9098
9002
  key: layerFromServiceLayers.name,
9099
9003
  value: layerFromServiceLayers.name,
9100
- disabled: !layerFromServiceLayers.leaf
9101
- }, layerFromServiceLayers.text);
9004
+ disabled: !layerFromServiceLayers.leaf,
9005
+ sx: {
9006
+ '& .MuiSvgIcon-root': {
9007
+ marginLeft: '28px'
9008
+ }
9009
+ }
9010
+ }, layerFromServiceLayers.text, currentIndex === layers.length && /*#__PURE__*/React.createElement(AlertIcon, {
9011
+ severity: "error"
9012
+ }));
9102
9013
  }));
9103
9014
  };
9104
9015
 
9105
- var useStyles$u = makeStyles(function (theme) {
9016
+ var useStyles$r = makeStyles(function (theme) {
9106
9017
  return {
9107
9018
  opacityDiv: {
9108
9019
  height: 'calc(100% - 5px)',
@@ -9125,7 +9036,7 @@ var useStyles$u = makeStyles(function (theme) {
9125
9036
  position: 'fixed',
9126
9037
  top: '-5px',
9127
9038
  boxSizing: 'initial',
9128
- zIndex: 1,
9039
+ zIndex: 2,
9129
9040
  boxShadow: theme.shadows[8]
9130
9041
  }
9131
9042
  };
@@ -9163,9 +9074,8 @@ var OpacitySelect = function OpacitySelect(_ref) {
9163
9074
  onLayerChangeOpacity = _ref.onLayerChangeOpacity,
9164
9075
  _ref$isEnabled = _ref.isEnabled,
9165
9076
  isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
9166
- var classes = useStyles$u();
9077
+ var classes = useStyles$r();
9167
9078
  var sliderClasses = sliderStyles();
9168
- var containerClass = useTooltipContainerStyles(isEnabled);
9169
9079
 
9170
9080
  var _React$useState = React.useState(false),
9171
9081
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -9177,22 +9087,8 @@ var OpacitySelect = function OpacitySelect(_ref) {
9177
9087
  tooltipOpen = _React$useState4[0],
9178
9088
  setTooltipOpen = _React$useState4[1];
9179
9089
 
9180
- var preventDefault = function preventDefault(event) {
9181
- event.preventDefault();
9182
- event.stopPropagation();
9183
- };
9184
-
9185
- var enableScroll = React.useCallback(function () {
9186
- document.removeEventListener('wheel', preventDefault, false);
9187
- }, []);
9188
- var disableScroll = React.useCallback(function () {
9189
- document.addEventListener('wheel', preventDefault, {
9190
- passive: false
9191
- });
9192
- }, []);
9193
9090
  var onWheel = React.useCallback(function (event) {
9194
9091
  if (event.ctrlKey || event.metaKey) {
9195
- disableScroll();
9196
9092
  var multiplier = event.altKey ? 10 : 1;
9197
9093
  var direction = event.deltaY > 0 ? 0.01 * multiplier : -0.01 * multiplier;
9198
9094
  var newValue = Math.min(Math.max(currentOpacity - direction, 0), 1); // Kind of "one frame debouncer", meant to dampen too fast slider movement
@@ -9200,8 +9096,8 @@ var OpacitySelect = function OpacitySelect(_ref) {
9200
9096
  window.requestAnimationFrame(function () {
9201
9097
  onLayerChangeOpacity(newValue);
9202
9098
  });
9203
- } else enableScroll();
9204
- }, [currentOpacity, onLayerChangeOpacity, disableScroll, enableScroll]);
9099
+ }
9100
+ }, [currentOpacity, onLayerChangeOpacity]);
9205
9101
  var onClickButton = React.useCallback(function () {
9206
9102
  setOpen(!open);
9207
9103
  }, [open]);
@@ -9214,23 +9110,21 @@ var OpacitySelect = function OpacitySelect(_ref) {
9214
9110
  if (!open) setTooltipOpen(true);
9215
9111
  }, [open]);
9216
9112
  var onMouseLeave = React.useCallback(function () {
9217
- enableScroll();
9218
9113
  setTooltipOpen(false);
9219
- }, [enableScroll]);
9114
+ }, []);
9220
9115
  var onFocus = React.useCallback(function () {
9221
9116
  setTooltipOpen(true);
9222
9117
  }, []);
9223
9118
  var onBlur = React.useCallback(function () {
9224
- enableScroll();
9225
9119
  setTooltipOpen(false);
9226
- }, [enableScroll]);
9120
+ }, []);
9227
9121
  return /*#__PURE__*/React.createElement("div", {
9228
9122
  className: classes.opacityDiv,
9229
9123
  onWheel: onWheel,
9230
9124
  "data-testid": "scrollOpacity"
9231
9125
  }, /*#__PURE__*/React.createElement(Tooltip, {
9232
9126
  title: tooltipTitle,
9233
- className: containerClass.textContainer,
9127
+ sx: tooltipContainerStyles(isEnabled),
9234
9128
  placement: "top",
9235
9129
  open: tooltipOpen
9236
9130
  }, /*#__PURE__*/React.createElement(Button, {
@@ -9321,7 +9215,6 @@ var RenderStyles = function RenderStyles(_ref) {
9321
9215
  onChangeLayerStyle = _ref.onChangeLayerStyle,
9322
9216
  _ref$isEnabled = _ref.isEnabled,
9323
9217
  isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
9324
- var classes = useTooltipContainerStyles(isEnabled);
9325
9218
  var styles = [{
9326
9219
  title: 'default',
9327
9220
  name: 'default',
@@ -9356,7 +9249,7 @@ var RenderStyles = function RenderStyles(_ref) {
9356
9249
  'data-testid': 'selectStyle'
9357
9250
  }
9358
9251
  },
9359
- className: classes.textContainer,
9252
+ isEnabled: isEnabled,
9360
9253
  value: currentStyle,
9361
9254
  list: list,
9362
9255
  currentIndex: currentIndex,
@@ -9391,7 +9284,7 @@ var RenderStyles = function RenderStyles(_ref) {
9391
9284
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9392
9285
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
9393
9286
  * */
9394
- var useStyles$t = makeStyles(function (theme) {
9287
+ var useStyles$q = makeStyles(function (theme) {
9395
9288
  return createStyles({
9396
9289
  svgIcon: {
9397
9290
  fill: function fill(_ref) {
@@ -9420,7 +9313,7 @@ var ActivateLayer = function ActivateLayer(_ref2) {
9420
9313
  isActive = _ref2$isActive === void 0 ? false : _ref2$isActive,
9421
9314
  _ref2$isEnabled = _ref2.isEnabled,
9422
9315
  isEnabled = _ref2$isEnabled === void 0 ? true : _ref2$isEnabled;
9423
- var classes = useStyles$t({
9316
+ var classes = useStyles$q({
9424
9317
  isActive: isActive,
9425
9318
  isEnabled: isEnabled
9426
9319
  });
@@ -9473,7 +9366,7 @@ var ActivateLayer = function ActivateLayer(_ref2) {
9473
9366
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9474
9367
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
9475
9368
  * */
9476
- var useStyles$s = makeStyles(function (theme) {
9369
+ var useStyles$p = makeStyles(function (theme) {
9477
9370
  return createStyles({
9478
9371
  row: {
9479
9372
  background: function background(isEnabled) {
@@ -9526,7 +9419,7 @@ var LayerRow = function LayerRow(_ref) {
9526
9419
  layerActiveLayout = _ref.layerActiveLayout,
9527
9420
  layerManagerWidth = _ref.layerManagerWidth,
9528
9421
  dragHandle = _ref.dragHandle;
9529
- var classes = useStyles$s(isEnabled);
9422
+ var classes = useStyles$p(isEnabled);
9530
9423
  var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
9531
9424
 
9532
9425
  var onClickRow = function onClickRow() {
@@ -10152,7 +10045,7 @@ var DragHandle = function DragHandle(_ref) {
10152
10045
  });
10153
10046
  };
10154
10047
 
10155
- var useStyles$r = makeStyles(function () {
10048
+ var useStyles$o = makeStyles(function () {
10156
10049
  return {
10157
10050
  layerRows: {
10158
10051
  width: '100%',
@@ -10172,6 +10065,12 @@ var LayerContainerRow = function LayerContainerRow(_ref) {
10172
10065
  var mapId = _ref.mapId,
10173
10066
  layerManagerWidth = _ref.layerManagerWidth;
10174
10067
  var dispatch = useDispatch();
10068
+
10069
+ var _React$useState = React.useState(false),
10070
+ _React$useState2 = _slicedToArray(_React$useState, 2),
10071
+ keyPressed = _React$useState2[0],
10072
+ setKeyPressed = _React$useState2[1];
10073
+
10175
10074
  var layerIds = useSelector(function (store) {
10176
10075
  return getLayerIds(store, mapId);
10177
10076
  });
@@ -10187,10 +10086,10 @@ var LayerContainerRow = function LayerContainerRow(_ref) {
10187
10086
  }));
10188
10087
  }, [dispatch]);
10189
10088
 
10190
- var _React$useState = React.useState(null),
10191
- _React$useState2 = _slicedToArray(_React$useState, 2),
10192
- activeDragIndex = _React$useState2[0],
10193
- setActiveDragIndex = _React$useState2[1];
10089
+ var _React$useState3 = React.useState(null),
10090
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
10091
+ activeDragIndex = _React$useState4[0],
10092
+ setActiveDragIndex = _React$useState4[1];
10194
10093
 
10195
10094
  var onSetList = function onSetList() {}; // since we use activeDragIndex, we don't need inner state handling of ReactSortable
10196
10095
 
@@ -10219,7 +10118,43 @@ var LayerContainerRow = function LayerContainerRow(_ref) {
10219
10118
 
10220
10119
  var isSorting = activeDragIndex !== null;
10221
10120
  var isDragDisabled = layerIds.length === 1;
10222
- var classes = useStyles$r(isSorting);
10121
+ var classes = useStyles$o(isSorting);
10122
+
10123
+ var keyPressedTrue = function keyPressedTrue(event) {
10124
+ if (event.ctrlKey || event.metaKey) {
10125
+ setKeyPressed(true);
10126
+ }
10127
+ };
10128
+
10129
+ var keyPressedFalse = function keyPressedFalse() {
10130
+ setKeyPressed(false);
10131
+ };
10132
+
10133
+ React.useEffect(function () {
10134
+ window.addEventListener('keydown', keyPressedTrue);
10135
+ window.addEventListener('keyup', keyPressedFalse);
10136
+ return function () {
10137
+ window.removeEventListener('keydown', keyPressedTrue);
10138
+ window.removeEventListener('keyup', keyPressedFalse);
10139
+ };
10140
+ }, []);
10141
+ var preventDefault = React.useCallback(function (event) {
10142
+ event.preventDefault();
10143
+ event.stopPropagation();
10144
+ }, []);
10145
+ React.useEffect(function () {
10146
+ if (keyPressed === true) {
10147
+ window.addEventListener('wheel', preventDefault, {
10148
+ passive: false
10149
+ });
10150
+ } else {
10151
+ window.removeEventListener('wheel', preventDefault);
10152
+ }
10153
+
10154
+ return function () {
10155
+ return window.removeEventListener('wheel', preventDefault);
10156
+ };
10157
+ }, [keyPressed, preventDefault]);
10223
10158
  return /*#__PURE__*/React.createElement(Grid, {
10224
10159
  container: true,
10225
10160
  item: true,
@@ -10275,7 +10210,6 @@ var BaseLayers = function BaseLayers(_ref) {
10275
10210
  var selectedBaseLayers = _ref.selectedBaseLayers,
10276
10211
  availableBaseLayers = _ref.availableBaseLayers,
10277
10212
  onChangeBaseLayers = _ref.onChangeBaseLayers;
10278
- var classes = useTooltipContainerStyles();
10279
10213
 
10280
10214
  if (!availableBaseLayers || !availableBaseLayers.length) {
10281
10215
  return /*#__PURE__*/React.createElement("div", null, "No service available");
@@ -10305,7 +10239,7 @@ var BaseLayers = function BaseLayers(_ref) {
10305
10239
  style: {
10306
10240
  maxWidth: '100%'
10307
10241
  },
10308
- className: classes.textContainer,
10242
+ isEnabled: true,
10309
10243
  value: selectedBaseLayerId,
10310
10244
  list: list,
10311
10245
  currentIndex: currentIndex,
@@ -10429,7 +10363,7 @@ var BaseLayersConnect = function BaseLayersConnect(_ref) {
10429
10363
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10430
10364
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
10431
10365
  * */
10432
- var useStyles$q = makeStyles({
10366
+ var useStyles$n = makeStyles({
10433
10367
  layerRow: {
10434
10368
  width: '100%',
10435
10369
  height: '36px'
@@ -10452,7 +10386,7 @@ var BaseLayerRow = function BaseLayerRow(_ref) {
10452
10386
  layerManagerWidth = _ref.layerManagerWidth,
10453
10387
  _ref$tooltip = _ref.tooltip,
10454
10388
  tooltip = _ref$tooltip === void 0 ? '' : _ref$tooltip;
10455
- var classes = useStyles$q();
10389
+ var classes = useStyles$n();
10456
10390
  var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
10457
10391
  return /*#__PURE__*/React.createElement(Grid, {
10458
10392
  container: true,
@@ -10481,7 +10415,7 @@ var BaseLayerRow = function BaseLayerRow(_ref) {
10481
10415
  })));
10482
10416
  };
10483
10417
 
10484
- var useStyles$p = makeStyles({
10418
+ var styles$1 = {
10485
10419
  layerRowContainer: {
10486
10420
  position: 'relative',
10487
10421
  width: '100%',
@@ -10495,7 +10429,7 @@ var useStyles$p = makeStyles({
10495
10429
  width: '100%',
10496
10430
  boxSizing: 'border-box'
10497
10431
  }
10498
- });
10432
+ };
10499
10433
 
10500
10434
  var LayerManager = function LayerManager(_ref) {
10501
10435
  var mapId = _ref.mapId,
@@ -10515,8 +10449,9 @@ var LayerManager = function LayerManager(_ref) {
10515
10449
  _ref$layerSelect = _ref.layerSelect,
10516
10450
  layerSelect = _ref$layerSelect === void 0 ? false : _ref$layerSelect,
10517
10451
  _ref$showAddLayersToo = _ref.showAddLayersTooltip,
10518
- showAddLayersTooltip = _ref$showAddLayersToo === void 0 ? true : _ref$showAddLayersToo;
10519
- var classes = useStyles$p();
10452
+ showAddLayersTooltip = _ref$showAddLayersToo === void 0 ? true : _ref$showAddLayersToo,
10453
+ _ref$leftComponent = _ref.leftComponent,
10454
+ leftComponent = _ref$leftComponent === void 0 ? null : _ref$leftComponent;
10520
10455
 
10521
10456
  var _React$useState = React.useState(LayerManagerWidth.lg),
10522
10457
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -10548,13 +10483,14 @@ var LayerManager = function LayerManager(_ref) {
10548
10483
  "data-testid": "layerManagerWindow",
10549
10484
  onMouseDown: onMouseDown,
10550
10485
  order: order,
10551
- source: source
10552
- }, /*#__PURE__*/React.createElement("div", {
10553
- className: classes.layerManagerContainer
10486
+ source: source,
10487
+ leftComponent: leftComponent
10488
+ }, /*#__PURE__*/React.createElement(Box, {
10489
+ sx: styles$1.layerManagerContainer
10554
10490
  }, /*#__PURE__*/React.createElement(Grid, {
10555
10491
  container: true,
10556
10492
  "data-testid": "layerManagerRowContainer",
10557
- className: classes.layerRowContainer
10493
+ sx: styles$1.layerRowContainer
10558
10494
  }, /*#__PURE__*/React.createElement(DescriptionRow, {
10559
10495
  mapId: mapId,
10560
10496
  tooltip: showAddLayersTooltip ? 'Add Layers' : '',
@@ -10920,10 +10856,10 @@ var ServicePopup = function ServicePopup(_ref) {
10920
10856
  }
10921
10857
 
10922
10858
  serviceSetLayers({
10923
- id: serviceUrl,
10924
10859
  name: serviceName,
10925
- service: serviceUrl,
10926
- layers: serviceLayers
10860
+ serviceUrl: serviceUrl,
10861
+ layers: serviceLayers,
10862
+ isUserAddedService: true
10927
10863
  });
10928
10864
  setIsLoading(false);
10929
10865
  closePopupAndResetState();
@@ -11306,6 +11242,65 @@ var SearchFieldConnect = function SearchFieldConnect() {
11306
11242
  });
11307
11243
  };
11308
11244
 
11245
+ /* *
11246
+ * Licensed under the Apache License, Version 2.0 (the "License");
11247
+ * you may not use this file except in compliance with the License.
11248
+ * You may obtain a copy of the License at
11249
+ *
11250
+ * http://www.apache.org/licenses/LICENSE-2.0
11251
+ *
11252
+ * Unless required by applicable law or agreed to in writing, software
11253
+ * distributed under the License is distributed on an "AS IS" BASIS,
11254
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11255
+ * See the License for the specific language governing permissions and
11256
+ * limitations under the License.
11257
+ *
11258
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11259
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
11260
+ * */
11261
+ var getMapStoreServiceFromLayerSelectServiceId = function getMapStoreServiceFromLayerSelectServiceId(services, serviceId) {
11262
+ /*
11263
+ Because the mapStore services redux store is refactored,
11264
+ the id's do not match anymore with the layerSelect services redux store.
11265
+ The following code ensures that the right mapStore service is found based on the id in the layerSelect store.
11266
+ TODO: https://gitlab.com/opengeoweb/opengeoweb/-/issues/1883
11267
+ */
11268
+ var mapStoreServiceIndex = Object.keys(services).findIndex(function (serviceKey) {
11269
+ return services[serviceKey].serviceUrl === serviceId;
11270
+ });
11271
+
11272
+ if (mapStoreServiceIndex === -1) {
11273
+ console.warn("serviceId ".concat(serviceId, " not found"));
11274
+ return null;
11275
+ }
11276
+
11277
+ return services[Object.keys(services)[mapStoreServiceIndex]];
11278
+ };
11279
+ var filterLayersFromService = function filterLayersFromService(serviceId, services, keywordIds, allKeywordsActive, searchString) {
11280
+ var mapStoreService = getMapStoreServiceFromLayerSelectServiceId(services, serviceId);
11281
+ if (!mapStoreService) return [];
11282
+
11283
+ if (searchString === '' && allKeywordsActive) {
11284
+ return mapStoreService.layers.filter(function (layer) {
11285
+ return layer.leaf;
11286
+ });
11287
+ }
11288
+
11289
+ var searchStringArray = searchString.split(' ');
11290
+ return mapStoreService.layers.filter(function (layer) {
11291
+ return searchStringArray.every(function (search) {
11292
+ var layerPathAndKeywords = layer.path.concat(layer.keywords);
11293
+ return (!!layerPathAndKeywords && !layerPathAndKeywords.every(function (keyword) {
11294
+ return !keywordIds.includes(keyword);
11295
+ }) || allKeywordsActive) && (!!layer.name && layer.name.toLowerCase().includes(search.toLowerCase()) || !!layer.text && layer.text.toLowerCase().includes(search.toLowerCase()) || !!layer["abstract"] && layer["abstract"].toLowerCase().includes(search.toLowerCase()) || !!layerPathAndKeywords && !layerPathAndKeywords.every(function (keyword) {
11296
+ return !keyword.toLowerCase().includes(search.toLowerCase());
11297
+ }) || mapStoreService.name.toLowerCase().includes(search.toLowerCase()));
11298
+ });
11299
+ }).filter(function (layer) {
11300
+ return layer.leaf;
11301
+ });
11302
+ };
11303
+
11309
11304
  /* *
11310
11305
  * Licensed under the Apache License, Version 2.0 (the "License");
11311
11306
  * you may not use this file except in compliance with the License.
@@ -11363,78 +11358,104 @@ var LayerAddRemoveButton = function LayerAddRemoveButton(_ref) {
11363
11358
  * See the License for the specific language governing permissions and
11364
11359
  * limitations under the License.
11365
11360
  *
11366
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11367
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
11361
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11362
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
11368
11363
  * */
11369
- var filterLayersFromService = function filterLayersFromService(serviceId, services, keywordIds, allKeywordsActive, searchString) {
11370
- if (searchString === '' && allKeywordsActive) {
11371
- return services[serviceId].layers.filter(function (layer) {
11372
- return layer.leaf;
11373
- });
11374
- }
11375
-
11376
- var searchStringArray = searchString.split(' ');
11377
- return services[serviceId].layers.filter(function (layer) {
11378
- return searchStringArray.every(function (search) {
11379
- var layerPathAndKeywords = layer.path.concat(layer.keywords);
11380
- return (!!layerPathAndKeywords && !layerPathAndKeywords.every(function (keyword) {
11381
- return !keywordIds.includes(keyword);
11382
- }) || allKeywordsActive) && (!!layer.name && layer.name.toLowerCase().includes(search.toLowerCase()) || !!layer.text && layer.text.toLowerCase().includes(search.toLowerCase()) || !!layer["abstract"] && layer["abstract"].toLowerCase().includes(search.toLowerCase()) || !!layerPathAndKeywords && !layerPathAndKeywords.every(function (keyword) {
11383
- return !keyword.toLowerCase().includes(search.toLowerCase());
11384
- }) || services[serviceId].name.toLowerCase().includes(search.toLowerCase()));
11385
- });
11386
- }).filter(function (layer) {
11387
- return layer.leaf;
11388
- });
11389
- };
11390
11364
 
11391
- var useStyles$o = makeStyles(function (theme) {
11392
- return {
11393
- layerRow: {
11394
- background: theme.palette.geowebColors.cards.cardContainer,
11395
- padding: '8px 0px 8px 12px',
11365
+ var LayerListRow = function LayerListRow(_ref) {
11366
+ var layer = _ref.layer,
11367
+ layerIndex = _ref.layerIndex,
11368
+ serviceId = _ref.serviceId,
11369
+ addLayer = _ref.addLayer,
11370
+ deleteLayer = _ref.deleteLayer,
11371
+ mapLayers = _ref.mapLayers;
11372
+ return /*#__PURE__*/React__default.createElement(Grid, {
11373
+ "data-testid": "layerListLayerRow",
11374
+ container: true,
11375
+ item: true,
11376
+ xs: 12,
11377
+ justifyContent: "center",
11378
+ alignItems: "center",
11379
+ sx: {
11380
+ backgroundColor: 'geowebColors.cards.cardContainer',
11381
+ paddingLeft: '12px',
11396
11382
  marginBottom: '4px',
11397
11383
  height: '64px',
11398
- border: "solid 1px ".concat(theme.palette.geowebColors.cards.cardContainerBorder),
11399
- display: 'grid',
11400
- gridTemplateColumns: '1fr 0.1fr',
11401
- gridGap: '20px'
11402
- },
11403
- layerText: {
11384
+ border: 'solid 1px',
11385
+ borderColor: 'geowebColors.cards.cardContainerBorder'
11386
+ }
11387
+ }, /*#__PURE__*/React__default.createElement(Grid, {
11388
+ container: true,
11389
+ item: true,
11390
+ xs: 10
11391
+ }, /*#__PURE__*/React__default.createElement(Grid, {
11392
+ container: true,
11393
+ item: true,
11394
+ xs: 12
11395
+ }, /*#__PURE__*/React__default.createElement(Box, {
11396
+ sx: {
11404
11397
  fontSize: '12px',
11398
+ height: '24px',
11399
+ lineHeight: '24px',
11405
11400
  fontWeight: 500,
11406
- overflow: 'clip',
11407
- height: '20px',
11408
- textOverflow: 'ellipsis'
11409
- },
11410
- layerName: {
11401
+ WebkitLineClamp: 1,
11402
+ display: '-webkit-box',
11403
+ WebkitBoxOrient: 'vertical',
11404
+ textOverflow: 'ellipsis',
11405
+ overflow: 'hidden'
11406
+ }
11407
+ }, layer.text)), /*#__PURE__*/React__default.createElement(Grid, {
11408
+ container: true,
11409
+ item: true,
11410
+ xs: 4
11411
+ }, /*#__PURE__*/React__default.createElement(Box, {
11412
+ sx: {
11411
11413
  fontSize: '12px',
11412
11414
  height: '24px',
11413
- overflow: 'clip',
11414
- "float": 'left',
11415
- paddingTop: '6px',
11416
- whiteSpace: 'nowrap'
11417
- },
11418
- layerNameMaxWidth: {
11419
- maxWidth: '270px'
11420
- },
11421
- layerAbstract: {
11415
+ lineHeight: '24px',
11416
+ WebkitLineClamp: 1,
11417
+ display: '-webkit-box',
11418
+ WebkitBoxOrient: 'vertical',
11419
+ textOverflow: 'ellipsis',
11420
+ overflow: 'hidden'
11421
+ }
11422
+ }, layer.name)), layer["abstract"] ? /*#__PURE__*/React__default.createElement(Grid, {
11423
+ "data-testid": "layerAbstract",
11424
+ container: true,
11425
+ item: true,
11426
+ xs: 8,
11427
+ sx: {
11422
11428
  fontSize: '10px',
11423
- paddingLeft: '200px',
11424
- overflow: 'clip',
11425
- height: '30px'
11426
- },
11427
- resultCount: {
11428
- marginBottom: '4px',
11429
- fontSize: '12px'
11430
- },
11431
- layerButton: {
11429
+ height: '30px',
11430
+ paddingLeft: '20px',
11431
+ WebkitLineClamp: 2,
11432
+ display: '-webkit-box',
11433
+ WebkitBoxOrient: 'vertical',
11434
+ textOverflow: 'ellipsis',
11435
+ overflow: 'hidden'
11436
+ }
11437
+ }, layer["abstract"]) : null), /*#__PURE__*/React__default.createElement(Grid, {
11438
+ container: true,
11439
+ item: true,
11440
+ xs: 2,
11441
+ justifyContent: "flex-end",
11442
+ alignItems: "center"
11443
+ }, /*#__PURE__*/React__default.createElement(Box, {
11444
+ sx: {
11445
+ width: '80px',
11446
+ height: '48px',
11432
11447
  marginRight: '8px',
11433
- marginTop: '4px',
11434
- width: '80px'
11448
+ paddingTop: '4px'
11435
11449
  }
11436
- };
11437
- });
11450
+ }, /*#__PURE__*/React__default.createElement(LayerAddRemoveButton, {
11451
+ layer: layer,
11452
+ layerIndex: layerIndex,
11453
+ serviceId: serviceId,
11454
+ addLayer: addLayer,
11455
+ deleteLayer: deleteLayer,
11456
+ mapLayers: mapLayers
11457
+ }))));
11458
+ };
11438
11459
 
11439
11460
  var LayerList = function LayerList(_ref) {
11440
11461
  var services = _ref.services,
@@ -11446,7 +11467,6 @@ var LayerList = function LayerList(_ref) {
11446
11467
  mapLayers = _ref.mapLayers,
11447
11468
  keywordIds = _ref.keywordIds,
11448
11469
  allKeywordsActive = _ref.allKeywordsActive;
11449
- var classes = useStyles$o();
11450
11470
 
11451
11471
  var _React$useState = React.useState(0),
11452
11472
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -11458,42 +11478,29 @@ var LayerList = function LayerList(_ref) {
11458
11478
  return totalNumberOfLayers + filterLayersFromService(serviceId, services, keywordIds, allKeywordsActive, searchString).length;
11459
11479
  }, 0));
11460
11480
  }, [serviceIds, keywordIds, services, searchString, allKeywordsActive]);
11461
- return /*#__PURE__*/React.createElement("div", {
11481
+ return /*#__PURE__*/React.createElement(Box, {
11462
11482
  "data-testid": "layerList"
11463
- }, /*#__PURE__*/React.createElement("div", {
11464
- className: classes.resultCount
11465
- }, numberOfLayers, " results"), /*#__PURE__*/React.createElement("div", {
11466
- style: {
11483
+ }, /*#__PURE__*/React.createElement(Box, {
11484
+ sx: {
11485
+ marginBottom: '4px',
11486
+ fontSize: '12px'
11487
+ }
11488
+ }, numberOfLayers, " results"), /*#__PURE__*/React.createElement(Box, {
11489
+ sx: {
11467
11490
  height: layerSelectHeight - 199,
11468
11491
  overflow: 'auto'
11469
11492
  }
11470
11493
  }, serviceIds.map(function (serviceId) {
11471
11494
  return filterLayersFromService(serviceId, services, keywordIds, allKeywordsActive, searchString).map(function (layer, layerIndex) {
11472
- return /*#__PURE__*/React.createElement("div", {
11473
- key: "".concat(serviceId, "-").concat(layer.name, "-").concat(layer.text)
11474
- }, /*#__PURE__*/React.createElement("div", {
11475
- key: "".concat(serviceId, "-").concat(layer.name),
11476
- className: classes.layerRow,
11477
- "data-testid": "layerListLayerRow"
11478
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
11479
- className: classes.layerText
11480
- }, layer.text), /*#__PURE__*/React.createElement("div", null, layer["abstract"] ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
11481
- className: "".concat(classes.layerName, " ").concat(classes.layerNameMaxWidth)
11482
- }, layer.name), /*#__PURE__*/React.createElement("div", {
11483
- className: classes.layerAbstract,
11484
- "data-testid": "layerAbstract"
11485
- }, layer["abstract"])) : /*#__PURE__*/React.createElement("div", {
11486
- className: classes.layerName
11487
- }, layer.name))), /*#__PURE__*/React.createElement("div", {
11488
- className: classes.layerButton
11489
- }, /*#__PURE__*/React.createElement(LayerAddRemoveButton, {
11495
+ return /*#__PURE__*/React.createElement(LayerListRow, {
11496
+ key: layer.name,
11490
11497
  layer: layer,
11491
11498
  layerIndex: layerIndex,
11492
11499
  serviceId: serviceId,
11493
11500
  addLayer: addLayer,
11494
11501
  deleteLayer: deleteLayer,
11495
11502
  mapLayers: mapLayers
11496
- }))));
11503
+ });
11497
11504
  });
11498
11505
  })));
11499
11506
  };
@@ -11627,10 +11634,10 @@ var ServiceChip = function ServiceChip(_ref) {
11627
11634
  tabIndex: 0,
11628
11635
  "data-testid": all ? 'serviceChipAll' : 'serviceChip',
11629
11636
  onClick: function onClick() {
11630
- return toggleChip(all ? 'all' : service && service.service);
11637
+ return toggleChip(all ? 'all' : service && service.serviceUrl);
11631
11638
  },
11632
11639
  onKeyPress: function onKeyPress() {
11633
- return toggleChip(all ? 'all' : service && service.service);
11640
+ return toggleChip(all ? 'all' : service && service.serviceUrl);
11634
11641
  },
11635
11642
  sx: style
11636
11643
  }, service ? service.name : 'All');
@@ -11701,7 +11708,7 @@ var ServiceChipConnect = function ServiceChipConnect(_ref) {
11701
11708
  });
11702
11709
  };
11703
11710
 
11704
- var useStyles$n = makeStyles(function (theme) {
11711
+ var useStyles$m = makeStyles(function (theme) {
11705
11712
  return createStyles({
11706
11713
  serviceChips: {
11707
11714
  width: '100%',
@@ -11725,7 +11732,7 @@ var useStyles$n = makeStyles(function (theme) {
11725
11732
  fontSize: '0.875rem'
11726
11733
  },
11727
11734
  scrollArrowLeft: {
11728
- width: '120px',
11735
+ width: '100px',
11729
11736
  marginBottom: '-12px',
11730
11737
  height: '34px',
11731
11738
  backgroundImage: "linear-gradient(to left, rgba(0, 0, 0, 0), ".concat(theme.palette.geowebColors.background.surfaceApp, " 51%)"),
@@ -11733,7 +11740,10 @@ var useStyles$n = makeStyles(function (theme) {
11733
11740
  marginRight: '-120px',
11734
11741
  "float": 'left',
11735
11742
  zIndex: 1,
11736
- position: 'relative'
11743
+ position: 'relative',
11744
+ '&:hover': {
11745
+ color: theme.palette.geowebColors.buttons.tertiary.activeMouseOver.color
11746
+ }
11737
11747
  },
11738
11748
  serviceList: {
11739
11749
  height: '32px',
@@ -11742,13 +11752,16 @@ var useStyles$n = makeStyles(function (theme) {
11742
11752
  overflow: 'hidden'
11743
11753
  },
11744
11754
  scrollArrowRight: {
11745
- width: '120px',
11755
+ width: '100px',
11746
11756
  marginBottom: '-12px',
11747
11757
  height: '34px',
11748
11758
  backgroundImage: "linear-gradient(to right, rgba(0, 0, 0, 0), ".concat(theme.palette.geowebColors.background.surfaceApp, " 51%)"),
11749
11759
  right: '0px',
11750
11760
  position: 'fixed',
11751
- cursor: 'pointer'
11761
+ cursor: 'pointer',
11762
+ '&:hover': {
11763
+ color: theme.palette.geowebColors.buttons.tertiary.activeMouseOver.color
11764
+ }
11752
11765
  }
11753
11766
  });
11754
11767
  });
@@ -11776,7 +11789,7 @@ var ServiceList = function ServiceList(_ref4) {
11776
11789
  var ref = React.useRef(null);
11777
11790
  var scrollSpeed = 5;
11778
11791
  var maxWidthValue = ref && ref.current && ref.current.scrollWidth && ref.current.scrollWidth >= layerSelectWidth - margin && ref.current.scrollWidth || layerSelectWidth - 50;
11779
- var classes = useStyles$n({
11792
+ var classes = useStyles$m({
11780
11793
  margin: margin,
11781
11794
  maxWidthValue: maxWidthValue
11782
11795
  });
@@ -11842,13 +11855,14 @@ var ServiceList = function ServiceList(_ref4) {
11842
11855
  key: "All",
11843
11856
  all: true,
11844
11857
  isEnabled: isAllEnabled
11845
- }), Object.keys(services).map(function (service) {
11858
+ }), Object.keys(services).map(function (serviceId) {
11846
11859
  var _a;
11847
11860
 
11861
+ var service = services[serviceId];
11848
11862
  return /*#__PURE__*/React.createElement(ServiceChipConnect, {
11849
- key: services[service].id,
11850
- service: services[service],
11851
- isEnabled: (_a = activeServices[service]) === null || _a === void 0 ? void 0 : _a.enabled
11863
+ key: serviceId,
11864
+ service: service,
11865
+ isEnabled: (_a = activeServices[service.serviceUrl]) === null || _a === void 0 ? void 0 : _a.enabled
11852
11866
  });
11853
11867
  })), layerSelectWidth + margin < width && /*#__PURE__*/React.createElement(ChevronRight, {
11854
11868
  className: classes.scrollArrowRight,
@@ -11890,63 +11904,49 @@ var ServiceListConnect = function ServiceListConnect(_ref) {
11890
11904
  });
11891
11905
  };
11892
11906
 
11893
- var useStyles$m = makeStyles(function (theme) {
11894
- return createStyles({
11895
- servicesContainer: {
11896
- width: '300px',
11897
- maxHeight: '380px',
11898
- top: '140px',
11899
- backgroundColor: theme.palette.geowebColors.background.surface,
11900
- boxShadow: theme.shadows[6],
11901
- overflow: 'auto'
11902
- },
11903
- header: {
11904
- position: 'sticky',
11905
- top: 0,
11906
- fontSize: theme.typography.fontSize,
11907
- padding: '12px',
11908
- backgroundColor: theme.palette.geowebColors.background.surface,
11909
- zIndex: 100
11910
- },
11911
- footer: {
11912
- display: 'flex',
11913
- justifyContent: 'center',
11914
- alignItems: 'center',
11915
- position: 'sticky',
11916
- bottom: 0,
11917
- backgroundColor: theme.palette.geowebColors.background.surface,
11918
- zIndex: 100
11919
- },
11920
- iconFill: {
11921
- color: theme.palette.geowebColors.typographyAndIcons.icon
11922
- },
11923
- button: {
11924
- margin: '16px',
11925
- width: '80%',
11926
- fontSize: '12px',
11927
- textTransform: 'none'
11928
- },
11929
- text: {
11930
- paddingTop: '3px',
11931
- fontSize: '12px',
11932
- fontFamily: theme.typography.fontFamily,
11933
- fontWeight: theme.typography.fontWeightRegular,
11934
- textTransform: 'none',
11935
- color: '#575f7a'
11936
- },
11937
- icon: {
11938
- width: '24px',
11939
- height: '24px'
11940
- }
11941
- });
11942
- });
11907
+ var styles = {
11908
+ servicesContainer: {
11909
+ width: '300px',
11910
+ maxHeight: '380px',
11911
+ top: '140px',
11912
+ backgroundColor: 'geowebColors.background.surface',
11913
+ boxShadow: 6,
11914
+ overflow: 'auto'
11915
+ },
11916
+ header: {
11917
+ position: 'sticky',
11918
+ top: 0,
11919
+ fontSize: 'default',
11920
+ padding: '12px',
11921
+ backgroundColor: 'geowebColors.background.surface',
11922
+ zIndex: 100
11923
+ },
11924
+ footer: {
11925
+ display: 'flex',
11926
+ justifyContent: 'center',
11927
+ alignItems: 'center',
11928
+ position: 'sticky',
11929
+ bottom: 0,
11930
+ backgroundColor: 'geowebColors.background.surface',
11931
+ zIndex: 100
11932
+ },
11933
+ button: {
11934
+ margin: '16px',
11935
+ width: '80%',
11936
+ fontSize: '12px',
11937
+ textTransform: 'none'
11938
+ },
11939
+ icon: {
11940
+ width: '24px',
11941
+ height: '24px'
11942
+ }
11943
+ };
11943
11944
 
11944
11945
  var ServiceOptionsDialog = function ServiceOptionsDialog(_ref) {
11945
11946
  var services = _ref.services,
11946
11947
  mapStoreRemoveService = _ref.mapStoreRemoveService,
11947
11948
  _ref$layers = _ref.layers,
11948
11949
  layers = _ref$layers === void 0 ? [] : _ref$layers;
11949
- var classes = useStyles$m();
11950
11950
 
11951
11951
  var _React$useState = React.useState(false),
11952
11952
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -11970,11 +11970,11 @@ var ServiceOptionsDialog = function ServiceOptionsDialog(_ref) {
11970
11970
  };
11971
11971
 
11972
11972
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, {
11973
- className: classes.servicesContainer,
11973
+ sx: styles.servicesContainer,
11974
11974
  "data-testid": "ServiceDialog"
11975
- }, /*#__PURE__*/React.createElement("div", {
11976
- className: classes.header
11977
- }, " Services"), /*#__PURE__*/React.createElement(List, {
11975
+ }, /*#__PURE__*/React.createElement(Box, {
11976
+ sx: styles.header
11977
+ }, "Services"), /*#__PURE__*/React.createElement(List, {
11978
11978
  disablePadding: true
11979
11979
  }, services.map(function (service) {
11980
11980
  return /*#__PURE__*/React.createElement(ListItem, {
@@ -11996,36 +11996,34 @@ var ServiceOptionsDialog = function ServiceOptionsDialog(_ref) {
11996
11996
  }, /*#__PURE__*/React.createElement(Tooltip, {
11997
11997
  title: "Edit Service"
11998
11998
  }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(IconButton, {
11999
- disabled: isDisabled(service.service),
11999
+ disabled: isDisabled(service.serviceUrl),
12000
12000
  "data-testid": "openEditServiceButton",
12001
12001
  size: "large"
12002
12002
  }, /*#__PURE__*/React.createElement(SvgIcon, null, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
12003
12003
  d: "m8.332 17.09-.005.001-2.652.604.956-2.542.001-.001.001-.001.857-.744 1.69 1.945-.848.738zm.71.815L20.932 7.577 17.823 4 5.933 14.329l-.01.008.005.005L4.173 19l4.857-1.09-.004-.02.019.02-.002-.005z",
12004
- fill: classes.iconFill,
12005
12004
  fillRule: "evenodd"
12006
12005
  })))))), /*#__PURE__*/React.createElement(Tooltip, {
12007
12006
  title: "Delete Service"
12008
12007
  }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(IconButton, {
12009
12008
  size: "large",
12010
- disabled: isDisabled(service.service),
12009
+ disabled: isDisabled(service.serviceUrl),
12011
12010
  onClick: function onClick() {
12012
- return mapStoreRemoveService(service.service);
12011
+ return mapStoreRemoveService(service.serviceUrl);
12013
12012
  },
12014
12013
  "data-testid": "removeServiceButton"
12015
12014
  }, /*#__PURE__*/React.createElement(SvgIcon, null, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
12016
12015
  d: "M17.504 8.228c.588 0 1.027.48.973 1.066l-.876 9.64A1.197 1.197 0 0 1 16.434 20H8.41c-.59 0-1.115-.48-1.167-1.066l-.877-9.64a.962.962 0 0 1 .973-1.066zm-2.115 1.228a.82.82 0 0 0-.819.82v7.674a.818.818 0 0 0 1.638 0v-7.675a.819.819 0 0 0-.819-.819zm-2.968 0a.819.819 0 0 0-.819.82v7.674a.818.818 0 1 0 1.638 0v-7.675a.82.82 0 0 0-.82-.819zm-2.968 0a.819.819 0 0 0-.818.82v7.674a.818.818 0 1 0 1.637 0v-7.675a.82.82 0 0 0-.82-.819zM13.432 4c.21 0 .404.168.436.376l.107.758 3.256-.01a1.606 1.606 0 0 1 1.61 1.6l.001.535-12.841.038L6 6.76a1.605 1.605 0 0 1 1.6-1.61l3.262-.008.103-.758a.454.454 0 0 1 .434-.38z",
12017
- fill: classes.iconFill,
12018
12016
  fillRule: "evenodd"
12019
12017
  }))))))));
12020
- })), /*#__PURE__*/React.createElement("div", {
12021
- className: classes.footer
12018
+ })), /*#__PURE__*/React.createElement(Box, {
12019
+ sx: styles.footer
12022
12020
  }, /*#__PURE__*/React.createElement(Button, {
12023
12021
  onClick: openAddService,
12024
12022
  "data-testid": "openAddServiceButton",
12025
- className: classes.button,
12023
+ sx: styles.button,
12026
12024
  variant: "tertiary",
12027
12025
  startIcon: /*#__PURE__*/React.createElement(SvgIcon, {
12028
- className: classes.icon
12026
+ sx: styles.icon
12029
12027
  }, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
12030
12028
  d: "M13.647 13.647h6.82a1.276 1.276 0 1 0 0-2.552h-6.82v-6.82a1.276 1.276 0 1 0-2.552 0v6.82h-6.82a1.276 1.276 0 1 0 0 2.552h6.82v6.82a1.274 1.274 0 0 0 1.276 1.275c.705 0 1.276-.571 1.276-1.276v-6.82z",
12031
12029
  fillRule: "evenodd"
@@ -12695,14 +12693,14 @@ var LayerSelectConnect = function LayerSelectConnect(_ref) {
12695
12693
  }, [dispatch]);
12696
12694
  React.useEffect(function () {
12697
12695
  if (isOpenInStore && preloadedServices && preloadedServices.length > 0) {
12698
- preloadedServices.forEach(function (service) {
12696
+ mergePresetsAndUserAddedServices(preloadedServices, getUserAddedServices()).forEach(function (service) {
12699
12697
  getLayersFlattenedFromService(service.url).then(function (layers) {
12700
12698
  if (isMounted.current) {
12701
12699
  serviceSetLayers$1({
12702
- id: service.id,
12703
12700
  name: service.name,
12704
- service: service.url,
12705
- layers: layers
12701
+ serviceUrl: service.url,
12702
+ layers: layers,
12703
+ isUserAddedService: false
12706
12704
  });
12707
12705
  }
12708
12706
  })["catch"](function () {
@@ -12760,7 +12758,9 @@ var LayerManagerConnect = function LayerManagerConnect(_ref) {
12760
12758
  _ref$showTitle = _ref.showTitle,
12761
12759
  showTitle = _ref$showTitle === void 0 ? false : _ref$showTitle,
12762
12760
  _ref$layerSelect = _ref.layerSelect,
12763
- layerSelect = _ref$layerSelect === void 0 ? false : _ref$layerSelect;
12761
+ layerSelect = _ref$layerSelect === void 0 ? false : _ref$layerSelect,
12762
+ _ref$leftComponent = _ref.leftComponent,
12763
+ leftComponent = _ref$leftComponent === void 0 ? null : _ref$leftComponent;
12764
12764
  var dispatch = useDispatch();
12765
12765
  var isOpenInStore = useSelector(function (store) {
12766
12766
  return getisDialogOpen(store, 'layerManager');
@@ -12829,8 +12829,11 @@ var LayerManagerConnect = function LayerManagerConnect(_ref) {
12829
12829
  onMouseDown: onOrderDialog,
12830
12830
  order: uiOrder,
12831
12831
  source: uiSource,
12832
- layerSelect: layerSelect
12833
- }), layerSelect && /*#__PURE__*/React.createElement(LayerSelectConnect, null));
12832
+ layerSelect: layerSelect,
12833
+ leftComponent: leftComponent
12834
+ }), layerSelect && /*#__PURE__*/React.createElement(LayerSelectConnect, {
12835
+ preloadedServices: preloadedMapServices
12836
+ }));
12834
12837
  };
12835
12838
 
12836
12839
  /* *
@@ -13800,60 +13803,6 @@ var AutoUpdateButton = function AutoUpdateButton(_ref) {
13800
13803
  }, "AUTO")))))));
13801
13804
  };
13802
13805
 
13803
- /* *
13804
- * Licensed under the Apache License, Version 2.0 (the "License");
13805
- * you may not use this file except in compliance with the License.
13806
- * You may obtain a copy of the License at
13807
- *
13808
- * http://www.apache.org/licenses/LICENSE-2.0
13809
- *
13810
- * Unless required by applicable law or agreed to in writing, software
13811
- * distributed under the License is distributed on an "AS IS" BASIS,
13812
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13813
- * See the License for the specific language governing permissions and
13814
- * limitations under the License.
13815
- *
13816
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
13817
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
13818
- * */
13819
- var svgLoopPath = {
13820
- title: 'Loop',
13821
- src: 'M20.029 10.371c.24-.013.487.078.67.246.176.162.278.38.288.615.001 0 .22 1.941-1.458 3.79-1.124 1.224-2.718 1.844-4.74 1.844H6.96v1.288c0 .43-.284.654-.564.654-.14 0-.277-.05-.41-.148l-2.671-1.948c-.2-.147-.314-.36-.314-.587 0-.229.114-.443.315-.588l2.67-1.95c.134-.096.272-.145.41-.145.28 0 .563.224.563.653v1.116h7.832c1.417 0 2.59-.465 3.393-1.342 1.025-1.13 1.011-2.28.998-2.5-.023-.508.355-.954.842-.998zM17.605 5c.14 0 .277.05.41.148l2.671 1.947c.2.147.314.36.314.587 0 .23-.114.444-.315.589l-2.67 1.949c-.134.096-.272.146-.41.146-.28 0-.563-.224-.563-.654V8.597H9.21c-1.416 0-2.59.465-3.393 1.342-1.025 1.13-1.011 2.329-.999 2.558.024.508-.354.954-.841.998l-.05.002c-.228 0-.454-.09-.626-.248-.176-.163-.278-.38-.288-.614-.002 0-.227-1.993 1.458-3.849 1.124-1.224 2.718-1.845 4.74-1.845h7.83V5.654c0-.429.284-.654.564-.654z'
13822
- };
13823
- var svgLoopOffPath = {
13824
- title: 'Loop off',
13825
- src: 'M15.154 3.26l1.827.814-1.278 2.867h1.339V5.654c0-.429.283-.654.563-.654.14 0 .277.05.41.148l2.671 1.947c.2.147.314.36.314.587 0 .23-.114.444-.315.589l-2.67 1.949c-.134.096-.272.146-.41.146-.28 0-.563-.224-.563-.654V8.597h-2.076l-2.944 6.613h2.768c1.328 0 2.442-.408 3.238-1.182l.155-.16c1.025-1.129 1.011-2.279.998-2.499-.023-.508.355-.954.842-.998.247-.013.493.078.676.246.176.162.278.38.288.615.001 0 .22 1.941-1.458 3.79-1.124 1.224-2.718 1.844-4.74 1.844h-3.504l-2.439 5.478-1.827-.813 2.077-4.666H6.958v1.29c0 .429-.283.653-.563.653-.14 0-.277-.05-.41-.148l-2.671-1.948c-.2-.147-.314-.36-.314-.587 0-.229.114-.443.315-.588l2.67-1.95c.134-.096.272-.145.41-.145.28 0 .563.224.563.653v1.116h2.875l2.944-6.614H9.21c-1.322 0-2.432.405-3.228 1.172l-.165.17c-1.025 1.13-1.011 2.329-.999 2.558.024.508-.354.954-.841.998l-.05.002c-.228 0-.454-.09-.626-.248-.176-.163-.278-.38-.288-.614-.002 0-.227-1.993 1.458-3.849 1.124-1.224 2.718-1.845 4.74-1.845h4.303l1.64-3.68z'
13826
- };
13827
-
13828
- var LoopButton = function LoopButton(_ref) {
13829
- var _ref$isLooping = _ref.isLooping,
13830
- isLooping = _ref$isLooping === void 0 ? true : _ref$isLooping,
13831
- _ref$isDisabled = _ref.isDisabled,
13832
- isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
13833
- _ref$onToggleLoop = _ref.onToggleLoop,
13834
- onToggleLoop = _ref$onToggleLoop === void 0 ? function () {
13835
- return null;
13836
- } : _ref$onToggleLoop;
13837
- var loopButtonPath = isLooping ? svgLoopOffPath : svgLoopPath;
13838
- return /*#__PURE__*/React.createElement(Tooltip, {
13839
- title: loopButtonPath.title
13840
- }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(ToolButton, {
13841
- onClick: function onClick() {
13842
- return onToggleLoop();
13843
- },
13844
- active: isLooping,
13845
- disabled: isDisabled,
13846
- "data-testid": "loopButton"
13847
- }, /*#__PURE__*/React.createElement(SvgIcon, null, /*#__PURE__*/React.createElement("rect", {
13848
- width: 24,
13849
- height: 24,
13850
- fill: "transparent"
13851
- }), /*#__PURE__*/React.createElement("path", {
13852
- "data-testid": isLooping ? 'loop-off-svg-path' : 'loop-svg-path',
13853
- d: loopButtonPath.src
13854
- })))));
13855
- };
13856
-
13857
13806
  var useStyles$g = makeStyles(function (theme) {
13858
13807
  return {
13859
13808
  speedButtonDiv: {
@@ -14281,7 +14230,6 @@ var OptionsPopOver = withStyles(function (theme) {
14281
14230
 
14282
14231
  var OptionsMenuButton = function OptionsMenuButton(_ref) {
14283
14232
  var autoUpdateBtn = _ref.autoUpdateBtn,
14284
- loopBtn = _ref.loopBtn,
14285
14233
  speedBtn = _ref.speedBtn,
14286
14234
  timeStepBtn = _ref.timeStepBtn;
14287
14235
 
@@ -14345,9 +14293,6 @@ var OptionsMenuButton = function OptionsMenuButton(_ref) {
14345
14293
  })), /*#__PURE__*/React.createElement(Grid, {
14346
14294
  item: true,
14347
14295
  xs: "auto"
14348
- }, loopBtn || /*#__PURE__*/React.createElement(LoopButton, null)), /*#__PURE__*/React.createElement(Grid, {
14349
- item: true,
14350
- xs: "auto"
14351
14296
  }, autoUpdateBtn || /*#__PURE__*/React.createElement(AutoUpdateButton, null)))));
14352
14297
  };
14353
14298
 
@@ -14436,7 +14381,6 @@ var useStyles$e = makeStyles({
14436
14381
 
14437
14382
  var TimeSliderButtons = function TimeSliderButtons(_ref) {
14438
14383
  var autoUpdateBtn = _ref.autoUpdateBtn,
14439
- loopBtn = _ref.loopBtn,
14440
14384
  optionsMenuBtn = _ref.optionsMenuBtn,
14441
14385
  playBtn = _ref.playBtn,
14442
14386
  speedBtn = _ref.speedBtn,
@@ -14447,7 +14391,7 @@ var TimeSliderButtons = function TimeSliderButtons(_ref) {
14447
14391
  "data-testid": "timeSliderButtons"
14448
14392
  }, matches ? /*#__PURE__*/React.createElement(Grid, {
14449
14393
  container: true,
14450
- spacing: 1,
14394
+ spacing: 2,
14451
14395
  className: classes.buttonContainerBig
14452
14396
  }, /*#__PURE__*/React.createElement(Grid, {
14453
14397
  item: true
@@ -14465,8 +14409,6 @@ var TimeSliderButtons = function TimeSliderButtons(_ref) {
14465
14409
  }
14466
14410
  })), /*#__PURE__*/React.createElement(Grid, {
14467
14411
  item: true
14468
- }, loopBtn || /*#__PURE__*/React.createElement(LoopButton, null)), /*#__PURE__*/React.createElement(Grid, {
14469
- item: true
14470
14412
  }, autoUpdateBtn || /*#__PURE__*/React.createElement(AutoUpdateButton, null)), /*#__PURE__*/React.createElement(Grid, {
14471
14413
  item: true
14472
14414
  }, playBtn || /*#__PURE__*/React.createElement(PlayButton, null))) : /*#__PURE__*/React.createElement(Grid, {
@@ -16547,14 +16489,14 @@ var TimeSlider = function TimeSlider(_ref) {
16547
16489
  * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16548
16490
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
16549
16491
  * */
16550
- var connectRedux$6 = connect(function (store, props) {
16492
+ var connectRedux$5 = connect(function (store, props) {
16551
16493
  return {
16552
16494
  isAutoUpdating: isAutoUpdating(store, props.mapId)
16553
16495
  };
16554
16496
  }, {
16555
16497
  toggleAutoUpdate: toggleAutoUpdate
16556
16498
  });
16557
- var AutoUpdateButtonConnectComponent = connectRedux$6(function (_ref) {
16499
+ var AutoUpdateButtonConnectComponent = connectRedux$5(function (_ref) {
16558
16500
  var mapId = _ref.mapId,
16559
16501
  isAutoUpdating = _ref.isAutoUpdating,
16560
16502
  toggleAutoUpdate = _ref.toggleAutoUpdate;
@@ -16572,54 +16514,7 @@ var AutoUpdateButtonConnectComponent = connectRedux$6(function (_ref) {
16572
16514
  disabled: false
16573
16515
  });
16574
16516
  });
16575
- var AutoUpdateButtonConnect = connectRedux$6(AutoUpdateButtonConnectComponent);
16576
-
16577
- /* *
16578
- * Licensed under the Apache License, Version 2.0 (the "License");
16579
- * you may not use this file except in compliance with the License.
16580
- * You may obtain a copy of the License at
16581
- *
16582
- * http://www.apache.org/licenses/LICENSE-2.0
16583
- *
16584
- * Unless required by applicable law or agreed to in writing, software
16585
- * distributed under the License is distributed on an "AS IS" BASIS,
16586
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16587
- * See the License for the specific language governing permissions and
16588
- * limitations under the License.
16589
- *
16590
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16591
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
16592
- * */
16593
- var connectRedux$5 = connect(function (store, props) {
16594
- return {
16595
- isLooping: isLooping(store, props.mapId)
16596
- };
16597
- }, {
16598
- mapToggleLoop: toggleLoop
16599
- });
16600
- var LoopButtonConnect = connectRedux$5(function (_ref) {
16601
- var mapId = _ref.mapId,
16602
- _ref$isLooping = _ref.isLooping,
16603
- isLooping = _ref$isLooping === void 0 ? true : _ref$isLooping,
16604
- _ref$isDisabled = _ref.isDisabled,
16605
- isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
16606
- mapToggleLoop = _ref.mapToggleLoop;
16607
-
16608
- var onMapToggleLoop = function onMapToggleLoop() {
16609
- mapToggleLoop({
16610
- mapId: mapId,
16611
- shouldLoop: !isLooping
16612
- });
16613
- };
16614
-
16615
- return /*#__PURE__*/React__default.createElement(LoopButton, {
16616
- isLooping: isLooping,
16617
- isDisabled: isDisabled,
16618
- onToggleLoop: function onToggleLoop() {
16619
- onMapToggleLoop();
16620
- }
16621
- });
16622
- });
16517
+ var AutoUpdateButtonConnect = connectRedux$5(AutoUpdateButtonConnectComponent);
16623
16518
 
16624
16519
  /* *
16625
16520
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -16750,9 +16645,6 @@ var OptionsMenuButtonConnect = function OptionsMenuButtonConnect(_ref) {
16750
16645
  autoUpdateBtn: /*#__PURE__*/React.createElement(AutoUpdateButtonConnect, {
16751
16646
  mapId: mapId
16752
16647
  }),
16753
- loopBtn: /*#__PURE__*/React.createElement(LoopButtonConnect, {
16754
- mapId: mapId
16755
- }),
16756
16648
  speedBtn: /*#__PURE__*/React.createElement(SpeedButtonConnect, {
16757
16649
  mapId: mapId
16758
16650
  }),
@@ -16856,9 +16748,6 @@ var TimeSliderButtonsConnect = function TimeSliderButtonsConnect(_ref) {
16856
16748
  autoUpdateBtn: /*#__PURE__*/React.createElement(AutoUpdateButtonConnect, {
16857
16749
  mapId: mapId
16858
16750
  }),
16859
- loopBtn: /*#__PURE__*/React.createElement(LoopButtonConnect, {
16860
- mapId: mapId
16861
- }),
16862
16751
  optionsMenuBtn: /*#__PURE__*/React.createElement(OptionsMenuButtonConnect, {
16863
16752
  mapId: mapId
16864
16753
  }),
@@ -18239,6 +18128,172 @@ var tileRenderSettings = {
18239
18128
  }
18240
18129
  };
18241
18130
 
18131
+ /* *
18132
+ * Licensed under the Apache License, Version 2.0 (the "License");
18133
+ * you may not use this file except in compliance with the License.
18134
+ * You may obtain a copy of the License at
18135
+ *
18136
+ * http://www.apache.org/licenses/LICENSE-2.0
18137
+ *
18138
+ * Unless required by applicable law or agreed to in writing, software
18139
+ * distributed under the License is distributed on an "AS IS" BASIS,
18140
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18141
+ * See the License for the specific language governing permissions and
18142
+ * limitations under the License.
18143
+ *
18144
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
18145
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
18146
+ * */
18147
+ /* Function which calculates the distance between two points */
18148
+ // eslint-disable-next-line class-methods-use-this
18149
+
18150
+ var distance = function distance(a, b) {
18151
+ return Math.sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
18152
+ };
18153
+
18154
+ var checkHoverVertice = function checkHoverVertice(feature, mouseX, mouseY, convertGeoCoordsToScreenCoords) {
18155
+ var maxDistance = 20;
18156
+
18157
+ if (feature.geometry.type === 'Point') {
18158
+ var featureCoords = feature.geometry.coordinates;
18159
+ /* Get all vertexes */
18160
+
18161
+ var XYCoords = convertGeoCoordsToScreenCoords([featureCoords]);
18162
+
18163
+ if (XYCoords.length > 0 && distance(XYCoords[0], {
18164
+ x: mouseX,
18165
+ y: mouseY
18166
+ }) < maxDistance) {
18167
+ return {
18168
+ coordinateIndexInFeature: 0
18169
+ };
18170
+ }
18171
+ }
18172
+
18173
+ if (feature.geometry.type === 'MultiPoint') {
18174
+ for (var polygonIndex = feature.geometry.coordinates.length - 1; polygonIndex >= 0; polygonIndex -= 1) {
18175
+ var _featureCoords = feature.geometry.coordinates[polygonIndex];
18176
+
18177
+ if (_featureCoords === undefined) {
18178
+ // eslint-disable-next-line no-continue
18179
+ continue;
18180
+ }
18181
+ /* Get all vertexes */
18182
+
18183
+
18184
+ var _XYCoords = convertGeoCoordsToScreenCoords([_featureCoords]);
18185
+
18186
+ if (_XYCoords.length > 0 && distance(_XYCoords[0], {
18187
+ x: mouseX,
18188
+ y: mouseY
18189
+ }) < maxDistance) {
18190
+ return {
18191
+ coordinateIndexInFeature: polygonIndex
18192
+ };
18193
+ }
18194
+ }
18195
+ }
18196
+
18197
+ if (feature.geometry.type === 'Polygon') {
18198
+ var point = [mouseX, mouseY];
18199
+
18200
+ for (var _polygonIndex = feature.geometry.coordinates.length - 1; _polygonIndex >= 0; _polygonIndex -= 1) {
18201
+ var _featureCoords2 = feature.geometry.coordinates[_polygonIndex];
18202
+
18203
+ if (_featureCoords2 === undefined) {
18204
+ // eslint-disable-next-line no-continue
18205
+ continue;
18206
+ }
18207
+ /* Get all vertexes */
18208
+
18209
+
18210
+ var poly = [convertGeoCoordsToScreenCoords(_featureCoords2).map(function (coord) {
18211
+ return [coord.x, coord.y];
18212
+ })];
18213
+
18214
+ try {
18215
+ var isPointInPoly = turf.booleanPointInPolygon(turf.point(point), turf.polygon(poly));
18216
+
18217
+ if (isPointInPoly) {
18218
+ return {
18219
+ coordinateIndexInFeature: _polygonIndex
18220
+ };
18221
+ } // eslint-disable-next-line no-empty
18222
+
18223
+ } catch (e) {}
18224
+ }
18225
+ }
18226
+
18227
+ if (feature.geometry.type === 'MultiPolygon') {
18228
+ var _point = [mouseX, mouseY];
18229
+
18230
+ for (var _polygonIndex2 = feature.geometry.coordinates.length - 1; _polygonIndex2 >= 0; _polygonIndex2 -= 1) {
18231
+ var _featureCoords3 = feature.geometry.coordinates[_polygonIndex2][0];
18232
+
18233
+ if (_featureCoords3 === undefined) {
18234
+ // eslint-disable-next-line no-continue
18235
+ continue;
18236
+ }
18237
+
18238
+ var _poly = [convertGeoCoordsToScreenCoords(_featureCoords3).map(function (coord) {
18239
+ return [coord.x, coord.y];
18240
+ })];
18241
+
18242
+ try {
18243
+ var _isPointInPoly = turf.booleanPointInPolygon(turf.point(_point), turf.polygon(_poly));
18244
+
18245
+ if (_isPointInPoly) {
18246
+ return {
18247
+ coordinateIndexInFeature: _polygonIndex2
18248
+ };
18249
+ } // eslint-disable-next-line no-empty
18250
+
18251
+ } catch (e) {}
18252
+ }
18253
+ }
18254
+
18255
+ if (feature.geometry.type === 'LineString') {
18256
+ var _featureCoords4 = feature.geometry.coordinates;
18257
+ /* Get all vertexes */
18258
+
18259
+ var _XYCoords2 = convertGeoCoordsToScreenCoords(_featureCoords4);
18260
+ /* Snap to the vertex closer than specified pixels */
18261
+
18262
+
18263
+ for (var j = 0; j < _XYCoords2.length; j += 1) {
18264
+ var coord = _XYCoords2[j];
18265
+
18266
+ if (distance(coord, {
18267
+ x: mouseX,
18268
+ y: mouseY
18269
+ }) < maxDistance) {
18270
+ return {
18271
+ coordinateIndexInFeature: j
18272
+ };
18273
+ }
18274
+ }
18275
+ }
18276
+
18277
+ return null;
18278
+ };
18279
+
18280
+ var checkHoverFeatures = function checkHoverFeatures(geojson, mouseX, mouseY, convertGeoCoordsToScreenCoords) {
18281
+ for (var j = 0; j < geojson.features.length; j += 1) {
18282
+ var feature = geojson.features[j];
18283
+ var hoverResult = checkHoverVertice(feature, mouseX, mouseY, convertGeoCoordsToScreenCoords);
18284
+
18285
+ if (hoverResult != null) {
18286
+ return {
18287
+ coordinateIndexInFeature: hoverResult.coordinateIndexInFeature,
18288
+ featureIndex: j,
18289
+ feature: feature
18290
+ };
18291
+ }
18292
+ }
18293
+
18294
+ return null;
18295
+ };
18296
+
18242
18297
  var Proj4js = proj4; // Cache for for storing and reusing Proj4 instances
18243
18298
 
18244
18299
  var projectorCache = {}; // Ensure that you have a Proj4 object, pulling from the cache if necessary
@@ -18850,9 +18905,12 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
18850
18905
  }, {
18851
18906
  key: "adagucMouseMove",
18852
18907
  value: function adagucMouseMove(event) {
18908
+ var _this2 = this;
18909
+
18853
18910
  var _this$props2 = this.props,
18854
18911
  isInEditMode = _this$props2.isInEditMode,
18855
- featureNrToEdit = _this$props2.featureNrToEdit;
18912
+ featureNrToEdit = _this$props2.featureNrToEdit,
18913
+ onHoverFeature = _this$props2.onHoverFeature;
18856
18914
  if (event && event.rightButton === true) return;
18857
18915
  /* adagucMouseMove is an event callback function which is triggered when the mouse moves over the map
18858
18916
  This event is only triggered if the map is in hover state.
@@ -18865,6 +18923,29 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
18865
18923
  this.mouseX = mouseX;
18866
18924
  this.mouseY = mouseY;
18867
18925
 
18926
+ if (onHoverFeature) {
18927
+ var handleMouseStoppedTimer = function handleMouseStoppedTimer() {
18928
+ var result = checkHoverFeatures(_this2.geojson, mouseX, mouseY, function (coordinates) {
18929
+ return _this2.convertGeoCoordsToScreenCoords(coordinates);
18930
+ });
18931
+
18932
+ if (result) {
18933
+ var featureEvent = {
18934
+ coordinateIndexInFeature: result.coordinateIndexInFeature,
18935
+ featureIndex: result.featureIndex,
18936
+ mouseX: mouseX,
18937
+ mouseY: mouseY,
18938
+ isInEditMode: isInEditMode,
18939
+ feature: result.feature
18940
+ };
18941
+ onHoverFeature(featureEvent);
18942
+ }
18943
+ };
18944
+
18945
+ window.clearTimeout(this.mouseStoppedTimer);
18946
+ this.mouseStoppedTimer = window.setTimeout(handleMouseStoppedTimer, 20);
18947
+ }
18948
+
18868
18949
  if (isInEditMode === false) {
18869
18950
  return;
18870
18951
  }
@@ -18942,14 +19023,14 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
18942
19023
  }, {
18943
19024
  key: "triggerMouseDownTimer",
18944
19025
  value: function triggerMouseDownTimer(event) {
18945
- var _this2 = this;
19026
+ var _this3 = this;
18946
19027
 
18947
19028
  if (!this.doubleClickTimer) this.doubleClickTimer = {};
18948
19029
  var mouseX = event.mouseX,
18949
19030
  mouseY = event.mouseY;
18950
19031
 
18951
19032
  var checkTimeOut = function checkTimeOut() {
18952
- _this2.doubleClickTimer.isRunning = false;
19033
+ _this3.doubleClickTimer.isRunning = false;
18953
19034
  };
18954
19035
  /* Reset the timer */
18955
19036
 
@@ -19384,9 +19465,35 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
19384
19465
  }, {
19385
19466
  key: "adagucMouseUp",
19386
19467
  value: function adagucMouseUp(event) {
19387
- var isInEditMode = this.props.isInEditMode;
19468
+ var _this4 = this;
19469
+
19470
+ var _this$props10 = this.props,
19471
+ isInEditMode = _this$props10.isInEditMode,
19472
+ onClickFeature = _this$props10.onClickFeature;
19388
19473
  if (event && event.rightButton === true) return;
19389
19474
 
19475
+ if (onClickFeature) {
19476
+ var mouseX = event.mouseX,
19477
+ mouseY = event.mouseY;
19478
+ var result = checkHoverFeatures(this.geojson, mouseX, mouseY, function (coordinates) {
19479
+ return _this4.convertGeoCoordsToScreenCoords(coordinates);
19480
+ });
19481
+
19482
+ if (result) {
19483
+ var featureEvent = {
19484
+ coordinateIndexInFeature: result.coordinateIndexInFeature,
19485
+ featureIndex: result.featureIndex,
19486
+ mouseX: mouseX,
19487
+ mouseY: mouseY,
19488
+ isInEditMode: isInEditMode,
19489
+ feature: result.feature
19490
+ };
19491
+ onClickFeature(featureEvent);
19492
+ } else {
19493
+ onClickFeature(null);
19494
+ }
19495
+ }
19496
+
19390
19497
  if (isInEditMode === false) {
19391
19498
  return;
19392
19499
  }
@@ -19420,9 +19527,9 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
19420
19527
  }, {
19421
19528
  key: "cancelEdit",
19422
19529
  value: function cancelEdit(cancelLastPoint) {
19423
- var _this$props10 = this.props,
19424
- isInEditMode = _this$props10.isInEditMode,
19425
- featureNrToEdit = _this$props10.featureNrToEdit;
19530
+ var _this$props11 = this.props,
19531
+ isInEditMode = _this$props11.isInEditMode,
19532
+ featureNrToEdit = _this$props11.featureNrToEdit;
19426
19533
 
19427
19534
  if (isInEditMode === false) {
19428
19535
  return;
@@ -19595,14 +19702,14 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
19595
19702
  just before adagucviewer will flip the back canvas buffer to the front.
19596
19703
  You are free to draw anything you like on the canvas.
19597
19704
  */
19598
- var _this$props11 = this.props,
19599
- featureNrToEdit = _this$props11.featureNrToEdit,
19600
- isInEditMode = _this$props11.isInEditMode,
19601
- hoverFeatureCallback = _this$props11.hoverFeatureCallback;
19705
+ var _this$props12 = this.props,
19706
+ featureNrToEdit = _this$props12.featureNrToEdit,
19707
+ isInEditMode = _this$props12.isInEditMode;
19602
19708
  if (!this.geojson || !this.geojson.features || !this.geojson.features.length) return;
19603
19709
  this.textPositions = [];
19604
19710
  this.mouseOverPolygonCoordinates = [];
19605
19711
  this.mouseOverPolygonFeatureIndex = -1;
19712
+ this.mouseOverPolygonIndex = -1;
19606
19713
  /* Current selected feature from GeoJSON */
19607
19714
 
19608
19715
  for (var featureIndex = 0; featureIndex < this.geojson.features.length; featureIndex += 1) {
@@ -19795,19 +19902,6 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
19795
19902
  ctx.globalAlpha = 1;
19796
19903
  ctx.stroke();
19797
19904
  }
19798
- } // if (isInEditMode === true &&
19799
- // this.mouseOverPolygonFeatureIndex === this.props.featureNrToEdit &&
19800
-
19801
-
19802
- if (hoverFeatureCallback) {
19803
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
19804
- // @ts-ignore
19805
- hoverFeatureCallback({
19806
- polygonIndex: this.mouseOverPolygonFeatureIndex,
19807
- featureIndex: this.mouseOverPolygonFeatureIndex,
19808
- mouseX: this.mouseX,
19809
- mouseY: this.mouseY
19810
- });
19811
19905
  }
19812
19906
  /* Draw labels */
19813
19907
 
@@ -20085,9 +20179,9 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
20085
20179
  }, {
20086
20180
  key: "drawLine",
20087
20181
  value: function drawLine(ctx, XYCoords, featureIndex, lineStringIndex) {
20088
- var _this$props12 = this.props,
20089
- isInEditMode = _this$props12.isInEditMode,
20090
- featureNrToEdit = _this$props12.featureNrToEdit;
20182
+ var _this$props13 = this.props,
20183
+ isInEditMode = _this$props13.isInEditMode,
20184
+ featureNrToEdit = _this$props13.featureNrToEdit;
20091
20185
  var feature = this.geojson.features[featureIndex];
20092
20186
  if (!feature || !feature.geometry) return;
20093
20187
  if (feature.geometry.type !== 'LineString') return;
@@ -20131,7 +20225,8 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
20131
20225
  // if (test) {
20132
20226
 
20133
20227
  this.mouseOverPolygonCoordinates = 0;
20134
- this.mouseOverPolygonFeatureIndex = 0; // }
20228
+ this.mouseOverPolygonFeatureIndex = 0;
20229
+ this.mouseOverPolygonIndex = 0; // }
20135
20230
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
20136
20231
  // @ts-ignore
20137
20232
 
@@ -20160,9 +20255,9 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
20160
20255
  }, {
20161
20256
  key: "drawPolygon",
20162
20257
  value: function drawPolygon(ctx, XYCoords, featureIndex, polygonIndex) {
20163
- var _this$props13 = this.props,
20164
- isInEditMode = _this$props13.isInEditMode,
20165
- featureNrToEdit = _this$props13.featureNrToEdit;
20258
+ var _this$props14 = this.props,
20259
+ isInEditMode = _this$props14.isInEditMode,
20260
+ featureNrToEdit = _this$props14.featureNrToEdit;
20166
20261
  var feature = this.geojson.features[featureIndex];
20167
20262
  if (!feature || !feature.geometry) return;
20168
20263
  if (feature.geometry.type !== 'Polygon' && feature.geometry.type !== 'MultiPolygon') return;
@@ -20209,6 +20304,7 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
20209
20304
  if (test) {
20210
20305
  this.mouseOverPolygonCoordinates = XYCoords;
20211
20306
  this.mouseOverPolygonFeatureIndex = featureIndex;
20307
+ this.mouseOverPolygonIndex = polygonIndex;
20212
20308
  } // eslint-disable-next-line @typescript-eslint/ban-ts-comment
20213
20309
  // @ts-ignore
20214
20310
 
@@ -20363,9 +20459,9 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
20363
20459
  }, {
20364
20460
  key: "render",
20365
20461
  value: function render() {
20366
- var _this$props14 = this.props,
20367
- webmapjs = _this$props14.webmapjs,
20368
- isInDeleteMode = _this$props14.isInDeleteMode;
20462
+ var _this$props15 = this.props,
20463
+ webmapjs = _this$props15.webmapjs,
20464
+ isInDeleteMode = _this$props15.isInDeleteMode;
20369
20465
 
20370
20466
  if (this.disabled === undefined) {
20371
20467
  this.disabled = isInDeleteMode;
@@ -20430,9 +20526,14 @@ var AdagucMapDrawContainer = function AdagucMapDrawContainer(_ref) {
20430
20526
  isInDeleteMode: layer.isInDeleteMode,
20431
20527
  drawMode: layer.drawMode,
20432
20528
  webmapjs: webMapJS,
20433
- hoverFeatureCallback: function hoverFeatureCallback(hoverInfo) {
20434
- if (layer.hoverFeatureCallback) {
20435
- layer.hoverFeatureCallback(hoverInfo);
20529
+ onHoverFeature: function onHoverFeature(hoverInfo) {
20530
+ if (layer.onHoverFeature) {
20531
+ layer.onHoverFeature(hoverInfo);
20532
+ }
20533
+ },
20534
+ onClickFeature: function onClickFeature(hoverInfo) {
20535
+ if (layer.onClickFeature) {
20536
+ layer.onClickFeature(hoverInfo);
20436
20537
  }
20437
20538
  },
20438
20539
  updateGeojson: function updateGeojson(geojson) {
@@ -23303,4 +23404,55 @@ var CoreThemeStoreProvider = function CoreThemeStoreProvider(_ref2) {
23303
23404
  }, children)));
23304
23405
  };
23305
23406
 
23306
- export { ConfigurableConnectedMap, ConfigurableMapWithSliderConnect, CoreThemeProvider, CoreThemeStoreProvider, HarmRefTimePreset, HarmonieTempAndPrecipPreset, LayerManagerConnect, LayerManagerMapButtonConnect, Legend, LegendConnect, LegendMapButtonConnect, MapControls, MapView, MapViewConnect, MapViewLayer, MultiDimensionSelectMapButtonsConnect, MultiMapMultiDimensionSelectConnect as MultiMapDimensionSelectConnect, MultiMapViewConnect, ReactMapView, ReactMapViewLayer, SyncGroupViewerConnect, index as SyncGroups, TimeSliderConnect, TooltipSelect, ZoomControlConnect, ZoomControls, componentsLookUp, coreModuleConfig, dateFormat, defaultConfigurations, filterBaseLayers, filterBbox, filterDimensions, filterMapLayers, filterMapPresets, filterNonTimeDimensions, filterServices, filterSrs, generateLayerId, generateMapId, generateTimesliderId, getFirstTimeStepForLayerId, getInitialPresets, getLastTimeStepForLayerId, getNextTimeStepForLayerId, getPreviousTimeStepForLayerId, getWMJSDimensionForLayerAndDimension, getWMJSMapById, getWMJSTimeDimensionForLayerId, getWMLayerById, reducer$6 as layerReducer, makeMapPreset, actions$3 as mapActions, constants as mapConstants, moduleConfig as mapModuleConfig, selectors$1 as mapSelectors, types$2 as mapTypes, utils as mapUtils, publicLayers, publicServices, registerWMJSMap, registerWMLayer, store, actions as syncGroupActions, synchronizationGroupConfig as synchronizationGroupModuleConfig, testLayers, actions$2 as uiActions, uiModuleConfig, selectors as uiSelectors, types$1 as uiTypes, useStyles$3 as useStyles };
23407
+ /* *
23408
+ * Licensed under the Apache License, Version 2.0 (the "License");
23409
+ * you may not use this file except in compliance with the License.
23410
+ * You may obtain a copy of the License at
23411
+ *
23412
+ * http://www.apache.org/licenses/LICENSE-2.0
23413
+ *
23414
+ * Unless required by applicable law or agreed to in writing, software
23415
+ * distributed under the License is distributed on an "AS IS" BASIS,
23416
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23417
+ * See the License for the specific language governing permissions and
23418
+ * limitations under the License.
23419
+ *
23420
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
23421
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
23422
+ * */
23423
+ var MapWarningProperties = function MapWarningProperties(_ref) {
23424
+ var selectedFeatureProperties = _ref.selectedFeatureProperties;
23425
+ return /*#__PURE__*/React__default.createElement("div", {
23426
+ "data-testid": "map-warning-properties",
23427
+ style: {
23428
+ width: '100%',
23429
+ height: '15%',
23430
+ marginTop: '30px',
23431
+ marginLeft: '100px',
23432
+ position: 'relative',
23433
+ zIndex: 10000,
23434
+ backgroundColor: '#CCCCCCC0',
23435
+ padding: '0px 20px 20px',
23436
+ overflow: 'auto',
23437
+ fontSize: '11px'
23438
+ }
23439
+ }, /*#__PURE__*/React__default.createElement("h1", {
23440
+ "data-testid": "map-warning-properties-title"
23441
+ }, selectedFeatureProperties.country), selectedFeatureProperties.details[0].event && /*#__PURE__*/React__default.createElement("pre", {
23442
+ "data-testid": "map-warning-properties-row"
23443
+ }, "Event: ", selectedFeatureProperties.details[0].event), selectedFeatureProperties.details[0].sent && /*#__PURE__*/React__default.createElement("pre", {
23444
+ "data-testid": "map-warning-properties-row"
23445
+ }, "Sent:", ' ', moment.utc(selectedFeatureProperties.details[0].sent).format('DD MMM YYYY, HH:mm'), ' ', "UTC"), selectedFeatureProperties.details[0].expires && /*#__PURE__*/React__default.createElement("pre", {
23446
+ "data-testid": "map-warning-properties-row"
23447
+ }, "Expires:", ' ', moment.utc(selectedFeatureProperties.details[0].expires).format('DD MMM YYYY, HH:mm'), ' ', "UTC"), selectedFeatureProperties.details[0].web && /*#__PURE__*/React__default.createElement("pre", {
23448
+ "data-testid": "map-warning-properties-row"
23449
+ }, "Web: ", selectedFeatureProperties.details[0].web), selectedFeatureProperties.details[0].sender && /*#__PURE__*/React__default.createElement("pre", {
23450
+ "data-testid": "map-warning-properties-row"
23451
+ }, "Sender: ", selectedFeatureProperties.details[0].sender), selectedFeatureProperties.details[0].identifier && /*#__PURE__*/React__default.createElement("pre", {
23452
+ "data-testid": "map-warning-properties-row"
23453
+ }, "Identifier: ", selectedFeatureProperties.details[0].identifier), selectedFeatureProperties.details[0].area && /*#__PURE__*/React__default.createElement("pre", {
23454
+ "data-testid": "map-warning-properties-row"
23455
+ }, "area: ", selectedFeatureProperties.details[0].area));
23456
+ };
23457
+
23458
+ export { ConfigurableConnectedMap, ConfigurableMapWithSliderConnect, CoreThemeProvider, CoreThemeStoreProvider, HarmRefTimePreset, HarmonieTempAndPrecipPreset, LayerManagerConnect, LayerManagerMapButtonConnect, Legend, LegendConnect, LegendMapButtonConnect, MapControls, MapView, MapViewConnect, MapViewLayer, MapWarningProperties, MultiDimensionSelectMapButtonsConnect, MultiMapMultiDimensionSelectConnect as MultiMapDimensionSelectConnect, MultiMapViewConnect, ReactMapView, ReactMapViewLayer, SyncGroupViewerConnect, index as SyncGroups, TimeSliderConnect, ZoomControlConnect, ZoomControls, componentsLookUp, coreModuleConfig, dateFormat, defaultConfigurations, filterBaseLayers, filterBbox, filterDimensions, filterMapLayers, filterMapPresets, filterNonTimeDimensions, filterServices, filterSrs, generateLayerId, generateMapId, generateServiceId, generateTimeSeriesId, generateTimesliderId, getFirstTimeStepForLayerId, getInitialPresets, getLastTimeStepForLayerId, getNextTimeStepForLayerId, getPreviousTimeStepForLayerId, getWMJSDimensionForLayerAndDimension, getWMJSMapById, getWMJSTimeDimensionForLayerId, getWMLayerById, reducer$6 as layerReducer, makeMapPreset, actions$3 as mapActions, constants as mapConstants, moduleConfig as mapModuleConfig, selectors$1 as mapSelectors, types$2 as mapTypes, utils as mapUtils, publicLayers, publicServices, registerWMJSMap, registerWMLayer, store, actions as syncGroupActions, synchronizationGroupConfig as synchronizationGroupModuleConfig, synchronizationGroupConfig as synchronizationGroupsConfig, testLayers, actions$2 as uiActions, uiModuleConfig, selectors as uiSelectors, types$1 as uiTypes, useStyles$3 as useStyles };