@opengeoweb/core 2.2.1 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/index.esm.js +1131 -1102
  2. package/index.umd.js +1147 -1108
  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/LayerRow/LayerRow.d.ts +1 -0
  7. package/lib/components/{CustomToggleButton/CustomToggleButton.spec.d.ts → LayerManager/LayerContainerRow/LayerRow/LayerRowConnect.spec.d.ts} +0 -0
  8. package/lib/components/LayerManager/LayerContainerRow/LayerRow/Menubutton/MenuButton.d.ts +0 -2
  9. package/lib/components/LayerManager/LayerManagerUtils.d.ts +2 -2
  10. package/lib/components/LayerManager/LayerSelect/LayerList/LayerAddRemoveButton.d.ts +18 -0
  11. package/lib/components/LayerManager/{LayerContainerRow/LayerManagerButton.spec.d.ts → LayerSelect/LayerList/LayerAddRemoveButton.spec.d.ts} +0 -0
  12. package/lib/components/LayerManager/LayerSelect/LayerList/LayerList.d.ts +10 -0
  13. package/lib/components/LayerManager/LayerSelect/LayerList/LayerListConnect.d.ts +1 -0
  14. package/lib/components/MapControls/MapControlButton.d.ts +1 -1
  15. package/lib/components/MapView/MapViewConnect.DisableMapPin.stories.d.ts +5 -0
  16. package/lib/components/MapView/MapViewConnect.stories.d.ts +1 -0
  17. package/lib/components/ReactMapView/types.d.ts +1 -0
  18. package/lib/components/SyncGroups/SyncGroupViewer.d.ts +2 -0
  19. package/lib/components/SyncGroups/SyncGroupViewerConnect.d.ts +1 -6
  20. package/lib/components/SyncGroups/selector.d.ts +4 -4
  21. package/lib/components/TimeSlider/TimeSliderButtons/PlayButton/PlayButtonConnect.d.ts +1 -0
  22. package/lib/components/TimeSlider/TimeSliderLegend/TimeSliderLegend.d.ts +2 -0
  23. package/lib/components/TimeSlider/TimeSliderLegend/TimeSliderLegendRenderFunctions.d.ts +1 -1
  24. package/lib/components/TooltipSelect/TooltipSelect.d.ts +1 -1
  25. package/lib/index.d.ts +4 -1
  26. package/lib/store/generic/selectors.d.ts +1 -0
  27. package/lib/store/generic/synchronizationGroups/actions.d.ts +2 -1
  28. package/lib/store/generic/synchronizationGroups/constants.d.ts +1 -0
  29. package/lib/store/generic/synchronizationGroups/sagas.d.ts +1 -0
  30. package/lib/store/generic/synchronizationGroups/selectors.d.ts +13 -0
  31. package/lib/store/generic/synchronizationGroups/types.d.ts +11 -2
  32. package/lib/store/mapStore/map/actions.d.ts +8 -1
  33. package/lib/store/mapStore/map/constants.d.ts +1 -0
  34. package/lib/store/mapStore/map/selectors.d.ts +52 -1
  35. package/lib/store/mapStore/map/types.d.ts +11 -2
  36. package/lib/store/ui/types.d.ts +1 -1
  37. package/lib/utils/testUtils.d.ts +2 -1
  38. package/lib/utils/types.d.ts +14 -23
  39. package/package.json +5 -5
  40. package/lib/components/CustomToggleButton/CustomToggleButton.d.ts +0 -9
  41. package/lib/components/CustomToggleButton/CustomToggleButton.stories.d.ts +0 -13
  42. package/lib/components/LayerManager/LayerContainerRow/LayerManagerButton.d.ts +0 -12
  43. package/lib/components/LayerManager/LayerContainerRow/LayerRow/DeleteLayer/DeleteLayer.d.ts +0 -8
  44. package/lib/components/LayerManager/LayerContainerRow/LayerRow/DeleteLayer/DeleteLayer.spec.d.ts +0 -1
  45. package/lib/components/LayerManager/LayerContainerRow/LayerRow/EnableLayer/EnableLayer.d.ts +0 -8
  46. package/lib/components/LayerManager/LayerContainerRow/LayerRow/EnableLayer/EnableLayer.spec.d.ts +0 -1
  47. package/lib/components/LayerManager/LayerContainerRow/LayerRow/Menubutton/MenuItemButton.d.ts +0 -8
  48. package/lib/components/LayerManager/LayerContainerRow/LayerRow/styles.d.ts +0 -4
  49. package/lib/components/ToolButton/ToolButton.d.ts +0 -12
  50. package/lib/components/ToolButton/ToolButton.spec.d.ts +0 -1
  51. package/lib/components/ToolButton/ToolButton.stories.d.ts +0 -13
  52. 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';
10
- import makeStyles from '@mui/styles/makeStyles';
8
+ import { WMGetServiceFromStore, LayerType as LayerType$1, getMapImageStore, WMBBOX, debug, DebugType, WMJSMap, WMLayer, legendImageStore, WMImageEventType, getLegendGraphicURLForLayer } from '@opengeoweb/webmap';
9
+ import { Tooltip, Select, Grid, InputLabel, IconButton, Paper, Box, Typography, CircularProgress, List, ListSubheader, ListItem, ListItemText, Dialog, DialogTitle, DialogContent, DialogContentText, TextField, DialogActions, Button, MenuItem, SvgIcon, FormControl, InputAdornment, ListItemSecondaryAction, ListItemIcon, Checkbox, Switch, Slider, FormControlLabel, Popover, useMediaQuery, useTheme, SliderThumb } from '@mui/material';
11
10
  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';
11
+ import makeStyles from '@mui/styles/makeStyles';
12
+ import { sliderStyles, CustomSlider, ToggleMenu, ManagerButton, EnableButton, AlertBanner, ManagerDeleteButton, ToolContainerDraggable, ToolButton, CustomToggleButton, useIsMounted } from '@opengeoweb/shared';
13
+ import { Cached, Add, DragIndicator, Close, ChevronLeft, ChevronRight, Link, LinkOff, MoreVert, DeleteForever } from '@mui/icons-material';
14
14
  import { Sortable, ReactSortable } from 'react-sortablejs';
15
15
  import createStyles from '@mui/styles/createStyles';
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,
@@ -1278,6 +1293,103 @@ var getAvailableBaseLayersForMap = createSelector(layerStore, function (_store,
1278
1293
  return [];
1279
1294
  }, selectorMemoizationOptions);
1280
1295
 
