@opengeoweb/core 2.2.1 → 2.3.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 (32) hide show
  1. package/index.esm.js +597 -556
  2. package/index.umd.js +578 -548
  3. package/lib/components/ComponentsLookUp/componentsLookUp.d.ts +1 -1
  4. package/lib/components/ConfigurableConnectedMap/ConfigurableConnectedMap.d.ts +2 -0
  5. package/lib/components/ConfigurableMapWithSlider/ConfigurableMapWithSliderConnect.d.ts +3 -0
  6. package/lib/components/LayerManager/LayerContainerRow/LayerManagerButton.d.ts +1 -0
  7. package/lib/components/LayerManager/LayerContainerRow/LayerRow/Menubutton/MenuButton.d.ts +0 -2
  8. package/lib/components/LayerManager/LayerContainerRow/LayerRow/styles.d.ts +1 -0
  9. package/lib/components/LayerManager/LayerSelect/LayerList/LayerAddRemoveButton.d.ts +18 -0
  10. package/lib/components/{CustomToggleButton/CustomToggleButton.spec.d.ts → LayerManager/LayerSelect/LayerList/LayerAddRemoveButton.spec.d.ts} +0 -0
  11. package/lib/components/LayerManager/LayerSelect/LayerList/LayerList.d.ts +10 -0
  12. package/lib/components/LayerManager/LayerSelect/LayerList/LayerListConnect.d.ts +1 -0
  13. package/lib/components/MapControls/MapControlButton.d.ts +1 -1
  14. package/lib/components/MapView/MapViewConnect.DisableMapPin.stories.d.ts +5 -0
  15. package/lib/components/MapView/MapViewConnect.stories.d.ts +1 -0
  16. package/lib/components/ReactMapView/types.d.ts +1 -0
  17. package/lib/components/TooltipSelect/TooltipSelect.d.ts +1 -0
  18. package/lib/index.d.ts +4 -1
  19. package/lib/store/mapStore/map/actions.d.ts +8 -1
  20. package/lib/store/mapStore/map/constants.d.ts +1 -0
  21. package/lib/store/mapStore/map/selectors.d.ts +22 -1
  22. package/lib/store/mapStore/map/types.d.ts +11 -2
  23. package/lib/store/ui/types.d.ts +1 -1
  24. package/lib/utils/types.d.ts +14 -23
  25. package/package.json +5 -5
  26. package/lib/components/CustomToggleButton/CustomToggleButton.d.ts +0 -9
  27. package/lib/components/CustomToggleButton/CustomToggleButton.stories.d.ts +0 -13
  28. package/lib/components/LayerManager/LayerContainerRow/LayerRow/Menubutton/MenuItemButton.d.ts +0 -8
  29. package/lib/components/ToolButton/ToolButton.d.ts +0 -12
  30. package/lib/components/ToolButton/ToolButton.spec.d.ts +0 -1
  31. package/lib/components/ToolButton/ToolButton.stories.d.ts +0 -13
  32. package/lib/components/ToolButton/index.d.ts +0 -1
package/index.esm.js CHANGED
@@ -1,16 +1,16 @@
1
1
  import { createSelector } from 'reselect';
2
2
  import moment from 'moment';
3
- import _, { isEqual, debounce } from 'lodash';
3
+ import _, { isEqual, debounce, throttle } from 'lodash';
4
4
  import * as React from 'react';
5
5
  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
- import { WMGetServiceFromStore, 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, Checkbox, SvgIcon, ListItemIcon, Menu, FormControl, ToggleButton, InputAdornment, ListItemSecondaryAction, Switch, Slider, FormControlLabel, Popover, useMediaQuery, useTheme, SliderThumb } from '@mui/material';
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, Checkbox, SvgIcon, FormControl, InputAdornment, ListItemSecondaryAction, ListItemIcon, Switch, Slider, FormControlLabel, Popover, useMediaQuery, useTheme, SliderThumb } from '@mui/material';
10
10
  import makeStyles from '@mui/styles/makeStyles';
11
11
  import { connect, useDispatch, useSelector, Provider } from 'react-redux';
12
- import { sliderStyles, CustomSlider, ToolContainerDraggable, useIsMounted } from '@opengeoweb/shared';
13
- import { Cached, Add, MoreVert, FileCopy, Delete, DragIndicator, Close, ChevronLeft, ChevronRight, Link, LinkOff, DeleteForever } from '@mui/icons-material';
12
+ import { sliderStyles, CustomSlider, ToggleMenu, ToolContainerDraggable, ToolButton, CustomToggleButton, useIsMounted } from '@opengeoweb/shared';
13
+ import { Cached, Add, Delete, 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';
16
16
  import withStyles from '@mui/styles/withStyles';
@@ -59,6 +59,7 @@ var WEBMAP_SET_TIME_SLIDER_CENTER_TIME = 'WEBMAP_SET_TIME_SLIDER_CENTER_TIME';
59
59
  var WEBMAP_SET_TIME_SLIDER_SECONDS_PER_PX = 'WEBMAP_SET_TIME_SLIDER_SECONDS_PER_PX';
60
60
  var WEBMAP_SET_TIME_SLIDER_DATA_SCALE_TO_SECONDS_PER_PX = 'WEBMAP_SET_TIME_SLIDER_DATA_SCALE_TO_SECONDS_PER_PX';
61
61
  var WEBMAP_SET_PIN = 'WEBMAP_SET_PIN';
62
+ var WEBMAP_DISABLE_PIN = 'WEBMAP_DISABLE_PIN';
62
63
 
63
64
  /* *
64
65
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -367,6 +368,19 @@ var setMapPinLocation = function setMapPinLocation(payload) {
367
368
  payload: payload
368
369
  };
369
370
  };
371
+ /**
372
+ * Sets the diable map pin boolean
373
+ *
374
+ * Example: setMapPinLocation({ mapId: 'mapId1', diableMapPin: true })
375
+ * @param {object} payload object with mapId: string, diableMapPin: boolean
376
+ */
377
+
378
+ var setDisableMapPin = function setDisableMapPin(payload) {
379
+ return {
380
+ type: WEBMAP_DISABLE_PIN,
381
+ payload: payload
382
+ };
383
+ };
370
384
 
371
385
  /* *
372
386
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -743,6 +757,7 @@ var actions$3 = /*#__PURE__*/Object.freeze({
743
757
  setTimeSliderSecondsPerPx: setTimeSliderSecondsPerPx,
744
758
  setTimeSliderDataScaleToSecondsPerPx: setTimeSliderDataScaleToSecondsPerPx,
745
759
  setMapPinLocation: setMapPinLocation,
760
+ setDisableMapPin: setDisableMapPin,
746
761
  setLayers: setLayers,
747
762
  setBaseLayers: setBaseLayers,
748
763
  addBaseLayer: addBaseLayer,
@@ -2615,7 +2630,7 @@ var getAllUniqueDimensions = createSelector(getAllMapIds, function (store) {
2615
2630
  /**
2616
2631
  * Returns the mapPinLocation for the current map
2617
2632
  *
2618
- * Example getAllUniqueDimensions(store);
2633
+ * Example getPinLocation(store);
2619
2634
  * @param {object} store store: object - store object
2620
2635
  * @param {string} mapId mapId: string - Id of the map
2621
2636
  * @returns {object} returnType: latitude and longitude of pin
@@ -2624,6 +2639,18 @@ var getAllUniqueDimensions = createSelector(getAllMapIds, function (store) {
2624
2639
  var getPinLocation = createSelector(getMapById, function (store) {
2625
2640
  return store ? store.mapPinLocation : undefined;
2626
2641
  }, selectorMemoizationOptions);
2642
+ /**
2643
+ * Returns the disable map pin boolean for the current map
2644
+ *
2645
+ * Example getDisableMapPin(store);
2646
+ * @param {object} store store: object - store object
2647
+ * @param {string} mapId mapId: string - Id of the map
2648
+ * @returns {boolean} returnType: boolean or undefined
2649
+ */
2650
+
2651
+ var getDisableMapPin = createSelector(getMapById, function (store) {
2652
+ return store ? store.disableMapPin : undefined;
2653
+ });
2627
2654
 
2628
2655
  /* *
2629
2656
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -2775,7 +2802,7 @@ var getServicesInArray = createSelector(servicesStore, function (store) {
2775
2802
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
2776
2803
  * */
2777
2804
 
2778
- var selectors = /*#__PURE__*/Object.freeze({
2805
+ var selectors$1 = /*#__PURE__*/Object.freeze({
2779
2806
  __proto__: null,
2780
2807
  getMapById: getMapById,
2781
2808
  getAllMapIds: getAllMapIds,
@@ -2813,6 +2840,7 @@ var selectors = /*#__PURE__*/Object.freeze({
2813
2840
  getLayerByLayerIndex: getLayerByLayerIndex,
2814
2841
  getAllUniqueDimensions: getAllUniqueDimensions,
2815
2842
  getPinLocation: getPinLocation,
2843
+ getDisableMapPin: getDisableMapPin,
2816
2844
  getLayerById: getLayerById,
2817
2845
  getLayersById: getLayersById,
2818
2846
  getLayersIds: getLayersIds,
@@ -2881,6 +2909,7 @@ var constants$1 = /*#__PURE__*/Object.freeze({
2881
2909
  WEBMAP_SET_TIME_SLIDER_SECONDS_PER_PX: WEBMAP_SET_TIME_SLIDER_SECONDS_PER_PX,
2882
2910
  WEBMAP_SET_TIME_SLIDER_DATA_SCALE_TO_SECONDS_PER_PX: WEBMAP_SET_TIME_SLIDER_DATA_SCALE_TO_SECONDS_PER_PX,
2883
2911
  WEBMAP_SET_PIN: WEBMAP_SET_PIN,
2912
+ WEBMAP_DISABLE_PIN: WEBMAP_DISABLE_PIN,
2884
2913
  WEBMAP_LAYER_CHANGE_OPACITY: WEBMAP_LAYER_CHANGE_OPACITY,
2885
2914
  WEBMAP_LAYER_CHANGE_NAME: WEBMAP_LAYER_CHANGE_NAME,
2886
2915
  WEBMAP_LAYER_CHANGE_STYLE: WEBMAP_LAYER_CHANGE_STYLE,
@@ -3014,6 +3043,130 @@ var actions$2 = /*#__PURE__*/Object.freeze({
3014
3043
  orderDialog: orderDialog
3015
3044
  });
3016
3045
 
3046
+ /* *
3047
+ * Licensed under the Apache License, Version 2.0 (the "License");
3048
+ * you may not use this file except in compliance with the License.
3049
+ * You may obtain a copy of the License at
3050
+ *
3051
+ * http://www.apache.org/licenses/LICENSE-2.0
3052
+ *
3053
+ * Unless required by applicable law or agreed to in writing, software
3054
+ * distributed under the License is distributed on an "AS IS" BASIS,
3055
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3056
+ * See the License for the specific language governing permissions and
3057
+ * limitations under the License.
3058
+ *
3059
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3060
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
3061
+ * */
3062
+ /**
3063
+ * Gets the active map Id and wether a dialog is open or closed
3064
+ *
3065
+ * Example: getDialogDetailsByType(store, 'legend')
3066
+ * @param {object} store store object from which the ui state wll be extracted
3067
+ * @param {string} dialogType type of the dialog 'legend' | 'layerManager' | 'dimensionSelect-elevation'
3068
+ * @returns {array} [string, boolean] first element gives the active map id, second element whether the dialog is open
3069
+ */
3070
+
3071
+ var getDialogDetailsByType = function getDialogDetailsByType(store, dialogType) {
3072
+ if (store && store.ui && store.ui.dialogs && store.ui.dialogs[dialogType]) {
3073
+ return store.ui.dialogs[dialogType];
3074
+ }
3075
+
3076
+ return null;
3077
+ };
3078
+ /**
3079
+ * For a given ui component: gets wether the dialog is open or closed
3080
+ *
3081
+ * @param {object} store store object from which the ui state wll be extracted
3082
+ * @param {string} dialogType type of the dialog 'legend' | 'layerManager' | 'dimensionSelect-elevation'
3083
+ * @returns {boolean} returnType: boolean
3084
+ */
3085
+
3086
+ var getisDialogOpen = createSelector(getDialogDetailsByType, function (details) {
3087
+ if (details) {
3088
+ return details.isOpen;
3089
+ }
3090
+
3091
+ return false;
3092
+ });
3093
+ /**
3094
+ *For a given ui component: gets the active map Id
3095
+ *
3096
+ * @param {object} store store object from which the ui state wll be extracted
3097
+ * @param {string} dialogType type of the dialog 'legend' | 'layerManager' | 'dimensionSelect-elevation'
3098
+ * @returns {string} returnType: string - the active map id
3099
+ */
3100
+
3101
+ var getDialogMapId = createSelector(getDialogDetailsByType, function (details) {
3102
+ if (details) {
3103
+ return details.activeMapId;
3104
+ }
3105
+
3106
+ return '';
3107
+ });
3108
+ /**
3109
+ *For a given ui component: gets the order of visible dialog
3110
+ *
3111
+ * @param {object} store store object from which the ui state wll be extracted
3112
+ * @param {DialogType} dialogType type of the dialog 'legend' | 'layerManager' | 'dimensionSelect-elevation' | dimensionSelect-ensemble_member
3113
+ * @returns {number} the higher the order number the higher the zIndex
3114
+ */
3115
+
3116
+ var getDialogOrder = createSelector(function (store, dialogType) {
3117
+ if (store && store.ui && store.ui.order) {
3118
+ var order = store.ui.order;
3119
+ var visibleOrder = order.filter(function (orderedDialogType) {
3120
+ return store.ui.dialogs[orderedDialogType].isOpen;
3121
+ });
3122
+
3123
+ if (!visibleOrder.includes(dialogType)) {
3124
+ return 0;
3125
+ }
3126
+
3127
+ return visibleOrder.length - visibleOrder.indexOf(dialogType);
3128
+ }
3129
+
3130
+ return 0;
3131
+ }, function (order) {
3132
+ return order;
3133
+ });
3134
+ /**
3135
+ *For a given ui component: returns if ordered on top
3136
+ *
3137
+ * @param {object} store store object from which the ui state wll be extracted
3138
+ * @param {DialogType} dialogType type of the dialog 'legend' | 'layerManager' | 'dimensionSelect-elevation' | dimensionSelect-ensemble_member
3139
+ * @returns {boolean}
3140
+ */
3141
+
3142
+ var getDialogIsOrderedOnTop = createSelector(function (store, dialogType) {
3143
+ if (store && store.ui && store.ui.order) {
3144
+ var order = store.ui.order;
3145
+ return order.includes(dialogType) && order.indexOf(dialogType) === 0;
3146
+ }
3147
+
3148
+ return false;
3149
+ }, function (isOrderedOnTop) {
3150
+ return isOrderedOnTop;
3151
+ });
3152
+ var getDialogSource = createSelector(getDialogDetailsByType, function (details) {
3153
+ if (details && details.source) {
3154
+ return details.source;
3155
+ }
3156
+
3157
+ return 'app';
3158
+ });
3159
+
3160
+ var selectors = /*#__PURE__*/Object.freeze({
3161
+ __proto__: null,
3162
+ getDialogDetailsByType: getDialogDetailsByType,
3163
+ getisDialogOpen: getisDialogOpen,
3164
+ getDialogMapId: getDialogMapId,
3165
+ getDialogOrder: getDialogOrder,
3166
+ getDialogIsOrderedOnTop: getDialogIsOrderedOnTop,
3167
+ getDialogSource: getDialogSource
3168
+ });
3169
+
3017
3170
  /* *
3018
3171
  * Licensed under the Apache License, Version 2.0 (the "License");
3019
3172
  * you may not use this file except in compliance with the License.
@@ -5177,7 +5330,7 @@ var synchronizationGroupConfig = {
5177
5330
  sagas: [rootSaga$4, rootSaga$3]
5178
5331
  };
5179
5332
 
5180
- var useStyles$I = makeStyles(function (theme) {
5333
+ var useStyles$B = makeStyles(function (theme) {
5181
5334
  return {
5182
5335
  select: {
5183
5336
  '& ul': {
@@ -5220,7 +5373,9 @@ var TooltipSelect = function TooltipSelect(_a) {
5220
5373
  currentIndex = _a$currentIndex === void 0 ? -1 : _a$currentIndex,
5221
5374
  _a$onChangeMouseWheel = _a.onChangeMouseWheel,
5222
5375
  onChangeMouseWheel = _a$onChangeMouseWheel === void 0 ? function () {} : _a$onChangeMouseWheel,
5223
- props = __rest(_a, ["tooltip", "list", "currentIndex", "onChangeMouseWheel"]);
5376
+ _a$requiresCtrlToChan = _a.requiresCtrlToChange,
5377
+ requiresCtrlToChange = _a$requiresCtrlToChan === void 0 ? false : _a$requiresCtrlToChan,
5378
+ props = __rest(_a, ["tooltip", "list", "currentIndex", "onChangeMouseWheel", "requiresCtrlToChange"]);
5224
5379
 
5225
5380
  props.disableUnderline;
5226
5381
  var otherProps = __rest(props, ["disableUnderline"]);
@@ -5235,7 +5390,7 @@ var TooltipSelect = function TooltipSelect(_a) {
5235
5390
  tooltipOpen = _React$useState4[0],
5236
5391
  setTooltipOpen = _React$useState4[1];
5237
5392
 
5238
- var classes = useStyles$I();
5393
+ var classes = useStyles$B();
5239
5394
 
5240
5395
  var preventDefault = function preventDefault(event) {
5241
5396
  event.preventDefault();
@@ -5251,11 +5406,14 @@ var TooltipSelect = function TooltipSelect(_a) {
5251
5406
  });
5252
5407
  }, []);
5253
5408
  var onWheel = React.useCallback(function (event) {
5254
- if (selectOpen) return;
5255
- var direction = event.deltaY < 0 ? 1 : -1;
5256
- var newValue = list[Math.min(Math.max(currentIndex - direction, 0), list.length - 1)];
5257
- onChangeMouseWheel(newValue);
5258
- }, [selectOpen, currentIndex, list, onChangeMouseWheel]);
5409
+ if (requiresCtrlToChange && (event.ctrlKey || event.metaKey) || !requiresCtrlToChange) {
5410
+ disableScroll();
5411
+ if (selectOpen) return;
5412
+ var direction = event.deltaY < 0 ? 1 : -1;
5413
+ var newValue = list[Math.min(Math.max(currentIndex - direction, 0), list.length - 1)];
5414
+ onChangeMouseWheel(newValue);
5415
+ } else enableScroll();
5416
+ }, [selectOpen, currentIndex, list, onChangeMouseWheel, enableScroll, disableScroll, requiresCtrlToChange]);
5259
5417
  var onOpen = React.useCallback(function () {
5260
5418
  setSelectOpen(true);
5261
5419
  setTooltipOpen(false);
@@ -5264,17 +5422,23 @@ var TooltipSelect = function TooltipSelect(_a) {
5264
5422
  setSelectOpen(false);
5265
5423
  }, []);
5266
5424
  var onMouseEnter = React.useCallback(function () {
5267
- disableScroll();
5425
+ if (!requiresCtrlToChange) {
5426
+ disableScroll();
5427
+ }
5428
+
5268
5429
  if (!selectOpen) setTooltipOpen(true);
5269
- }, [selectOpen, disableScroll]);
5430
+ }, [selectOpen, disableScroll, requiresCtrlToChange]);
5270
5431
  var onMouseLeave = React.useCallback(function () {
5271
5432
  enableScroll();
5272
5433
  setTooltipOpen(false);
5273
5434
  }, [enableScroll]);
5274
5435
  var onFocus = React.useCallback(function () {
5275
- disableScroll();
5436
+ if (!requiresCtrlToChange) {
5437
+ disableScroll();
5438
+ }
5439
+
5276
5440
  setTooltipOpen(true);
5277
- }, [disableScroll]);
5441
+ }, [disableScroll, requiresCtrlToChange]);
5278
5442
  var onBlur = React.useCallback(function () {
5279
5443
  enableScroll();
5280
5444
  setTooltipOpen(false);
@@ -5467,120 +5631,6 @@ var reducer$3 = function reducer() {
5467
5631
  }
5468
5632
  };
5469
5633
 
5470
- /* *
5471
- * Licensed under the Apache License, Version 2.0 (the "License");
5472
- * you may not use this file except in compliance with the License.
5473
- * You may obtain a copy of the License at
5474
- *
5475
- * http://www.apache.org/licenses/LICENSE-2.0
5476
- *
5477
- * Unless required by applicable law or agreed to in writing, software
5478
- * distributed under the License is distributed on an "AS IS" BASIS,
5479
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5480
- * See the License for the specific language governing permissions and
5481
- * limitations under the License.
5482
- *
5483
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
5484
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
5485
- * */
5486
- /**
5487
- * Gets the active map Id and wether a dialog is open or closed
5488
- *
5489
- * Example: getDialogDetailsByType(store, 'legend')
5490
- * @param {object} store store object from which the ui state wll be extracted
5491
- * @param {string} dialogType type of the dialog 'legend' | 'layerManager' | 'dimensionSelect-elevation'
5492
- * @returns {array} [string, boolean] first element gives the active map id, second element whether the dialog is open
5493
- */
5494
-
5495
- var getDialogDetailsByType = function getDialogDetailsByType(store, dialogType) {
5496
- if (store && store.ui && store.ui.dialogs && store.ui.dialogs[dialogType]) {
5497
- return store.ui.dialogs[dialogType];
5498
- }
5499
-
5500
- return null;
5501
- };
5502
- /**
5503
- * For a given ui component: gets wether the dialog is open or closed
5504
- *
5505
- * @param {object} store store object from which the ui state wll be extracted
5506
- * @param {string} dialogType type of the dialog 'legend' | 'layerManager' | 'dimensionSelect-elevation'
5507
- * @returns {boolean} returnType: boolean
5508
- */
5509
-
5510
- var getisDialogOpen = createSelector(getDialogDetailsByType, function (details) {
5511
- if (details) {
5512
- return details.isOpen;
5513
- }
5514
-
5515
- return false;
5516
- });
5517
- /**
5518
- *For a given ui component: gets the active map Id
5519
- *
5520
- * @param {object} store store object from which the ui state wll be extracted
5521
- * @param {string} dialogType type of the dialog 'legend' | 'layerManager' | 'dimensionSelect-elevation'
5522
- * @returns {string} returnType: string - the active map id
5523
- */
5524
-
5525
- var getDialogMapId = createSelector(getDialogDetailsByType, function (details) {
5526
- if (details) {
5527
- return details.activeMapId;
5528
- }
5529
-
5530
- return '';
5531
- });
5532
- /**
5533
- *For a given ui component: gets the order of visible dialog
5534
- *
5535
- * @param {object} store store object from which the ui state wll be extracted
5536
- * @param {DialogType} dialogType type of the dialog 'legend' | 'layerManager' | 'dimensionSelect-elevation' | dimensionSelect-ensemble_member
5537
- * @returns {number} the higher the order number the higher the zIndex
5538
- */
5539
-
5540
- var getDialogOrder = createSelector(function (store, dialogType) {
5541
- if (store && store.ui && store.ui.order) {
5542
- var order = store.ui.order;
5543
- var visibleOrder = order.filter(function (orderedDialogType) {
5544
- return store.ui.dialogs[orderedDialogType].isOpen;
5545
- });
5546
-
5547
- if (!visibleOrder.includes(dialogType)) {
5548
- return 0;
5549
- }
5550
-
5551
- return visibleOrder.length - visibleOrder.indexOf(dialogType);
5552
- }
5553
-
5554
- return 0;
5555
- }, function (order) {
5556
- return order;
5557
- });
5558
- /**
5559
- *For a given ui component: returns if ordered on top
5560
- *
5561
- * @param {object} store store object from which the ui state wll be extracted
5562
- * @param {DialogType} dialogType type of the dialog 'legend' | 'layerManager' | 'dimensionSelect-elevation' | dimensionSelect-ensemble_member
5563
- * @returns {boolean}
5564
- */
5565
-
5566
- var getDialogIsOrderedOnTop = createSelector(function (store, dialogType) {
5567
- if (store && store.ui && store.ui.order) {
5568
- var order = store.ui.order;
5569
- return order.includes(dialogType) && order.indexOf(dialogType) === 0;
5570
- }
5571
-
5572
- return false;
5573
- }, function (isOrderedOnTop) {
5574
- return isOrderedOnTop;
5575
- });
5576
- var getDialogSource = createSelector(getDialogDetailsByType, function (details) {
5577
- if (details && details.source) {
5578
- return details.source;
5579
- }
5580
-
5581
- return 'app';
5582
- });
5583
-
5584
5634
  var _marked$2 = /*#__PURE__*/regeneratorRuntime.mark(registerMapUISaga),
5585
5635
  _marked2$2 = /*#__PURE__*/regeneratorRuntime.mark(unregisterUIMapSaga),
5586
5636
  _marked3$2 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$2);
@@ -6341,6 +6391,21 @@ var reducer$2 = function reducer() {
6341
6391
  });
6342
6392
  }
6343
6393
 
6394
+ case WEBMAP_DISABLE_PIN:
6395
+ {
6396
+ var _action$payload26 = action.payload,
6397
+ _mapId28 = _action$payload26.mapId,
6398
+ disableMapPin = _action$payload26.disableMapPin;
6399
+
6400
+ if (!state.byId[_mapId28]) {
6401
+ return state;
6402
+ }
6403
+
6404
+ return produce$1(state, function (draft) {
6405
+ draft.byId[_mapId28].disableMapPin = disableMapPin;
6406
+ });
6407
+ }
6408
+
6344
6409
  case GENERIC_SYNC_SETLAYERACTIONS:
6345
6410
  {
6346
6411
  /*
@@ -6349,9 +6414,9 @@ var reducer$2 = function reducer() {
6349
6414
  * These targets can be used as payloads in new Layer actions.
6350
6415
  * These actions are here handled via the layer reducer, as it is the same logic
6351
6416
  */
6352
- var _action$payload26 = action.payload,
6353
- targets = _action$payload26.targets,
6354
- source = _action$payload26.source;
6417
+ var _action$payload27 = action.payload,
6418
+ targets = _action$payload27.targets,
6419
+ source = _action$payload27.source;
6355
6420
  return targets.reduce(function (prevState, target) {
6356
6421
  var action = {
6357
6422
  payload: target,
@@ -7897,7 +7962,7 @@ var preset = {
7897
7962
  },
7898
7963
  {
7899
7964
  name: "ECMWF",
7900
- url: "https://apps.ecmwf.int/wms/?token=public",
7965
+ url: "https://eccharts.ecmwf.int/wms/?token=public",
7901
7966
  id: "ecmwf"
7902
7967
  },
7903
7968
  {
@@ -8000,7 +8065,7 @@ var defaultConfigurations = /*#__PURE__*/Object.freeze({
8000
8065
  preloadedDefaultMapServices: preloadedDefaultMapServices
8001
8066
  });
8002
8067
 
8003
- var useStyles$H = makeStyles({
8068
+ var useStyles$A = makeStyles({
8004
8069
  buttonDiv: {
8005
8070
  position: 'relative'
8006
8071
  },
@@ -8036,7 +8101,7 @@ var AddLayersPopup = function AddLayersPopup(_ref) {
8036
8101
  handleClose = _ref.handleClose,
8037
8102
  _ref$layerType = _ref.layerType,
8038
8103
  layerType = _ref$layerType === void 0 ? LayerType.mapLayer : _ref$layerType;
8039
- var classes = useStyles$H();
8104
+ var classes = useStyles$A();
8040
8105
 
8041
8106
  var _React$useState = React.useState(''),
8042
8107
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -8156,7 +8221,6 @@ var AddLayersPopup = function AddLayersPopup(_ref) {
8156
8221
  }, /*#__PURE__*/React.createElement(IconButton, {
8157
8222
  "data-testid": "add-service",
8158
8223
  onClick: handleAddServiceURL,
8159
- color: "primary",
8160
8224
  disabled: loading,
8161
8225
  size: "large"
8162
8226
  }, /*#__PURE__*/React.createElement(Add, null)), loading && /*#__PURE__*/React.createElement(CircularProgress, {
@@ -8190,26 +8254,23 @@ var AddLayersPopup = function AddLayersPopup(_ref) {
8190
8254
  }, "Close")));
8191
8255
  };
8192
8256
 
8193
- var useStyles$G = makeStyles(function (theme) {
8194
- return {
8195
- buttonDiv: {
8196
- position: 'relative'
8197
- },
8198
- loadingButton: {
8199
- position: 'absolute',
8200
- top: 7,
8201
- left: 7,
8202
- zIndex: 1
8203
- },
8204
- button: {
8205
- width: '24px',
8206
- height: '24px',
8207
- margin: '6px 0px 0px 10px',
8208
- color: theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat,
8209
- borderRadius: '15%'
8210
- }
8211
- };
8212
- });
8257
+ var styles = {
8258
+ buttonDiv: {
8259
+ position: 'relative'
8260
+ },
8261
+ loadingButton: {
8262
+ position: 'absolute',
8263
+ top: 7,
8264
+ left: 7,
8265
+ zIndex: 1
8266
+ },
8267
+ button: {
8268
+ width: '24px',
8269
+ height: '24px',
8270
+ margin: '6px 0px 0px 10px',
8271
+ borderRadius: '15%'
8272
+ }
8273
+ };
8213
8274
 
8214
8275
  var AddLayersButton = function AddLayersButton(_ref) {
8215
8276
  var onClickService = _ref.onClickService,
@@ -8225,7 +8286,6 @@ var AddLayersButton = function AddLayersButton(_ref) {
8225
8286
  _ref$shouldFocus = _ref.shouldFocus,
8226
8287
  shouldFocus = _ref$shouldFocus === void 0 ? false : _ref$shouldFocus;
8227
8288
  var ref = React.useRef(null);
8228
- var classes = useStyles$G();
8229
8289
 
8230
8290
  var _React$useState = React.useState(false),
8231
8291
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -8246,7 +8306,7 @@ var AddLayersButton = function AddLayersButton(_ref) {
8246
8306
  title: tooltip
8247
8307
  }, /*#__PURE__*/React.createElement(IconButton, {
8248
8308
  onClick: handleClose,
8249
- className: classes.button,
8309
+ sx: styles.button,
8250
8310
  disableRipple: true,
8251
8311
  "data-testid": "addLayersButton",
8252
8312
  ref: ref,
@@ -8351,24 +8411,18 @@ var widthToWidthClass = function widthToWidthClass(w) {
8351
8411
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8352
8412
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
8353
8413
  * */
8354
- var useStyles$F = makeStyles(function (theme) {
8355
- return {
8356
- button: {
8357
- width: '24px',
8358
- height: '24px',
8359
- margin: '6px 0px 0px 10px',
8360
- color: theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat,
8361
- borderRadius: '15%'
8362
- }
8363
- };
8364
- });
8414
+ var style$2 = {
8415
+ width: '24px',
8416
+ height: '24px',
8417
+ margin: '6px 0px 0px 10px',
8418
+ borderRadius: '15%'
8419
+ };
8365
8420
 
8366
8421
  var LayerSelectButtonConnect = function LayerSelectButtonConnect(_ref) {
8367
8422
  var mapId = _ref.mapId,
8368
8423
  _ref$source = _ref.source,
8369
8424
  source = _ref$source === void 0 ? 'app' : _ref$source;
8370
8425
  var dispatch = useDispatch();
8371
- var classes = useStyles$F();
8372
8426
  var currentActiveMapId = useSelector(function (store) {
8373
8427
  return getDialogMapId(store, 'layerSelect');
8374
8428
  });
@@ -8387,7 +8441,7 @@ var LayerSelectButtonConnect = function LayerSelectButtonConnect(_ref) {
8387
8441
  title: "Layer Select"
8388
8442
  }, /*#__PURE__*/React.createElement(IconButton, {
8389
8443
  onClick: openLayerSelectDialog,
8390
- className: classes.button,
8444
+ sx: style$2,
8391
8445
  id: "layerSelectButton",
8392
8446
  "data-testid": "layerSelectButton",
8393
8447
  disableRipple: true,
@@ -8411,7 +8465,7 @@ var LayerSelectButtonConnect = function LayerSelectButtonConnect(_ref) {
8411
8465
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8412
8466
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
8413
8467
  * */
8414
- var useStyles$E = makeStyles({
8468
+ var useStyles$z = makeStyles({
8415
8469
  row: {
8416
8470
  height: '32px'
8417
8471
  },
@@ -8435,7 +8489,7 @@ var DescriptionRow = function DescriptionRow(_ref) {
8435
8489
  layerManagerWidth = _ref.layerManagerWidth,
8436
8490
  _ref$layerSelect = _ref.layerSelect,
8437
8491
  layerSelect = _ref$layerSelect === void 0 ? false : _ref$layerSelect;
8438
- var classes = useStyles$E();
8492
+ var classes = useStyles$z();
8439
8493
  var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
8440
8494
  return /*#__PURE__*/React.createElement(Grid, {
8441
8495
  container: true,
@@ -8528,7 +8582,7 @@ var useTooltipContainerStyles = makeStyles(function (theme) {
8528
8582
  '& .MuiSvgIcon-root': {
8529
8583
  transition: 'none',
8530
8584
  fill: function fill(isEnabled) {
8531
- return isEnabled ? theme.palette.geowebColors.layerManager.tableRowDefaultIcon.rgba : theme.palette.geowebColors.layerManager.tableRowDisabledIcon.rgba;
8585
+ return isEnabled ? theme.palette.geowebColors.buttons.flat["default"].color : theme.palette.geowebColors.buttons.flat.disabled.color;
8532
8586
  }
8533
8587
  },
8534
8588
  '&>div': {
@@ -8693,7 +8747,7 @@ var DimensionSelect = function DimensionSelect(_ref) {
8693
8747
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8694
8748
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
8695
8749
  * */
8696
- var useStyles$D = makeStyles(function (theme) {
8750
+ var useStyles$y = makeStyles(function (theme) {
8697
8751
  return createStyles({
8698
8752
  button: {
8699
8753
  height: 28,
@@ -8702,20 +8756,22 @@ var useStyles$D = makeStyles(function (theme) {
8702
8756
  marginTop: 2,
8703
8757
  color: function color(_ref) {
8704
8758
  var isActive = _ref.isActive,
8759
+ isAccessible = _ref.isAccessible,
8705
8760
  isEnabled = _ref.isEnabled;
8706
- var _theme$palette$geoweb = theme.palette.geowebColors.layerManager,
8707
- tableRowDefaultIcon = _theme$palette$geoweb.tableRowDefaultIcon,
8708
- tableRowDisabledIcon = _theme$palette$geoweb.tableRowDisabledIcon;
8709
8761
 
8710
8762
  if (!isEnabled) {
8711
- return tableRowDisabledIcon.fill;
8763
+ return theme.palette.geowebColors.buttons.flat.disabled.color;
8764
+ }
8765
+
8766
+ if (isAccessible) {
8767
+ return theme.palette.geowebColors.greys.accessible;
8712
8768
  }
8713
8769
 
8714
8770
  if (isActive) {
8715
8771
  return theme.palette.common.white;
8716
8772
  }
8717
8773
 
8718
- return tableRowDefaultIcon.rgba;
8774
+ return theme.palette.geowebColors.buttons.flat["default"].color;
8719
8775
  },
8720
8776
  backgroundColor: function backgroundColor(_ref2) {
8721
8777
  var isActive = _ref2.isActive;
@@ -8724,7 +8780,7 @@ var useStyles$D = makeStyles(function (theme) {
8724
8780
  '&:focus': {
8725
8781
  backgroundColor: function backgroundColor(_ref3) {
8726
8782
  var isActive = _ref3.isActive;
8727
- return isActive ? theme.palette.geowebColors.buttons.primary.mouseOver.fill : theme.palette.geowebColors.layerManager.tableRowMouseover.rgba;
8783
+ return isActive ? theme.palette.geowebColors.buttons.primary.mouseOver.fill : theme.palette.geowebColors.buttons.flat.mouseOver.fill;
8728
8784
  },
8729
8785
  outline: theme.palette.geowebColors.buttons.focusDefault.outline,
8730
8786
  borderRadius: 0
@@ -8732,7 +8788,7 @@ var useStyles$D = makeStyles(function (theme) {
8732
8788
  '&:hover': {
8733
8789
  backgroundColor: function backgroundColor(_ref4) {
8734
8790
  var isActive = _ref4.isActive;
8735
- return isActive ? theme.palette.geowebColors.buttons.primary.mouseOver.fill : theme.palette.geowebColors.layerManager.tableRowMouseover.rgba;
8791
+ return isActive ? theme.palette.geowebColors.buttons.primary.mouseOver.fill : theme.palette.geowebColors.buttons.flat.mouseOver.fill;
8736
8792
  }
8737
8793
  }
8738
8794
  },
@@ -8753,11 +8809,15 @@ var LayerManagerButton = function LayerManagerButton(_a) {
8753
8809
  isEnabled = _a$isEnabled === void 0 ? true : _a$isEnabled,
8754
8810
  icon = _a.icon,
8755
8811
  testId = _a.testId,
8756
- props = __rest(_a, ["tooltipTitle", "onClick", "isActive", "isEnabled", "icon", "testId"]);
8812
+ _a$isAccessible = _a.isAccessible,
8813
+ isAccessible = _a$isAccessible === void 0 ? false : _a$isAccessible,
8814
+ className = _a.className,
8815
+ props = __rest(_a, ["tooltipTitle", "onClick", "isActive", "isEnabled", "icon", "testId", "isAccessible", "className"]);
8757
8816
 
8758
- var classes = useStyles$D({
8817
+ var classes = useStyles$y({
8759
8818
  isActive: isActive,
8760
- isEnabled: isEnabled
8819
+ isEnabled: isEnabled,
8820
+ isAccessible: isAccessible
8761
8821
  });
8762
8822
 
8763
8823
  var handleClick = function handleClick(event) {
@@ -8774,7 +8834,7 @@ var LayerManagerButton = function LayerManagerButton(_a) {
8774
8834
  size: "small",
8775
8835
  onClick: handleClick,
8776
8836
  "data-testid": testId,
8777
- className: classes.button,
8837
+ className: "".concat(classes.button, " ").concat(className),
8778
8838
  disableFocusRipple: true
8779
8839
  }, props), icon));
8780
8840
  };
@@ -8795,7 +8855,7 @@ var LayerManagerButton = function LayerManagerButton(_a) {
8795
8855
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8796
8856
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
8797
8857
  * */
8798
- var useStyles$C = makeStyles(function (theme) {
8858
+ var useStyles$x = makeStyles(function (theme) {
8799
8859
  return createStyles({
8800
8860
  checkbox: {
8801
8861
  color: 'inherit',
@@ -8818,7 +8878,7 @@ var EnableLayer = function EnableLayer(_ref) {
8818
8878
  var isEnabled = _ref.isEnabled,
8819
8879
  title = _ref.title,
8820
8880
  onChangeEnableLayer = _ref.onChangeEnableLayer;
8821
- var classes = useStyles$C(isEnabled);
8881
+ var classes = useStyles$x(isEnabled);
8822
8882
 
8823
8883
  var onClick = function onClick() {
8824
8884
  onChangeEnableLayer(!isEnabled);
@@ -8858,23 +8918,7 @@ var EnableLayer = function EnableLayer(_ref) {
8858
8918
  });
8859
8919
  };
8860
8920
 
8861
- /* *
8862
- * Licensed under the Apache License, Version 2.0 (the "License");
8863
- * you may not use this file except in compliance with the License.
8864
- * You may obtain a copy of the License at
8865
- *
8866
- * http://www.apache.org/licenses/LICENSE-2.0
8867
- *
8868
- * Unless required by applicable law or agreed to in writing, software
8869
- * distributed under the License is distributed on an "AS IS" BASIS,
8870
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8871
- * See the License for the specific language governing permissions and
8872
- * limitations under the License.
8873
- *
8874
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8875
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
8876
- * */
8877
- var useStyles$B = makeStyles(function (theme) {
8921
+ var useStyles$w = makeStyles(function (theme) {
8878
8922
  return createStyles({
8879
8923
  dropdownEmpty: {
8880
8924
  paddingLeft: 8,
@@ -8890,6 +8934,33 @@ var useStyles$B = makeStyles(function (theme) {
8890
8934
  });
8891
8935
  });
8892
8936
 
8937
+ var getRenderLayersValues = function getRenderLayersValues(layerName, layers) {
8938
+ var serviceLayer = layers.find(function (l) {
8939
+ return l.name === layerName;
8940
+ });
8941
+
8942
+ if (!serviceLayer && layerName) {
8943
+ return {
8944
+ currentValue: layerName,
8945
+ currentIndex: layers.length,
8946
+ extendedLayers: [].concat(_toConsumableArray(layers), [{
8947
+ name: layerName,
8948
+ text: layerName,
8949
+ leaf: true,
8950
+ path: []
8951
+ }])
8952
+ };
8953
+ }
8954
+
8955
+ return {
8956
+ currentValue: (serviceLayer === null || serviceLayer === void 0 ? void 0 : serviceLayer.name) || '',
8957
+ currentIndex: layers.findIndex(function (l) {
8958
+ return l.name === (serviceLayer === null || serviceLayer === void 0 ? void 0 : serviceLayer.name);
8959
+ }),
8960
+ extendedLayers: layers
8961
+ };
8962
+ };
8963
+
8893
8964
  var RenderLayers = function RenderLayers(_ref) {
8894
8965
  var onChangeLayerName = _ref.onChangeLayerName,
8895
8966
  layerName = _ref.layerName,
@@ -8897,7 +8968,7 @@ var RenderLayers = function RenderLayers(_ref) {
8897
8968
  layers = _ref$layers === void 0 ? [] : _ref$layers,
8898
8969
  _ref$isEnabled = _ref.isEnabled,
8899
8970
  isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
8900
- var classes = useStyles$B();
8971
+ var classes = useStyles$w();
8901
8972
  var containerClass = useTooltipContainerStyles(isEnabled);
8902
8973
 
8903
8974
  if (!layers || !layers.length) {
@@ -8909,24 +8980,21 @@ var RenderLayers = function RenderLayers(_ref) {
8909
8980
  }, "No service available"));
8910
8981
  }
8911
8982
 
8912
- var filteredLayers = layers.filter(function (l) {
8913
- return l.name === layerName;
8914
- });
8915
- var currentValue = filteredLayers.length === 1 && filteredLayers[0].name ? filteredLayers[0].name : '';
8916
-
8917
8983
  var selectLayer = function selectLayer(event) {
8918
8984
  event.stopPropagation();
8919
8985
  onChangeLayerName(event.target.value);
8920
8986
  };
8921
8987
 
8922
- var list = layers.map(function (layer) {
8988
+ var _getRenderLayersValue = getRenderLayersValues(layerName, layers),
8989
+ currentIndex = _getRenderLayersValue.currentIndex,
8990
+ currentValue = _getRenderLayersValue.currentValue,
8991
+ extendedLayers = _getRenderLayersValue.extendedLayers;
8992
+
8993
+ var list = extendedLayers.map(function (layer) {
8923
8994
  return {
8924
8995
  value: layer.name
8925
8996
  };
8926
8997
  });
8927
- var currentIndex = layers.findIndex(function (layer) {
8928
- return currentValue === layer.name;
8929
- });
8930
8998
  return /*#__PURE__*/React.createElement(TooltipSelect, {
8931
8999
  disableUnderline: true,
8932
9000
  tooltip: "Select a layer",
@@ -8942,10 +9010,11 @@ var RenderLayers = function RenderLayers(_ref) {
8942
9010
  onChange: selectLayer,
8943
9011
  onChangeMouseWheel: function onChangeMouseWheel(e) {
8944
9012
  return onChangeLayerName(e.value);
8945
- }
9013
+ },
9014
+ requiresCtrlToChange: true
8946
9015
  }, /*#__PURE__*/React.createElement(MenuItem, {
8947
9016
  disabled: true
8948
- }, "Select layer"), layers.map(function (layerFromServiceLayers) {
9017
+ }, "Select layer"), extendedLayers.map(function (layerFromServiceLayers) {
8949
9018
  return /*#__PURE__*/React.createElement(MenuItem, {
8950
9019
  key: layerFromServiceLayers.name,
8951
9020
  value: layerFromServiceLayers.name,
@@ -8954,7 +9023,7 @@ var RenderLayers = function RenderLayers(_ref) {
8954
9023
  }));
8955
9024
  };
8956
9025
 
8957
- var useStyles$A = makeStyles(function (theme) {
9026
+ var useStyles$v = makeStyles(function (theme) {
8958
9027
  return {
8959
9028
  opacityDiv: {
8960
9029
  height: 'calc(100% - 5px)',
@@ -9015,7 +9084,7 @@ var OpacitySelect = function OpacitySelect(_ref) {
9015
9084
  onLayerChangeOpacity = _ref.onLayerChangeOpacity,
9016
9085
  _ref$isEnabled = _ref.isEnabled,
9017
9086
  isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
9018
- var classes = useStyles$A();
9087
+ var classes = useStyles$v();
9019
9088
  var sliderClasses = sliderStyles();
9020
9089
  var containerClass = useTooltipContainerStyles(isEnabled);
9021
9090
 
@@ -9043,11 +9112,17 @@ var OpacitySelect = function OpacitySelect(_ref) {
9043
9112
  });
9044
9113
  }, []);
9045
9114
  var onWheel = React.useCallback(function (event) {
9046
- var multiplier = event.altKey ? 10 : 1;
9047
- var direction = event.deltaY > 0 ? 0.01 * multiplier : -0.01 * multiplier;
9048
- var newValue = Math.min(Math.max(currentOpacity - direction, 0), 1);
9049
- onLayerChangeOpacity(newValue);
9050
- }, [currentOpacity, onLayerChangeOpacity]);
9115
+ if (event.ctrlKey || event.metaKey) {
9116
+ disableScroll();
9117
+ var multiplier = event.altKey ? 10 : 1;
9118
+ var direction = event.deltaY > 0 ? 0.01 * multiplier : -0.01 * multiplier;
9119
+ var newValue = Math.min(Math.max(currentOpacity - direction, 0), 1); // Kind of "one frame debouncer", meant to dampen too fast slider movement
9120
+
9121
+ window.requestAnimationFrame(function () {
9122
+ onLayerChangeOpacity(newValue);
9123
+ });
9124
+ } else enableScroll();
9125
+ }, [currentOpacity, onLayerChangeOpacity, disableScroll, enableScroll]);
9051
9126
  var onClickButton = React.useCallback(function () {
9052
9127
  setOpen(!open);
9053
9128
  }, [open]);
@@ -9057,17 +9132,15 @@ var OpacitySelect = function OpacitySelect(_ref) {
9057
9132
  }
9058
9133
  }, [open]);
9059
9134
  var onMouseEnter = React.useCallback(function () {
9060
- disableScroll();
9061
9135
  if (!open) setTooltipOpen(true);
9062
- }, [open, disableScroll]);
9136
+ }, [open]);
9063
9137
  var onMouseLeave = React.useCallback(function () {
9064
9138
  enableScroll();
9065
9139
  setTooltipOpen(false);
9066
9140
  }, [enableScroll]);
9067
9141
  var onFocus = React.useCallback(function () {
9068
- disableScroll();
9069
9142
  setTooltipOpen(true);
9070
- }, [disableScroll]);
9143
+ }, []);
9071
9144
  var onBlur = React.useCallback(function () {
9072
9145
  enableScroll();
9073
9146
  setTooltipOpen(false);
@@ -9118,109 +9191,48 @@ var OpacitySelect = function OpacitySelect(_ref) {
9118
9191
  *
9119
9192
  * http://www.apache.org/licenses/LICENSE-2.0
9120
9193
  *
9121
- * Unless required by applicable law or agreed to in writing, software
9122
- * distributed under the License is distributed on an "AS IS" BASIS,
9123
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9124
- * See the License for the specific language governing permissions and
9125
- * limitations under the License.
9126
- *
9127
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9128
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
9129
- * */
9130
- var useStyles$z = makeStyles(function (theme) {
9131
- return createStyles({
9132
- icon: {
9133
- minWidth: 32,
9134
- color: theme.palette.geowebColors.layerManager.tableRowDefaultIcon.rgba
9135
- },
9136
- text: {
9137
- fontSize: 16,
9138
- color: theme.palette.geowebColors.layerManager.tableRowDefaultText.rgba
9139
- }
9140
- });
9141
- });
9142
-
9143
- var MenuItemButton = function MenuItemButton(_ref) {
9144
- var title = _ref.title,
9145
- tooltipTitle = _ref.tooltipTitle,
9146
- icon = _ref.icon;
9147
- var classes = useStyles$z();
9148
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ListItemIcon, {
9149
- className: "".concat(classes.icon, " icon")
9150
- }, icon), /*#__PURE__*/React.createElement(Tooltip, {
9151
- title: tooltipTitle,
9152
- placement: "top"
9153
- }, /*#__PURE__*/React.createElement(Typography, {
9154
- className: classes.text,
9155
- variant: "inherit"
9156
- }, title)));
9157
- };
9158
-
9159
- var useStyles$y = makeStyles(function (theme) {
9160
- return {
9161
- menu: {
9162
- backgroundColor: theme.palette.geowebColors.background.surface,
9163
- '& li:hover': {
9164
- backgroundColor: theme.palette.geowebColors.layerManager.tableRowMouseover.rgba
9165
- }
9166
- }
9167
- };
9168
- });
9169
-
9170
- var LayerManagerMenuButton = function LayerManagerMenuButton(_ref) {
9171
- var tooltipTitle = _ref.tooltipTitle,
9172
- mapId = _ref.mapId,
9173
- layerId = _ref.layerId,
9174
- onLayerDuplicate = _ref.onLayerDuplicate,
9175
- _ref$isEnabled = _ref.isEnabled,
9176
- isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
9177
- var classes = useStyles$y();
9178
-
9179
- var _React$useState = React.useState(null),
9180
- _React$useState2 = _slicedToArray(_React$useState, 2),
9181
- anchorEl = _React$useState2[0],
9182
- setAnchorEl = _React$useState2[1];
9183
-
9184
- var handleClick = function handleClick(event) {
9185
- setAnchorEl(event.currentTarget);
9186
- };
9194
+ * Unless required by applicable law or agreed to in writing, software
9195
+ * distributed under the License is distributed on an "AS IS" BASIS,
9196
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9197
+ * See the License for the specific language governing permissions and
9198
+ * limitations under the License.
9199
+ *
9200
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9201
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
9202
+ * */
9203
+ var CopyIcon = /*#__PURE__*/React.createElement(SvgIcon, null, /*#__PURE__*/React.createElement("path", {
9204
+ d: "M8 7v2H6a1 1 0 0 0-.993.883L5 10v9a1 1 0 0 0 .883.993L6 20h6a1 1 0 0 0 .993-.883L13 19h2v1.6a1.4 1.4 0 0 1-1.263 1.394l-.135.006H4.399a1.4 1.4 0 0 1-1.393-1.265L3 20.6V8.4a1.4 1.4 0 0 1 1.264-1.394L4.4 7H8zm7.584-5v2H12a1 1 0 0 0-.993.883L11 5v9a1 1 0 0 0 .883.993L12 15h6a1 1 0 0 0 .993-.883L19 14V7.42h2v8.18a1.4 1.4 0 0 1-1.263 1.394l-.135.006h-9.203a1.4 1.4 0 0 1-1.393-1.265L9 15.6V3.4a1.4 1.4 0 0 1 1.264-1.394L10.4 2h5.185zM17 2l4 4h-2.5c-.777 0-1.42-.598-1.493-1.357L17 4.499V2z"
9205
+ }));
9187
9206
 
9188
- var handleClose = function handleClose() {
9189
- setAnchorEl(null);
9190
- };
9207
+ var LayerManagerMenuButton = function LayerManagerMenuButton(_ref) {
9208
+ var mapId = _ref.mapId,
9209
+ layerId = _ref.layerId,
9210
+ onLayerDuplicate = _ref.onLayerDuplicate;
9191
9211
 
9192
9212
  var onClickDuplicate = function onClickDuplicate() {
9193
9213
  onLayerDuplicate({
9194
9214
  mapId: mapId,
9195
9215
  layerId: layerId
9196
9216
  });
9197
- handleClose();
9198
9217
  };
9199
9218
 
9200
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LayerManagerButton, {
9201
- tooltipTitle: tooltipTitle,
9202
- onClick: handleClick,
9203
- icon: /*#__PURE__*/React.createElement(MoreVert, null),
9204
- testId: "openMenuButton",
9205
- isEnabled: isEnabled
9206
- }), /*#__PURE__*/React.createElement(Menu, {
9207
- anchorEl: anchorEl,
9208
- keepMounted: true,
9209
- open: Boolean(anchorEl),
9210
- onClose: handleClose,
9211
- PaperProps: {
9212
- className: classes.menu
9213
- }
9214
- }, /*#__PURE__*/React.createElement(MenuItem, {
9215
- "data-testid": "duplicateLayerButton",
9216
- onClick: onClickDuplicate
9217
- }, /*#__PURE__*/React.createElement(MenuItemButton, {
9218
- title: "Duplicate layer",
9219
- tooltipTitle: "Duplicate layer",
9220
- icon: /*#__PURE__*/React.createElement(FileCopy, {
9221
- fontSize: "small"
9222
- })
9223
- }))));
9219
+ return /*#__PURE__*/React.createElement(ToggleMenu, {
9220
+ buttonTestId: "openMenuButton",
9221
+ buttonSx: {
9222
+ margin: '4px 2px',
9223
+ '&.MuiButtonBase-root': {
9224
+ backgroundColor: 'transparent',
9225
+ color: 'geowebColors.greys.accessible'
9226
+ }
9227
+ },
9228
+ menuPosition: "bottom",
9229
+ menuItems: [{
9230
+ text: 'Duplicate layer',
9231
+ action: onClickDuplicate,
9232
+ icon: CopyIcon
9233
+ }],
9234
+ tooltipTitle: "Open menu"
9235
+ });
9224
9236
  };
9225
9237
 
9226
9238
  var RenderStyles = function RenderStyles(_ref) {
@@ -9272,7 +9284,8 @@ var RenderStyles = function RenderStyles(_ref) {
9272
9284
  onChange: selectStyle,
9273
9285
  onChangeMouseWheel: function onChangeMouseWheel(e) {
9274
9286
  return onChangeLayerStyle(e.value);
9275
- }
9287
+ },
9288
+ requiresCtrlToChange: true
9276
9289
  }, /*#__PURE__*/React.createElement(MenuItem, {
9277
9290
  disabled: true
9278
9291
  }, "Select style"), styles.map(function (styleFromlayer) {
@@ -9299,7 +9312,7 @@ var RenderStyles = function RenderStyles(_ref) {
9299
9312
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9300
9313
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
9301
9314
  * */
9302
- var useStyles$x = makeStyles(function () {
9315
+ var useStyles$u = makeStyles(function () {
9303
9316
  return createStyles({
9304
9317
  icon: {
9305
9318
  width: 20,
@@ -9313,7 +9326,7 @@ var DeleteButton = function DeleteButton(_ref) {
9313
9326
  onClickDelete = _ref.onClickDelete,
9314
9327
  _ref$isEnabled = _ref.isEnabled,
9315
9328
  isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
9316
- var classes = useStyles$x();
9329
+ var classes = useStyles$u();
9317
9330
  return /*#__PURE__*/React.createElement(LayerManagerButton, {
9318
9331
  tooltipTitle: tooltipTitle,
9319
9332
  onClick: onClickDelete,
@@ -9341,30 +9354,17 @@ var DeleteButton = function DeleteButton(_ref) {
9341
9354
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9342
9355
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
9343
9356
  * */
9344
- var useStyles$w = makeStyles(function (theme) {
9357
+ var useStyles$t = makeStyles(function (theme) {
9345
9358
  return createStyles({
9346
- icon: {
9347
- width: 18,
9348
- height: 18,
9349
- marginTop: 4
9350
- },
9351
9359
  svgIcon: {
9352
9360
  fill: function fill(_ref) {
9353
- var isActive = _ref.isActive,
9354
- isEnabled = _ref.isEnabled;
9355
- var _theme$palette$geoweb = theme.palette.geowebColors.layerManager,
9356
- tableRowDefaultIcon = _theme$palette$geoweb.tableRowDefaultIcon,
9357
- tableRowDisabledIcon = _theme$palette$geoweb.tableRowDisabledIcon;
9361
+ var isActive = _ref.isActive;
9358
9362
 
9359
9363
  if (isActive) {
9360
9364
  return theme.palette.common.white;
9361
9365
  }
9362
9366
 
9363
- if (!isEnabled) {
9364
- return tableRowDisabledIcon.fill;
9365
- }
9366
-
9367
- return tableRowDefaultIcon.rgba;
9367
+ return theme.palette.geowebColors.buttons.flat["default"].color;
9368
9368
  }
9369
9369
  }
9370
9370
  });
@@ -9378,14 +9378,18 @@ var ActivateLayer = function ActivateLayer(_ref2) {
9378
9378
  isActive = _ref2$isActive === void 0 ? false : _ref2$isActive,
9379
9379
  _ref2$isEnabled = _ref2.isEnabled,
9380
9380
  isEnabled = _ref2$isEnabled === void 0 ? true : _ref2$isEnabled;
9381
- var classes = useStyles$w({
9381
+ var classes = useStyles$t({
9382
9382
  isActive: isActive,
9383
9383
  isEnabled: isEnabled
9384
9384
  });
9385
9385
 
9386
9386
  var Icon = function Icon() {
9387
9387
  return /*#__PURE__*/React.createElement(SvgIcon, {
9388
- className: classes.icon
9388
+ sx: {
9389
+ width: '18px',
9390
+ height: '18px',
9391
+ marginTop: '4px'
9392
+ }
9389
9393
  }, /*#__PURE__*/React.createElement("g", {
9390
9394
  id: "Concept-3",
9391
9395
  stroke: "none",
@@ -9427,7 +9431,7 @@ var ActivateLayer = function ActivateLayer(_ref2) {
9427
9431
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9428
9432
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
9429
9433
  * */
9430
- var useStyles$v = makeStyles(function (theme) {
9434
+ var useStyles$s = makeStyles(function (theme) {
9431
9435
  return createStyles({
9432
9436
  row: {
9433
9437
  background: function background(isEnabled) {
@@ -9478,7 +9482,7 @@ var LayerRow = function LayerRow(_ref) {
9478
9482
  layerActiveLayout = _ref.layerActiveLayout,
9479
9483
  layerManagerWidth = _ref.layerManagerWidth,
9480
9484
  dragHandle = _ref.dragHandle;
9481
- var classes = useStyles$v(isEnabled);
9485
+ var classes = useStyles$s(isEnabled);
9482
9486
  var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
9483
9487
 
9484
9488
  var onClickRow = function onClickRow() {
@@ -9571,7 +9575,6 @@ var LayerRow = function LayerRow(_ref) {
9571
9575
  });
9572
9576
  }
9573
9577
  }), layerMenuLayout || /*#__PURE__*/React__default.createElement(LayerManagerMenuButton, {
9574
- tooltipTitle: "Open Menu",
9575
9578
  mapId: mapId,
9576
9579
  layerId: layerId,
9577
9580
  onLayerDuplicate: onLayerDuplicate
@@ -9899,11 +9902,7 @@ var LayerManagerMenuButtonConnect = function LayerManagerMenuButtonConnect(_ref)
9899
9902
  origin: 'MenuButtonConnect'
9900
9903
  }));
9901
9904
  }, [dispatch]);
9902
- var isLayerEnabled = useSelector(function (store) {
9903
- return getLayerEnabled(store, layerId);
9904
- });
9905
9905
  return /*#__PURE__*/React.createElement(LayerManagerMenuButton, {
9906
- tooltipTitle: "Open Menu",
9907
9906
  layerId: layerId,
9908
9907
  mapId: mapId,
9909
9908
  onLayerDuplicate: function onLayerDuplicate() {
@@ -9912,8 +9911,7 @@ var LayerManagerMenuButtonConnect = function LayerManagerMenuButtonConnect(_ref)
9912
9911
  mapId: mapId,
9913
9912
  layer: layer
9914
9913
  });
9915
- },
9916
- isEnabled: isLayerEnabled
9914
+ }
9917
9915
  });
9918
9916
  };
9919
9917
 
@@ -10060,48 +10058,38 @@ var LayerRowConnect = function LayerRowConnect(_ref) {
10060
10058
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
10061
10059
  * */
10062
10060
  var TOOLTIP_TITLE = 'Drag a layer up or down';
10063
- var useStyles$u = makeStyles(function (theme) {
10064
- return {
10065
- dragHandle: {
10066
- cursor: 'grab',
10067
- backgroundColor: 'inherit',
10068
- '&:hover': {
10069
- backgroundColor: 'inherit'
10070
- },
10071
- height: 32,
10072
- color: function color(_ref) {
10073
- var isDisabled = _ref.isDisabled;
10074
- return isDisabled ? theme.palette.geowebColors.layerManager.tableRowDefaultIcon.rgba : theme.palette.geowebColors.layerManager.tableRowDisabledIcon.fill;
10075
- }
10076
- }
10077
- };
10078
- });
10079
10061
 
10080
- var DragHandle = function DragHandle(_ref2) {
10081
- var _ref2$isDisabled = _ref2.isDisabled,
10082
- isDisabled = _ref2$isDisabled === void 0 ? false : _ref2$isDisabled,
10083
- _ref2$index = _ref2.index,
10084
- index = _ref2$index === void 0 ? undefined : _ref2$index,
10085
- _ref2$hideTooltip = _ref2.hideTooltip,
10086
- hideTooltip = _ref2$hideTooltip === void 0 ? false : _ref2$hideTooltip;
10087
- var classes = useStyles$u({
10088
- isDisabled: isDisabled
10089
- });
10062
+ var DragHandle = function DragHandle(_ref) {
10063
+ var _ref$isDisabled = _ref.isDisabled,
10064
+ isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
10065
+ _ref$index = _ref.index,
10066
+ index = _ref$index === void 0 ? undefined : _ref$index,
10067
+ _ref$hideTooltip = _ref.hideTooltip,
10068
+ hideTooltip = _ref$hideTooltip === void 0 ? false : _ref$hideTooltip;
10090
10069
  var tooltipTitle = hideTooltip ? '' : TOOLTIP_TITLE;
10091
10070
  return /*#__PURE__*/React__default.createElement(LayerManagerButton, {
10092
10071
  tooltipTitle: tooltipTitle,
10093
10072
  icon: /*#__PURE__*/React__default.createElement(DragIndicator, null),
10094
10073
  testId: "dragHandle".concat(index !== undefined ? "-".concat(index) : ''),
10095
- className: "".concat(classes.dragHandle, " handle"),
10074
+ className: "handle",
10096
10075
  tabIndex: -1,
10097
10076
  isEnabled: !isDisabled,
10098
10077
  disableFocusRipple: true,
10099
10078
  disableTouchRipple: true,
10100
- disabled: isDisabled
10079
+ disabled: isDisabled,
10080
+ isAccessible: true,
10081
+ sx: {
10082
+ cursor: 'grab',
10083
+ '&:hover': {
10084
+ backgroundColor: 'inherit!important'
10085
+ },
10086
+ marginLeft: '3px',
10087
+ marginRight: '3px'
10088
+ }
10101
10089
  });
10102
10090
  };
10103
10091
 
10104
- var useStyles$t = makeStyles(function () {
10092
+ var useStyles$r = makeStyles(function () {
10105
10093
  return {
10106
10094
  layerRows: {
10107
10095
  width: '100%',
@@ -10168,7 +10156,7 @@ var LayerContainerRow = function LayerContainerRow(_ref) {
10168
10156
 
10169
10157
  var isSorting = activeDragIndex !== null;
10170
10158
  var isDragDisabled = layerIds.length === 1;
10171
- var classes = useStyles$t(isSorting);
10159
+ var classes = useStyles$r(isSorting);
10172
10160
  return /*#__PURE__*/React.createElement(Grid, {
10173
10161
  container: true,
10174
10162
  item: true,
@@ -10378,7 +10366,7 @@ var BaseLayersConnect = function BaseLayersConnect(_ref) {
10378
10366
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10379
10367
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
10380
10368
  * */
10381
- var useStyles$s = makeStyles({
10369
+ var useStyles$q = makeStyles({
10382
10370
  layerRow: {
10383
10371
  width: '100%',
10384
10372
  height: '36px'
@@ -10401,7 +10389,7 @@ var BaseLayerRow = function BaseLayerRow(_ref) {
10401
10389
  layerManagerWidth = _ref.layerManagerWidth,
10402
10390
  _ref$tooltip = _ref.tooltip,
10403
10391
  tooltip = _ref$tooltip === void 0 ? '' : _ref$tooltip;
10404
- var classes = useStyles$s();
10392
+ var classes = useStyles$q();
10405
10393
  var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
10406
10394
  return /*#__PURE__*/React.createElement(Grid, {
10407
10395
  container: true,
@@ -10430,7 +10418,7 @@ var BaseLayerRow = function BaseLayerRow(_ref) {
10430
10418
  })));
10431
10419
  };
10432
10420
 
10433
- var useStyles$r = makeStyles({
10421
+ var useStyles$p = makeStyles({
10434
10422
  layerRowContainer: {
10435
10423
  position: 'relative',
10436
10424
  width: '100%',
@@ -10465,7 +10453,7 @@ var LayerManager = function LayerManager(_ref) {
10465
10453
  layerSelect = _ref$layerSelect === void 0 ? false : _ref$layerSelect,
10466
10454
  _ref$showAddLayersToo = _ref.showAddLayersTooltip,
10467
10455
  showAddLayersTooltip = _ref$showAddLayersToo === void 0 ? true : _ref$showAddLayersToo;
10468
- var classes = useStyles$r();
10456
+ var classes = useStyles$p();
10469
10457
 
10470
10458
  var _React$useState = React.useState(LayerManagerWidth.lg),
10471
10459
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -10522,80 +10510,6 @@ var LayerManager = function LayerManager(_ref) {
10522
10510
  }))));
10523
10511
  };
10524
10512
 
10525
- /* *
10526
- * Licensed under the Apache License, Version 2.0 (the "License");
10527
- * you may not use this file except in compliance with the License.
10528
- * You may obtain a copy of the License at
10529
- *
10530
- * http://www.apache.org/licenses/LICENSE-2.0
10531
- *
10532
- * Unless required by applicable law or agreed to in writing, software
10533
- * distributed under the License is distributed on an "AS IS" BASIS,
10534
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10535
- * See the License for the specific language governing permissions and
10536
- * limitations under the License.
10537
- *
10538
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10539
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
10540
- * */
10541
-
10542
- var CustomToggleButton = function CustomToggleButton(_a) {
10543
- var _a$variant = _a.variant,
10544
- variant = _a$variant === void 0 ? 'primary' : _a$variant,
10545
- _a$value = _a.value,
10546
- value = _a$value === void 0 ? 0 : _a$value,
10547
- props = __rest(_a, ["variant", "value"]);
10548
-
10549
- return /*#__PURE__*/React.createElement(ToggleButton, Object.assign({
10550
- className: variant,
10551
- value: value
10552
- }, props));
10553
- };
10554
-
10555
- /* *
10556
- * Licensed under the Apache License, Version 2.0 (the "License");
10557
- * you may not use this file except in compliance with the License.
10558
- * You may obtain a copy of the License at
10559
- *
10560
- * http://www.apache.org/licenses/LICENSE-2.0
10561
- *
10562
- * Unless required by applicable law or agreed to in writing, software
10563
- * distributed under the License is distributed on an "AS IS" BASIS,
10564
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10565
- * See the License for the specific language governing permissions and
10566
- * limitations under the License.
10567
- *
10568
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10569
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
10570
- * */
10571
-
10572
- var ToolButton = function ToolButton(_a) {
10573
- var active = _a.active,
10574
- _a$width = _a.width,
10575
- width = _a$width === void 0 ? '24px' : _a$width,
10576
- _a$height = _a.height,
10577
- height = _a$height === void 0 ? '24px' : _a$height,
10578
- children = _a.children,
10579
- _a$value = _a.value,
10580
- value = _a$value === void 0 ? 0 : _a$value,
10581
- _a$sx = _a.sx,
10582
- sx = _a$sx === void 0 ? {} : _a$sx,
10583
- props = __rest(_a, ["active", "width", "height", "children", "value", "sx"]);
10584
-
10585
- return /*#__PURE__*/React.createElement(CustomToggleButton, Object.assign({
10586
- variant: "tool",
10587
- disableRipple: true,
10588
- selected: active,
10589
- value: value,
10590
- sx: Object.assign({
10591
- width: "".concat(width, "!important"),
10592
- height: "".concat(height, "!important"),
10593
- textTransform: 'none!important',
10594
- padding: '11px!important'
10595
- }, sx)
10596
- }, props), children);
10597
- };
10598
-
10599
10513
  /* *
10600
10514
  * Licensed under the Apache License, Version 2.0 (the "License");
10601
10515
  * you may not use this file except in compliance with the License.
@@ -11177,13 +11091,6 @@ var ServicePopupConnect = function ServicePopupConnect(_ref) {
11177
11091
  var isURL = function isURL(string) {
11178
11092
  return /^https?:\/\//.test(string);
11179
11093
  };
11180
- var useStyles$q = makeStyles(function (theme) {
11181
- return {
11182
- iconButton: {
11183
- color: theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat
11184
- }
11185
- };
11186
- });
11187
11094
  var clearIconPath = 'M12,2 C17.5228475,2 22,6.4771525 22,12 C22,17.5228475 17.5228475,22 12,22 C6.4771525,22 2,17.5228475 2,12 C2,6.4771525 6.4771525,2 12,2 Z M15.44426,7.26697571 L12.0002861,10.7110482 L8.55573996,7.26697571 C8.19978253,6.9110081 7.62292549,6.9110081 7.26696807,7.26697571 C6.91101064,7.62294331 6.91101064,8.19981687 7.26696807,8.55578447 L10.7115142,11.9998569 L7.26696807,15.4445017 C6.91101064,15.8004693 6.91101064,16.3767705 7.26696807,16.7333104 C7.44494678,16.910722 7.67843653,17 7.91192629,17 C8.14484377,17 8.37776125,16.910722 8.55573996,16.7333104 L12.0002861,13.289238 L15.44426,16.7333104 C15.6222388,16.910722 15.8551562,17 16.088646,17 C16.3221357,17 16.5550532,16.910722 16.7330319,16.7333104 C17.0889894,16.3767705 17.0889894,15.8004693 16.7330319,15.4445017 L13.289058,11.9998569 L16.7330319,8.55578447 C17.0889894,8.19981687 17.0889894,7.62294331 16.7330319,7.26697571 C16.3770745,6.9110081 15.8002175,6.9110081 15.44426,7.26697571 Z';
11188
11095
  var clearIcon = /*#__PURE__*/React__default.createElement(SvgIcon, {
11189
11096
  style: {
@@ -11216,7 +11123,6 @@ var SearchFieldButtonContainer = function SearchFieldButtonContainer(_ref) {
11216
11123
  isPopupOpen = _React$useState2[0],
11217
11124
  setPopupOpen = _React$useState2[1];
11218
11125
 
11219
- var classes = useStyles$q();
11220
11126
  React__default.useEffect(function () {
11221
11127
  if (isPopupOpen === false) {
11222
11128
  onClickClear();
@@ -11227,7 +11133,6 @@ var SearchFieldButtonContainer = function SearchFieldButtonContainer(_ref) {
11227
11133
  title: "Clear",
11228
11134
  placement: "top"
11229
11135
  }, /*#__PURE__*/React__default.createElement(IconButton, {
11230
- className: classes.iconButton,
11231
11136
  edge: "end",
11232
11137
  onClick: function onClick() {
11233
11138
  onClickClear();
@@ -11256,7 +11161,6 @@ var SearchFieldButtonContainer = function SearchFieldButtonContainer(_ref) {
11256
11161
  title: "Search",
11257
11162
  placement: "top"
11258
11163
  }, /*#__PURE__*/React__default.createElement(IconButton, {
11259
- className: classes.iconButton,
11260
11164
  edge: "end",
11261
11165
  size: "large"
11262
11166
  }, searchIcon));
@@ -11339,6 +11243,50 @@ var SearchFieldConnect = function SearchFieldConnect() {
11339
11243
  });
11340
11244
  };
11341
11245
 
11246
+ /* *
11247
+ * Licensed under the Apache License, Version 2.0 (the "License");
11248
+ * you may not use this file except in compliance with the License.
11249
+ * You may obtain a copy of the License at
11250
+ *
11251
+ * http://www.apache.org/licenses/LICENSE-2.0
11252
+ *
11253
+ * Unless required by applicable law or agreed to in writing, software
11254
+ * distributed under the License is distributed on an "AS IS" BASIS,
11255
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11256
+ * See the License for the specific language governing permissions and
11257
+ * limitations under the License.
11258
+ *
11259
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11260
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
11261
+ * */
11262
+
11263
+ var LayerAddRemoveButton = function LayerAddRemoveButton(_ref) {
11264
+ var layer = _ref.layer,
11265
+ layerIndex = _ref.layerIndex,
11266
+ serviceId = _ref.serviceId,
11267
+ addLayer = _ref.addLayer,
11268
+ deleteLayer = _ref.deleteLayer,
11269
+ mapLayers = _ref.mapLayers;
11270
+ var foundLayer = mapLayers.find(function (lr) {
11271
+ return lr.name === layer.name && lr.service === serviceId;
11272
+ });
11273
+ return /*#__PURE__*/React.createElement(CustomToggleButton, {
11274
+ "data-testid": "layerAddRemoveButton-".concat(layer.name),
11275
+ onClick: function onClick() {
11276
+ !foundLayer ? addLayer({
11277
+ serviceURL: serviceId,
11278
+ layerName: layer.name
11279
+ }) : deleteLayer({
11280
+ layerId: foundLayer.id,
11281
+ layerIndex: layerIndex
11282
+ });
11283
+ },
11284
+ selected: !!foundLayer,
11285
+ variant: "tool",
11286
+ fullWidth: true
11287
+ }, !foundLayer ? 'Add' : 'Remove');
11288
+ };
11289
+
11342
11290
  /* *
11343
11291
  * Licensed under the Apache License, Version 2.0 (the "License");
11344
11292
  * you may not use this file except in compliance with the License.
@@ -11377,35 +11325,35 @@ var filterLayersFromService = function filterLayersFromService(serviceId, servic
11377
11325
  });
11378
11326
  };
11379
11327
 
11380
- var useStyles$p = makeStyles(function (theme) {
11328
+ var useStyles$o = makeStyles(function (theme) {
11381
11329
  return {
11382
11330
  layerRow: {
11383
- background: theme.palette.geowebColors.background.surface,
11331
+ background: theme.palette.geowebColors.cards.cardContainer,
11384
11332
  padding: '8px 0px 8px 12px',
11385
11333
  marginBottom: '4px',
11386
11334
  height: '64px',
11387
- border: "solid 1px ".concat(theme.palette.geowebColors.cards.cardContainerBorder)
11335
+ border: "solid 1px ".concat(theme.palette.geowebColors.cards.cardContainerBorder),
11336
+ display: 'grid',
11337
+ gridTemplateColumns: '1fr 0.1fr',
11338
+ gridGap: '20px'
11388
11339
  },
11389
11340
  layerText: {
11390
11341
  fontSize: '12px',
11391
11342
  fontWeight: 500,
11392
11343
  overflow: 'clip',
11393
11344
  height: '20px',
11394
- textOverflow: 'ellipsis',
11395
- whiteSpace: 'nowrap'
11345
+ textOverflow: 'ellipsis'
11396
11346
  },
11397
11347
  layerName: {
11398
11348
  fontSize: '12px',
11399
11349
  height: '24px',
11400
- maxWidth: '100%',
11401
11350
  overflow: 'clip',
11402
11351
  "float": 'left',
11403
11352
  paddingTop: '6px',
11404
- textOverflow: 'ellipsis',
11405
11353
  whiteSpace: 'nowrap'
11406
11354
  },
11407
11355
  layerNameMaxWidth: {
11408
- maxWidth: '196px'
11356
+ maxWidth: '270px'
11409
11357
  },
11410
11358
  layerAbstract: {
11411
11359
  fontSize: '10px',
@@ -11416,6 +11364,11 @@ var useStyles$p = makeStyles(function (theme) {
11416
11364
  resultCount: {
11417
11365
  marginBottom: '4px',
11418
11366
  fontSize: '12px'
11367
+ },
11368
+ layerButton: {
11369
+ marginRight: '8px',
11370
+ marginTop: '4px',
11371
+ width: '80px'
11419
11372
  }
11420
11373
  };
11421
11374
  });
@@ -11424,10 +11377,13 @@ var LayerList = function LayerList(_ref) {
11424
11377
  var services = _ref.services,
11425
11378
  serviceIds = _ref.serviceIds,
11426
11379
  layerSelectHeight = _ref.layerSelectHeight,
11380
+ addLayer = _ref.addLayer,
11381
+ deleteLayer = _ref.deleteLayer,
11427
11382
  searchString = _ref.searchString,
11383
+ mapLayers = _ref.mapLayers,
11428
11384
  keywordIds = _ref.keywordIds,
11429
11385
  allKeywordsActive = _ref.allKeywordsActive;
11430
- var classes = useStyles$p();
11386
+ var classes = useStyles$o();
11431
11387
 
11432
11388
  var _React$useState = React.useState(0),
11433
11389
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -11449,12 +11405,14 @@ var LayerList = function LayerList(_ref) {
11449
11405
  overflow: 'auto'
11450
11406
  }
11451
11407
  }, serviceIds.map(function (serviceId) {
11452
- return filterLayersFromService(serviceId, services, keywordIds, allKeywordsActive, searchString).map(function (layer) {
11408
+ return filterLayersFromService(serviceId, services, keywordIds, allKeywordsActive, searchString).map(function (layer, layerIndex) {
11453
11409
  return /*#__PURE__*/React.createElement("div", {
11410
+ key: "".concat(serviceId, "-").concat(layer.name, "-").concat(layer.text)
11411
+ }, /*#__PURE__*/React.createElement("div", {
11454
11412
  key: "".concat(serviceId, "-").concat(layer.name),
11455
11413
  className: classes.layerRow,
11456
11414
  "data-testid": "layerListLayerRow"
11457
- }, /*#__PURE__*/React.createElement("div", {
11415
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
11458
11416
  className: classes.layerText
11459
11417
  }, layer.text), /*#__PURE__*/React.createElement("div", null, layer["abstract"] ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
11460
11418
  className: "".concat(classes.layerName, " ").concat(classes.layerNameMaxWidth)
@@ -11463,7 +11421,16 @@ var LayerList = function LayerList(_ref) {
11463
11421
  "data-testid": "layerAbstract"
11464
11422
  }, layer["abstract"])) : /*#__PURE__*/React.createElement("div", {
11465
11423
  className: classes.layerName
11466
- }, layer.name)));
11424
+ }, layer.name))), /*#__PURE__*/React.createElement("div", {
11425
+ className: classes.layerButton
11426
+ }, /*#__PURE__*/React.createElement(LayerAddRemoveButton, {
11427
+ layer: layer,
11428
+ layerIndex: layerIndex,
11429
+ serviceId: serviceId,
11430
+ addLayer: addLayer,
11431
+ deleteLayer: deleteLayer,
11432
+ mapLayers: mapLayers
11433
+ }))));
11467
11434
  });
11468
11435
  })));
11469
11436
  };
@@ -11486,13 +11453,57 @@ var LayerList = function LayerList(_ref) {
11486
11453
  * */
11487
11454
 
11488
11455
  var LayerListConnect = function LayerListConnect(_ref) {
11489
- var layerSelectHeight = _ref.layerSelectHeight;
11456
+ var mapId = _ref.mapId,
11457
+ layerSelectHeight = _ref.layerSelectHeight;
11490
11458
  var services = useSelector(function (store) {
11491
11459
  return getServices(store);
11492
11460
  });
11461
+ var dispatch = useDispatch();
11493
11462
  var enabledServiceIds = useSelector(function (store) {
11494
11463
  return getEnabledServiceIds(store);
11495
11464
  });
11465
+ var mapLayers = useSelector(function (store) {
11466
+ return getMapLayers(store, mapId);
11467
+ });
11468
+
11469
+ var addLayer$1 = function addLayer(_ref2) {
11470
+ var serviceURL = _ref2.serviceURL,
11471
+ layerName = _ref2.layerName;
11472
+ var layer = {
11473
+ service: serviceURL,
11474
+ name: layerName,
11475
+ id: generateLayerId(),
11476
+ layerType: LayerType$1.mapLayer
11477
+ };
11478
+ addMapLayer({
11479
+ mapId: mapId,
11480
+ layerId: layer.id,
11481
+ layer: layer,
11482
+ origin: 'LayerListConnect'
11483
+ });
11484
+ };
11485
+
11486
+ var addMapLayer = React.useCallback(function (_ref3) {
11487
+ var layerId = _ref3.layerId,
11488
+ layer = _ref3.layer,
11489
+ origin = _ref3.origin;
11490
+ return dispatch(addLayer({
11491
+ mapId: mapId,
11492
+ layerId: layerId,
11493
+ layer: layer,
11494
+ origin: origin
11495
+ }));
11496
+ }, [dispatch, mapId]);
11497
+ var deleteLayer = React.useCallback(function (_ref4) {
11498
+ var layerId = _ref4.layerId,
11499
+ layerIndex = _ref4.layerIndex;
11500
+ return dispatch(layerDelete({
11501
+ mapId: mapId,
11502
+ layerId: layerId,
11503
+ layerIndex: layerIndex,
11504
+ origin: 'LayerListConnect'
11505
+ }));
11506
+ }, [dispatch, mapId]);
11496
11507
  var checkedKeywordIds = useSelector(function (store) {
11497
11508
  return getCheckedKeywordIds(store);
11498
11509
  });
@@ -11506,9 +11517,12 @@ var LayerListConnect = function LayerListConnect(_ref) {
11506
11517
  services: services,
11507
11518
  serviceIds: enabledServiceIds,
11508
11519
  layerSelectHeight: layerSelectHeight,
11520
+ addLayer: addLayer$1,
11521
+ deleteLayer: deleteLayer,
11509
11522
  keywordIds: checkedKeywordIds,
11510
11523
  allKeywordsActive: allKeywordsActive,
11511
- searchString: searchString
11524
+ searchString: searchString,
11525
+ mapLayers: mapLayers
11512
11526
  });
11513
11527
  };
11514
11528
 
@@ -11624,7 +11638,7 @@ var ServiceChipConnect = function ServiceChipConnect(_ref) {
11624
11638
  });
11625
11639
  };
11626
11640
 
11627
- var useStyles$o = makeStyles(function (theme) {
11641
+ var useStyles$n = makeStyles(function (theme) {
11628
11642
  return createStyles({
11629
11643
  serviceChips: {
11630
11644
  width: '100%',
@@ -11699,7 +11713,7 @@ var ServiceList = function ServiceList(_ref4) {
11699
11713
  var ref = React.useRef(null);
11700
11714
  var scrollSpeed = 5;
11701
11715
  var maxWidthValue = ref && ref.current && ref.current.scrollWidth && ref.current.scrollWidth >= layerSelectWidth - margin && ref.current.scrollWidth || layerSelectWidth - 50;
11702
- var classes = useStyles$o({
11716
+ var classes = useStyles$n({
11703
11717
  margin: margin,
11704
11718
  maxWidthValue: maxWidthValue
11705
11719
  });
@@ -11813,7 +11827,7 @@ var ServiceListConnect = function ServiceListConnect(_ref) {
11813
11827
  });
11814
11828
  };
11815
11829
 
11816
- var useStyles$n = makeStyles(function (theme) {
11830
+ var useStyles$m = makeStyles(function (theme) {
11817
11831
  return createStyles({
11818
11832
  servicesContainer: {
11819
11833
  width: '300px',
@@ -11869,7 +11883,7 @@ var ServiceOptionsDialog = function ServiceOptionsDialog(_ref) {
11869
11883
  mapStoreRemoveService = _ref.mapStoreRemoveService,
11870
11884
  _ref$layers = _ref.layers,
11871
11885
  layers = _ref$layers === void 0 ? [] : _ref$layers;
11872
- var classes = useStyles$n();
11886
+ var classes = useStyles$m();
11873
11887
 
11874
11888
  var _React$useState = React.useState(false),
11875
11889
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -11887,6 +11901,8 @@ var ServiceOptionsDialog = function ServiceOptionsDialog(_ref) {
11887
11901
  var isDisabled = function isDisabled(service) {
11888
11902
  return layers.some(function (layer) {
11889
11903
  return layer.service && layer.service.includes(service);
11904
+ }) || preloadedDefaultMapServices.some(function (defaultMapService) {
11905
+ return defaultMapService.url && defaultMapService.url.includes(service);
11890
11906
  });
11891
11907
  };
11892
11908
 
@@ -11916,14 +11932,15 @@ var ServiceOptionsDialog = function ServiceOptionsDialog(_ref) {
11916
11932
  }
11917
11933
  }, /*#__PURE__*/React.createElement(Tooltip, {
11918
11934
  title: "Edit Service"
11919
- }, /*#__PURE__*/React.createElement(IconButton, {
11935
+ }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(IconButton, {
11936
+ disabled: isDisabled(service.service),
11920
11937
  "data-testid": "openEditServiceButton",
11921
11938
  size: "large"
11922
11939
  }, /*#__PURE__*/React.createElement(SvgIcon, null, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
11923
11940
  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",
11924
11941
  fill: classes.iconFill,
11925
11942
  fillRule: "evenodd"
11926
- }))))), /*#__PURE__*/React.createElement(Tooltip, {
11943
+ })))))), /*#__PURE__*/React.createElement(Tooltip, {
11927
11944
  title: "Delete Service"
11928
11945
  }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(IconButton, {
11929
11946
  size: "large",
@@ -11994,49 +12011,28 @@ var ServiceOptionsDialogConnect = function ServiceOptionsDialogConnect() {
11994
12011
  });
11995
12012
  };
11996
12013
 
11997
- var useStyles$m = makeStyles(function (theme) {
11998
- return createStyles({
11999
- servicesContainer: {
12000
- position: 'fixed',
12001
- top: '140px',
12002
- right: '-72px',
12003
- backgroundColor: theme.palette.geowebColors.background.surface,
12004
- boxShadow: theme.shadows[6]
12005
- },
12006
- servicesText: {
12007
- paddingTop: '12px',
12008
- paddingLeft: '12px'
12009
- }
12010
- });
12011
- });
12014
+ /* *
12015
+ * Licensed under the Apache License, Version 2.0 (the "License");
12016
+ * you may not use this file except in compliance with the License.
12017
+ * You may obtain a copy of the License at
12018
+ *
12019
+ * http://www.apache.org/licenses/LICENSE-2.0
12020
+ *
12021
+ * Unless required by applicable law or agreed to in writing, software
12022
+ * distributed under the License is distributed on an "AS IS" BASIS,
12023
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12024
+ * See the License for the specific language governing permissions and
12025
+ * limitations under the License.
12026
+ *
12027
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
12028
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
12029
+ * */
12012
12030
 
12013
12031
  var ServiceOptionsButton = function ServiceOptionsButton() {
12014
- var classes = useStyles$m();
12015
-
12016
- var _React$useState = React.useState(false),
12017
- _React$useState2 = _slicedToArray(_React$useState, 2),
12018
- containerOpen = _React$useState2[0],
12019
- setContainerOpen = _React$useState2[1];
12020
-
12021
- var toggleContainer = function toggleContainer() {
12022
- setContainerOpen(!containerOpen);
12023
- };
12024
-
12025
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ToolButton, {
12026
- onClick: toggleContainer,
12027
- active: containerOpen,
12028
- "data-testid": "serviceOptionsButton",
12029
- variant: "tool"
12030
- }, /*#__PURE__*/React.createElement(SvgIcon, {
12031
- viewBox: "0 0 24 24",
12032
- xmlns: "http://www.w3.org/2000/svg"
12033
- }, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
12034
- d: "M12 16c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm0-2c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm0-6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z",
12035
- fillRule: "evenodd"
12036
- })))), containerOpen ? /*#__PURE__*/React.createElement(Box, {
12037
- className: classes.servicesContainer,
12038
- "data-testid": "ServiceOptionsDialogContainer"
12039
- }, /*#__PURE__*/React.createElement(ServiceOptionsDialogConnect, null)) : null);
12032
+ return /*#__PURE__*/React.createElement(ToggleMenu, {
12033
+ buttonTestId: "serviceOptionsButton",
12034
+ menuPosition: "bottom"
12035
+ }, /*#__PURE__*/React.createElement(ServiceOptionsDialogConnect, null));
12040
12036
  };
12041
12037
 
12042
12038
  var useStyles$l = makeStyles({
@@ -12129,6 +12125,7 @@ var LayerSelect = function LayerSelect(_ref) {
12129
12125
  })), /*#__PURE__*/React.createElement("div", {
12130
12126
  className: classes.layerSelectContainer
12131
12127
  }, /*#__PURE__*/React.createElement(LayerListConnect, {
12128
+ mapId: mapId,
12132
12129
  layerSelectHeight: height
12133
12130
  })));
12134
12131
  };
@@ -15483,6 +15480,12 @@ var getNextSecondsPerPxValue = function getNextSecondsPerPxValue(direction, oldS
15483
15480
 
15484
15481
  var NEEDLE_HANDLE_WIDTH = 10;
15485
15482
  var LEFT_MOUSE_BTN = 1;
15483
+ var THROTTLE_WAIT_TIME = 500; // [ms]
15484
+
15485
+ var THROTTLE_OPTIONS = {
15486
+ trailing: false // Invoke function when called, but not more than once every <THROTTLE_WAIT_TIME>.
15487
+
15488
+ };
15486
15489
 
15487
15490
  var TimeSliderLegend = function TimeSliderLegend(_ref) {
15488
15491
  var centerTime = _ref.centerTime,
@@ -15551,7 +15554,21 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
15551
15554
  setNewRoundedTime(x, centerTime, width, secondsPerPx, timeStep, dataStartTime, dataEndTime, onSetNewDate);
15552
15555
  };
15553
15556
 
15554
- var theme = useTheme();
15557
+ var theme = useTheme(); // eslint-disable-next-line react-hooks/exhaustive-deps
15558
+
15559
+ var throttledZoom = React.useCallback(throttle(function (newSecondsPerPx, newCenterTime) {
15560
+ onZoom(newSecondsPerPx, newCenterTime);
15561
+ }, THROTTLE_WAIT_TIME, THROTTLE_OPTIONS), []);
15562
+
15563
+ var zoom = function zoom(deltaY, deltaX, canvasWidth, mouseX) {
15564
+ if (!onZoom) return;
15565
+ var direction = deltaY || deltaX;
15566
+ var newSecondsPerPx = getNextSecondsPerPxValue(Math.sign(direction), secondsPerPx, dataScaleToSecondsPerPx);
15567
+ var mouseTime = pixelToTimestamp(mouseX, centerTime, canvasWidth, secondsPerPx);
15568
+ var newCenterTime = getNewCenterOfFixedPointZoom(mouseTime, secondsPerPx, newSecondsPerPx, centerTime);
15569
+ throttledZoom(newSecondsPerPx, newCenterTime);
15570
+ };
15571
+
15555
15572
  return /*#__PURE__*/React.createElement("div", {
15556
15573
  className: classes.timeSliderLegend,
15557
15574
  "data-testid": "timeSliderLegend"
@@ -15583,12 +15600,7 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
15583
15600
  deltaX = _ref2.deltaX,
15584
15601
  canvasWidth = _ref2.canvasWidth,
15585
15602
  mouseX = _ref2.mouseX;
15586
- if (!onZoom) return;
15587
- var direction = deltaY || deltaX;
15588
- var newSecondsPerPx = getNextSecondsPerPxValue(Math.sign(direction), secondsPerPx, dataScaleToSecondsPerPx);
15589
- var mouseTime = pixelToTimestamp(mouseX, centerTime, canvasWidth, secondsPerPx);
15590
- var newCenterTime = getNewCenterOfFixedPointZoom(mouseTime, secondsPerPx, newSecondsPerPx, centerTime);
15591
- onZoom(newSecondsPerPx, newCenterTime);
15603
+ zoom(deltaY, deltaX, canvasWidth, mouseX);
15592
15604
  },
15593
15605
  onMouseDown: function onMouseDown(x, y, width) {
15594
15606
  setDragged(false);
@@ -17312,7 +17324,7 @@ var eumetviewEUMETSAT = {
17312
17324
  };
17313
17325
  var ECMWFPublicService = {
17314
17326
  name: 'ECMWF',
17315
- url: 'https://apps.ecmwf.int/wms/?token=public',
17327
+ url: 'https://eccharts.ecmwf.int/wms/?token=public',
17316
17328
  id: 'ecmwf'
17317
17329
  };
17318
17330
  var MeteoCanada = {
@@ -20742,6 +20754,14 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
20742
20754
  });
20743
20755
  }
20744
20756
  }
20757
+ /* Set disable map pin */
20758
+
20759
+
20760
+ if (!prevProps || prevProps.disableMapPin !== props.disableMapPin) {
20761
+ if (!(props.disableMapPin === undefined)) {
20762
+ this.adaguc.webMapJS.getMapPin().toggleDisableMapPin();
20763
+ }
20764
+ }
20745
20765
  /* Change the animation delay */
20746
20766
 
20747
20767
 
@@ -21410,6 +21430,9 @@ var MapViewConnect = function MapViewConnect(_a) {
21410
21430
  var mapPinLocation = useSelector(function (store) {
21411
21431
  return getPinLocation(store, mapId);
21412
21432
  });
21433
+ var disableMapPin = useSelector(function (store) {
21434
+ return getDisableMapPin(store, mapId);
21435
+ });
21413
21436
  var dispatch = useDispatch();
21414
21437
  var map = getWMJSMapById(mapId);
21415
21438
  var mapChangeDimension$1 = React.useCallback(function (mapDimensionPayload) {
@@ -21481,6 +21504,7 @@ var MapViewConnect = function MapViewConnect(_a) {
21481
21504
  activeLayerId: activeLayerId,
21482
21505
  animationDelay: animationDelay,
21483
21506
  displayMapPin: displayMapPin,
21507
+ disableMapPin: disableMapPin,
21484
21508
  onMapChangeDimension: function onMapChangeDimension(mapDimensionPayload) {
21485
21509
  if (mapDimensionPayload && mapDimensionPayload.dimension && mapDimensionPayload.dimension.name && mapDimensionPayload.dimension.name === 'time') {
21486
21510
  setTime$1({
@@ -22086,7 +22110,9 @@ var ConfigurableConnectedMap = function ConfigurableConnectedMap(_ref) {
22086
22110
  _ref$shouldShowZoomCo = _ref.shouldShowZoomControls,
22087
22111
  shouldShowZoomControls = _ref$shouldShowZoomCo === void 0 ? false : _ref$shouldShowZoomCo,
22088
22112
  _ref$displayMapPin = _ref.displayMapPin,
22089
- displayMapPin = _ref$displayMapPin === void 0 ? false : _ref$displayMapPin;
22113
+ displayMapPin = _ref$displayMapPin === void 0 ? false : _ref$displayMapPin,
22114
+ toggleTimestepAuto$1 = _ref.toggleTimestepAuto,
22115
+ setTimestep = _ref.setTimestep;
22090
22116
  var classes = useStyles$4();
22091
22117
  var dispatch = useDispatch();
22092
22118
  var mapId = React__default.useRef(id || generateMapId()).current;
@@ -22155,6 +22181,22 @@ var ConfigurableConnectedMap = function ConfigurableConnectedMap(_ref) {
22155
22181
  timestepAuto: false
22156
22182
  }));
22157
22183
  }
22184
+ } // Set timestep auto based on preset
22185
+
22186
+
22187
+ if (toggleTimestepAuto$1 !== undefined && shouldAnimate !== true) {
22188
+ dispatch(toggleTimestepAuto({
22189
+ mapId: mapId,
22190
+ timestepAuto: toggleTimestepAuto$1
22191
+ }));
22192
+ } // Set timestep value based on preset
22193
+
22194
+
22195
+ if (setTimestep !== undefined && shouldAnimate !== true) {
22196
+ dispatch(setTimeStep({
22197
+ mapId: mapId,
22198
+ timeStep: setTimestep
22199
+ }));
22158
22200
  } // eslint-disable-next-line react-hooks/exhaustive-deps
22159
22201
 
22160
22202
  }, []);
@@ -22501,7 +22543,11 @@ var ConfigurableMapWithSliderConnect = function ConfigurableMapWithSliderConnect
22501
22543
  _ref$animationPayload = _ref.animationPayload,
22502
22544
  animationPayload = _ref$animationPayload === void 0 ? undefined : _ref$animationPayload,
22503
22545
  _ref$displayMapPin = _ref.displayMapPin,
22504
- displayMapPin = _ref$displayMapPin === void 0 ? false : _ref$displayMapPin;
22546
+ displayMapPin = _ref$displayMapPin === void 0 ? false : _ref$displayMapPin,
22547
+ _ref$showTimeSlider = _ref.showTimeSlider,
22548
+ showTimeSlider = _ref$showTimeSlider === void 0 ? true : _ref$showTimeSlider,
22549
+ toggleTimestepAuto = _ref.toggleTimestepAuto,
22550
+ setTimestep = _ref.setTimestep;
22505
22551
  var classes = useStyles$2();
22506
22552
  return /*#__PURE__*/React__default.createElement("div", {
22507
22553
  className: classes.mapSliderConnect,
@@ -22510,7 +22556,7 @@ var ConfigurableMapWithSliderConnect = function ConfigurableMapWithSliderConnect
22510
22556
  className: classes.zoomControls
22511
22557
  }, /*#__PURE__*/React__default.createElement(ZoomControlConnect, {
22512
22558
  mapId: id
22513
- })), /*#__PURE__*/React__default.createElement("div", {
22559
+ })), showTimeSlider && /*#__PURE__*/React__default.createElement("div", {
22514
22560
  className: classes.timeSlider
22515
22561
  }, /*#__PURE__*/React__default.createElement(TimeSliderConnect, {
22516
22562
  mapId: id,
@@ -22528,7 +22574,9 @@ var ConfigurableMapWithSliderConnect = function ConfigurableMapWithSliderConnect
22528
22574
  shouldAnimate: shouldAnimate,
22529
22575
  animationPayload: animationPayload,
22530
22576
  shouldShowZoomControls: shouldShowZoomControls,
22531
- displayMapPin: displayMapPin
22577
+ displayMapPin: displayMapPin,
22578
+ toggleTimestepAuto: toggleTimestepAuto,
22579
+ setTimestep: setTimestep
22532
22580
  }));
22533
22581
  };
22534
22582
 
@@ -22747,11 +22795,7 @@ var SyncGroupList = function SyncGroupList(_ref) {
22747
22795
  return removeGroup(groupObject.id);
22748
22796
  },
22749
22797
  size: "large"
22750
- }, index === 0 ? /*#__PURE__*/React.createElement(Add, {
22751
- className: classes.iconColor
22752
- }) : /*#__PURE__*/React.createElement(DeleteForever, {
22753
- className: classes.iconColor
22754
- })))), /*#__PURE__*/React.createElement(SyncGroupListItem, {
22798
+ }, index === 0 ? /*#__PURE__*/React.createElement(Add, null) : /*#__PURE__*/React.createElement(DeleteForever, null)))), /*#__PURE__*/React.createElement(SyncGroupListItem, {
22755
22799
  viewStateData: viewStateData,
22756
22800
  groupId: groupObject.id,
22757
22801
  selected: groupObject.selected,
@@ -22777,9 +22821,6 @@ var useStyles = makeStyles(function (theme) {
22777
22821
  backgroundColor: theme.palette.geowebColors.syncGroups.drawerOpen.fill,
22778
22822
  boxShadow: 'inset 0px 7px 7px -7px, inset 0px -7px 7px -7px',
22779
22823
  color: '#000000'
22780
- },
22781
- iconColor: {
22782
- color: theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat
22783
22824
  }
22784
22825
  });
22785
22826
  });
@@ -23264,4 +23305,4 @@ var CoreThemeStoreProvider = function CoreThemeStoreProvider(_ref2) {
23264
23305
  }, children)));
23265
23306
  };
23266
23307
 
23267
- 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$1 as mapConstants, selectors 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, types$1 as uiTypes, useStyles$3 as useStyles };
23308
+ 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$1 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 };