1296
+ /* *
1297
+ * Licensed under the Apache License, Version 2.0 (the "License");
1298
+ * you may not use this file except in compliance with the License.
1299
+ * You may obtain a copy of the License at
1300
+ *
1301
+ * http://www.apache.org/licenses/LICENSE-2.0
1302
+ *
1303
+ * Unless required by applicable law or agreed to in writing, software
1304
+ * distributed under the License is distributed on an "AS IS" BASIS,
1305
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1306
+ * See the License for the specific language governing permissions and
1307
+ * limitations under the License.
1308
+ *
1309
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1310
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
1311
+ * */
1312
+
1313
+ /* Action constants for sources */
1314
+ var SYNCGROUPS_ADD_SOURCE = 'SYNCGROUPS_ADD_SOURCE';
1315
+ var SYNCGROUPS_REMOVE_SOURCE = 'SYNCGROUPS_REMOVE_SOURCE';
1316
+ /* Action constants for groups */
1317
+
1318
+ var SYNCGROUPS_TOGGLE_LINK_TARGET = 'SYNCGROUPS_TOGGLE_LINK_TARGET';
1319
+ var SYNCGROUPS_ADD_TARGET = 'SYNCGROUPS_ADD_TARGET';
1320
+ var SYNCGROUPS_REMOVE_TARGET = 'SYNCGROUPS_REMOVE_TARGET';
1321
+ var SYNCGROUPS_ADD_GROUP = 'SYNCGROUPS_ADD_GROUP';
1322
+ var SYNCGROUPS_REMOVE_GROUP = 'SYNCGROUPS_REMOVE_GROUP';
1323
+ var SYNCGROUPS_CLEAR = 'SYNCGROUPS_CLEAR';
1324
+ /* Type constants */
1325
+
1326
+ var SYNCGROUPS_TYPE_SETTIME = 'SYNCGROUPS_TYPE_SETTIME';
1327
+ var SYNCGROUPS_TYPE_SETBBOX = 'SYNCGROUPS_TYPE_SETBBOX';
1328
+ var SYNCGROUPS_TYPE_SETLAYERACTIONS = 'SYNCGROUPS_TYPE_SETLAYERACTIONS';
1329
+ var SYNCGROUPS_SET_VIEW_STATE = 'SYNCGROUPS_SET_VIEW_STATE';
1330
+
1331
+ var constants$1 = /*#__PURE__*/Object.freeze({
1332
+ __proto__: null,
1333
+ SYNCGROUPS_ADD_SOURCE: SYNCGROUPS_ADD_SOURCE,
1334
+ SYNCGROUPS_REMOVE_SOURCE: SYNCGROUPS_REMOVE_SOURCE,
1335
+ SYNCGROUPS_TOGGLE_LINK_TARGET: SYNCGROUPS_TOGGLE_LINK_TARGET,
1336
+ SYNCGROUPS_ADD_TARGET: SYNCGROUPS_ADD_TARGET,
1337
+ SYNCGROUPS_REMOVE_TARGET: SYNCGROUPS_REMOVE_TARGET,
1338
+ SYNCGROUPS_ADD_GROUP: SYNCGROUPS_ADD_GROUP,
1339
+ SYNCGROUPS_REMOVE_GROUP: SYNCGROUPS_REMOVE_GROUP,
1340
+ SYNCGROUPS_CLEAR: SYNCGROUPS_CLEAR,
1341
+ SYNCGROUPS_TYPE_SETTIME: SYNCGROUPS_TYPE_SETTIME,
1342
+ SYNCGROUPS_TYPE_SETBBOX: SYNCGROUPS_TYPE_SETBBOX,
1343
+ SYNCGROUPS_TYPE_SETLAYERACTIONS: SYNCGROUPS_TYPE_SETLAYERACTIONS,
1344
+ SYNCGROUPS_SET_VIEW_STATE: SYNCGROUPS_SET_VIEW_STATE
1345
+ });
1346
+
1347
+ /* *
1348
+ * Licensed under the Apache License, Version 2.0 (the "License");
1349
+ * you may not use this file except in compliance with the License.
1350
+ * You may obtain a copy of the License at
1351
+ *
1352
+ * http://www.apache.org/licenses/LICENSE-2.0
1353
+ *
1354
+ * Unless required by applicable law or agreed to in writing, software
1355
+ * distributed under the License is distributed on an "AS IS" BASIS,
1356
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1357
+ * See the License for the specific language governing permissions and
1358
+ * limitations under the License.
1359
+ *
1360
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1361
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
1362
+ * */
1363
+
1364
+ var synchronizationGroupStore = function synchronizationGroupStore(store) {
1365
+ return store && store.syncronizationGroupStore ? store.syncronizationGroupStore : null;
1366
+ };
1367
+
1368
+ var getSynchronizationGroupStore = createSelector(synchronizationGroupStore, function (store) {
1369
+ return store;
1370
+ });
1371
+ /**
1372
+ * Returns the synchronization source by id
1373
+ * @param store The app store
1374
+ * @param id The source id to find
1375
+ */
1376
+
1377
+ var getSyncSourceBySourceId = function getSyncSourceBySourceId(state, id) {
1378
+ if (state && state.sources) {
1379
+ var sources = state.sources;
1380
+
1381
+ if (sources.byId[id]) {
1382
+ return sources.byId[id];
1383
+ }
1384
+ }
1385
+
1386
+ return null;
1387
+ };
1388
+
1389
+ var getTime = createSelector(getSyncSourceBySourceId, function (store) {
1390
+ return store && store.payloadByType && store.payloadByType[SYNCGROUPS_TYPE_SETTIME] ? store.payloadByType[SYNCGROUPS_TYPE_SETTIME].value : null;
1391
+ });
1392
+
1281
1393
  function _typeof(obj) {
1282
1394
  "@babel/helpers - typeof";
1283
1395
 
@@ -2346,6 +2458,34 @@ var getBbox = createSelector(getMapById, function (store) {
2346
2458
  var isAnimating = createSelector(getMapById, function (store) {
2347
2459
  return store ? store.isAnimating : false;
2348
2460
  });
2461
+ /**
2462
+ * Gets if any linked map is animating
2463
+ *
2464
+ * Example: linkedMapIsAnimating = linkedMapAnimationInfo(store, 'mapid_1')
2465
+ * @param {object} store store: object - store object
2466
+ * @param {string} mapId mapId: string - Id of the map
2467
+ * @returns {object} returnType: object - object containing isAnimating boolean and id string
2468
+ */
2469
+
2470
+ var linkedMapAnimationInfo = createSelector(function (store, mapId) {
2471
+ var animationInfo = {
2472
+ isAnimating: isAnimating(store, mapId),
2473
+ id: mapId
2474
+ };
2475
+ getSynchronizationGroupStore(store).groups.allIds.forEach(function (groupId) {
2476
+ if (getSynchronizationGroupStore(store).groups.byId[groupId].targets.byId[animationInfo.id] && getSynchronizationGroupStore(store).groups.byId[groupId].targets.byId[animationInfo.id].linked) {
2477
+ getSynchronizationGroupStore(store).groups.byId[groupId].targets.allIds.forEach(function (id) {
2478
+ if (isAnimating(store, id) === true) {
2479
+ animationInfo.isAnimating = true;
2480
+ animationInfo.id = id;
2481
+ }
2482
+ });
2483
+ }
2484
+ });
2485
+ return animationInfo;
2486
+ }, function (animationInfo) {
2487
+ return animationInfo;
2488
+ });
2349
2489
  /**
2350
2490
  * Gets start time of animation
2351
2491
  *
@@ -2615,7 +2755,7 @@ var getAllUniqueDimensions = createSelector(getAllMapIds, function (store) {
2615
2755
  /**
2616
2756
  * Returns the mapPinLocation for the current map
2617
2757
  *
2618
- * Example getAllUniqueDimensions(store);
2758
+ * Example getPinLocation(store);
2619
2759
  * @param {object} store store: object - store object
2620
2760
  * @param {string} mapId mapId: string - Id of the map
2621
2761
  * @returns {object} returnType: latitude and longitude of pin
@@ -2624,6 +2764,18 @@ var getAllUniqueDimensions = createSelector(getAllMapIds, function (store) {
2624
2764
  var getPinLocation = createSelector(getMapById, function (store) {
2625
2765
  return store ? store.mapPinLocation : undefined;
2626
2766
  }, selectorMemoizationOptions);
2767
+ /**
2768
+ * Returns the disable map pin boolean for the current map
2769
+ *
2770
+ * Example getDisableMapPin(store);
2771
+ * @param {object} store store: object - store object
2772
+ * @param {string} mapId mapId: string - Id of the map
2773
+ * @returns {boolean} returnType: boolean or undefined
2774
+ */
2775
+
2776
+ var getDisableMapPin = createSelector(getMapById, function (store) {
2777
+ return store ? store.disableMapPin : undefined;
2778
+ });
2627
2779
 
2628
2780
  /* *
2629
2781
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -2775,7 +2927,7 @@ var getServicesInArray = createSelector(servicesStore, function (store) {
2775
2927
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
2776
2928
  * */
2777
2929
 
2778
- var selectors = /*#__PURE__*/Object.freeze({
2930
+ var selectors$1 = /*#__PURE__*/Object.freeze({
2779
2931
  __proto__: null,
2780
2932
  getMapById: getMapById,
2781
2933
  getAllMapIds: getAllMapIds,
@@ -2793,6 +2945,7 @@ var selectors = /*#__PURE__*/Object.freeze({
2793
2945
  getSrs: getSrs,
2794
2946
  getBbox: getBbox,
2795
2947
  isAnimating: isAnimating,
2948
+ linkedMapAnimationInfo: linkedMapAnimationInfo,
2796
2949
  getAnimationStartTime: getAnimationStartTime,
2797
2950
  getAnimationEndTime: getAnimationEndTime,
2798
2951
  isAutoUpdating: isAutoUpdating,
@@ -2813,6 +2966,7 @@ var selectors = /*#__PURE__*/Object.freeze({
2813
2966
  getLayerByLayerIndex: getLayerByLayerIndex,
2814
2967
  getAllUniqueDimensions: getAllUniqueDimensions,
2815
2968
  getPinLocation: getPinLocation,
2969
+ getDisableMapPin: getDisableMapPin,
2816
2970
  getLayerById: getLayerById,
2817
2971
  getLayersById: getLayersById,
2818
2972
  getLayersIds: getLayersIds,
@@ -2857,7 +3011,7 @@ var selectors = /*#__PURE__*/Object.freeze({
2857
3011
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
2858
3012
  * */
2859
3013
 
2860
- var constants$1 = /*#__PURE__*/Object.freeze({
3014
+ var constants = /*#__PURE__*/Object.freeze({
2861
3015
  __proto__: null,
2862
3016
  WEBMAP_REGISTER_MAP: WEBMAP_REGISTER_MAP,
2863
3017
  WEBMAP_UNREGISTER_MAP: WEBMAP_UNREGISTER_MAP,
@@ -2881,6 +3035,7 @@ var constants$1 = /*#__PURE__*/Object.freeze({
2881
3035
  WEBMAP_SET_TIME_SLIDER_SECONDS_PER_PX: WEBMAP_SET_TIME_SLIDER_SECONDS_PER_PX,
2882
3036
  WEBMAP_SET_TIME_SLIDER_DATA_SCALE_TO_SECONDS_PER_PX: WEBMAP_SET_TIME_SLIDER_DATA_SCALE_TO_SECONDS_PER_PX,
2883
3037
  WEBMAP_SET_PIN: WEBMAP_SET_PIN,
3038
+ WEBMAP_DISABLE_PIN: WEBMAP_DISABLE_PIN,
2884
3039
  WEBMAP_LAYER_CHANGE_OPACITY: WEBMAP_LAYER_CHANGE_OPACITY,
2885
3040
  WEBMAP_LAYER_CHANGE_NAME: WEBMAP_LAYER_CHANGE_NAME,
2886
3041
  WEBMAP_LAYER_CHANGE_STYLE: WEBMAP_LAYER_CHANGE_STYLE,
@@ -3014,6 +3169,130 @@ var actions$2 = /*#__PURE__*/Object.freeze({
3014
3169
  orderDialog: orderDialog
3015
3170
  });
3016
3171
 
3172
+ /* *
3173
+ * Licensed under the Apache License, Version 2.0 (the "License");
3174
+ * you may not use this file except in compliance with the License.
3175
+ * You may obtain a copy of the License at
3176
+ *
3177
+ * http://www.apache.org/licenses/LICENSE-2.0
3178
+ *
3179
+ * Unless required by applicable law or agreed to in writing, software
3180
+ * distributed under the License is distributed on an "AS IS" BASIS,
3181
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3182
+ * See the License for the specific language governing permissions and
3183
+ * limitations under the License.
3184
+ *
3185
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3186
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
3187
+ * */
3188
+ /**
3189
+ * Gets the active map Id and wether a dialog is open or closed
3190
+ *
3191
+ * Example: getDialogDetailsByType(store, 'legend')
3192
+ * @param {object} store store object from which the ui state wll be extracted
3193
+ * @param {string} dialogType type of the dialog 'legend' | 'layerManager' | 'dimensionSelect-elevation'
3194
+ * @returns {array} [string, boolean] first element gives the active map id, second element whether the dialog is open
3195
+ */
3196
+
3197
+ var getDialogDetailsByType = function getDialogDetailsByType(store, dialogType) {
3198
+ if (store && store.ui && store.ui.dialogs && store.ui.dialogs[dialogType]) {
3199
+ return store.ui.dialogs[dialogType];
3200
+ }
3201
+
3202
+ return null;
3203
+ };
3204
+ /**
3205
+ * For a given ui component: gets wether the dialog is open or closed
3206
+ *
3207
+ * @param {object} store store object from which the ui state wll be extracted
3208
+ * @param {string} dialogType type of the dialog 'legend' | 'layerManager' | 'dimensionSelect-elevation'
3209
+ * @returns {boolean} returnType: boolean
3210
+ */
3211
+
3212
+ var getisDialogOpen = createSelector(getDialogDetailsByType, function (details) {
3213
+ if (details) {
3214
+ return details.isOpen;
3215
+ }
3216
+
3217
+ return false;
3218
+ });
3219
+ /**
3220
+ *For a given ui component: gets the active map Id
3221
+ *
3222
+ * @param {object} store store object from which the ui state wll be extracted
3223
+ * @param {string} dialogType type of the dialog 'legend' | 'layerManager' | 'dimensionSelect-elevation'
3224
+ * @returns {string} returnType: string - the active map id
3225
+ */
3226
+
3227
+ var getDialogMapId = createSelector(getDialogDetailsByType, function (details) {
3228
+ if (details) {
3229
+ return details.activeMapId;
3230
+ }
3231
+
3232
+ return '';
3233
+ });
3234
+ /**
3235
+ *For a given ui component: gets the order of visible dialog
3236
+ *
3237
+ * @param {object} store store object from which the ui state wll be extracted
3238
+ * @param {DialogType} dialogType type of the dialog 'legend' | 'layerManager' | 'dimensionSelect-elevation' | dimensionSelect-ensemble_member
3239
+ * @returns {number} the higher the order number the higher the zIndex
3240
+ */
3241
+
3242
+ var getDialogOrder = createSelector(function (store, dialogType) {
3243
+ if (store && store.ui && store.ui.order) {
3244
+ var order = store.ui.order;
3245
+ var visibleOrder = order.filter(function (orderedDialogType) {
3246
+ return store.ui.dialogs[orderedDialogType].isOpen;
3247
+ });
3248
+
3249
+ if (!visibleOrder.includes(dialogType)) {
3250
+ return 0;
3251
+ }
3252
+
3253
+ return visibleOrder.length - visibleOrder.indexOf(dialogType);
3254
+ }
3255
+
3256
+ return 0;
3257
+ }, function (order) {
3258
+ return order;
3259
+ });
3260
+ /**
3261
+ *For a given ui component: returns if ordered on top
3262
+ *
3263
+ * @param {object} store store object from which the ui state wll be extracted
3264
+ * @param {DialogType} dialogType type of the dialog 'legend' | 'layerManager' | 'dimensionSelect-elevation' | dimensionSelect-ensemble_member
3265
+ * @returns {boolean}
3266
+ */
3267
+
3268
+ var getDialogIsOrderedOnTop = createSelector(function (store, dialogType) {
3269
+ if (store && store.ui && store.ui.order) {
3270
+ var order = store.ui.order;
3271
+ return order.includes(dialogType) && order.indexOf(dialogType) === 0;
3272
+ }
3273
+
3274
+ return false;
3275
+ }, function (isOrderedOnTop) {
3276
+ return isOrderedOnTop;
3277
+ });
3278
+ var getDialogSource = createSelector(getDialogDetailsByType, function (details) {
3279
+ if (details && details.source) {
3280
+ return details.source;
3281
+ }
3282
+
3283
+ return 'app';
3284
+ });
3285
+
3286
+ var selectors = /*#__PURE__*/Object.freeze({
3287
+ __proto__: null,
3288
+ getDialogDetailsByType: getDialogDetailsByType,
3289
+ getisDialogOpen: getisDialogOpen,
3290
+ getDialogMapId: getDialogMapId,
3291
+ getDialogOrder: getDialogOrder,
3292
+ getDialogIsOrderedOnTop: getDialogIsOrderedOnTop,
3293
+ getDialogSource: getDialogSource
3294
+ });
3295
+
3017
3296
  /* *
3018
3297
  * Licensed under the Apache License, Version 2.0 (the "License");
3019
3298
  * you may not use this file except in compliance with the License.
@@ -3070,56 +3349,7 @@ var GENERIC_SETBBOX = 'GENERIC_SETBBOX';
3070
3349
  * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3071
3350
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
3072
3351
  * */
3073
-
3074
- /* Action constants for sources */
3075
- var SYNCGROUPS_ADD_SOURCE = 'SYNCGROUPS_ADD_SOURCE';
3076
- var SYNCGROUPS_REMOVE_SOURCE = 'SYNCGROUPS_REMOVE_SOURCE';
3077
- /* Action constants for groups */
3078
-
3079
- var SYNCGROUPS_TOGGLE_LINK_TARGET = 'SYNCGROUPS_TOGGLE_LINK_TARGET';
3080
- var SYNCGROUPS_ADD_TARGET = 'SYNCGROUPS_ADD_TARGET';
3081
- var SYNCGROUPS_REMOVE_TARGET = 'SYNCGROUPS_REMOVE_TARGET';
3082
- var SYNCGROUPS_ADD_GROUP = 'SYNCGROUPS_ADD_GROUP';
3083
- var SYNCGROUPS_REMOVE_GROUP = 'SYNCGROUPS_REMOVE_GROUP';
3084
- var SYNCGROUPS_CLEAR = 'SYNCGROUPS_CLEAR';
3085
- /* Type constants */
3086
-
3087
- var SYNCGROUPS_TYPE_SETTIME = 'SYNCGROUPS_TYPE_SETTIME';
3088
- var SYNCGROUPS_TYPE_SETBBOX = 'SYNCGROUPS_TYPE_SETBBOX';
3089
- var SYNCGROUPS_TYPE_SETLAYERACTIONS = 'SYNCGROUPS_TYPE_SETLAYERACTIONS';
3090
-
3091
- var constants = /*#__PURE__*/Object.freeze({
3092
- __proto__: null,
3093
- SYNCGROUPS_ADD_SOURCE: SYNCGROUPS_ADD_SOURCE,
3094
- SYNCGROUPS_REMOVE_SOURCE: SYNCGROUPS_REMOVE_SOURCE,
3095
- SYNCGROUPS_TOGGLE_LINK_TARGET: SYNCGROUPS_TOGGLE_LINK_TARGET,
3096
- SYNCGROUPS_ADD_TARGET: SYNCGROUPS_ADD_TARGET,
3097
- SYNCGROUPS_REMOVE_TARGET: SYNCGROUPS_REMOVE_TARGET,
3098
- SYNCGROUPS_ADD_GROUP: SYNCGROUPS_ADD_GROUP,
3099
- SYNCGROUPS_REMOVE_GROUP: SYNCGROUPS_REMOVE_GROUP,
3100
- SYNCGROUPS_CLEAR: SYNCGROUPS_CLEAR,
3101
- SYNCGROUPS_TYPE_SETTIME: SYNCGROUPS_TYPE_SETTIME,
3102
- SYNCGROUPS_TYPE_SETBBOX: SYNCGROUPS_TYPE_SETBBOX,
3103
- SYNCGROUPS_TYPE_SETLAYERACTIONS: SYNCGROUPS_TYPE_SETLAYERACTIONS
3104
- });
3105
-
3106
- /* *
3107
- * Licensed under the Apache License, Version 2.0 (the "License");
3108
- * you may not use this file except in compliance with the License.
3109
- * You may obtain a copy of the License at
3110
- *
3111
- * http://www.apache.org/licenses/LICENSE-2.0
3112
- *
3113
- * Unless required by applicable law or agreed to in writing, software
3114
- * distributed under the License is distributed on an "AS IS" BASIS,
3115
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3116
- * See the License for the specific language governing permissions and
3117
- * limitations under the License.
3118
- *
3119
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3120
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
3121
- * */
3122
- /* Actions for sources */
3352
+ /* Actions for sources */
3123
3353
 
3124
3354
  /**
3125
3355
  * Add a source component to the sources list.
@@ -3248,6 +3478,12 @@ var syncGroupClear = function syncGroupClear() {
3248
3478
  type: SYNCGROUPS_CLEAR
3249
3479
  };
3250
3480
  };
3481
+ var syncGroupSetViewState = function syncGroupSetViewState(payload) {
3482
+ return {
3483
+ type: SYNCGROUPS_SET_VIEW_STATE,
3484
+ payload: payload
3485
+ };
3486
+ };
3251
3487
 
3252
3488
  var actions$1 = /*#__PURE__*/Object.freeze({
3253
3489
  __proto__: null,
@@ -3258,7 +3494,8 @@ var actions$1 = /*#__PURE__*/Object.freeze({
3258
3494
  syncGroupLinkTarget: syncGroupLinkTarget,
3259
3495
  syncGroupAddGroup: syncGroupAddGroup,
3260
3496
  syncGroupRemoveGroup: syncGroupRemoveGroup,
3261
- syncGroupClear: syncGroupClear
3497
+ syncGroupClear: syncGroupClear,
3498
+ syncGroupSetViewState: syncGroupSetViewState
3262
3499
  });
3263
3500
 
3264
3501
  /* *
@@ -3328,7 +3565,8 @@ var actions = /*#__PURE__*/Object.freeze({
3328
3565
  syncGroupLinkTarget: syncGroupLinkTarget,
3329
3566
  syncGroupAddGroup: syncGroupAddGroup,
3330
3567
  syncGroupRemoveGroup: syncGroupRemoveGroup,
3331
- syncGroupClear: syncGroupClear
3568
+ syncGroupClear: syncGroupClear,
3569
+ syncGroupSetViewState: syncGroupSetViewState
3332
3570
  });
3333
3571
 
3334
3572
  /*! *****************************************************************************
@@ -3966,6 +4204,20 @@ var initialState$4 = {
3966
4204
  groups: {
3967
4205
  byId: {},
3968
4206
  allIds: []
4207
+ },
4208
+ viewState: {
4209
+ timeslider: {
4210
+ groups: [],
4211
+ sourcesById: []
4212
+ },
4213
+ zoompane: {
4214
+ groups: [],
4215
+ sourcesById: []
4216
+ },
4217
+ level: {
4218
+ groups: [],
4219
+ sourcesById: []
4220
+ }
3969
4221
  }
3970
4222
  };
3971
4223
  var reducer$4 = function reducer() {
@@ -4185,6 +4437,12 @@ var reducer$4 = function reducer() {
4185
4437
  case SYNCGROUPS_CLEAR:
4186
4438
  return initialState$4;
4187
4439
 
4440
+ case SYNCGROUPS_SET_VIEW_STATE:
4441
+ return produce(state, function (draft) {
4442
+ var viewState = action.payload.viewState;
4443
+ draft.viewState = viewState;
4444
+ });
4445
+
4188
4446
  default:
4189
4447
  return state;
4190
4448
  }
@@ -4296,6 +4554,9 @@ var getTargetGroups = function getTargetGroups(state, payload, actionType) {
4296
4554
  }, []);
4297
4555
  return groups;
4298
4556
  };
4557
+ var syncGroupGetViewState = createSelector(syncGroupStore, function (store) {
4558
+ return store.viewState;
4559
+ });
4299
4560
 
4300
4561
  /* *
4301
4562
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -4666,7 +4927,7 @@ var _marked$4 = /*#__PURE__*/regeneratorRuntime.mark(setTimeSaga),
4666
4927
  _marked2$4 = /*#__PURE__*/regeneratorRuntime.mark(setBBoxSaga),
4667
4928
  _marked3$4 = /*#__PURE__*/regeneratorRuntime.mark(layerActionsSaga),
4668
4929
  _marked4$2 = /*#__PURE__*/regeneratorRuntime.mark(addLayerActionsSaga),
4669
- _marked5$1 = /*#__PURE__*/regeneratorRuntime.mark(deleteLayerActionsSaga),
4930
+ _marked5$2 = /*#__PURE__*/regeneratorRuntime.mark(deleteLayerActionsSaga),
4670
4931
  _marked6$1 = /*#__PURE__*/regeneratorRuntime.mark(moveLayerActionsSaga),
4671
4932
  _marked7$1 = /*#__PURE__*/regeneratorRuntime.mark(setActiveLayerIdActionsSaga),
4672
4933
  _marked8 = /*#__PURE__*/regeneratorRuntime.mark(mapBaseLayerActionsSaga),
@@ -4848,7 +5109,7 @@ function deleteLayerActionsSaga(_ref5) {
4848
5109
  return _context5.stop();
4849
5110
  }
4850
5111
  }
4851
- }, _marked5$1);
5112
+ }, _marked5$2);
4852
5113
  }
4853
5114
  function moveLayerActionsSaga(_ref6) {
4854
5115
  var payload, type, targets;
@@ -5012,10 +5273,110 @@ function rootSaga$4() {
5012
5273
  }, _marked9);
5013
5274
  }
5014
5275
 
5276
+ /* *
5277
+ * Licensed under the Apache License, Version 2.0 (the "License");
5278
+ * you may not use this file except in compliance with the License.
5279
+ * You may obtain a copy of the License at
5280
+ *
5281
+ * http://www.apache.org/licenses/LICENSE-2.0
5282
+ *
5283
+ * Unless required by applicable law or agreed to in writing, software
5284
+ * distributed under the License is distributed on an "AS IS" BASIS,
5285
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5286
+ * See the License for the specific language governing permissions and
5287
+ * limitations under the License.
5288
+ *
5289
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
5290
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
5291
+ * */
5292
+ var emptyState = {
5293
+ timeslider: {
5294
+ groups: [],
5295
+ sourcesById: []
5296
+ },
5297
+ zoompane: {
5298
+ groups: [],
5299
+ sourcesById: []
5300
+ },
5301
+ level: {
5302
+ groups: [],
5303
+ sourcesById: []
5304
+ }
5305
+ };
5306
+ var groupTypes = [{
5307
+ title: 'Timeslider',
5308
+ syncType: 'SYNCGROUPS_TYPE_SETTIME',
5309
+ groupType: 'timeslider'
5310
+ }, {
5311
+ title: 'Zoompane',
5312
+ syncType: 'SYNCGROUPS_TYPE_SETBBOX',
5313
+ groupType: 'zoompane'
5314
+ }];
5315
+ /*
5316
+ _____ Creates viewState _____
5317
+ - Runs Each time viewState is created:
5318
+ - Fill arrays inside initialState with objects containing new values from Redux
5319
+ */
5320
+
5321
+ var createSyncGroupViewState = function createSyncGroupViewState(groups, sources) {
5322
+ var initialState = produce(emptyState, function (draft) {
5323
+ /*
5324
+ _____ 1. Fill groups _____
5325
+ 1. Goes through all groups by ID
5326
+ 2. Collects original timeslider or zoompane values into an array
5327
+ 3. Sorts and adds selected sources to ViewState based on ID type
5328
+ */
5329
+ Object.keys(groups.byId).forEach(function (id) {
5330
+ var _a;
5331
+
5332
+ var groupType = (_a = groupTypes.find(function (object) {
5333
+ return object.syncType === groups.byId[id].type;
5334
+ })) === null || _a === void 0 ? void 0 : _a.groupType;
5335
+
5336
+ if (groupType) {
5337
+ draft[groupType].groups.push({
5338
+ id: id,
5339
+ selected: groups.byId[id].targets.allIds
5340
+ });
5341
+ }
5342
+ });
5343
+ /*
5344
+ _____ 2. Fill sourcesById _____
5345
+ 1. Loop though sources and add source to each group type
5346
+ */
5347
+
5348
+ Object.keys(sources.byId).forEach(function (id) {
5349
+ groupTypes.forEach(function (_ref) {
5350
+ var syncType = _ref.syncType,
5351
+ groupType = _ref.groupType;
5352
+
5353
+ if (sources.byId[id].types.includes(syncType)) {
5354
+ draft[groupType].sourcesById.push({
5355
+ id: id,
5356
+ name: id
5357
+ });
5358
+ }
5359
+ });
5360
+ });
5361
+ });
5362
+ return initialState;
5363
+ };
5364
+
5365
+ var groups = function groups(store) {
5366
+ return store.syncronizationGroupStore.groups;
5367
+ };
5368
+
5369
+ var sources = function sources(store) {
5370
+ return store.syncronizationGroupStore.sources;
5371
+ };
5372
+
5373
+ var createSyncGroupViewStateSelector = createSelector(groups, sources, createSyncGroupViewState);
5374
+
5015
5375
  var _marked$3 = /*#__PURE__*/regeneratorRuntime.mark(updateSourceValueWhenLinkingComponentToGroupSaga),
5016
5376
  _marked2$3 = /*#__PURE__*/regeneratorRuntime.mark(addGroupTargetSaga),
5017
5377
  _marked3$3 = /*#__PURE__*/regeneratorRuntime.mark(linkGroupTargetSaga),
5018
- _marked4$1 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$3);
5378
+ _marked4$1 = /*#__PURE__*/regeneratorRuntime.mark(updateViewStateSaga),
5379
+ _marked5$1 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$3);
5019
5380
  function updateSourceValueWhenLinkingComponentToGroupSaga(groupId, targetToUpdate) {
5020
5381
  var group;
5021
5382
  return regeneratorRuntime.wrap(function updateSourceValueWhenLinkingComponentToGroupSaga$(_context) {
@@ -5132,25 +5493,76 @@ function linkGroupTargetSaga(_ref2) {
5132
5493
  }
5133
5494
  }, _marked3$3);
5134
5495
  }
5135
-
5136
- function rootSaga$3() {
5137
- return regeneratorRuntime.wrap(function rootSaga$(_context4) {
5496
+ function updateViewStateSaga() {
5497
+ var viewState;
5498
+ return regeneratorRuntime.wrap(function updateViewStateSaga$(_context4) {
5138
5499
  while (1) {
5139
5500
  switch (_context4.prev = _context4.next) {
5140
5501
  case 0:
5141
5502
  _context4.next = 2;
5503
+ return select(createSyncGroupViewStateSelector);
5504
+
5505
+ case 2:
5506
+ viewState = _context4.sent;
5507
+ _context4.next = 5;
5508
+ return put(syncGroupSetViewState({
5509
+ viewState: viewState
5510
+ }));
5511
+
5512
+ case 5:
5513
+ case "end":
5514
+ return _context4.stop();
5515
+ }
5516
+ }
5517
+ }, _marked4$1);
5518
+ }
5519
+
5520
+ function rootSaga$3() {
5521
+ return regeneratorRuntime.wrap(function rootSaga$(_context5) {
5522
+ while (1) {
5523
+ switch (_context5.prev = _context5.next) {
5524
+ case 0:
5525
+ _context5.next = 2;
5142
5526
  return takeLatest(SYNCGROUPS_ADD_TARGET, addGroupTargetSaga);
5143
5527
 
5144
5528
  case 2:
5145
- _context4.next = 4;
5529
+ _context5.next = 4;
5146
5530
  return takeLatest(SYNCGROUPS_TOGGLE_LINK_TARGET, linkGroupTargetSaga);
5147
5531
 
5148
5532
  case 4:
5533
+ _context5.next = 6;
5534
+ return takeLatest(SYNCGROUPS_ADD_GROUP, updateViewStateSaga);
5535
+
5536
+ case 6:
5537
+ _context5.next = 8;
5538
+ return takeLatest(SYNCGROUPS_REMOVE_GROUP, updateViewStateSaga);
5539
+
5540
+ case 8:
5541
+ _context5.next = 10;
5542
+ return takeLatest(SYNCGROUPS_ADD_SOURCE, updateViewStateSaga);
5543
+
5544
+ case 10:
5545
+ _context5.next = 12;
5546
+ return takeLatest(SYNCGROUPS_REMOVE_SOURCE, updateViewStateSaga);
5547
+
5548
+ case 12:
5549
+ _context5.next = 14;
5550
+ return takeLatest(SYNCGROUPS_ADD_TARGET, updateViewStateSaga);
5551
+
5552
+ case 14:
5553
+ _context5.next = 16;
5554
+ return takeLatest(SYNCGROUPS_REMOVE_TARGET, updateViewStateSaga);
5555
+
5556
+ case 16:
5557
+ _context5.next = 18;
5558
+ return takeLatest(SYNCGROUPS_TOGGLE_LINK_TARGET, updateViewStateSaga);
5559
+
5560
+ case 18:
5149
5561
  case "end":
5150
- return _context4.stop();
5562
+ return _context5.stop();
5151
5563
  }
5152
5564
  }
5153
- }, _marked4$1);
5565
+ }, _marked5$1);
5154
5566
  }
5155
5567
 
5156
5568
  /* *
@@ -5177,41 +5589,6 @@ var synchronizationGroupConfig = {
5177
5589
  sagas: [rootSaga$4, rootSaga$3]
5178
5590
  };
5179
5591
 
5180
- var useStyles$I = makeStyles(function (theme) {
5181
- return {
5182
- select: {
5183
- '& ul': {
5184
- backgroundColor: theme.palette.geowebColors.background.surface
5185
- },
5186
- '& li': {
5187
- fontSize: 16,
5188
- padding: 12,
5189
- '&:hover': {
5190
- backgroundColor: theme.palette.geowebColors.layerManager.tableRowMouseover.rgba
5191
- },
5192
- '&.Mui-selected': {
5193
- color: theme.palette.common.white,
5194
- backgroundColor: theme.palette.geowebColors.buttons.primary.active.fill,
5195
- boxShadow: "none",
5196
- '&:hover': {
5197
- color: theme.palette.common.white,
5198
- backgroundColor: theme.palette.geowebColors.buttons.primary.mouseOver.fill
5199
- }
5200
- },
5201
- '&:after': {
5202
- background: 'none!important'
5203
- },
5204
- // (optional) header
5205
- '&.Mui-disabled': {
5206
- fontSize: 12,
5207
- opacity: 0.67,
5208
- padding: '0 12px'
5209
- }
5210
- }
5211
- }
5212
- };
5213
- });
5214
-
5215
5592
  var TooltipSelect = function TooltipSelect(_a) {
5216
5593
  var tooltip = _a.tooltip,
5217
5594
  _a$list = _a.list,
@@ -5220,7 +5597,9 @@ var TooltipSelect = function TooltipSelect(_a) {
5220
5597
  currentIndex = _a$currentIndex === void 0 ? -1 : _a$currentIndex,
5221
5598
  _a$onChangeMouseWheel = _a.onChangeMouseWheel,
5222
5599
  onChangeMouseWheel = _a$onChangeMouseWheel === void 0 ? function () {} : _a$onChangeMouseWheel,
5223
- props = __rest(_a, ["tooltip", "list", "currentIndex", "onChangeMouseWheel"]);
5600
+ _a$requiresCtrlToChan = _a.requiresCtrlToChange,
5601
+ requiresCtrlToChange = _a$requiresCtrlToChan === void 0 ? false : _a$requiresCtrlToChan,
5602
+ props = __rest(_a, ["tooltip", "list", "currentIndex", "onChangeMouseWheel", "requiresCtrlToChange"]);
5224
5603
 
5225
5604
  props.disableUnderline;
5226
5605
  var otherProps = __rest(props, ["disableUnderline"]);
@@ -5235,8 +5614,6 @@ var TooltipSelect = function TooltipSelect(_a) {
5235
5614
  tooltipOpen = _React$useState4[0],
5236
5615
  setTooltipOpen = _React$useState4[1];
5237
5616
 
5238
- var classes = useStyles$I();
5239
-
5240
5617
  var preventDefault = function preventDefault(event) {
5241
5618
  event.preventDefault();
5242
5619
  event.stopPropagation();
@@ -5251,11 +5628,14 @@ var TooltipSelect = function TooltipSelect(_a) {
5251
5628
  });
5252
5629
  }, []);
5253
5630
  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]);
5631
+ if (requiresCtrlToChange && (event.ctrlKey || event.metaKey) || !requiresCtrlToChange) {
5632
+ disableScroll();
5633
+ if (selectOpen) return;
5634
+ var direction = event.deltaY < 0 ? 1 : -1;
5635
+ var newValue = list[Math.min(Math.max(currentIndex - direction, 0), list.length - 1)];
5636
+ onChangeMouseWheel(newValue);
5637
+ } else enableScroll();
5638
+ }, [selectOpen, currentIndex, list, onChangeMouseWheel, enableScroll, disableScroll, requiresCtrlToChange]);
5259
5639
  var onOpen = React.useCallback(function () {
5260
5640
  setSelectOpen(true);
5261
5641
  setTooltipOpen(false);
@@ -5264,17 +5644,23 @@ var TooltipSelect = function TooltipSelect(_a) {
5264
5644
  setSelectOpen(false);
5265
5645
  }, []);
5266
5646
  var onMouseEnter = React.useCallback(function () {
5267
- disableScroll();
5647
+ if (!requiresCtrlToChange) {
5648
+ disableScroll();
5649
+ }
5650
+
5268
5651
  if (!selectOpen) setTooltipOpen(true);
5269
- }, [selectOpen, disableScroll]);
5652
+ }, [selectOpen, disableScroll, requiresCtrlToChange]);
5270
5653
  var onMouseLeave = React.useCallback(function () {
5271
5654
  enableScroll();
5272
5655
  setTooltipOpen(false);
5273
5656
  }, [enableScroll]);
5274
5657
  var onFocus = React.useCallback(function () {
5275
- disableScroll();
5658
+ if (!requiresCtrlToChange) {
5659
+ disableScroll();
5660
+ }
5661
+
5276
5662
  setTooltipOpen(true);
5277
- }, [disableScroll]);
5663
+ }, [disableScroll, requiresCtrlToChange]);
5278
5664
  var onBlur = React.useCallback(function () {
5279
5665
  enableScroll();
5280
5666
  setTooltipOpen(false);
@@ -5292,8 +5678,46 @@ var TooltipSelect = function TooltipSelect(_a) {
5292
5678
  onBlur: onBlur,
5293
5679
  onWheel: onWheel,
5294
5680
  MenuProps: {
5295
- classes: {
5296
- paper: classes.select
5681
+ BackdropProps: {
5682
+ sx: {
5683
+ '&.MuiBackdrop-root': {
5684
+ backgroundColor: 'transparent'
5685
+ }
5686
+ }
5687
+ },
5688
+ sx: {
5689
+ '& ul': {
5690
+ backgroundColor: 'geowebColors.background.surface'
5691
+ },
5692
+ '& li': {
5693
+ fontSize: '16px',
5694
+ padding: '12px',
5695
+ '&:hover': {
5696
+ backgroundColor: 'geowebColors.buttons.tool.mouseOver.fill'
5697
+ },
5698
+ '&.Mui-selected': {
5699
+ color: 'geowebColors.buttons.tool.active.color',
5700
+ backgroundColor: 'geowebColors.buttons.tool.active.fill',
5701
+ boxShadow: "none",
5702
+ '&:hover': {
5703
+ backgroundColor: 'geowebColors.buttons.tool.activeMouseOver.fill'
5704
+ },
5705
+ '&:focus': {
5706
+ backgroundColor: 'geowebColors.buttons.tool.activeMouseOver.fill'
5707
+ }
5708
+ },
5709
+ '&:after': {
5710
+ background: 'none!important'
5711
+ },
5712
+ '&.Mui-disabled': {
5713
+ fontSize: '12px',
5714
+ opacity: 0.67,
5715
+ padding: '0px 12px',
5716
+ '&.MuiMenuItem-root': {
5717
+ minHeight: '30px!important'
5718
+ }
5719
+ }
5720
+ }
5297
5721
  }
5298
5722
  }
5299
5723
  }, otherProps)));
@@ -5342,7 +5766,7 @@ var types = /*#__PURE__*/Object.freeze({
5342
5766
  var index = /*#__PURE__*/Object.freeze({
5343
5767
  __proto__: null,
5344
5768
  actions: actions$1,
5345
- constants: constants,
5769
+ constants: constants$1,
5346
5770
  types: types,
5347
5771
  initialState: initialState$4
5348
5772
  });
@@ -5454,132 +5878,18 @@ var reducer$3 = function reducer() {
5454
5878
  });
5455
5879
  }
5456
5880
 
5457
- case UI_ORDER_DIALOG:
5458
- {
5459
- var _type4 = action.payload.type;
5460
- return produce$1(state, function (draft) {
5461
- draft.order = moveToTop(state.order, _type4);
5462
- });
5463
- }
5464
-
5465
- default:
5466
- return state;
5467
- }
5468
- };
5469
-
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
- }
5881
+ case UI_ORDER_DIALOG:
5882
+ {
5883
+ var _type4 = action.payload.type;
5884
+ return produce$1(state, function (draft) {
5885
+ draft.order = moveToTop(state.order, _type4);
5886
+ });
5887
+ }
5571
5888
 
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;
5889
+ default:
5890
+ return state;
5579
5891
  }
5580
-
5581
- return 'app';
5582
- });
5892
+ };
5583
5893
 
5584
5894
  var _marked$2 = /*#__PURE__*/regeneratorRuntime.mark(registerMapUISaga),
5585
5895
  _marked2$2 = /*#__PURE__*/regeneratorRuntime.mark(unregisterUIMapSaga),
@@ -6341,6 +6651,21 @@ var reducer$2 = function reducer() {
6341
6651
  });
6342
6652
  }
6343
6653
 
6654
+ case WEBMAP_DISABLE_PIN:
6655
+ {
6656
+ var _action$payload26 = action.payload,
6657
+ _mapId28 = _action$payload26.mapId,
6658
+ disableMapPin = _action$payload26.disableMapPin;
6659
+
6660
+ if (!state.byId[_mapId28]) {
6661
+ return state;
6662
+ }
6663
+
6664
+ return produce$1(state, function (draft) {
6665
+ draft.byId[_mapId28].disableMapPin = disableMapPin;
6666
+ });
6667
+ }
6668
+
6344
6669
  case GENERIC_SYNC_SETLAYERACTIONS:
6345
6670
  {
6346
6671
  /*
@@ -6349,9 +6674,9 @@ var reducer$2 = function reducer() {
6349
6674
  * These targets can be used as payloads in new Layer actions.
6350
6675
  * These actions are here handled via the layer reducer, as it is the same logic
6351
6676
  */
6352
- var _action$payload26 = action.payload,
6353
- targets = _action$payload26.targets,
6354
- source = _action$payload26.source;
6677
+ var _action$payload27 = action.payload,
6678
+ targets = _action$payload27.targets,
6679
+ source = _action$payload27.source;
6355
6680
  return targets.reduce(function (prevState, target) {
6356
6681
  var action = {
6357
6682
  payload: target,
@@ -7897,7 +8222,7 @@ var preset = {
7897
8222
  },
7898
8223
  {
7899
8224
  name: "ECMWF",
7900
- url: "https://apps.ecmwf.int/wms/?token=public",
8225
+ url: "https://eccharts.ecmwf.int/wms/?token=public",
7901
8226
  id: "ecmwf"
7902
8227
  },
7903
8228
  {
@@ -8000,7 +8325,7 @@ var defaultConfigurations = /*#__PURE__*/Object.freeze({
8000
8325
  preloadedDefaultMapServices: preloadedDefaultMapServices
8001
8326
  });
8002
8327
 
8003
- var useStyles$H = makeStyles({
8328
+ var useStyles$w = makeStyles({
8004
8329
  buttonDiv: {
8005
8330
  position: 'relative'
8006
8331
  },
@@ -8036,7 +8361,7 @@ var AddLayersPopup = function AddLayersPopup(_ref) {
8036
8361
  handleClose = _ref.handleClose,
8037
8362
  _ref$layerType = _ref.layerType,
8038
8363
  layerType = _ref$layerType === void 0 ? LayerType.mapLayer : _ref$layerType;
8039
- var classes = useStyles$H();
8364
+ var classes = useStyles$w();
8040
8365
 
8041
8366
  var _React$useState = React.useState(''),
8042
8367
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -8156,7 +8481,6 @@ var AddLayersPopup = function AddLayersPopup(_ref) {
8156
8481
  }, /*#__PURE__*/React.createElement(IconButton, {
8157
8482
  "data-testid": "add-service",
8158
8483
  onClick: handleAddServiceURL,
8159
- color: "primary",
8160
8484
  disabled: loading,
8161
8485
  size: "large"
8162
8486
  }, /*#__PURE__*/React.createElement(Add, null)), loading && /*#__PURE__*/React.createElement(CircularProgress, {
@@ -8190,26 +8514,23 @@ var AddLayersPopup = function AddLayersPopup(_ref) {
8190
8514
  }, "Close")));
8191
8515
  };
8192
8516
 
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
- });
8517
+ var styles$1 = {
8518
+ buttonDiv: {
8519
+ position: 'relative'
8520
+ },
8521
+ loadingButton: {
8522
+ position: 'absolute',
8523
+ top: 7,
8524
+ left: 7,
8525
+ zIndex: 1
8526
+ },
8527
+ button: {
8528
+ width: '24px',
8529
+ height: '24px',
8530
+ margin: '6px 0px 0px 10px',
8531
+ borderRadius: '15%'
8532
+ }
8533
+ };
8213
8534
 
8214
8535
  var AddLayersButton = function AddLayersButton(_ref) {
8215
8536
  var onClickService = _ref.onClickService,
@@ -8225,7 +8546,6 @@ var AddLayersButton = function AddLayersButton(_ref) {
8225
8546
  _ref$shouldFocus = _ref.shouldFocus,
8226
8547
  shouldFocus = _ref$shouldFocus === void 0 ? false : _ref$shouldFocus;
8227
8548
  var ref = React.useRef(null);
8228
- var classes = useStyles$G();
8229
8549
 
8230
8550
  var _React$useState = React.useState(false),
8231
8551
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -8246,7 +8566,7 @@ var AddLayersButton = function AddLayersButton(_ref) {
8246
8566
  title: tooltip
8247
8567
  }, /*#__PURE__*/React.createElement(IconButton, {
8248
8568
  onClick: handleClose,
8249
- className: classes.button,
8569
+ sx: styles$1.button,
8250
8570
  disableRipple: true,
8251
8571
  "data-testid": "addLayersButton",
8252
8572
  ref: ref,
@@ -8300,6 +8620,9 @@ var LayerManagerColumnsLarge = makeStyles({
8300
8620
  column6: {
8301
8621
  width: iconButtonSize * 2,
8302
8622
  display: 'inline-flex'
8623
+ },
8624
+ columns35: {
8625
+ width: "calc((100% - ".concat(iconButtonSize * totalButtons, "px) * 0.75)")
8303
8626
  }
8304
8627
  });
8305
8628
  var LayerManagerColumnsSmall = makeStyles({
@@ -8321,6 +8644,9 @@ var LayerManagerColumnsSmall = makeStyles({
8321
8644
  column6: {
8322
8645
  width: iconButtonSize * 2,
8323
8646
  display: 'inline-flex'
8647
+ },
8648
+ columns35: {
8649
+ display: 'none'
8324
8650
  }
8325
8651
  });
8326
8652
  var LayerManagerWidth;
@@ -8351,24 +8677,18 @@ var widthToWidthClass = function widthToWidthClass(w) {
8351
8677
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8352
8678
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
8353
8679
  * */
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
- });
8680
+ var style$2 = {
8681
+ width: '24px',
8682
+ height: '24px',
8683
+ margin: '6px 0px 0px 10px',
8684
+ borderRadius: '15%'
8685
+ };
8365
8686
 
8366
8687
  var LayerSelectButtonConnect = function LayerSelectButtonConnect(_ref) {
8367
8688
  var mapId = _ref.mapId,
8368
8689
  _ref$source = _ref.source,
8369
8690
  source = _ref$source === void 0 ? 'app' : _ref$source;
8370
8691
  var dispatch = useDispatch();
8371
- var classes = useStyles$F();
8372
8692
  var currentActiveMapId = useSelector(function (store) {
8373
8693
  return getDialogMapId(store, 'layerSelect');
8374
8694
  });
@@ -8387,7 +8707,7 @@ var LayerSelectButtonConnect = function LayerSelectButtonConnect(_ref) {
8387
8707
  title: "Layer Select"
8388
8708
  }, /*#__PURE__*/React.createElement(IconButton, {
8389
8709
  onClick: openLayerSelectDialog,
8390
- className: classes.button,
8710
+ sx: style$2,
8391
8711
  id: "layerSelectButton",
8392
8712
  "data-testid": "layerSelectButton",
8393
8713
  disableRipple: true,
@@ -8411,7 +8731,7 @@ var LayerSelectButtonConnect = function LayerSelectButtonConnect(_ref) {
8411
8731
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8412
8732
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
8413
8733
  * */
8414
- var useStyles$E = makeStyles({
8734
+ var useStyles$v = makeStyles({
8415
8735
  row: {
8416
8736
  height: '32px'
8417
8737
  },
@@ -8435,7 +8755,7 @@ var DescriptionRow = function DescriptionRow(_ref) {
8435
8755
  layerManagerWidth = _ref.layerManagerWidth,
8436
8756
  _ref$layerSelect = _ref.layerSelect,
8437
8757
  layerSelect = _ref$layerSelect === void 0 ? false : _ref$layerSelect;
8438
- var classes = useStyles$E();
8758
+ var classes = useStyles$v();
8439
8759
  var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
8440
8760
  return /*#__PURE__*/React.createElement(Grid, {
8441
8761
  container: true,
@@ -8512,23 +8832,23 @@ var useTooltipContainerStyles = makeStyles(function (theme) {
8512
8832
  borderColor: 'transparent!important'
8513
8833
  },
8514
8834
  '&:hover .MuiSelect-select': {
8515
- backgroundColor: theme.palette.geowebColors.layerManager.tableRowMouseover.rgba
8835
+ backgroundColor: theme.palette.geowebColors.buttons.tool.mouseOver.fill
8516
8836
  },
8517
8837
  '&.Mui-focused .MuiSelect-select': {
8518
8838
  outline: theme.palette.geowebColors.buttons.focusDefault.outline,
8519
- backgroundColor: theme.palette.geowebColors.layerManager.tableRowMouseover.rgba
8839
+ backgroundColor: theme.palette.geowebColors.buttons.tool.mouseOver.fill
8520
8840
  },
8521
8841
  '&:hover&.MuiButton-root': {
8522
- backgroundColor: theme.palette.geowebColors.layerManager.tableRowMouseover.rgba
8842
+ backgroundColor: theme.palette.geowebColors.buttons.tool.mouseOver.fill
8523
8843
  },
8524
8844
  '&:focus&.MuiButton-root': {
8525
8845
  outline: theme.palette.geowebColors.buttons.focusDefault.outline,
8526
- backgroundColor: theme.palette.geowebColors.layerManager.tableRowMouseover.rgba
8846
+ backgroundColor: theme.palette.geowebColors.buttons.tool.mouseOver.fill
8527
8847
  },
8528
8848
  '& .MuiSvgIcon-root': {
8529
8849
  transition: 'none',
8530
8850
  fill: function fill(isEnabled) {
8531
- return isEnabled ? theme.palette.geowebColors.layerManager.tableRowDefaultIcon.rgba : theme.palette.geowebColors.layerManager.tableRowDisabledIcon.rgba;
8851
+ return isEnabled ? theme.palette.geowebColors.buttons.flat["default"].color : theme.palette.geowebColors.buttons.flat.disabled.color;
8532
8852
  }
8533
8853
  },
8534
8854
  '&>div': {
@@ -8643,7 +8963,7 @@ var DimensionSelect = function DimensionSelect(_ref) {
8643
8963
  }
8644
8964
  }, /*#__PURE__*/React.createElement(MenuItem, {
8645
8965
  disabled: true
8646
- }, "Select dimension"), layerDimensions.map(function (dimension) {
8966
+ }, "Dimension"), layerDimensions.map(function (dimension) {
8647
8967
  return /*#__PURE__*/React.createElement(MenuItem, {
8648
8968
  key: dimension.name,
8649
8969
  value: dimension.name
@@ -8669,7 +8989,7 @@ var DimensionSelect = function DimensionSelect(_ref) {
8669
8989
  }
8670
8990
  }, /*#__PURE__*/React.createElement(MenuItem, {
8671
8991
  disabled: true
8672
- }, "Select dimension value. (", valuesToDisplay.length, " options)"), valuesToDisplay.map(function (dimValue) {
8992
+ }, "Dimension value (", valuesToDisplay.length, " options)"), valuesToDisplay.map(function (dimValue) {
8673
8993
  return /*#__PURE__*/React.createElement(MenuItem, {
8674
8994
  key: dimValue,
8675
8995
  value: dimValue
@@ -8677,204 +8997,7 @@ var DimensionSelect = function DimensionSelect(_ref) {
8677
8997
  }))));
8678
8998
  };
8679
8999
 
8680
- /* *
8681
- * Licensed under the Apache License, Version 2.0 (the "License");
8682
- * you may not use this file except in compliance with the License.
8683
- * You may obtain a copy of the License at
8684
- *
8685
- * http://www.apache.org/licenses/LICENSE-2.0
8686
- *
8687
- * Unless required by applicable law or agreed to in writing, software
8688
- * distributed under the License is distributed on an "AS IS" BASIS,
8689
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8690
- * See the License for the specific language governing permissions and
8691
- * limitations under the License.
8692
- *
8693
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8694
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
8695
- * */
8696
- var useStyles$D = makeStyles(function (theme) {
8697
- return createStyles({
8698
- button: {
8699
- height: 28,
8700
- width: 28,
8701
- borderRadius: 5,
8702
- marginTop: 2,
8703
- color: function color(_ref) {
8704
- var isActive = _ref.isActive,
8705
- 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
-
8710
- if (!isEnabled) {
8711
- return tableRowDisabledIcon.fill;
8712
- }
8713
-
8714
- if (isActive) {
8715
- return theme.palette.common.white;
8716
- }
8717
-
8718
- return tableRowDefaultIcon.rgba;
8719
- },
8720
- backgroundColor: function backgroundColor(_ref2) {
8721
- var isActive = _ref2.isActive;
8722
- return isActive ? theme.palette.geowebColors.buttons.primary.active.fill : 'inherit';
8723
- },
8724
- '&:focus': {
8725
- backgroundColor: function backgroundColor(_ref3) {
8726
- var isActive = _ref3.isActive;
8727
- return isActive ? theme.palette.geowebColors.buttons.primary.mouseOver.fill : theme.palette.geowebColors.layerManager.tableRowMouseover.rgba;
8728
- },
8729
- outline: theme.palette.geowebColors.buttons.focusDefault.outline,
8730
- borderRadius: 0
8731
- },
8732
- '&:hover': {
8733
- backgroundColor: function backgroundColor(_ref4) {
8734
- var isActive = _ref4.isActive;
8735
- return isActive ? theme.palette.geowebColors.buttons.primary.mouseOver.fill : theme.palette.geowebColors.layerManager.tableRowMouseover.rgba;
8736
- }
8737
- }
8738
- },
8739
- popper: {
8740
- pointerEvents: 'none'
8741
- }
8742
- });
8743
- });
8744
-
8745
- var LayerManagerButton = function LayerManagerButton(_a) {
8746
- var _a$tooltipTitle = _a.tooltipTitle,
8747
- tooltipTitle = _a$tooltipTitle === void 0 ? '' : _a$tooltipTitle,
8748
- _a$onClick = _a.onClick,
8749
- onClick = _a$onClick === void 0 ? function () {} : _a$onClick,
8750
- _a$isActive = _a.isActive,
8751
- isActive = _a$isActive === void 0 ? false : _a$isActive,
8752
- _a$isEnabled = _a.isEnabled,
8753
- isEnabled = _a$isEnabled === void 0 ? true : _a$isEnabled,
8754
- icon = _a.icon,
8755
- testId = _a.testId,
8756
- props = __rest(_a, ["tooltipTitle", "onClick", "isActive", "isEnabled", "icon", "testId"]);
8757
-
8758
- var classes = useStyles$D({
8759
- isActive: isActive,
8760
- isEnabled: isEnabled
8761
- });
8762
-
8763
- var handleClick = function handleClick(event) {
8764
- onClick(event);
8765
- };
8766
-
8767
- return /*#__PURE__*/React.createElement(Tooltip, {
8768
- title: tooltipTitle,
8769
- placement: "top",
8770
- classes: {
8771
- popper: classes.popper
8772
- }
8773
- }, /*#__PURE__*/React.createElement(IconButton, Object.assign({
8774
- size: "small",
8775
- onClick: handleClick,
8776
- "data-testid": testId,
8777
- className: classes.button,
8778
- disableFocusRipple: true
8779
- }, props), icon));
8780
- };
8781
-
8782
- /* *
8783
- * Licensed under the Apache License, Version 2.0 (the "License");
8784
- * you may not use this file except in compliance with the License.
8785
- * You may obtain a copy of the License at
8786
- *
8787
- * http://www.apache.org/licenses/LICENSE-2.0
8788
- *
8789
- * Unless required by applicable law or agreed to in writing, software
8790
- * distributed under the License is distributed on an "AS IS" BASIS,
8791
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8792
- * See the License for the specific language governing permissions and
8793
- * limitations under the License.
8794
- *
8795
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8796
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
8797
- * */
8798
- var useStyles$C = makeStyles(function (theme) {
8799
- return createStyles({
8800
- checkbox: {
8801
- color: 'inherit',
8802
- padding: 4,
8803
- borderRadius: 5,
8804
- '&.Mui-focusVisible': {
8805
- backgroundColor: theme.palette.geowebColors.layerManager.tableRowMouseover.rgba
8806
- },
8807
- '&:hover': {
8808
- backgroundColor: 'transparent!important'
8809
- },
8810
- '&.Mui-checked': {
8811
- color: 'inherit'
8812
- }
8813
- }
8814
- });
8815
- });
8816
-
8817
- var EnableLayer = function EnableLayer(_ref) {
8818
- var isEnabled = _ref.isEnabled,
8819
- title = _ref.title,
8820
- onChangeEnableLayer = _ref.onChangeEnableLayer;
8821
- var classes = useStyles$C(isEnabled);
8822
-
8823
- var onClick = function onClick() {
8824
- onChangeEnableLayer(!isEnabled);
8825
- };
8826
-
8827
- var visibilityIcon = /*#__PURE__*/React.createElement(SvgIcon, null, /*#__PURE__*/React.createElement("rect", {
8828
- width: 24,
8829
- height: 24,
8830
- fill: "transparent"
8831
- }), /*#__PURE__*/React.createElement("path", {
8832
- d: "M14.4980749,15.8618431 C15.8661433,15.0851043 16.779689,13.6936347 16.779689,12.1014551 C16.779689,10.5092755 15.8661433,9.11870594 14.4980749,8.34106705 C17.6257313,9.18620931 19.3529176,11.4300215 19.8092405,12.1014551 C19.3529176,12.7719886 17.6266313,15.0167008 14.4980749,15.8618431 L14.4980749,15.8618431 Z M4.18985949,12.1014551 C4.64618231,11.4300215 6.37336867,9.18710936 9.49922496,8.3419671 C8.13295665,9.11870594 7.21851093,10.5101755 7.21851093,12.1014551 C7.21851093,13.6936347 8.13295665,15.0842042 9.49922496,15.8618431 C6.37336867,15.0167008 4.64618231,12.7728886 4.18985949,12.1014551 L4.18985949,12.1014551 Z M11.99955,13.8583429 C10.9950998,13.8583429 10.180559,13.0717036 10.180559,12.1014551 C10.180559,11.1312066 10.9950998,10.3445672 11.99955,10.3445672 C13.0031002,10.3445672 13.8176409,11.1312066 13.8176409,12.1014551 C13.8176409,13.0717036 13.0031002,13.8583429 11.99955,13.8583429 L11.99955,13.8583429 Z M20.7983899,11.7666383 C20.6813841,11.5713286 17.8696435,7 11.99955,7 C6.12945647,7 3.31681584,11.5713286 3.19980999,11.7666383 L3,12.1014551 L3.19980999,12.4362718 C3.31681584,12.6306815 6.12945647,17.2020101 11.99955,17.2020101 C17.8696435,17.2020101 20.6813841,12.6306815 20.7983899,12.4362718 L21,12.1014551 L20.7983899,11.7666383 Z"
8833
- }));
8834
- var visibilityOffIcon = /*#__PURE__*/React.createElement(SvgIcon, {
8835
- style: {
8836
- marginTop: 2
8837
- }
8838
- }, /*#__PURE__*/React.createElement("rect", {
8839
- width: 24,
8840
- height: 24,
8841
- fill: "transparent"
8842
- }), /*#__PURE__*/React.createElement("path", {
8843
- d: "M12 15.309c-.755 0-1.45-.088-2.092-.236l.798-.797c.41.124.844.192 1.294.192 2.453 0 4.442-1.988 4.442-4.44 0-.495-.085-.907-.234-1.255l.03-.03c1.72.906 2.781 2.167 3.218 2.766-.724.992-3.151 3.8-7.456 3.8zm-7.456-3.8c.442-.607 1.522-1.89 3.276-2.796-.166.36-.261.79-.261 1.315 0 1.228.499 2.34 1.305 3.144l-1.102 1.104c-1.72-.906-2.78-2.169-3.218-2.767zm5.646-3.524c.818 0 1.482.665 1.482 1.483 0 .818-.664 1.481-1.482 1.481s-1.482-.663-1.482-1.481c0-.818.664-1.483 1.482-1.483zm10.608 3.19c-.073-.125-1.245-2.026-3.603-3.388l2.009-2.01c.406-.406.406-1.065 0-1.473-.407-.405-1.066-.405-1.473 0l-2.58 2.582c-.93-.295-1.98-.478-3.151-.478-5.87 0-8.681 4.57-8.798 4.766L3 11.51l.202.335c.073.124 1.244 2.025 3.603 3.387l-2.009 2.01c-.406.406-.406 1.065 0 1.472.204.203.47.305.737.305.266 0 .532-.102.736-.305l2.58-2.58c.93.293 1.98.476 3.151.476 5.87 0 8.681-4.57 8.798-4.765l.202-.335-.202-.335z"
8844
- }));
8845
- return /*#__PURE__*/React.createElement(LayerManagerButton, {
8846
- tooltipTitle: title,
8847
- onClick: onClick,
8848
- icon: /*#__PURE__*/React.createElement(Checkbox, {
8849
- className: classes.checkbox,
8850
- icon: visibilityOffIcon,
8851
- checkedIcon: visibilityIcon,
8852
- checked: isEnabled,
8853
- disableFocusRipple: true,
8854
- tabIndex: -1
8855
- }),
8856
- testId: "enableLayer",
8857
- isEnabled: isEnabled
8858
- });
8859
- };
8860
-
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) {
9000
+ var useStyles$u = makeStyles(function (theme) {
8878
9001
  return createStyles({
8879
9002
  dropdownEmpty: {
8880
9003
  paddingLeft: 8,
@@ -8890,6 +9013,33 @@ var useStyles$B = makeStyles(function (theme) {
8890
9013
  });
8891
9014
  });
8892
9015
 
9016
+ var getRenderLayersValues = function getRenderLayersValues(layerName, layers) {
9017
+ var serviceLayer = layers.find(function (l) {
9018
+ return l.name === layerName;
9019
+ });
9020
+
9021
+ if (!serviceLayer && layerName) {
9022
+ return {
9023
+ currentValue: layerName,
9024
+ currentIndex: layers.length,
9025
+ extendedLayers: [].concat(_toConsumableArray(layers), [{
9026
+ name: layerName,
9027
+ text: layerName,
9028
+ leaf: true,
9029
+ path: []
9030
+ }])
9031
+ };
9032
+ }
9033
+
9034
+ return {
9035
+ currentValue: (serviceLayer === null || serviceLayer === void 0 ? void 0 : serviceLayer.name) || '',
9036
+ currentIndex: layers.findIndex(function (l) {
9037
+ return l.name === (serviceLayer === null || serviceLayer === void 0 ? void 0 : serviceLayer.name);
9038
+ }),
9039
+ extendedLayers: layers
9040
+ };
9041
+ };
9042
+
8893
9043
  var RenderLayers = function RenderLayers(_ref) {
8894
9044
  var onChangeLayerName = _ref.onChangeLayerName,
8895
9045
  layerName = _ref.layerName,
@@ -8897,7 +9047,7 @@ var RenderLayers = function RenderLayers(_ref) {
8897
9047
  layers = _ref$layers === void 0 ? [] : _ref$layers,
8898
9048
  _ref$isEnabled = _ref.isEnabled,
8899
9049
  isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
8900
- var classes = useStyles$B();
9050
+ var classes = useStyles$u();
8901
9051
  var containerClass = useTooltipContainerStyles(isEnabled);
8902
9052
 
8903
9053
  if (!layers || !layers.length) {
@@ -8909,24 +9059,21 @@ var RenderLayers = function RenderLayers(_ref) {
8909
9059
  }, "No service available"));
8910
9060
  }
8911
9061
 
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
9062
  var selectLayer = function selectLayer(event) {
8918
9063
  event.stopPropagation();
8919
9064
  onChangeLayerName(event.target.value);
8920
9065
  };
8921
9066
 
8922
- var list = layers.map(function (layer) {
9067
+ var _getRenderLayersValue = getRenderLayersValues(layerName, layers),
9068
+ currentIndex = _getRenderLayersValue.currentIndex,
9069
+ currentValue = _getRenderLayersValue.currentValue,
9070
+ extendedLayers = _getRenderLayersValue.extendedLayers;
9071
+
9072
+ var list = extendedLayers.map(function (layer) {
8923
9073
  return {
8924
9074
  value: layer.name
8925
9075
  };
8926
9076
  });
8927
- var currentIndex = layers.findIndex(function (layer) {
8928
- return currentValue === layer.name;
8929
- });
8930
9077
  return /*#__PURE__*/React.createElement(TooltipSelect, {
8931
9078
  disableUnderline: true,
8932
9079
  tooltip: "Select a layer",
@@ -8942,10 +9089,11 @@ var RenderLayers = function RenderLayers(_ref) {
8942
9089
  onChange: selectLayer,
8943
9090
  onChangeMouseWheel: function onChangeMouseWheel(e) {
8944
9091
  return onChangeLayerName(e.value);
8945
- }
9092
+ },
9093
+ requiresCtrlToChange: true
8946
9094
  }, /*#__PURE__*/React.createElement(MenuItem, {
8947
9095
  disabled: true
8948
- }, "Select layer"), layers.map(function (layerFromServiceLayers) {
9096
+ }, "Layer"), extendedLayers.map(function (layerFromServiceLayers) {
8949
9097
  return /*#__PURE__*/React.createElement(MenuItem, {
8950
9098
  key: layerFromServiceLayers.name,
8951
9099
  value: layerFromServiceLayers.name,
@@ -8954,7 +9102,7 @@ var RenderLayers = function RenderLayers(_ref) {
8954
9102
  }));
8955
9103
  };
8956
9104
 
8957
- var useStyles$A = makeStyles(function (theme) {
9105
+ var useStyles$t = makeStyles(function (theme) {
8958
9106
  return {
8959
9107
  opacityDiv: {
8960
9108
  height: 'calc(100% - 5px)',
@@ -8977,7 +9125,7 @@ var useStyles$A = makeStyles(function (theme) {
8977
9125
  position: 'fixed',
8978
9126
  top: '-5px',
8979
9127
  boxSizing: 'initial',
8980
- zIndex: 1,
9128
+ zIndex: 2,
8981
9129
  boxShadow: theme.shadows[8]
8982
9130
  }
8983
9131
  };
@@ -9015,7 +9163,7 @@ var OpacitySelect = function OpacitySelect(_ref) {
9015
9163
  onLayerChangeOpacity = _ref.onLayerChangeOpacity,
9016
9164
  _ref$isEnabled = _ref.isEnabled,
9017
9165
  isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
9018
- var classes = useStyles$A();
9166
+ var classes = useStyles$t();
9019
9167
  var sliderClasses = sliderStyles();
9020
9168
  var containerClass = useTooltipContainerStyles(isEnabled);
9021
9169
 
@@ -9043,11 +9191,17 @@ var OpacitySelect = function OpacitySelect(_ref) {
9043
9191
  });
9044
9192
  }, []);
9045
9193
  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]);
9194
+ if (event.ctrlKey || event.metaKey) {
9195
+ disableScroll();
9196
+ var multiplier = event.altKey ? 10 : 1;
9197
+ var direction = event.deltaY > 0 ? 0.01 * multiplier : -0.01 * multiplier;
9198
+ var newValue = Math.min(Math.max(currentOpacity - direction, 0), 1); // Kind of "one frame debouncer", meant to dampen too fast slider movement
9199
+
9200
+ window.requestAnimationFrame(function () {
9201
+ onLayerChangeOpacity(newValue);
9202
+ });
9203
+ } else enableScroll();
9204
+ }, [currentOpacity, onLayerChangeOpacity, disableScroll, enableScroll]);
9051
9205
  var onClickButton = React.useCallback(function () {
9052
9206
  setOpen(!open);
9053
9207
  }, [open]);
@@ -9057,17 +9211,15 @@ var OpacitySelect = function OpacitySelect(_ref) {
9057
9211
  }
9058
9212
  }, [open]);
9059
9213
  var onMouseEnter = React.useCallback(function () {
9060
- disableScroll();
9061
9214
  if (!open) setTooltipOpen(true);
9062
- }, [open, disableScroll]);
9215
+ }, [open]);
9063
9216
  var onMouseLeave = React.useCallback(function () {
9064
9217
  enableScroll();
9065
9218
  setTooltipOpen(false);
9066
9219
  }, [enableScroll]);
9067
9220
  var onFocus = React.useCallback(function () {
9068
- disableScroll();
9069
9221
  setTooltipOpen(true);
9070
- }, [disableScroll]);
9222
+ }, []);
9071
9223
  var onBlur = React.useCallback(function () {
9072
9224
  enableScroll();
9073
9225
  setTooltipOpen(false);
@@ -9127,100 +9279,39 @@ var OpacitySelect = function OpacitySelect(_ref) {
9127
9279
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9128
9280
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
9129
9281
  * */
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
- });
9282
+ var CopyIcon = /*#__PURE__*/React.createElement(SvgIcon, null, /*#__PURE__*/React.createElement("path", {
9283
+ 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"
9284
+ }));
9169
9285
 
9170
9286
  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
- };
9187
-
9188
- var handleClose = function handleClose() {
9189
- setAnchorEl(null);
9190
- };
9287
+ var mapId = _ref.mapId,
9288
+ layerId = _ref.layerId,
9289
+ onLayerDuplicate = _ref.onLayerDuplicate;
9191
9290
 
9192
9291
  var onClickDuplicate = function onClickDuplicate() {
9193
9292
  onLayerDuplicate({
9194
9293
  mapId: mapId,
9195
9294
  layerId: layerId
9196
9295
  });
9197
- handleClose();
9198
9296
  };
9199
9297
 
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
- }))));
9298
+ return /*#__PURE__*/React.createElement(ToggleMenu, {
9299
+ buttonTestId: "openMenuButton",
9300
+ buttonSx: {
9301
+ margin: '4px 2px',
9302
+ '&.MuiButtonBase-root': {
9303
+ backgroundColor: 'transparent',
9304
+ color: 'geowebColors.greys.accessible'
9305
+ }
9306
+ },
9307
+ menuPosition: "bottom",
9308
+ menuItems: [{
9309
+ text: 'Duplicate layer',
9310
+ action: onClickDuplicate,
9311
+ icon: CopyIcon
9312
+ }],
9313
+ tooltipTitle: "Open menu"
9314
+ });
9224
9315
  };
9225
9316
 
9226
9317
  var RenderStyles = function RenderStyles(_ref) {
@@ -9272,10 +9363,11 @@ var RenderStyles = function RenderStyles(_ref) {
9272
9363
  onChange: selectStyle,
9273
9364
  onChangeMouseWheel: function onChangeMouseWheel(e) {
9274
9365
  return onChangeLayerStyle(e.value);
9275
- }
9366
+ },
9367
+ requiresCtrlToChange: true
9276
9368
  }, /*#__PURE__*/React.createElement(MenuItem, {
9277
9369
  disabled: true
9278
- }, "Select style"), styles.map(function (styleFromlayer) {
9370
+ }, "Style"), styles.map(function (styleFromlayer) {
9279
9371
  return /*#__PURE__*/React.createElement(MenuItem, {
9280
9372
  key: styleFromlayer.name,
9281
9373
  value: styleFromlayer.name
@@ -9299,72 +9391,22 @@ var RenderStyles = function RenderStyles(_ref) {
9299
9391
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9300
9392
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
9301
9393
  * */
9302
- var useStyles$x = makeStyles(function () {
9303
- return createStyles({
9304
- icon: {
9305
- width: 20,
9306
- height: 20
9307
- }
9308
- });
9309
- });
9310
-
9311
- var DeleteButton = function DeleteButton(_ref) {
9312
- var tooltipTitle = _ref.tooltipTitle,
9313
- onClickDelete = _ref.onClickDelete,
9314
- _ref$isEnabled = _ref.isEnabled,
9315
- isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
9316
- var classes = useStyles$x();
9317
- return /*#__PURE__*/React.createElement(LayerManagerButton, {
9318
- tooltipTitle: tooltipTitle,
9319
- onClick: onClickDelete,
9320
- icon: /*#__PURE__*/React.createElement(Delete, {
9321
- className: classes.icon
9322
- }),
9323
- testId: "deleteButton",
9324
- isEnabled: isEnabled
9325
- });
9326
- };
9327
-
9328
- /* *
9329
- * Licensed under the Apache License, Version 2.0 (the "License");
9330
- * you may not use this file except in compliance with the License.
9331
- * You may obtain a copy of the License at
9332
- *
9333
- * http://www.apache.org/licenses/LICENSE-2.0
9334
- *
9335
- * Unless required by applicable law or agreed to in writing, software
9336
- * distributed under the License is distributed on an "AS IS" BASIS,
9337
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9338
- * See the License for the specific language governing permissions and
9339
- * limitations under the License.
9340
- *
9341
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9342
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
9343
- * */
9344
- var useStyles$w = makeStyles(function (theme) {
9394
+ var useStyles$s = makeStyles(function (theme) {
9345
9395
  return createStyles({
9346
- icon: {
9347
- width: 18,
9348
- height: 18,
9349
- marginTop: 4
9350
- },
9351
9396
  svgIcon: {
9352
9397
  fill: function fill(_ref) {
9353
9398
  var isActive = _ref.isActive,
9354
9399
  isEnabled = _ref.isEnabled;
9355
- var _theme$palette$geoweb = theme.palette.geowebColors.layerManager,
9356
- tableRowDefaultIcon = _theme$palette$geoweb.tableRowDefaultIcon,
9357
- tableRowDisabledIcon = _theme$palette$geoweb.tableRowDisabledIcon;
9358
9400
 
9359
9401
  if (isActive) {
9360
9402
  return theme.palette.common.white;
9361
9403
  }
9362
9404
 
9363
- if (!isEnabled) {
9364
- return tableRowDisabledIcon.fill;
9405
+ if (isEnabled) {
9406
+ return theme.palette.geowebColors.buttons.flat["default"].color;
9365
9407
  }
9366
9408
 
9367
- return tableRowDefaultIcon.rgba;
9409
+ return theme.palette.geowebColors.buttons.flat.disabled.color;
9368
9410
  }
9369
9411
  }
9370
9412
  });
@@ -9378,14 +9420,18 @@ var ActivateLayer = function ActivateLayer(_ref2) {
9378
9420
  isActive = _ref2$isActive === void 0 ? false : _ref2$isActive,
9379
9421
  _ref2$isEnabled = _ref2.isEnabled,
9380
9422
  isEnabled = _ref2$isEnabled === void 0 ? true : _ref2$isEnabled;
9381
- var classes = useStyles$w({
9423
+ var classes = useStyles$s({
9382
9424
  isActive: isActive,
9383
9425
  isEnabled: isEnabled
9384
9426
  });
9385
9427
 
9386
9428
  var Icon = function Icon() {
9387
9429
  return /*#__PURE__*/React.createElement(SvgIcon, {
9388
- className: classes.icon
9430
+ sx: {
9431
+ width: '18px',
9432
+ height: '18px',
9433
+ marginTop: '4px'
9434
+ }
9389
9435
  }, /*#__PURE__*/React.createElement("g", {
9390
9436
  id: "Concept-3",
9391
9437
  stroke: "none",
@@ -9402,7 +9448,7 @@ var ActivateLayer = function ActivateLayer(_ref2) {
9402
9448
  }))));
9403
9449
  };
9404
9450
 
9405
- return /*#__PURE__*/React.createElement(LayerManagerButton, {
9451
+ return /*#__PURE__*/React.createElement(ManagerButton, {
9406
9452
  tooltipTitle: tooltipTitle,
9407
9453
  onClick: onClickActivate,
9408
9454
  icon: /*#__PURE__*/React.createElement(Icon, null),
@@ -9427,7 +9473,7 @@ var ActivateLayer = function ActivateLayer(_ref2) {
9427
9473
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9428
9474
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
9429
9475
  * */
9430
- var useStyles$v = makeStyles(function (theme) {
9476
+ var useStyles$r = makeStyles(function (theme) {
9431
9477
  return createStyles({
9432
9478
  row: {
9433
9479
  background: function background(isEnabled) {
@@ -9461,6 +9507,8 @@ var LayerRow = function LayerRow(_ref) {
9461
9507
  } : _ref$onLayerRowClick,
9462
9508
  _ref$isEnabled = _ref.isEnabled,
9463
9509
  isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled,
9510
+ _ref$isLayerMissing = _ref.isLayerMissing,
9511
+ isLayerMissing = _ref$isLayerMissing === void 0 ? false : _ref$isLayerMissing,
9464
9512
  onLayerEnable = _ref.onLayerEnable,
9465
9513
  onLayerChangeName = _ref.onLayerChangeName,
9466
9514
  onLayerChangeStyle = _ref.onLayerChangeStyle,
@@ -9478,7 +9526,7 @@ var LayerRow = function LayerRow(_ref) {
9478
9526
  layerActiveLayout = _ref.layerActiveLayout,
9479
9527
  layerManagerWidth = _ref.layerManagerWidth,
9480
9528
  dragHandle = _ref.dragHandle;
9481
- var classes = useStyles$v(isEnabled);
9529
+ var classes = useStyles$r(isEnabled);
9482
9530
  var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
9483
9531
 
9484
9532
  var onClickRow = function onClickRow() {
@@ -9493,7 +9541,7 @@ var LayerRow = function LayerRow(_ref) {
9493
9541
  }, /*#__PURE__*/React__default.createElement(Grid, {
9494
9542
  item: true,
9495
9543
  className: columnSizes.column1
9496
- }, dragHandle, layerEnableLayout || /*#__PURE__*/React__default.createElement(EnableLayer, {
9544
+ }, dragHandle, layerEnableLayout || /*#__PURE__*/React__default.createElement(EnableButton, {
9497
9545
  isEnabled: layer.enabled,
9498
9546
  title: layer.name,
9499
9547
  onChangeEnableLayer: function onChangeEnableLayer() {
@@ -9516,7 +9564,13 @@ var LayerRow = function LayerRow(_ref) {
9516
9564
  name: name
9517
9565
  });
9518
9566
  }
9519
- })), /*#__PURE__*/React__default.createElement(Grid, {
9567
+ })), isLayerMissing ? /*#__PURE__*/React__default.createElement(Grid, {
9568
+ item: true,
9569
+ className: "".concat(columnSizes.columns35)
9570
+ }, /*#__PURE__*/React__default.createElement(AlertBanner, {
9571
+ title: "This layer could not be loaded: does not exist on the server.",
9572
+ isCompact: true
9573
+ })) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Grid, {
9520
9574
  item: true,
9521
9575
  className: "".concat(columnSizes.column3)
9522
9576
  }, layerStylesLayout || /*#__PURE__*/React__default.createElement(RenderStyles, {
@@ -9559,10 +9613,10 @@ var LayerRow = function LayerRow(_ref) {
9559
9613
  dimension: dimension
9560
9614
  });
9561
9615
  }
9562
- })), /*#__PURE__*/React__default.createElement(Grid, {
9616
+ }))), /*#__PURE__*/React__default.createElement(Grid, {
9563
9617
  item: true,
9564
9618
  className: columnSizes.column6
9565
- }, layerDeleteLayout || /*#__PURE__*/React__default.createElement(DeleteButton, {
9619
+ }, layerDeleteLayout || /*#__PURE__*/React__default.createElement(ManagerDeleteButton, {
9566
9620
  tooltipTitle: "Remove layer",
9567
9621
  onClickDelete: function onClickDelete() {
9568
9622
  onLayerDelete({
@@ -9571,7 +9625,6 @@ var LayerRow = function LayerRow(_ref) {
9571
9625
  });
9572
9626
  }
9573
9627
  }), layerMenuLayout || /*#__PURE__*/React__default.createElement(LayerManagerMenuButton, {
9574
- tooltipTitle: "Open Menu",
9575
9628
  mapId: mapId,
9576
9629
  layerId: layerId,
9577
9630
  onLayerDuplicate: onLayerDuplicate
@@ -9613,7 +9666,7 @@ var DeleteLayerConnect = function DeleteLayerConnect(_ref) {
9613
9666
  var isLayerEnabled = useSelector(function (store) {
9614
9667
  return getLayerEnabled(store, layerId);
9615
9668
  });
9616
- return /*#__PURE__*/React.createElement(DeleteButton, {
9669
+ return /*#__PURE__*/React.createElement(ManagerDeleteButton, {
9617
9670
  tooltipTitle: "Remove layer",
9618
9671
  onClickDelete: function onClickDelete() {
9619
9672
  layerDelete$1({
@@ -9657,7 +9710,7 @@ var EnableLayerConnect = function EnableLayerConnect(_ref) {
9657
9710
  enabled: enabled
9658
9711
  }));
9659
9712
  }, [dispatch]);
9660
- return /*#__PURE__*/React.createElement(EnableLayer, {
9713
+ return /*#__PURE__*/React.createElement(EnableButton, {
9661
9714
  isEnabled: isEnabled,
9662
9715
  title: "Toggle this layer's visibility",
9663
9716
  onChangeEnableLayer: function onChangeEnableLayer(enable) {
@@ -9899,11 +9952,7 @@ var LayerManagerMenuButtonConnect = function LayerManagerMenuButtonConnect(_ref)
9899
9952
  origin: 'MenuButtonConnect'
9900
9953
  }));
9901
9954
  }, [dispatch]);
9902
- var isLayerEnabled = useSelector(function (store) {
9903
- return getLayerEnabled(store, layerId);
9904
- });
9905
9955
  return /*#__PURE__*/React.createElement(LayerManagerMenuButton, {
9906
- tooltipTitle: "Open Menu",
9907
9956
  layerId: layerId,
9908
9957
  mapId: mapId,
9909
9958
  onLayerDuplicate: function onLayerDuplicate() {
@@ -9912,8 +9961,7 @@ var LayerManagerMenuButtonConnect = function LayerManagerMenuButtonConnect(_ref)
9912
9961
  mapId: mapId,
9913
9962
  layer: layer
9914
9963
  });
9915
- },
9916
- isEnabled: isLayerEnabled
9964
+ }
9917
9965
  });
9918
9966
  };
9919
9967
 
@@ -10006,10 +10054,23 @@ var LayerRowConnect = function LayerRowConnect(_ref) {
10006
10054
  var isEnabled = useSelector(function (store) {
10007
10055
  return getLayerEnabled(store, layerId);
10008
10056
  });
10057
+ var layerName = useSelector(function (store) {
10058
+ return getLayerName(store, layerId);
10059
+ });
10060
+ var layerService = useSelector(function (store) {
10061
+ return getLayerService(store, layerId);
10062
+ });
10063
+ var layers = useSelector(function (store) {
10064
+ return getLayersFromService$1(store, layerService);
10065
+ });
10066
+ var isLayerMissing = layers && layers.length > 0 && !layers.some(function (l) {
10067
+ return l.name === layerName;
10068
+ });
10009
10069
  return /*#__PURE__*/React.createElement(LayerRow, {
10010
10070
  isEnabled: isEnabled,
10011
10071
  mapId: mapId,
10012
10072
  layerId: layerId,
10073
+ isLayerMissing: isLayerMissing,
10013
10074
  layerEnableLayout: /*#__PURE__*/React.createElement(EnableLayerConnect, {
10014
10075
  layerId: layerId
10015
10076
  }),
@@ -10060,48 +10121,38 @@ var LayerRowConnect = function LayerRowConnect(_ref) {
10060
10121
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
10061
10122
  * */
10062
10123
  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
10124
 
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
- });
10125
+ var DragHandle = function DragHandle(_ref) {
10126
+ var _ref$isDisabled = _ref.isDisabled,
10127
+ isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
10128
+ _ref$index = _ref.index,
10129
+ index = _ref$index === void 0 ? undefined : _ref$index,
10130
+ _ref$hideTooltip = _ref.hideTooltip,
10131
+ hideTooltip = _ref$hideTooltip === void 0 ? false : _ref$hideTooltip;
10090
10132
  var tooltipTitle = hideTooltip ? '' : TOOLTIP_TITLE;
10091
- return /*#__PURE__*/React__default.createElement(LayerManagerButton, {
10133
+ return /*#__PURE__*/React__default.createElement(ManagerButton, {
10092
10134
  tooltipTitle: tooltipTitle,
10093
10135
  icon: /*#__PURE__*/React__default.createElement(DragIndicator, null),
10094
10136
  testId: "dragHandle".concat(index !== undefined ? "-".concat(index) : ''),
10095
- className: "".concat(classes.dragHandle, " handle"),
10137
+ className: "handle",
10096
10138
  tabIndex: -1,
10097
10139
  isEnabled: !isDisabled,
10098
10140
  disableFocusRipple: true,
10099
10141
  disableTouchRipple: true,
10100
- disabled: isDisabled
10142
+ disabled: isDisabled,
10143
+ isAccessible: true,
10144
+ sx: {
10145
+ cursor: 'grab',
10146
+ '&:hover': {
10147
+ backgroundColor: 'inherit!important'
10148
+ },
10149
+ marginLeft: '3px',
10150
+ marginRight: '3px'
10151
+ }
10101
10152
  });
10102
10153
  };
10103
10154
 
10104
- var useStyles$t = makeStyles(function () {
10155
+ var useStyles$q = makeStyles(function () {
10105
10156
  return {
10106
10157
  layerRows: {
10107
10158
  width: '100%',
@@ -10168,7 +10219,7 @@ var LayerContainerRow = function LayerContainerRow(_ref) {
10168
10219
 
10169
10220
  var isSorting = activeDragIndex !== null;
10170
10221
  var isDragDisabled = layerIds.length === 1;
10171
- var classes = useStyles$t(isSorting);
10222
+ var classes = useStyles$q(isSorting);
10172
10223
  return /*#__PURE__*/React.createElement(Grid, {
10173
10224
  container: true,
10174
10225
  item: true,
@@ -10266,7 +10317,7 @@ var BaseLayers = function BaseLayers(_ref) {
10266
10317
  }
10267
10318
  }, /*#__PURE__*/React.createElement(MenuItem, {
10268
10319
  disabled: true
10269
- }, "Select base layer"), availableBaseLayers.map(function (baseLayer) {
10320
+ }, "Base layer"), availableBaseLayers.map(function (baseLayer) {
10270
10321
  return /*#__PURE__*/React.createElement(MenuItem, {
10271
10322
  key: baseLayer.id,
10272
10323
  value: baseLayer.id
@@ -10378,7 +10429,7 @@ var BaseLayersConnect = function BaseLayersConnect(_ref) {
10378
10429
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10379
10430
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
10380
10431
  * */
10381
- var useStyles$s = makeStyles({
10432
+ var useStyles$p = makeStyles({
10382
10433
  layerRow: {
10383
10434
  width: '100%',
10384
10435
  height: '36px'
@@ -10401,7 +10452,7 @@ var BaseLayerRow = function BaseLayerRow(_ref) {
10401
10452
  layerManagerWidth = _ref.layerManagerWidth,
10402
10453
  _ref$tooltip = _ref.tooltip,
10403
10454
  tooltip = _ref$tooltip === void 0 ? '' : _ref$tooltip;
10404
- var classes = useStyles$s();
10455
+ var classes = useStyles$p();
10405
10456
  var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
10406
10457
  return /*#__PURE__*/React.createElement(Grid, {
10407
10458
  container: true,
@@ -10430,7 +10481,7 @@ var BaseLayerRow = function BaseLayerRow(_ref) {
10430
10481
  })));
10431
10482
  };
10432
10483
 
10433
- var useStyles$r = makeStyles({
10484
+ var useStyles$o = makeStyles({
10434
10485
  layerRowContainer: {
10435
10486
  position: 'relative',
10436
10487
  width: '100%',
@@ -10465,7 +10516,7 @@ var LayerManager = function LayerManager(_ref) {
10465
10516
  layerSelect = _ref$layerSelect === void 0 ? false : _ref$layerSelect,
10466
10517
  _ref$showAddLayersToo = _ref.showAddLayersTooltip,
10467
10518
  showAddLayersTooltip = _ref$showAddLayersToo === void 0 ? true : _ref$showAddLayersToo;
10468
- var classes = useStyles$r();
10519
+ var classes = useStyles$o();
10469
10520
 
10470
10521
  var _React$useState = React.useState(LayerManagerWidth.lg),
10471
10522
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -10522,80 +10573,6 @@ var LayerManager = function LayerManager(_ref) {
10522
10573
  }))));
10523
10574
  };
10524
10575
 
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
10576
  /* *
10600
10577
  * Licensed under the Apache License, Version 2.0 (the "License");
10601
10578
  * you may not use this file except in compliance with the License.
@@ -11177,13 +11154,6 @@ var ServicePopupConnect = function ServicePopupConnect(_ref) {
11177
11154
  var isURL = function isURL(string) {
11178
11155
  return /^https?:\/\//.test(string);
11179
11156
  };
11180
- var useStyles$q = makeStyles(function (theme) {
11181
- return {
11182
- iconButton: {
11183
- color: theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat
11184
- }
11185
- };
11186
- });
11187
11157
  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
11158
  var clearIcon = /*#__PURE__*/React__default.createElement(SvgIcon, {
11189
11159
  style: {
@@ -11216,7 +11186,6 @@ var SearchFieldButtonContainer = function SearchFieldButtonContainer(_ref) {
11216
11186
  isPopupOpen = _React$useState2[0],
11217
11187
  setPopupOpen = _React$useState2[1];
11218
11188
 
11219
- var classes = useStyles$q();
11220
11189
  React__default.useEffect(function () {
11221
11190
  if (isPopupOpen === false) {
11222
11191
  onClickClear();
@@ -11227,7 +11196,6 @@ var SearchFieldButtonContainer = function SearchFieldButtonContainer(_ref) {
11227
11196
  title: "Clear",
11228
11197
  placement: "top"
11229
11198
  }, /*#__PURE__*/React__default.createElement(IconButton, {
11230
- className: classes.iconButton,
11231
11199
  edge: "end",
11232
11200
  onClick: function onClick() {
11233
11201
  onClickClear();
@@ -11256,7 +11224,6 @@ var SearchFieldButtonContainer = function SearchFieldButtonContainer(_ref) {
11256
11224
  title: "Search",
11257
11225
  placement: "top"
11258
11226
  }, /*#__PURE__*/React__default.createElement(IconButton, {
11259
- className: classes.iconButton,
11260
11227
  edge: "end",
11261
11228
  size: "large"
11262
11229
  }, searchIcon));
@@ -11339,6 +11306,50 @@ var SearchFieldConnect = function SearchFieldConnect() {
11339
11306
  });
11340
11307
  };
11341
11308
 
11309
+ /* *
11310
+ * Licensed under the Apache License, Version 2.0 (the "License");
11311
+ * you may not use this file except in compliance with the License.
11312
+ * You may obtain a copy of the License at
11313
+ *
11314
+ * http://www.apache.org/licenses/LICENSE-2.0
11315
+ *
11316
+ * Unless required by applicable law or agreed to in writing, software
11317
+ * distributed under the License is distributed on an "AS IS" BASIS,
11318
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11319
+ * See the License for the specific language governing permissions and
11320
+ * limitations under the License.
11321
+ *
11322
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11323
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
11324
+ * */
11325
+
11326
+ var LayerAddRemoveButton = function LayerAddRemoveButton(_ref) {
11327
+ var layer = _ref.layer,
11328
+ layerIndex = _ref.layerIndex,
11329
+ serviceId = _ref.serviceId,
11330
+ addLayer = _ref.addLayer,
11331
+ deleteLayer = _ref.deleteLayer,
11332
+ mapLayers = _ref.mapLayers;
11333
+ var foundLayer = mapLayers.find(function (lr) {
11334
+ return lr.name === layer.name && lr.service === serviceId;
11335
+ });
11336
+ return /*#__PURE__*/React.createElement(CustomToggleButton, {
11337
+ "data-testid": "layerAddRemoveButton-".concat(layer.name),
11338
+ onClick: function onClick() {
11339
+ !foundLayer ? addLayer({
11340
+ serviceURL: serviceId,
11341
+ layerName: layer.name
11342
+ }) : deleteLayer({
11343
+ layerId: foundLayer.id,
11344
+ layerIndex: layerIndex
11345
+ });
11346
+ },
11347
+ selected: !!foundLayer,
11348
+ variant: "tool",
11349
+ fullWidth: true
11350
+ }, !foundLayer ? 'Add' : 'Remove');
11351
+ };
11352
+
11342
11353
  /* *
11343
11354
  * Licensed under the Apache License, Version 2.0 (the "License");
11344
11355
  * you may not use this file except in compliance with the License.
@@ -11377,35 +11388,35 @@ var filterLayersFromService = function filterLayersFromService(serviceId, servic
11377
11388
  });
11378
11389
  };
11379
11390
 
11380
- var useStyles$p = makeStyles(function (theme) {
11391
+ var useStyles$n = makeStyles(function (theme) {
11381
11392
  return {
11382
11393
  layerRow: {
11383
- background: theme.palette.geowebColors.background.surface,
11394
+ background: theme.palette.geowebColors.cards.cardContainer,
11384
11395
  padding: '8px 0px 8px 12px',
11385
11396
  marginBottom: '4px',
11386
11397
  height: '64px',
11387
- border: "solid 1px ".concat(theme.palette.geowebColors.cards.cardContainerBorder)
11398
+ border: "solid 1px ".concat(theme.palette.geowebColors.cards.cardContainerBorder),
11399
+ display: 'grid',
11400
+ gridTemplateColumns: '1fr 0.1fr',
11401
+ gridGap: '20px'
11388
11402
  },
11389
11403
  layerText: {
11390
11404
  fontSize: '12px',
11391
11405
  fontWeight: 500,
11392
11406
  overflow: 'clip',
11393
11407
  height: '20px',
11394
- textOverflow: 'ellipsis',
11395
- whiteSpace: 'nowrap'
11408
+ textOverflow: 'ellipsis'
11396
11409
  },
11397
11410
  layerName: {
11398
11411
  fontSize: '12px',
11399
11412
  height: '24px',
11400
- maxWidth: '100%',
11401
11413
  overflow: 'clip',
11402
11414
  "float": 'left',
11403
11415
  paddingTop: '6px',
11404
- textOverflow: 'ellipsis',
11405
11416
  whiteSpace: 'nowrap'
11406
11417
  },
11407
11418
  layerNameMaxWidth: {
11408
- maxWidth: '196px'
11419
+ maxWidth: '270px'
11409
11420
  },
11410
11421
  layerAbstract: {
11411
11422
  fontSize: '10px',
@@ -11416,6 +11427,11 @@ var useStyles$p = makeStyles(function (theme) {
11416
11427
  resultCount: {
11417
11428
  marginBottom: '4px',
11418
11429
  fontSize: '12px'
11430
+ },
11431
+ layerButton: {
11432
+ marginRight: '8px',
11433
+ marginTop: '4px',
11434
+ width: '80px'
11419
11435
  }
11420
11436
  };
11421
11437
  });
@@ -11424,10 +11440,13 @@ var LayerList = function LayerList(_ref) {
11424
11440
  var services = _ref.services,
11425
11441
  serviceIds = _ref.serviceIds,
11426
11442
  layerSelectHeight = _ref.layerSelectHeight,
11443
+ addLayer = _ref.addLayer,
11444
+ deleteLayer = _ref.deleteLayer,
11427
11445
  searchString = _ref.searchString,
11446
+ mapLayers = _ref.mapLayers,
11428
11447
  keywordIds = _ref.keywordIds,
11429
11448
  allKeywordsActive = _ref.allKeywordsActive;
11430
- var classes = useStyles$p();
11449
+ var classes = useStyles$n();
11431
11450
 
11432
11451
  var _React$useState = React.useState(0),
11433
11452
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -11449,12 +11468,14 @@ var LayerList = function LayerList(_ref) {
11449
11468
  overflow: 'auto'
11450
11469
  }
11451
11470
  }, serviceIds.map(function (serviceId) {
11452
- return filterLayersFromService(serviceId, services, keywordIds, allKeywordsActive, searchString).map(function (layer) {
11471
+ return filterLayersFromService(serviceId, services, keywordIds, allKeywordsActive, searchString).map(function (layer, layerIndex) {
11453
11472
  return /*#__PURE__*/React.createElement("div", {
11473
+ key: "".concat(serviceId, "-").concat(layer.name, "-").concat(layer.text)
11474
+ }, /*#__PURE__*/React.createElement("div", {
11454
11475
  key: "".concat(serviceId, "-").concat(layer.name),
11455
11476
  className: classes.layerRow,
11456
11477
  "data-testid": "layerListLayerRow"
11457
- }, /*#__PURE__*/React.createElement("div", {
11478
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
11458
11479
  className: classes.layerText
11459
11480
  }, layer.text), /*#__PURE__*/React.createElement("div", null, layer["abstract"] ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
11460
11481
  className: "".concat(classes.layerName, " ").concat(classes.layerNameMaxWidth)
@@ -11463,7 +11484,16 @@ var LayerList = function LayerList(_ref) {
11463
11484
  "data-testid": "layerAbstract"
11464
11485
  }, layer["abstract"])) : /*#__PURE__*/React.createElement("div", {
11465
11486
  className: classes.layerName
11466
- }, layer.name)));
11487
+ }, layer.name))), /*#__PURE__*/React.createElement("div", {
11488
+ className: classes.layerButton
11489
+ }, /*#__PURE__*/React.createElement(LayerAddRemoveButton, {
11490
+ layer: layer,
11491
+ layerIndex: layerIndex,
11492
+ serviceId: serviceId,
11493
+ addLayer: addLayer,
11494
+ deleteLayer: deleteLayer,
11495
+ mapLayers: mapLayers
11496
+ }))));
11467
11497
  });
11468
11498
  })));
11469
11499
  };
@@ -11486,13 +11516,57 @@ var LayerList = function LayerList(_ref) {
11486
11516
  * */
11487
11517
 
11488
11518
  var LayerListConnect = function LayerListConnect(_ref) {
11489
- var layerSelectHeight = _ref.layerSelectHeight;
11519
+ var mapId = _ref.mapId,
11520
+ layerSelectHeight = _ref.layerSelectHeight;
11490
11521
  var services = useSelector(function (store) {
11491
11522
  return getServices(store);
11492
11523
  });
11524
+ var dispatch = useDispatch();
11493
11525
  var enabledServiceIds = useSelector(function (store) {
11494
11526
  return getEnabledServiceIds(store);
11495
11527
  });
11528
+ var mapLayers = useSelector(function (store) {
11529
+ return getMapLayers(store, mapId);
11530
+ });
11531
+
11532
+ var addLayer$1 = function addLayer(_ref2) {
11533
+ var serviceURL = _ref2.serviceURL,
11534
+ layerName = _ref2.layerName;
11535
+ var layer = {
11536
+ service: serviceURL,
11537
+ name: layerName,
11538
+ id: generateLayerId(),
11539
+ layerType: LayerType$1.mapLayer
11540
+ };
11541
+ addMapLayer({
11542
+ mapId: mapId,
11543
+ layerId: layer.id,
11544
+ layer: layer,
11545
+ origin: 'LayerListConnect'
11546
+ });
11547
+ };
11548
+
11549
+ var addMapLayer = React.useCallback(function (_ref3) {
11550
+ var layerId = _ref3.layerId,
11551
+ layer = _ref3.layer,
11552
+ origin = _ref3.origin;
11553
+ return dispatch(addLayer({
11554
+ mapId: mapId,
11555
+ layerId: layerId,
11556
+ layer: layer,
11557
+ origin: origin
11558
+ }));
11559
+ }, [dispatch, mapId]);
11560
+ var deleteLayer = React.useCallback(function (_ref4) {
11561
+ var layerId = _ref4.layerId,
11562
+ layerIndex = _ref4.layerIndex;
11563
+ return dispatch(layerDelete({
11564
+ mapId: mapId,
11565
+ layerId: layerId,
11566
+ layerIndex: layerIndex,
11567
+ origin: 'LayerListConnect'
11568
+ }));
11569
+ }, [dispatch, mapId]);
11496
11570
  var checkedKeywordIds = useSelector(function (store) {
11497
11571
  return getCheckedKeywordIds(store);
11498
11572
  });
@@ -11506,9 +11580,12 @@ var LayerListConnect = function LayerListConnect(_ref) {
11506
11580
  services: services,
11507
11581
  serviceIds: enabledServiceIds,
11508
11582
  layerSelectHeight: layerSelectHeight,
11583
+ addLayer: addLayer$1,
11584
+ deleteLayer: deleteLayer,
11509
11585
  keywordIds: checkedKeywordIds,
11510
11586
  allKeywordsActive: allKeywordsActive,
11511
- searchString: searchString
11587
+ searchString: searchString,
11588
+ mapLayers: mapLayers
11512
11589
  });
11513
11590
  };
11514
11591
 
@@ -11624,7 +11701,7 @@ var ServiceChipConnect = function ServiceChipConnect(_ref) {
11624
11701
  });
11625
11702
  };
11626
11703
 
11627
- var useStyles$o = makeStyles(function (theme) {
11704
+ var useStyles$m = makeStyles(function (theme) {
11628
11705
  return createStyles({
11629
11706
  serviceChips: {
11630
11707
  width: '100%',
@@ -11648,7 +11725,7 @@ var useStyles$o = makeStyles(function (theme) {
11648
11725
  fontSize: '0.875rem'
11649
11726
  },
11650
11727
  scrollArrowLeft: {
11651
- width: '120px',
11728
+ width: '100px',
11652
11729
  marginBottom: '-12px',
11653
11730
  height: '34px',
11654
11731
  backgroundImage: "linear-gradient(to left, rgba(0, 0, 0, 0), ".concat(theme.palette.geowebColors.background.surfaceApp, " 51%)"),
@@ -11656,7 +11733,10 @@ var useStyles$o = makeStyles(function (theme) {
11656
11733
  marginRight: '-120px',
11657
11734
  "float": 'left',
11658
11735
  zIndex: 1,
11659
- position: 'relative'
11736
+ position: 'relative',
11737
+ '&:hover': {
11738
+ color: theme.palette.geowebColors.buttons.tertiary.activeMouseOver.color
11739
+ }
11660
11740
  },
11661
11741
  serviceList: {
11662
11742
  height: '32px',
@@ -11665,13 +11745,16 @@ var useStyles$o = makeStyles(function (theme) {
11665
11745
  overflow: 'hidden'
11666
11746
  },
11667
11747
  scrollArrowRight: {
11668
- width: '120px',
11748
+ width: '100px',
11669
11749
  marginBottom: '-12px',
11670
11750
  height: '34px',
11671
11751
  backgroundImage: "linear-gradient(to right, rgba(0, 0, 0, 0), ".concat(theme.palette.geowebColors.background.surfaceApp, " 51%)"),
11672
11752
  right: '0px',
11673
11753
  position: 'fixed',
11674
- cursor: 'pointer'
11754
+ cursor: 'pointer',
11755
+ '&:hover': {
11756
+ color: theme.palette.geowebColors.buttons.tertiary.activeMouseOver.color
11757
+ }
11675
11758
  }
11676
11759
  });
11677
11760
  });
@@ -11699,7 +11782,7 @@ var ServiceList = function ServiceList(_ref4) {
11699
11782
  var ref = React.useRef(null);
11700
11783
  var scrollSpeed = 5;
11701
11784
  var maxWidthValue = ref && ref.current && ref.current.scrollWidth && ref.current.scrollWidth >= layerSelectWidth - margin && ref.current.scrollWidth || layerSelectWidth - 50;
11702
- var classes = useStyles$o({
11785
+ var classes = useStyles$m({
11703
11786
  margin: margin,
11704
11787
  maxWidthValue: maxWidthValue
11705
11788
  });
@@ -11813,63 +11896,49 @@ var ServiceListConnect = function ServiceListConnect(_ref) {
11813
11896
  });
11814
11897
  };
11815
11898
 
11816
- var useStyles$n = makeStyles(function (theme) {
11817
- return createStyles({
11818
- servicesContainer: {
11819
- width: '300px',
11820
- maxHeight: '380px',
11821
- top: '140px',
11822
- backgroundColor: theme.palette.geowebColors.background.surface,
11823
- boxShadow: theme.shadows[6],
11824
- overflow: 'auto'
11825
- },
11826
- header: {
11827
- position: 'sticky',
11828
- top: 0,
11829
- fontSize: theme.typography.fontSize,
11830
- padding: '12px',
11831
- backgroundColor: theme.palette.geowebColors.background.surface,
11832
- zIndex: 100
11833
- },
11834
- footer: {
11835
- display: 'flex',
11836
- justifyContent: 'center',
11837
- alignItems: 'center',
11838
- position: 'sticky',
11839
- bottom: 0,
11840
- backgroundColor: theme.palette.geowebColors.background.surface,
11841
- zIndex: 100
11842
- },
11843
- iconFill: {
11844
- color: theme.palette.geowebColors.typographyAndIcons.icon
11845
- },
11846
- button: {
11847
- margin: '16px',
11848
- width: '80%',
11849
- fontSize: '12px',
11850
- textTransform: 'none'
11851
- },
11852
- text: {
11853
- paddingTop: '3px',
11854
- fontSize: '12px',
11855
- fontFamily: theme.typography.fontFamily,
11856
- fontWeight: theme.typography.fontWeightRegular,
11857
- textTransform: 'none',
11858
- color: '#575f7a'
11859
- },
11860
- icon: {
11861
- width: '24px',
11862
- height: '24px'
11863
- }
11864
- });
11865
- });
11899
+ var styles = {
11900
+ servicesContainer: {
11901
+ width: '300px',
11902
+ maxHeight: '380px',
11903
+ top: '140px',
11904
+ backgroundColor: 'geowebColors.background.surface',
11905
+ boxShadow: 6,
11906
+ overflow: 'auto'
11907
+ },
11908
+ header: {
11909
+ position: 'sticky',
11910
+ top: 0,
11911
+ fontSize: 'default',
11912
+ padding: '12px',
11913
+ backgroundColor: 'geowebColors.background.surface',
11914
+ zIndex: 100
11915
+ },
11916
+ footer: {
11917
+ display: 'flex',
11918
+ justifyContent: 'center',
11919
+ alignItems: 'center',
11920
+ position: 'sticky',
11921
+ bottom: 0,
11922
+ backgroundColor: 'geowebColors.background.surface',
11923
+ zIndex: 100
11924
+ },
11925
+ button: {
11926
+ margin: '16px',
11927
+ width: '80%',
11928
+ fontSize: '12px',
11929
+ textTransform: 'none'
11930
+ },
11931
+ icon: {
11932
+ width: '24px',
11933
+ height: '24px'
11934
+ }
11935
+ };
11866
11936
 
11867
11937
  var ServiceOptionsDialog = function ServiceOptionsDialog(_ref) {
11868
11938
  var services = _ref.services,
11869
11939
  mapStoreRemoveService = _ref.mapStoreRemoveService,
11870
11940
  _ref$layers = _ref.layers,
11871
11941
  layers = _ref$layers === void 0 ? [] : _ref$layers;
11872
- var classes = useStyles$n();
11873
11942
 
11874
11943
  var _React$useState = React.useState(false),
11875
11944
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -11887,15 +11956,17 @@ var ServiceOptionsDialog = function ServiceOptionsDialog(_ref) {
11887
11956
  var isDisabled = function isDisabled(service) {
11888
11957
  return layers.some(function (layer) {
11889
11958
  return layer.service && layer.service.includes(service);
11959
+ }) || preloadedDefaultMapServices.some(function (defaultMapService) {
11960
+ return defaultMapService.url && defaultMapService.url.includes(service);
11890
11961
  });
11891
11962
  };
11892
11963
 
11893
11964
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, {
11894
- className: classes.servicesContainer,
11965
+ sx: styles.servicesContainer,
11895
11966
  "data-testid": "ServiceDialog"
11896
- }, /*#__PURE__*/React.createElement("div", {
11897
- className: classes.header
11898
- }, " Services"), /*#__PURE__*/React.createElement(List, {
11967
+ }, /*#__PURE__*/React.createElement(Box, {
11968
+ sx: styles.header
11969
+ }, "Services"), /*#__PURE__*/React.createElement(List, {
11899
11970
  disablePadding: true
11900
11971
  }, services.map(function (service) {
11901
11972
  return /*#__PURE__*/React.createElement(ListItem, {
@@ -11916,14 +11987,14 @@ var ServiceOptionsDialog = function ServiceOptionsDialog(_ref) {
11916
11987
  }
11917
11988
  }, /*#__PURE__*/React.createElement(Tooltip, {
11918
11989
  title: "Edit Service"
11919
- }, /*#__PURE__*/React.createElement(IconButton, {
11990
+ }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(IconButton, {
11991
+ disabled: isDisabled(service.service),
11920
11992
  "data-testid": "openEditServiceButton",
11921
11993
  size: "large"
11922
11994
  }, /*#__PURE__*/React.createElement(SvgIcon, null, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
11923
11995
  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
- fill: classes.iconFill,
11925
11996
  fillRule: "evenodd"
11926
- }))))), /*#__PURE__*/React.createElement(Tooltip, {
11997
+ })))))), /*#__PURE__*/React.createElement(Tooltip, {
11927
11998
  title: "Delete Service"
11928
11999
  }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(IconButton, {
11929
12000
  size: "large",
@@ -11934,18 +12005,17 @@ var ServiceOptionsDialog = function ServiceOptionsDialog(_ref) {
11934
12005
  "data-testid": "removeServiceButton"
11935
12006
  }, /*#__PURE__*/React.createElement(SvgIcon, null, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
11936
12007
  d: "M17.504 8.228c.588 0 1.027.48.973 1.066l-.876 9.64A1.197 1.197 0 0 1 16.434 20H8.41c-.59 0-1.115-.48-1.167-1.066l-.877-9.64a.962.962 0 0 1 .973-1.066zm-2.115 1.228a.82.82 0 0 0-.819.82v7.674a.818.818 0 0 0 1.638 0v-7.675a.819.819 0 0 0-.819-.819zm-2.968 0a.819.819 0 0 0-.819.82v7.674a.818.818 0 1 0 1.638 0v-7.675a.82.82 0 0 0-.82-.819zm-2.968 0a.819.819 0 0 0-.818.82v7.674a.818.818 0 1 0 1.637 0v-7.675a.82.82 0 0 0-.82-.819zM13.432 4c.21 0 .404.168.436.376l.107.758 3.256-.01a1.606 1.606 0 0 1 1.61 1.6l.001.535-12.841.038L6 6.76a1.605 1.605 0 0 1 1.6-1.61l3.262-.008.103-.758a.454.454 0 0 1 .434-.38z",
11937
- fill: classes.iconFill,
11938
12008
  fillRule: "evenodd"
11939
12009
  }))))))));
11940
- })), /*#__PURE__*/React.createElement("div", {
11941
- className: classes.footer
12010
+ })), /*#__PURE__*/React.createElement(Box, {
12011
+ sx: styles.footer
11942
12012
  }, /*#__PURE__*/React.createElement(Button, {
11943
12013
  onClick: openAddService,
11944
12014
  "data-testid": "openAddServiceButton",
11945
- className: classes.button,
12015
+ sx: styles.button,
11946
12016
  variant: "tertiary",
11947
12017
  startIcon: /*#__PURE__*/React.createElement(SvgIcon, {
11948
- className: classes.icon
12018
+ sx: styles.icon
11949
12019
  }, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
11950
12020
  d: "M13.647 13.647h6.82a1.276 1.276 0 1 0 0-2.552h-6.82v-6.82a1.276 1.276 0 1 0-2.552 0v6.82h-6.82a1.276 1.276 0 1 0 0 2.552h6.82v6.82a1.274 1.274 0 0 0 1.276 1.275c.705 0 1.276-.571 1.276-1.276v-6.82z",
11951
12021
  fillRule: "evenodd"
@@ -11994,49 +12064,28 @@ var ServiceOptionsDialogConnect = function ServiceOptionsDialogConnect() {
11994
12064
  });
11995
12065
  };
11996
12066
 
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
- });
12067
+ /* *
12068
+ * Licensed under the Apache License, Version 2.0 (the "License");
12069
+ * you may not use this file except in compliance with the License.
12070
+ * You may obtain a copy of the License at
12071
+ *
12072
+ * http://www.apache.org/licenses/LICENSE-2.0
12073
+ *
12074
+ * Unless required by applicable law or agreed to in writing, software
12075
+ * distributed under the License is distributed on an "AS IS" BASIS,
12076
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12077
+ * See the License for the specific language governing permissions and
12078
+ * limitations under the License.
12079
+ *
12080
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
12081
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
12082
+ * */
12012
12083
 
12013
12084
  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);
12085
+ return /*#__PURE__*/React.createElement(ToggleMenu, {
12086
+ buttonTestId: "serviceOptionsButton",
12087
+ menuPosition: "bottom"
12088
+ }, /*#__PURE__*/React.createElement(ServiceOptionsDialogConnect, null));
12040
12089
  };
12041
12090
 
12042
12091
  var useStyles$l = makeStyles({
@@ -12129,6 +12178,7 @@ var LayerSelect = function LayerSelect(_ref) {
12129
12178
  })), /*#__PURE__*/React.createElement("div", {
12130
12179
  className: classes.layerSelectContainer
12131
12180
  }, /*#__PURE__*/React.createElement(LayerListConnect, {
12181
+ mapId: mapId,
12132
12182
  layerSelectHeight: height
12133
12183
  })));
12134
12184
  };
@@ -14965,13 +15015,15 @@ var isColorIntervalEven = function isColorIntervalEven(scale, timestep) {
14965
15015
  }
14966
15016
  };
14967
15017
 
14968
- var drawBackground = function drawBackground(context, theme, visibleTimeStart, visibleTimeEnd, canvasWidth, height, scale) {
15018
+ var drawBackground = function drawBackground(context, theme, visibleTimeStart, visibleTimeEnd, animationStartPx, animationEndPx, canvasWidth, height, scale) {
14969
15019
  var ctx = context;
14970
15020
  var _theme$palette$geoweb7 = theme.palette.geowebColors.timeSlider,
14971
15021
  timelineTimelineSurface = _theme$palette$geoweb7.timelineTimelineSurface,
14972
15022
  timelineNightTime = _theme$palette$geoweb7.timelineNightTime;
14973
15023
  ctx.fillStyle = timelineTimelineSurface.fill;
14974
15024
  ctx.fillRect(0, 0, canvasWidth, height);
15025
+ ctx.fillStyle = theme.palette.geowebColors.timeSlider.timelineSelectionBackground.rgba;
15026
+ ctx.fillRect(animationStartPx, 0, Math.max(animationEndPx - animationStartPx, 0), height);
14975
15027
  var colorChangeUnit = getColorChangeTimestepUnit(scale);
14976
15028
 
14977
15029
  var _getCustomRoundedStar = getCustomRoundedStartAndEnd(visibleTimeStart, visibleTimeEnd, colorChangeUnit),
@@ -15070,7 +15122,7 @@ var drawTimeScale = function drawTimeScale(context, theme, visibleTimeStart, vis
15070
15122
  drawLeftSideDateText(ctx, theme, dateText, height);
15071
15123
  };
15072
15124
 
15073
- var renderTimeSliderLegend = function renderTimeSliderLegend(context, theme, canvasWidth, height, centerTime, secondsPerPx, dataScaleToSecondsPerPx, selectedTimeUnix, scale, currentTimeUnix) {
15125
+ var renderTimeSliderLegend = function renderTimeSliderLegend(context, theme, canvasWidth, height, centerTime, secondsPerPx, dataScaleToSecondsPerPx, selectedTimeUnix, scale, currentTimeUnix, animationStartTime, animationEndTime) {
15074
15126
  var ctx = context;
15075
15127
 
15076
15128
  var _map3 = [0, canvasWidth].map(function (px) {
@@ -15080,7 +15132,14 @@ var renderTimeSliderLegend = function renderTimeSliderLegend(context, theme, can
15080
15132
  visibleTimeStart = _map4[0],
15081
15133
  visibleTimeEnd = _map4[1];
15082
15134
 
15083
- drawBackground(ctx, theme, visibleTimeStart, visibleTimeEnd, canvasWidth, height, scale);
15135
+ var _map5 = [animationStartTime, animationEndTime].map(function (time) {
15136
+ return timestampToPixel(time, centerTime, canvasWidth, secondsPerPx);
15137
+ }),
15138
+ _map6 = _slicedToArray(_map5, 2),
15139
+ animationStartPx = _map6[0],
15140
+ animationEndPx = _map6[1];
15141
+
15142
+ drawBackground(ctx, theme, visibleTimeStart, visibleTimeEnd, animationStartPx, animationEndPx, canvasWidth, height, scale);
15084
15143
  drawTimeScale(ctx, theme, visibleTimeStart, visibleTimeEnd, canvasWidth, height, scale, dataScaleToSecondsPerPx);
15085
15144
  drawNeedle(ctx, theme, canvasWidth, height, visibleTimeStart, visibleTimeEnd, selectedTimeUnix);
15086
15145
  drawCurrentTime(ctx, theme, canvasWidth, height, visibleTimeStart, visibleTimeEnd, currentTimeUnix);
@@ -15483,6 +15542,12 @@ var getNextSecondsPerPxValue = function getNextSecondsPerPxValue(direction, oldS
15483
15542
 
15484
15543
  var NEEDLE_HANDLE_WIDTH = 10;
15485
15544
  var LEFT_MOUSE_BTN = 1;
15545
+ var THROTTLE_WAIT_TIME = 500; // [ms]
15546
+
15547
+ var THROTTLE_OPTIONS = {
15548
+ trailing: false // Invoke function when called, but not more than once every <THROTTLE_WAIT_TIME>.
15549
+
15550
+ };
15486
15551
 
15487
15552
  var TimeSliderLegend = function TimeSliderLegend(_ref) {
15488
15553
  var centerTime = _ref.centerTime,
@@ -15495,6 +15560,8 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
15495
15560
  currentTime = _ref.currentTime,
15496
15561
  dataStartTime = _ref.dataStartTime,
15497
15562
  dataEndTime = _ref.dataEndTime,
15563
+ animationStartTime = _ref.animationStartTime,
15564
+ animationEndTime = _ref.animationEndTime,
15498
15565
  isTimeSliderHoverOn = _ref.isTimeSliderHoverOn,
15499
15566
  timeStep = _ref.timeStep,
15500
15567
  onSetNewDate = _ref.onSetNewDate,
@@ -15522,6 +15589,20 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
15522
15589
  isNewSelectionTimeRequested = _React$useState6[0],
15523
15590
  setNewSelectionTimeRequested = _React$useState6[1];
15524
15591
 
15592
+ var _React$useState7 = React.useState(animationStartTime && moment.utc(animationStartTime).unix()),
15593
+ _React$useState8 = _slicedToArray(_React$useState7, 2),
15594
+ localAnimationStartTime = _React$useState8[0],
15595
+ setLocalAnimationStartTime = _React$useState8[1];
15596
+
15597
+ var _React$useState9 = React.useState(animationEndTime && moment.utc(animationEndTime).unix()),
15598
+ _React$useState10 = _slicedToArray(_React$useState9, 2),
15599
+ localAnimationEndTime = _React$useState10[0],
15600
+ setLocalAnimationEndTime = _React$useState10[1];
15601
+
15602
+ React.useEffect(function () {
15603
+ setLocalAnimationStartTime(animationStartTime && moment.utc(animationStartTime).unix());
15604
+ setLocalAnimationEndTime(animationEndTime && moment.utc(animationEndTime).unix());
15605
+ }, [animationStartTime, animationEndTime]);
15525
15606
  React.useEffect(function () {
15526
15607
  var handleKeyDown = function handleKeyDown(event) {
15527
15608
  if (event.key === 'Home') {
@@ -15551,7 +15632,21 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
15551
15632
  setNewRoundedTime(x, centerTime, width, secondsPerPx, timeStep, dataStartTime, dataEndTime, onSetNewDate);
15552
15633
  };
15553
15634
 
15554
- var theme = useTheme();
15635
+ var theme = useTheme(); // eslint-disable-next-line react-hooks/exhaustive-deps
15636
+
15637
+ var throttledZoom = React.useCallback(throttle(function (newSecondsPerPx, newCenterTime) {
15638
+ onZoom(newSecondsPerPx, newCenterTime);
15639
+ }, THROTTLE_WAIT_TIME, THROTTLE_OPTIONS), []);
15640
+
15641
+ var zoom = function zoom(deltaY, deltaX, canvasWidth, mouseX) {
15642
+ if (!onZoom) return;
15643
+ var direction = deltaY || deltaX;
15644
+ var newSecondsPerPx = getNextSecondsPerPxValue(Math.sign(direction), secondsPerPx, dataScaleToSecondsPerPx);
15645
+ var mouseTime = pixelToTimestamp(mouseX, centerTime, canvasWidth, secondsPerPx);
15646
+ var newCenterTime = getNewCenterOfFixedPointZoom(mouseTime, secondsPerPx, newSecondsPerPx, centerTime);
15647
+ throttledZoom(newSecondsPerPx, newCenterTime);
15648
+ };
15649
+
15555
15650
  return /*#__PURE__*/React.createElement("div", {
15556
15651
  className: classes.timeSliderLegend,
15557
15652
  "data-testid": "timeSliderLegend"
@@ -15583,12 +15678,7 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
15583
15678
  deltaX = _ref2.deltaX,
15584
15679
  canvasWidth = _ref2.canvasWidth,
15585
15680
  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);
15681
+ zoom(deltaY, deltaX, canvasWidth, mouseX);
15592
15682
  },
15593
15683
  onMouseDown: function onMouseDown(x, y, width) {
15594
15684
  setDragged(false);
@@ -15610,7 +15700,7 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
15610
15700
  }
15611
15701
  },
15612
15702
  onRenderCanvas: function onRenderCanvas(ctx, width, height) {
15613
- renderTimeSliderLegend(ctx, theme, width, height, centerTime, secondsPerPx, dataScaleToSecondsPerPx, selectedTime, scale, currentTime);
15703
+ renderTimeSliderLegend(ctx, theme, width, height, centerTime, secondsPerPx, dataScaleToSecondsPerPx, selectedTime, scale, currentTime, localAnimationStartTime, localAnimationEndTime);
15614
15704
  }
15615
15705
  }));
15616
15706
  };
@@ -15902,6 +15992,9 @@ var drawPlayerLoopIcon = function drawPlayerLoopIcon(ctx, x, y, theme) {
15902
15992
  var svgIconPath = new Path2D('M8.843 1.029c-.56 0-.814.362-.814.699 0 .179.065.36.19.54l3.06 4.34c.065.093.14.171.221.234v8.373c-.082.064-.156.142-.22.234L8.219 19.79c-.125.18-.19.361-.19.54 0 .337.255.699.814.699h6.373c.56 0 .813-.361.813-.7 0-.178-.064-.36-.19-.538l-3.06-4.343c-.08-.112-.174-.204-.278-.273V6.883c.104-.069.199-.16.278-.273l3.06-4.343c.126-.179.19-.36.19-.539 0-.338-.254-.7-.813-.7z');
15903
15993
  ctx.fillStyle = playerTimeMarkers.fill;
15904
15994
  ctx.fill(svgIconPath);
15995
+ ctx.strokeStyle = theme.palette.geowebColors.timeSlider.playerNeedlePlayer.rgba;
15996
+ ctx.lineWidth = 1;
15997
+ ctx.stroke(svgIconPath);
15905
15998
  ctx.restore();
15906
15999
  };
15907
16000
 
@@ -16678,10 +16771,10 @@ var OptionsMenuButtonConnect = function OptionsMenuButtonConnect(_ref) {
16678
16771
  var animationIntervalDefault = 5;
16679
16772
  var connectRedux$3 = connect(function (store, props) {
16680
16773
  return {
16681
- isAnimating: isAnimating(store, props.mapId),
16682
16774
  animationStartTime: getAnimationStartTime(store, props.mapId),
16683
16775
  animationEndTime: getAnimationEndTime(store, props.mapId),
16684
- timeStep: getMapTimeStep(store, props.mapId)
16776
+ timeStep: getMapTimeStep(store, props.mapId),
16777
+ linkedMapAnimationInfo: linkedMapAnimationInfo(store, props.mapId)
16685
16778
  };
16686
16779
  }, {
16687
16780
  mapStartAnimation: mapStartAnimation,
@@ -16689,19 +16782,19 @@ var connectRedux$3 = connect(function (store, props) {
16689
16782
  });
16690
16783
  var PlayButtonConnect = connectRedux$3(function (_ref) {
16691
16784
  var mapId = _ref.mapId,
16692
- isAnimating = _ref.isAnimating,
16693
16785
  animationStartTime = _ref.animationStartTime,
16694
16786
  animationEndTime = _ref.animationEndTime,
16695
16787
  isDisabled = _ref.isDisabled,
16696
16788
  timeStep = _ref.timeStep,
16789
+ linkedMapAnimationInfo = _ref.linkedMapAnimationInfo,
16697
16790
  mapStartAnimation = _ref.mapStartAnimation,
16698
16791
  mapStopAnimation = _ref.mapStopAnimation;
16699
16792
  var animationInterval = timeStep || animationIntervalDefault;
16700
16793
 
16701
16794
  var onTogglePlay = function onTogglePlay() {
16702
- if (isAnimating) {
16795
+ if (linkedMapAnimationInfo.isAnimating) {
16703
16796
  mapStopAnimation({
16704
- mapId: mapId
16797
+ mapId: linkedMapAnimationInfo.id
16705
16798
  });
16706
16799
  } else {
16707
16800
  mapStartAnimation({
@@ -16714,7 +16807,7 @@ var PlayButtonConnect = connectRedux$3(function (_ref) {
16714
16807
  };
16715
16808
 
16716
16809
  return /*#__PURE__*/React__default.createElement(PlayButton, {
16717
- isAnimating: isAnimating,
16810
+ isAnimating: linkedMapAnimationInfo.isAnimating,
16718
16811
  isDisabled: isDisabled,
16719
16812
  onTogglePlayButton: function onTogglePlayButton() {
16720
16813
  onTogglePlay();
@@ -16771,52 +16864,6 @@ var TimeSliderButtonsConnect = function TimeSliderButtonsConnect(_ref) {
16771
16864
  });
16772
16865
  };
16773
16866
 
16774
- /* *
16775
- * Licensed under the Apache License, Version 2.0 (the "License");
16776
- * you may not use this file except in compliance with the License.
16777
- * You may obtain a copy of the License at
16778
- *
16779
- * http://www.apache.org/licenses/LICENSE-2.0
16780
- *
16781
- * Unless required by applicable law or agreed to in writing, software
16782
- * distributed under the License is distributed on an "AS IS" BASIS,
16783
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16784
- * See the License for the specific language governing permissions and
16785
- * limitations under the License.
16786
- *
16787
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16788
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
16789
- * */
16790
-
16791
- var synchronizationGroupStore = function synchronizationGroupStore(store) {
16792
- return store && store.syncronizationGroupStore ? store.syncronizationGroupStore : null;
16793
- };
16794
-
16795
- var getSynchronizationGroupStore = createSelector(synchronizationGroupStore, function (store) {
16796
- return store;
16797
- });
16798
- /**
16799
- * Returns the synchronization source by id
16800
- * @param store The app store
16801
- * @param id The source id to find
16802
- */
16803
-
16804
- var getSyncSourceBySourceId = function getSyncSourceBySourceId(state, id) {
16805
- if (state && state.sources) {
16806
- var sources = state.sources;
16807
-
16808
- if (sources.byId[id]) {
16809
- return sources.byId[id];
16810
- }
16811
- }
16812
-
16813
- return null;
16814
- };
16815
-
16816
- var getTime = createSelector(getSyncSourceBySourceId, function (store) {
16817
- return store && store.payloadByType && store.payloadByType[SYNCGROUPS_TYPE_SETTIME] ? store.payloadByType[SYNCGROUPS_TYPE_SETTIME].value : null;
16818
- });
16819
-
16820
16867
  var connectRedux$2 = connect(function (store, props) {
16821
16868
  return {
16822
16869
  layers: getMapLayers(store, props.mapId),
@@ -16828,7 +16875,9 @@ var connectRedux$2 = connect(function (store, props) {
16828
16875
  isAnimating: isAnimating(store, props.mapId),
16829
16876
  timeStep: getMapTimeStep(store, props.mapId),
16830
16877
  isTimeSliderHoverOn: isTimeSliderHoverOn(store, props.mapId),
16831
- timeValue: getTime(getSynchronizationGroupStore(store), props.sourceId)
16878
+ timeValue: getTime(getSynchronizationGroupStore(store), props.sourceId),
16879
+ animationStartTime: getAnimationStartTime(store, props.mapId),
16880
+ animationEndTime: getAnimationEndTime(store, props.mapId)
16832
16881
  };
16833
16882
  }, {
16834
16883
  stopMapAnimation: mapStopAnimation,
@@ -16851,6 +16900,8 @@ var TimeSliderLegendConnect = function TimeSliderLegendConnect(_ref) {
16851
16900
  isAnimating = _ref.isAnimating,
16852
16901
  timeStep = _ref.timeStep,
16853
16902
  isTimeSliderHoverOn = _ref.isTimeSliderHoverOn,
16903
+ animationStartTime = _ref.animationStartTime,
16904
+ animationEndTime = _ref.animationEndTime,
16854
16905
  stopMapAnimation = _ref.stopMapAnimation,
16855
16906
  setTime = _ref.setTime,
16856
16907
  syncGroupAddSource = _ref.syncGroupAddSource,
@@ -16889,6 +16940,8 @@ var TimeSliderLegendConnect = function TimeSliderLegendConnect(_ref) {
16889
16940
  isTimeSliderHoverOn: isTimeSliderHoverOn,
16890
16941
  dataStartTime: dataStartTime,
16891
16942
  dataEndTime: dataEndTime,
16943
+ animationStartTime: animationStartTime,
16944
+ animationEndTime: animationEndTime,
16892
16945
  timeStep: timeStep,
16893
16946
  onSetNewDate: function onSetNewDate(newDate) {
16894
16947
  if (isAnimating) {
@@ -17312,7 +17365,7 @@ var eumetviewEUMETSAT = {
17312
17365
  };
17313
17366
  var ECMWFPublicService = {
17314
17367
  name: 'ECMWF',
17315
- url: 'https://apps.ecmwf.int/wms/?token=public',
17368
+ url: 'https://eccharts.ecmwf.int/wms/?token=public',
17316
17369
  id: 'ecmwf'
17317
17370
  };
17318
17371
  var MeteoCanada = {
@@ -20742,6 +20795,14 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
20742
20795
  });
20743
20796
  }
20744
20797
  }
20798
+ /* Set disable map pin */
20799
+
20800
+
20801
+ if (!prevProps || prevProps.disableMapPin !== props.disableMapPin) {
20802
+ if (!(props.disableMapPin === undefined)) {
20803
+ this.adaguc.webMapJS.getMapPin().toggleDisableMapPin();
20804
+ }
20805
+ }
20745
20806
  /* Change the animation delay */
20746
20807
 
20747
20808
 
@@ -21410,6 +21471,9 @@ var MapViewConnect = function MapViewConnect(_a) {
21410
21471
  var mapPinLocation = useSelector(function (store) {
21411
21472
  return getPinLocation(store, mapId);
21412
21473
  });
21474
+ var disableMapPin = useSelector(function (store) {
21475
+ return getDisableMapPin(store, mapId);
21476
+ });
21413
21477
  var dispatch = useDispatch();
21414
21478
  var map = getWMJSMapById(mapId);
21415
21479
  var mapChangeDimension$1 = React.useCallback(function (mapDimensionPayload) {
@@ -21481,6 +21545,7 @@ var MapViewConnect = function MapViewConnect(_a) {
21481
21545
  activeLayerId: activeLayerId,
21482
21546
  animationDelay: animationDelay,
21483
21547
  displayMapPin: displayMapPin,
21548
+ disableMapPin: disableMapPin,
21484
21549
  onMapChangeDimension: function onMapChangeDimension(mapDimensionPayload) {
21485
21550
  if (mapDimensionPayload && mapDimensionPayload.dimension && mapDimensionPayload.dimension.name && mapDimensionPayload.dimension.name === 'time') {
21486
21551
  setTime$1({
@@ -22086,7 +22151,9 @@ var ConfigurableConnectedMap = function ConfigurableConnectedMap(_ref) {
22086
22151
  _ref$shouldShowZoomCo = _ref.shouldShowZoomControls,
22087
22152
  shouldShowZoomControls = _ref$shouldShowZoomCo === void 0 ? false : _ref$shouldShowZoomCo,
22088
22153
  _ref$displayMapPin = _ref.displayMapPin,
22089
- displayMapPin = _ref$displayMapPin === void 0 ? false : _ref$displayMapPin;
22154
+ displayMapPin = _ref$displayMapPin === void 0 ? false : _ref$displayMapPin,
22155
+ toggleTimestepAuto$1 = _ref.toggleTimestepAuto,
22156
+ setTimestep = _ref.setTimestep;
22090
22157
  var classes = useStyles$4();
22091
22158
  var dispatch = useDispatch();
22092
22159
  var mapId = React__default.useRef(id || generateMapId()).current;
@@ -22155,6 +22222,22 @@ var ConfigurableConnectedMap = function ConfigurableConnectedMap(_ref) {
22155
22222
  timestepAuto: false
22156
22223
  }));
22157
22224
  }
22225
+ } // Set timestep auto based on preset
22226
+
22227
+
22228
+ if (toggleTimestepAuto$1 !== undefined && shouldAnimate !== true) {
22229
+ dispatch(toggleTimestepAuto({
22230
+ mapId: mapId,
22231
+ timestepAuto: toggleTimestepAuto$1
22232
+ }));
22233
+ } // Set timestep value based on preset
22234
+
22235
+
22236
+ if (setTimestep !== undefined && shouldAnimate !== true) {
22237
+ dispatch(setTimeStep({
22238
+ mapId: mapId,
22239
+ timeStep: setTimestep
22240
+ }));
22158
22241
  } // eslint-disable-next-line react-hooks/exhaustive-deps
22159
22242
 
22160
22243
  }, []);
@@ -22501,7 +22584,11 @@ var ConfigurableMapWithSliderConnect = function ConfigurableMapWithSliderConnect
22501
22584
  _ref$animationPayload = _ref.animationPayload,
22502
22585
  animationPayload = _ref$animationPayload === void 0 ? undefined : _ref$animationPayload,
22503
22586
  _ref$displayMapPin = _ref.displayMapPin,
22504
- displayMapPin = _ref$displayMapPin === void 0 ? false : _ref$displayMapPin;
22587
+ displayMapPin = _ref$displayMapPin === void 0 ? false : _ref$displayMapPin,
22588
+ _ref$showTimeSlider = _ref.showTimeSlider,
22589
+ showTimeSlider = _ref$showTimeSlider === void 0 ? true : _ref$showTimeSlider,
22590
+ toggleTimestepAuto = _ref.toggleTimestepAuto,
22591
+ setTimestep = _ref.setTimestep;
22505
22592
  var classes = useStyles$2();
22506
22593
  return /*#__PURE__*/React__default.createElement("div", {
22507
22594
  className: classes.mapSliderConnect,
@@ -22510,7 +22597,7 @@ var ConfigurableMapWithSliderConnect = function ConfigurableMapWithSliderConnect
22510
22597
  className: classes.zoomControls
22511
22598
  }, /*#__PURE__*/React__default.createElement(ZoomControlConnect, {
22512
22599
  mapId: id
22513
- })), /*#__PURE__*/React__default.createElement("div", {
22600
+ })), showTimeSlider && /*#__PURE__*/React__default.createElement("div", {
22514
22601
  className: classes.timeSlider
22515
22602
  }, /*#__PURE__*/React__default.createElement(TimeSliderConnect, {
22516
22603
  mapId: id,
@@ -22528,7 +22615,9 @@ var ConfigurableMapWithSliderConnect = function ConfigurableMapWithSliderConnect
22528
22615
  shouldAnimate: shouldAnimate,
22529
22616
  animationPayload: animationPayload,
22530
22617
  shouldShowZoomControls: shouldShowZoomControls,
22531
- displayMapPin: displayMapPin
22618
+ displayMapPin: displayMapPin,
22619
+ toggleTimestepAuto: toggleTimestepAuto,
22620
+ setTimestep: setTimestep
22532
22621
  }));
22533
22622
  };
22534
22623
 
@@ -22747,11 +22836,7 @@ var SyncGroupList = function SyncGroupList(_ref) {
22747
22836
  return removeGroup(groupObject.id);
22748
22837
  },
22749
22838
  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, {
22839
+ }, index === 0 ? /*#__PURE__*/React.createElement(Add, null) : /*#__PURE__*/React.createElement(DeleteForever, null)))), /*#__PURE__*/React.createElement(SyncGroupListItem, {
22755
22840
  viewStateData: viewStateData,
22756
22841
  groupId: groupObject.id,
22757
22842
  selected: groupObject.selected,
@@ -22777,110 +22862,10 @@ var useStyles = makeStyles(function (theme) {
22777
22862
  backgroundColor: theme.palette.geowebColors.syncGroups.drawerOpen.fill,
22778
22863
  boxShadow: 'inset 0px 7px 7px -7px, inset 0px -7px 7px -7px',
22779
22864
  color: '#000000'
22780
- },
22781
- iconColor: {
22782
- color: theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat
22783
22865
  }
22784
22866
  });
22785
22867
  });
22786
22868
 
22787
- /* *
22788
- * Licensed under the Apache License, Version 2.0 (the "License");
22789
- * you may not use this file except in compliance with the License.
22790
- * You may obtain a copy of the License at
22791
- *
22792
- * http://www.apache.org/licenses/LICENSE-2.0
22793
- *
22794
- * Unless required by applicable law or agreed to in writing, software
22795
- * distributed under the License is distributed on an "AS IS" BASIS,
22796
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22797
- * See the License for the specific language governing permissions and
22798
- * limitations under the License.
22799
- *
22800
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
22801
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
22802
- * */
22803
- var emptyState = {
22804
- timeslider: {
22805
- groups: [],
22806
- sourcesById: []
22807
- },
22808
- zoompane: {
22809
- groups: [],
22810
- sourcesById: []
22811
- },
22812
- level: {
22813
- groups: [],
22814
- sourcesById: []
22815
- }
22816
- };
22817
- var groupTypes = [{
22818
- title: 'Timeslider',
22819
- syncType: 'SYNCGROUPS_TYPE_SETTIME',
22820
- groupType: 'timeslider'
22821
- }, {
22822
- title: 'Zoompane',
22823
- syncType: 'SYNCGROUPS_TYPE_SETBBOX',
22824
- groupType: 'zoompane'
22825
- }];
22826
- /*
22827
- _____ Creates viewState _____
22828
- - Runs Each time viewState is created:
22829
- - Fill arrays inside initialState with objects containing new values from Redux
22830
- */
22831
-
22832
- var createSyncGroupViewState = function createSyncGroupViewState(syncState) {
22833
- var initialState = produce(emptyState, function (draft) {
22834
- /*
22835
- _____ 1. Fill groups _____
22836
- 1. Goes through all groups by ID
22837
- 2. Collects original timeslider or zoompane values into an array
22838
- 3. Sorts and adds selected sources to ViewState based on ID type
22839
- */
22840
- Object.keys(syncState.groups.byId).forEach(function (id) {
22841
- var _a;
22842
-
22843
- var groupType = (_a = groupTypes.find(function (object) {
22844
- return object.syncType === syncState.groups.byId[id].type;
22845
- })) === null || _a === void 0 ? void 0 : _a.groupType;
22846
-
22847
- if (groupType) {
22848
- draft[groupType].groups.push({
22849
- id: id,
22850
- selected: syncState.groups.byId[id].targets.allIds
22851
- });
22852
- }
22853
- });
22854
- /*
22855
- _____ 2. Fill sourcesById _____
22856
- 1. Loop though sources and add source to each group type
22857
- */
22858
-
22859
- Object.keys(syncState.sources.byId).forEach(function (id) {
22860
- groupTypes.forEach(function (_ref) {
22861
- var syncType = _ref.syncType,
22862
- groupType = _ref.groupType;
22863
-
22864
- if (syncState.sources.byId[id].types.includes(syncType)) {
22865
- draft[groupType].sourcesById.push({
22866
- id: id,
22867
- name: id
22868
- });
22869
- }
22870
- });
22871
- });
22872
- });
22873
- return initialState;
22874
- }; // TODO
22875
- // Improve selector to reduce unnecessary re-rendering
22876
- // https://gitlab.com/opengeoweb/opengeoweb/-/issues/1333
22877
-
22878
- var syncState = function syncState(store) {
22879
- return store.syncronizationGroupStore;
22880
- };
22881
-
22882
- var createSyncGroupViewStateSelector = createSelector(syncState, createSyncGroupViewState);
22883
-
22884
22869
  var SyncGroupViewer = function SyncGroupViewer(_ref) {
22885
22870
  var onClose = _ref.onClose,
22886
22871
  isOpen = _ref.isOpen,
@@ -22888,7 +22873,10 @@ var SyncGroupViewer = function SyncGroupViewer(_ref) {
22888
22873
  syncGroupAddTarget = _ref.syncGroupAddTarget,
22889
22874
  syncGroupRemoveTarget = _ref.syncGroupRemoveTarget,
22890
22875
  syncGroupAddGroup = _ref.syncGroupAddGroup,
22891
- syncGroupRemoveGroup = _ref.syncGroupRemoveGroup;
22876
+ syncGroupRemoveGroup = _ref.syncGroupRemoveGroup,
22877
+ onMouseDown = _ref.onMouseDown,
22878
+ _ref$order = _ref.order,
22879
+ order = _ref$order === void 0 ? 0 : _ref$order;
22892
22880
 
22893
22881
  /*
22894
22882
  _____ Handle Toggle _____
@@ -22989,7 +22977,9 @@ var SyncGroupViewer = function SyncGroupViewer(_ref) {
22989
22977
  headerSize: "medium",
22990
22978
  isOpen: isOpen,
22991
22979
  onClose: onClose,
22992
- "data-testid": "syncGroupViewer"
22980
+ "data-testid": "syncGroupViewer",
22981
+ onMouseDown: onMouseDown,
22982
+ order: order
22993
22983
  }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SyncGroupList, {
22994
22984
  viewStateData: syncGroupViewState.zoompane,
22995
22985
  title: "ZoomPane",
@@ -23045,14 +23035,12 @@ var SyncGroupViewer = function SyncGroupViewer(_ref) {
23045
23035
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
23046
23036
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
23047
23037
  * */
23048
- var SyncGroupViewerConnect = function SyncGroupViewerConnect(_ref) {
23049
- var onClose = _ref.onClose,
23050
- isOpen = _ref.isOpen;
23038
+ var SyncGroupViewerConnect = function SyncGroupViewerConnect() {
23051
23039
  var dispatch = useDispatch(); // TODO
23052
23040
  // Improve the selector to prevent re-renders
23053
23041
  // For example dusting anination syncgroups should not re-render
23054
23042
 
23055
- var viewState = useSelector(createSyncGroupViewStateSelector);
23043
+ var viewState = useSelector(syncGroupGetViewState);
23056
23044
  var syncGroupAddGroup$1 = React.useCallback(function (payload) {
23057
23045
  return dispatch(syncGroupAddGroup(payload));
23058
23046
  }, [dispatch]);
@@ -23065,14 +23053,55 @@ var SyncGroupViewerConnect = function SyncGroupViewerConnect(_ref) {
23065
23053
  var syncGroupRemoveTarget$1 = React.useCallback(function (payload) {
23066
23054
  return dispatch(syncGroupRemoveTarget(payload));
23067
23055
  }, [dispatch]);
23056
+ var isOpenInStore = useSelector(function (store) {
23057
+ return getisDialogOpen(store, 'syncGroups');
23058
+ });
23059
+ var onClose = React.useCallback(function () {
23060
+ return dispatch(setToggleOpenDialog({
23061
+ type: 'syncGroups',
23062
+ setOpen: false
23063
+ }));
23064
+ }, [dispatch]);
23065
+ var uiOrder = useSelector(function (store) {
23066
+ return getDialogOrder(store, 'syncGroups');
23067
+ });
23068
+ var uiIsOrderedOnTop = useSelector(function (store) {
23069
+ return getDialogIsOrderedOnTop(store, 'syncGroups');
23070
+ });
23071
+ var registerDialog$1 = React.useCallback(function () {
23072
+ return dispatch(registerDialog({
23073
+ type: 'syncGroups',
23074
+ setOpen: false
23075
+ }));
23076
+ }, [dispatch]);
23077
+ var unregisterDialog$1 = React.useCallback(function () {
23078
+ return dispatch(unregisterDialog({
23079
+ type: 'syncGroups'
23080
+ }));
23081
+ }, [dispatch]);
23082
+ var onOrderDialog = React.useCallback(function () {
23083
+ if (!uiIsOrderedOnTop) {
23084
+ dispatch(orderDialog({
23085
+ type: 'syncGroups'
23086
+ }));
23087
+ }
23088
+ }, [dispatch, uiIsOrderedOnTop]);
23089
+ React.useEffect(function () {
23090
+ registerDialog$1();
23091
+ return function () {
23092
+ unregisterDialog$1();
23093
+ }; // eslint-disable-next-line react-hooks/exhaustive-deps
23094
+ }, []);
23068
23095
  return /*#__PURE__*/React.createElement(SyncGroupViewer, {
23069
23096
  onClose: onClose,
23070
- isOpen: isOpen,
23097
+ isOpen: isOpenInStore,
23071
23098
  syncGroupViewState: viewState,
23072
23099
  syncGroupAddTarget: syncGroupAddTarget$1,
23073
23100
  syncGroupRemoveTarget: syncGroupRemoveTarget$1,
23074
23101
  syncGroupAddGroup: syncGroupAddGroup$1,
23075
- syncGroupRemoveGroup: syncGroupRemoveGroup$1
23102
+ syncGroupRemoveGroup: syncGroupRemoveGroup$1,
23103
+ order: uiOrder,
23104
+ onMouseDown: onOrderDialog
23076
23105
  });
23077
23106
  };
23078
23107
 
@@ -23264,4 +23293,4 @@ var CoreThemeStoreProvider = function CoreThemeStoreProvider(_ref2) {
23264
23293
  }, children)));
23265
23294
  };
23266
23295
 
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 };
23296
+ export { ConfigurableConnectedMap, ConfigurableMapWithSliderConnect, CoreThemeProvider, CoreThemeStoreProvider, HarmRefTimePreset, HarmonieTempAndPrecipPreset, LayerManagerConnect, LayerManagerMapButtonConnect, Legend, LegendConnect, LegendMapButtonConnect, MapControls, MapView, MapViewConnect, MapViewLayer, MultiDimensionSelectMapButtonsConnect, MultiMapMultiDimensionSelectConnect as MultiMapDimensionSelectConnect, MultiMapViewConnect, ReactMapView, ReactMapViewLayer, SyncGroupViewerConnect, index as SyncGroups, TimeSliderConnect, TooltipSelect, ZoomControlConnect, ZoomControls, componentsLookUp, coreModuleConfig, dateFormat, defaultConfigurations, filterBaseLayers, filterBbox, filterDimensions, filterMapLayers, filterMapPresets, filterNonTimeDimensions, filterServices, filterSrs, generateLayerId, generateMapId, generateTimesliderId, getFirstTimeStepForLayerId, getInitialPresets, getLastTimeStepForLayerId, getNextTimeStepForLayerId, getPreviousTimeStepForLayerId, getWMJSDimensionForLayerAndDimension, getWMJSMapById, getWMJSTimeDimensionForLayerId, getWMLayerById, reducer$6 as layerReducer, makeMapPreset, actions$3 as mapActions, constants as mapConstants, moduleConfig as mapModuleConfig, selectors$1 as mapSelectors, types$2 as mapTypes, utils as mapUtils, publicLayers, publicServices, registerWMJSMap, registerWMLayer, store, actions as syncGroupActions, synchronizationGroupConfig as synchronizationGroupModuleConfig, testLayers, actions$2 as uiActions, uiModuleConfig, selectors as uiSelectors, types$1 as uiTypes, useStyles$3 as useStyles };