@opengeoweb/core 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/index.esm.js +528 -530
  2. package/index.umd.js +541 -522
  3. package/lib/components/LayerManager/LayerContainerRow/LayerRow/LayerRow.d.ts +1 -0
  4. package/lib/components/LayerManager/LayerContainerRow/{LayerManagerButton.spec.d.ts → LayerRow/LayerRowConnect.spec.d.ts} +0 -0
  5. package/lib/components/LayerManager/LayerManagerUtils.d.ts +2 -2
  6. package/lib/components/SyncGroups/SyncGroupViewer.d.ts +2 -0
  7. package/lib/components/SyncGroups/SyncGroupViewerConnect.d.ts +1 -6
  8. package/lib/components/SyncGroups/selector.d.ts +4 -4
  9. package/lib/components/TimeSlider/TimeSliderButtons/PlayButton/PlayButtonConnect.d.ts +1 -0
  10. package/lib/components/TimeSlider/TimeSliderLegend/TimeSliderLegend.d.ts +2 -0
  11. package/lib/components/TimeSlider/TimeSliderLegend/TimeSliderLegendRenderFunctions.d.ts +1 -1
  12. package/lib/components/TooltipSelect/TooltipSelect.d.ts +0 -1
  13. package/lib/store/generic/selectors.d.ts +1 -0
  14. package/lib/store/generic/synchronizationGroups/actions.d.ts +2 -1
  15. package/lib/store/generic/synchronizationGroups/constants.d.ts +1 -0
  16. package/lib/store/generic/synchronizationGroups/sagas.d.ts +1 -0
  17. package/lib/store/generic/synchronizationGroups/selectors.d.ts +13 -0
  18. package/lib/store/generic/synchronizationGroups/types.d.ts +11 -2
  19. package/lib/store/mapStore/map/selectors.d.ts +30 -0
  20. package/lib/store/ui/types.d.ts +1 -1
  21. package/lib/utils/testUtils.d.ts +2 -1
  22. package/package.json +5 -5
  23. package/lib/components/LayerManager/LayerContainerRow/LayerManagerButton.d.ts +0 -13
  24. package/lib/components/LayerManager/LayerContainerRow/LayerRow/DeleteLayer/DeleteLayer.d.ts +0 -8
  25. package/lib/components/LayerManager/LayerContainerRow/LayerRow/DeleteLayer/DeleteLayer.spec.d.ts +0 -1
  26. package/lib/components/LayerManager/LayerContainerRow/LayerRow/EnableLayer/EnableLayer.d.ts +0 -8
  27. package/lib/components/LayerManager/LayerContainerRow/LayerRow/EnableLayer/EnableLayer.spec.d.ts +0 -1
  28. package/lib/components/LayerManager/LayerContainerRow/LayerRow/styles.d.ts +0 -5
package/index.esm.js CHANGED
@@ -6,11 +6,11 @@ import React__default, { useState, Component, useRef, useEffect } from 'react';
6
6
  import produce, { produce as produce$1 } from 'immer';
7
7
  import { takeLatest, put, select, call, takeEvery } from 'redux-saga/effects';
8
8
  import { WMGetServiceFromStore, LayerType as LayerType$1, getMapImageStore, WMBBOX, debug, DebugType, WMJSMap, WMLayer, legendImageStore, WMImageEventType, getLegendGraphicURLForLayer } from '@opengeoweb/webmap';
9
- import { Tooltip, Select, Grid, InputLabel, IconButton, Paper, Box, Typography, CircularProgress, List, ListSubheader, ListItem, ListItemText, Dialog, DialogTitle, DialogContent, DialogContentText, TextField, DialogActions, Button, MenuItem, Checkbox, SvgIcon, FormControl, InputAdornment, ListItemSecondaryAction, ListItemIcon, Switch, Slider, FormControlLabel, Popover, useMediaQuery, useTheme, SliderThumb } from '@mui/material';
10
- import makeStyles from '@mui/styles/makeStyles';
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, ToggleMenu, ToolContainerDraggable, ToolButton, CustomToggleButton, useIsMounted } from '@opengeoweb/shared';
13
- import { Cached, Add, Delete, DragIndicator, Close, ChevronLeft, ChevronRight, Link, LinkOff, MoreVert, DeleteForever } from '@mui/icons-material';
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';
@@ -1293,6 +1293,103 @@ var getAvailableBaseLayersForMap = createSelector(layerStore, function (_store,
1293
1293
  return [];
1294
1294
  }, selectorMemoizationOptions);
1295
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
+
1296
1393
  function _typeof(obj) {
1297
1394
  "@babel/helpers - typeof";
1298
1395
 
@@ -2361,6 +2458,34 @@ var getBbox = createSelector(getMapById, function (store) {
2361
2458
  var isAnimating = createSelector(getMapById, function (store) {
2362
2459
  return store ? store.isAnimating : false;
2363
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
+ });
2364
2489
  /**
2365
2490
  * Gets start time of animation
2366
2491
  *
@@ -2820,6 +2945,7 @@ var selectors$1 = /*#__PURE__*/Object.freeze({
2820
2945
  getSrs: getSrs,
2821
2946
  getBbox: getBbox,
2822
2947
  isAnimating: isAnimating,
2948
+ linkedMapAnimationInfo: linkedMapAnimationInfo,
2823
2949
  getAnimationStartTime: getAnimationStartTime,
2824
2950
  getAnimationEndTime: getAnimationEndTime,
2825
2951
  isAutoUpdating: isAutoUpdating,
@@ -2885,7 +3011,7 @@ var selectors$1 = /*#__PURE__*/Object.freeze({
2885
3011
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
2886
3012
  * */
2887
3013
 
2888
- var constants$1 = /*#__PURE__*/Object.freeze({
3014
+ var constants = /*#__PURE__*/Object.freeze({
2889
3015
  __proto__: null,
2890
3016
  WEBMAP_REGISTER_MAP: WEBMAP_REGISTER_MAP,
2891
3017
  WEBMAP_UNREGISTER_MAP: WEBMAP_UNREGISTER_MAP,
@@ -3207,55 +3333,6 @@ var types$1 = /*#__PURE__*/Object.freeze({
3207
3333
  var GENERIC_SETTIME = 'GENERIC_SETTIME';
3208
3334
  var GENERIC_SETBBOX = 'GENERIC_SETBBOX';
3209
3335
 
3210
- /* *
3211
- * Licensed under the Apache License, Version 2.0 (the "License");
3212
- * you may not use this file except in compliance with the License.
3213
- * You may obtain a copy of the License at
3214
- *
3215
- * http://www.apache.org/licenses/LICENSE-2.0
3216
- *
3217
- * Unless required by applicable law or agreed to in writing, software
3218
- * distributed under the License is distributed on an "AS IS" BASIS,
3219
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3220
- * See the License for the specific language governing permissions and
3221
- * limitations under the License.
3222
- *
3223
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3224
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
3225
- * */
3226
-
3227
- /* Action constants for sources */
3228
- var SYNCGROUPS_ADD_SOURCE = 'SYNCGROUPS_ADD_SOURCE';
3229
- var SYNCGROUPS_REMOVE_SOURCE = 'SYNCGROUPS_REMOVE_SOURCE';
3230
- /* Action constants for groups */
3231
-
3232
- var SYNCGROUPS_TOGGLE_LINK_TARGET = 'SYNCGROUPS_TOGGLE_LINK_TARGET';
3233
- var SYNCGROUPS_ADD_TARGET = 'SYNCGROUPS_ADD_TARGET';
3234
- var SYNCGROUPS_REMOVE_TARGET = 'SYNCGROUPS_REMOVE_TARGET';
3235
- var SYNCGROUPS_ADD_GROUP = 'SYNCGROUPS_ADD_GROUP';
3236
- var SYNCGROUPS_REMOVE_GROUP = 'SYNCGROUPS_REMOVE_GROUP';
3237
- var SYNCGROUPS_CLEAR = 'SYNCGROUPS_CLEAR';
3238
- /* Type constants */
3239
-
3240
- var SYNCGROUPS_TYPE_SETTIME = 'SYNCGROUPS_TYPE_SETTIME';
3241
- var SYNCGROUPS_TYPE_SETBBOX = 'SYNCGROUPS_TYPE_SETBBOX';
3242
- var SYNCGROUPS_TYPE_SETLAYERACTIONS = 'SYNCGROUPS_TYPE_SETLAYERACTIONS';
3243
-
3244
- var constants = /*#__PURE__*/Object.freeze({
3245
- __proto__: null,
3246
- SYNCGROUPS_ADD_SOURCE: SYNCGROUPS_ADD_SOURCE,
3247
- SYNCGROUPS_REMOVE_SOURCE: SYNCGROUPS_REMOVE_SOURCE,
3248
- SYNCGROUPS_TOGGLE_LINK_TARGET: SYNCGROUPS_TOGGLE_LINK_TARGET,
3249
- SYNCGROUPS_ADD_TARGET: SYNCGROUPS_ADD_TARGET,
3250
- SYNCGROUPS_REMOVE_TARGET: SYNCGROUPS_REMOVE_TARGET,
3251
- SYNCGROUPS_ADD_GROUP: SYNCGROUPS_ADD_GROUP,
3252
- SYNCGROUPS_REMOVE_GROUP: SYNCGROUPS_REMOVE_GROUP,
3253
- SYNCGROUPS_CLEAR: SYNCGROUPS_CLEAR,
3254
- SYNCGROUPS_TYPE_SETTIME: SYNCGROUPS_TYPE_SETTIME,
3255
- SYNCGROUPS_TYPE_SETBBOX: SYNCGROUPS_TYPE_SETBBOX,
3256
- SYNCGROUPS_TYPE_SETLAYERACTIONS: SYNCGROUPS_TYPE_SETLAYERACTIONS
3257
- });
3258
-
3259
3336
  /* *
3260
3337
  * Licensed under the Apache License, Version 2.0 (the "License");
3261
3338
  * you may not use this file except in compliance with the License.
@@ -3401,6 +3478,12 @@ var syncGroupClear = function syncGroupClear() {
3401
3478
  type: SYNCGROUPS_CLEAR
3402
3479
  };
3403
3480
  };
3481
+ var syncGroupSetViewState = function syncGroupSetViewState(payload) {
3482
+ return {
3483
+ type: SYNCGROUPS_SET_VIEW_STATE,
3484
+ payload: payload
3485
+ };
3486
+ };
3404
3487
 
3405
3488
  var actions$1 = /*#__PURE__*/Object.freeze({
3406
3489
  __proto__: null,
@@ -3411,7 +3494,8 @@ var actions$1 = /*#__PURE__*/Object.freeze({
3411
3494
  syncGroupLinkTarget: syncGroupLinkTarget,
3412
3495
  syncGroupAddGroup: syncGroupAddGroup,
3413
3496
  syncGroupRemoveGroup: syncGroupRemoveGroup,
3414
- syncGroupClear: syncGroupClear
3497
+ syncGroupClear: syncGroupClear,
3498
+ syncGroupSetViewState: syncGroupSetViewState
3415
3499
  });
3416
3500
 
3417
3501
  /* *
@@ -3481,7 +3565,8 @@ var actions = /*#__PURE__*/Object.freeze({
3481
3565
  syncGroupLinkTarget: syncGroupLinkTarget,
3482
3566
  syncGroupAddGroup: syncGroupAddGroup,
3483
3567
  syncGroupRemoveGroup: syncGroupRemoveGroup,
3484
- syncGroupClear: syncGroupClear
3568
+ syncGroupClear: syncGroupClear,
3569
+ syncGroupSetViewState: syncGroupSetViewState
3485
3570
  });
3486
3571
 
3487
3572
  /*! *****************************************************************************
@@ -4119,6 +4204,20 @@ var initialState$4 = {
4119
4204
  groups: {
4120
4205
  byId: {},
4121
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
+ }
4122
4221
  }
4123
4222
  };
4124
4223
  var reducer$4 = function reducer() {
@@ -4338,6 +4437,12 @@ var reducer$4 = function reducer() {
4338
4437
  case SYNCGROUPS_CLEAR:
4339
4438
  return initialState$4;
4340
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
+
4341
4446
  default:
4342
4447
  return state;
4343
4448
  }
@@ -4449,6 +4554,9 @@ var getTargetGroups = function getTargetGroups(state, payload, actionType) {
4449
4554
  }, []);
4450
4555
  return groups;
4451
4556
  };
4557
+ var syncGroupGetViewState = createSelector(syncGroupStore, function (store) {
4558
+ return store.viewState;
4559
+ });
4452
4560
 
4453
4561
  /* *
4454
4562
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -4819,7 +4927,7 @@ var _marked$4 = /*#__PURE__*/regeneratorRuntime.mark(setTimeSaga),
4819
4927
  _marked2$4 = /*#__PURE__*/regeneratorRuntime.mark(setBBoxSaga),
4820
4928
  _marked3$4 = /*#__PURE__*/regeneratorRuntime.mark(layerActionsSaga),
4821
4929
  _marked4$2 = /*#__PURE__*/regeneratorRuntime.mark(addLayerActionsSaga),
4822
- _marked5$1 = /*#__PURE__*/regeneratorRuntime.mark(deleteLayerActionsSaga),
4930
+ _marked5$2 = /*#__PURE__*/regeneratorRuntime.mark(deleteLayerActionsSaga),
4823
4931
  _marked6$1 = /*#__PURE__*/regeneratorRuntime.mark(moveLayerActionsSaga),
4824
4932
  _marked7$1 = /*#__PURE__*/regeneratorRuntime.mark(setActiveLayerIdActionsSaga),
4825
4933
  _marked8 = /*#__PURE__*/regeneratorRuntime.mark(mapBaseLayerActionsSaga),
@@ -5001,7 +5109,7 @@ function deleteLayerActionsSaga(_ref5) {
5001
5109
  return _context5.stop();
5002
5110
  }
5003
5111
  }
5004
- }, _marked5$1);
5112
+ }, _marked5$2);
5005
5113
  }
5006
5114
  function moveLayerActionsSaga(_ref6) {
5007
5115
  var payload, type, targets;
@@ -5165,10 +5273,110 @@ function rootSaga$4() {
5165
5273
  }, _marked9);
5166
5274
  }
5167
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
+
5168
5375
  var _marked$3 = /*#__PURE__*/regeneratorRuntime.mark(updateSourceValueWhenLinkingComponentToGroupSaga),
5169
5376
  _marked2$3 = /*#__PURE__*/regeneratorRuntime.mark(addGroupTargetSaga),
5170
5377
  _marked3$3 = /*#__PURE__*/regeneratorRuntime.mark(linkGroupTargetSaga),
5171
- _marked4$1 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$3);
5378
+ _marked4$1 = /*#__PURE__*/regeneratorRuntime.mark(updateViewStateSaga),
5379
+ _marked5$1 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$3);
5172
5380
  function updateSourceValueWhenLinkingComponentToGroupSaga(groupId, targetToUpdate) {
5173
5381
  var group;
5174
5382
  return regeneratorRuntime.wrap(function updateSourceValueWhenLinkingComponentToGroupSaga$(_context) {
@@ -5285,25 +5493,76 @@ function linkGroupTargetSaga(_ref2) {
5285
5493
  }
5286
5494
  }, _marked3$3);
5287
5495
  }
5288
-
5289
- function rootSaga$3() {
5290
- return regeneratorRuntime.wrap(function rootSaga$(_context4) {
5496
+ function updateViewStateSaga() {
5497
+ var viewState;
5498
+ return regeneratorRuntime.wrap(function updateViewStateSaga$(_context4) {
5291
5499
  while (1) {
5292
5500
  switch (_context4.prev = _context4.next) {
5293
5501
  case 0:
5294
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;
5295
5526
  return takeLatest(SYNCGROUPS_ADD_TARGET, addGroupTargetSaga);
5296
5527
 
5297
5528
  case 2:
5298
- _context4.next = 4;
5529
+ _context5.next = 4;
5299
5530
  return takeLatest(SYNCGROUPS_TOGGLE_LINK_TARGET, linkGroupTargetSaga);
5300
5531
 
5301
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:
5302
5561
  case "end":
5303
- return _context4.stop();
5562
+ return _context5.stop();
5304
5563
  }
5305
5564
  }
5306
- }, _marked4$1);
5565
+ }, _marked5$1);
5307
5566
  }
5308
5567
 
5309
5568
  /* *
@@ -5330,41 +5589,6 @@ var synchronizationGroupConfig = {
5330
5589
  sagas: [rootSaga$4, rootSaga$3]
5331
5590
  };
5332
5591
 
5333
- var useStyles$B = makeStyles(function (theme) {
5334
- return {
5335
- select: {
5336
- '& ul': {
5337
- backgroundColor: theme.palette.geowebColors.background.surface
5338
- },
5339
- '& li': {
5340
- fontSize: 16,
5341
- padding: 12,
5342
- '&:hover': {
5343
- backgroundColor: theme.palette.geowebColors.layerManager.tableRowMouseover.rgba
5344
- },
5345
- '&.Mui-selected': {
5346
- color: theme.palette.common.white,
5347
- backgroundColor: theme.palette.geowebColors.buttons.primary.active.fill,
5348
- boxShadow: "none",
5349
- '&:hover': {
5350
- color: theme.palette.common.white,
5351
- backgroundColor: theme.palette.geowebColors.buttons.primary.mouseOver.fill
5352
- }
5353
- },
5354
- '&:after': {
5355
- background: 'none!important'
5356
- },
5357
- // (optional) header
5358
- '&.Mui-disabled': {
5359
- fontSize: 12,
5360
- opacity: 0.67,
5361
- padding: '0 12px'
5362
- }
5363
- }
5364
- }
5365
- };
5366
- });
5367
-
5368
5592
  var TooltipSelect = function TooltipSelect(_a) {
5369
5593
  var tooltip = _a.tooltip,
5370
5594
  _a$list = _a.list,
@@ -5390,8 +5614,6 @@ var TooltipSelect = function TooltipSelect(_a) {
5390
5614
  tooltipOpen = _React$useState4[0],
5391
5615
  setTooltipOpen = _React$useState4[1];
5392
5616
 
5393
- var classes = useStyles$B();
5394
-
5395
5617
  var preventDefault = function preventDefault(event) {
5396
5618
  event.preventDefault();
5397
5619
  event.stopPropagation();
@@ -5456,8 +5678,46 @@ var TooltipSelect = function TooltipSelect(_a) {
5456
5678
  onBlur: onBlur,
5457
5679
  onWheel: onWheel,
5458
5680
  MenuProps: {
5459
- classes: {
5460
- 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
+ }
5461
5721
  }
5462
5722
  }
5463
5723
  }, otherProps)));
@@ -5506,7 +5766,7 @@ var types = /*#__PURE__*/Object.freeze({
5506
5766
  var index = /*#__PURE__*/Object.freeze({
5507
5767
  __proto__: null,
5508
5768
  actions: actions$1,
5509
- constants: constants,
5769
+ constants: constants$1,
5510
5770
  types: types,
5511
5771
  initialState: initialState$4
5512
5772
  });
@@ -8065,7 +8325,7 @@ var defaultConfigurations = /*#__PURE__*/Object.freeze({
8065
8325
  preloadedDefaultMapServices: preloadedDefaultMapServices
8066
8326
  });
8067
8327
 
8068
- var useStyles$A = makeStyles({
8328
+ var useStyles$x = makeStyles({
8069
8329
  buttonDiv: {
8070
8330
  position: 'relative'
8071
8331
  },
@@ -8101,7 +8361,7 @@ var AddLayersPopup = function AddLayersPopup(_ref) {
8101
8361
  handleClose = _ref.handleClose,
8102
8362
  _ref$layerType = _ref.layerType,
8103
8363
  layerType = _ref$layerType === void 0 ? LayerType.mapLayer : _ref$layerType;
8104
- var classes = useStyles$A();
8364
+ var classes = useStyles$x();
8105
8365
 
8106
8366
  var _React$useState = React.useState(''),
8107
8367
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -8360,6 +8620,9 @@ var LayerManagerColumnsLarge = makeStyles({
8360
8620
  column6: {
8361
8621
  width: iconButtonSize * 2,
8362
8622
  display: 'inline-flex'
8623
+ },
8624
+ columns35: {
8625
+ width: "calc((100% - ".concat(iconButtonSize * totalButtons, "px) * 0.75)")
8363
8626
  }
8364
8627
  });
8365
8628
  var LayerManagerColumnsSmall = makeStyles({
@@ -8381,6 +8644,9 @@ var LayerManagerColumnsSmall = makeStyles({
8381
8644
  column6: {
8382
8645
  width: iconButtonSize * 2,
8383
8646
  display: 'inline-flex'
8647
+ },
8648
+ columns35: {
8649
+ display: 'none'
8384
8650
  }
8385
8651
  });
8386
8652
  var LayerManagerWidth;
@@ -8465,7 +8731,7 @@ var LayerSelectButtonConnect = function LayerSelectButtonConnect(_ref) {
8465
8731
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8466
8732
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
8467
8733
  * */
8468
- var useStyles$z = makeStyles({
8734
+ var useStyles$w = makeStyles({
8469
8735
  row: {
8470
8736
  height: '32px'
8471
8737
  },
@@ -8489,7 +8755,7 @@ var DescriptionRow = function DescriptionRow(_ref) {
8489
8755
  layerManagerWidth = _ref.layerManagerWidth,
8490
8756
  _ref$layerSelect = _ref.layerSelect,
8491
8757
  layerSelect = _ref$layerSelect === void 0 ? false : _ref$layerSelect;
8492
- var classes = useStyles$z();
8758
+ var classes = useStyles$w();
8493
8759
  var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
8494
8760
  return /*#__PURE__*/React.createElement(Grid, {
8495
8761
  container: true,
@@ -8566,18 +8832,18 @@ var useTooltipContainerStyles = makeStyles(function (theme) {
8566
8832
  borderColor: 'transparent!important'
8567
8833
  },
8568
8834
  '&:hover .MuiSelect-select': {
8569
- backgroundColor: theme.palette.geowebColors.layerManager.tableRowMouseover.rgba
8835
+ backgroundColor: theme.palette.geowebColors.buttons.tool.mouseOver.fill
8570
8836
  },
8571
8837
  '&.Mui-focused .MuiSelect-select': {
8572
8838
  outline: theme.palette.geowebColors.buttons.focusDefault.outline,
8573
- backgroundColor: theme.palette.geowebColors.layerManager.tableRowMouseover.rgba
8839
+ backgroundColor: theme.palette.geowebColors.buttons.tool.mouseOver.fill
8574
8840
  },
8575
8841
  '&:hover&.MuiButton-root': {
8576
- backgroundColor: theme.palette.geowebColors.layerManager.tableRowMouseover.rgba
8842
+ backgroundColor: theme.palette.geowebColors.buttons.tool.mouseOver.fill
8577
8843
  },
8578
8844
  '&:focus&.MuiButton-root': {
8579
8845
  outline: theme.palette.geowebColors.buttons.focusDefault.outline,
8580
- backgroundColor: theme.palette.geowebColors.layerManager.tableRowMouseover.rgba
8846
+ backgroundColor: theme.palette.geowebColors.buttons.tool.mouseOver.fill
8581
8847
  },
8582
8848
  '& .MuiSvgIcon-root': {
8583
8849
  transition: 'none',
@@ -8697,7 +8963,7 @@ var DimensionSelect = function DimensionSelect(_ref) {
8697
8963
  }
8698
8964
  }, /*#__PURE__*/React.createElement(MenuItem, {
8699
8965
  disabled: true
8700
- }, "Select dimension"), layerDimensions.map(function (dimension) {
8966
+ }, "Dimension"), layerDimensions.map(function (dimension) {
8701
8967
  return /*#__PURE__*/React.createElement(MenuItem, {
8702
8968
  key: dimension.name,
8703
8969
  value: dimension.name
@@ -8722,203 +8988,16 @@ var DimensionSelect = function DimensionSelect(_ref) {
8722
8988
  maxWidth: '50%'
8723
8989
  }
8724
8990
  }, /*#__PURE__*/React.createElement(MenuItem, {
8725
- disabled: true
8726
- }, "Select dimension value. (", valuesToDisplay.length, " options)"), valuesToDisplay.map(function (dimValue) {
8727
- return /*#__PURE__*/React.createElement(MenuItem, {
8728
- key: dimValue,
8729
- value: dimValue
8730
- }, "".concat(dimValue), /*#__PURE__*/React.createElement(React.Fragment, null, "\xA0", /*#__PURE__*/React.createElement("i", null, "".concat(activeDim.units))));
8731
- }))));
8732
- };
8733
-
8734
- /* *
8735
- * Licensed under the Apache License, Version 2.0 (the "License");
8736
- * you may not use this file except in compliance with the License.
8737
- * You may obtain a copy of the License at
8738
- *
8739
- * http://www.apache.org/licenses/LICENSE-2.0
8740
- *
8741
- * Unless required by applicable law or agreed to in writing, software
8742
- * distributed under the License is distributed on an "AS IS" BASIS,
8743
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8744
- * See the License for the specific language governing permissions and
8745
- * limitations under the License.
8746
- *
8747
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8748
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
8749
- * */
8750
- var useStyles$y = makeStyles(function (theme) {
8751
- return createStyles({
8752
- button: {
8753
- height: 28,
8754
- width: 28,
8755
- borderRadius: 5,
8756
- marginTop: 2,
8757
- color: function color(_ref) {
8758
- var isActive = _ref.isActive,
8759
- isAccessible = _ref.isAccessible,
8760
- isEnabled = _ref.isEnabled;
8761
-
8762
- if (!isEnabled) {
8763
- return theme.palette.geowebColors.buttons.flat.disabled.color;
8764
- }
8765
-
8766
- if (isAccessible) {
8767
- return theme.palette.geowebColors.greys.accessible;
8768
- }
8769
-
8770
- if (isActive) {
8771
- return theme.palette.common.white;
8772
- }
8773
-
8774
- return theme.palette.geowebColors.buttons.flat["default"].color;
8775
- },
8776
- backgroundColor: function backgroundColor(_ref2) {
8777
- var isActive = _ref2.isActive;
8778
- return isActive ? theme.palette.geowebColors.buttons.primary.active.fill : 'inherit';
8779
- },
8780
- '&:focus': {
8781
- backgroundColor: function backgroundColor(_ref3) {
8782
- var isActive = _ref3.isActive;
8783
- return isActive ? theme.palette.geowebColors.buttons.primary.mouseOver.fill : theme.palette.geowebColors.buttons.flat.mouseOver.fill;
8784
- },
8785
- outline: theme.palette.geowebColors.buttons.focusDefault.outline,
8786
- borderRadius: 0
8787
- },
8788
- '&:hover': {
8789
- backgroundColor: function backgroundColor(_ref4) {
8790
- var isActive = _ref4.isActive;
8791
- return isActive ? theme.palette.geowebColors.buttons.primary.mouseOver.fill : theme.palette.geowebColors.buttons.flat.mouseOver.fill;
8792
- }
8793
- }
8794
- },
8795
- popper: {
8796
- pointerEvents: 'none'
8797
- }
8798
- });
8799
- });
8800
-
8801
- var LayerManagerButton = function LayerManagerButton(_a) {
8802
- var _a$tooltipTitle = _a.tooltipTitle,
8803
- tooltipTitle = _a$tooltipTitle === void 0 ? '' : _a$tooltipTitle,
8804
- _a$onClick = _a.onClick,
8805
- onClick = _a$onClick === void 0 ? function () {} : _a$onClick,
8806
- _a$isActive = _a.isActive,
8807
- isActive = _a$isActive === void 0 ? false : _a$isActive,
8808
- _a$isEnabled = _a.isEnabled,
8809
- isEnabled = _a$isEnabled === void 0 ? true : _a$isEnabled,
8810
- icon = _a.icon,
8811
- testId = _a.testId,
8812
- _a$isAccessible = _a.isAccessible,
8813
- isAccessible = _a$isAccessible === void 0 ? false : _a$isAccessible,
8814
- className = _a.className,
8815
- props = __rest(_a, ["tooltipTitle", "onClick", "isActive", "isEnabled", "icon", "testId", "isAccessible", "className"]);
8816
-
8817
- var classes = useStyles$y({
8818
- isActive: isActive,
8819
- isEnabled: isEnabled,
8820
- isAccessible: isAccessible
8821
- });
8822
-
8823
- var handleClick = function handleClick(event) {
8824
- onClick(event);
8825
- };
8826
-
8827
- return /*#__PURE__*/React.createElement(Tooltip, {
8828
- title: tooltipTitle,
8829
- placement: "top",
8830
- classes: {
8831
- popper: classes.popper
8832
- }
8833
- }, /*#__PURE__*/React.createElement(IconButton, Object.assign({
8834
- size: "small",
8835
- onClick: handleClick,
8836
- "data-testid": testId,
8837
- className: "".concat(classes.button, " ").concat(className),
8838
- disableFocusRipple: true
8839
- }, props), icon));
8840
- };
8841
-
8842
- /* *
8843
- * Licensed under the Apache License, Version 2.0 (the "License");
8844
- * you may not use this file except in compliance with the License.
8845
- * You may obtain a copy of the License at
8846
- *
8847
- * http://www.apache.org/licenses/LICENSE-2.0
8848
- *
8849
- * Unless required by applicable law or agreed to in writing, software
8850
- * distributed under the License is distributed on an "AS IS" BASIS,
8851
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8852
- * See the License for the specific language governing permissions and
8853
- * limitations under the License.
8854
- *
8855
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8856
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
8857
- * */
8858
- var useStyles$x = makeStyles(function (theme) {
8859
- return createStyles({
8860
- checkbox: {
8861
- color: 'inherit',
8862
- padding: 4,
8863
- borderRadius: 5,
8864
- '&.Mui-focusVisible': {
8865
- backgroundColor: theme.palette.geowebColors.layerManager.tableRowMouseover.rgba
8866
- },
8867
- '&:hover': {
8868
- backgroundColor: 'transparent!important'
8869
- },
8870
- '&.Mui-checked': {
8871
- color: 'inherit'
8872
- }
8873
- }
8874
- });
8875
- });
8876
-
8877
- var EnableLayer = function EnableLayer(_ref) {
8878
- var isEnabled = _ref.isEnabled,
8879
- title = _ref.title,
8880
- onChangeEnableLayer = _ref.onChangeEnableLayer;
8881
- var classes = useStyles$x(isEnabled);
8882
-
8883
- var onClick = function onClick() {
8884
- onChangeEnableLayer(!isEnabled);
8885
- };
8886
-
8887
- var visibilityIcon = /*#__PURE__*/React.createElement(SvgIcon, null, /*#__PURE__*/React.createElement("rect", {
8888
- width: 24,
8889
- height: 24,
8890
- fill: "transparent"
8891
- }), /*#__PURE__*/React.createElement("path", {
8892
- 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"
8893
- }));
8894
- var visibilityOffIcon = /*#__PURE__*/React.createElement(SvgIcon, {
8895
- style: {
8896
- marginTop: 2
8897
- }
8898
- }, /*#__PURE__*/React.createElement("rect", {
8899
- width: 24,
8900
- height: 24,
8901
- fill: "transparent"
8902
- }), /*#__PURE__*/React.createElement("path", {
8903
- 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"
8904
- }));
8905
- return /*#__PURE__*/React.createElement(LayerManagerButton, {
8906
- tooltipTitle: title,
8907
- onClick: onClick,
8908
- icon: /*#__PURE__*/React.createElement(Checkbox, {
8909
- className: classes.checkbox,
8910
- icon: visibilityOffIcon,
8911
- checkedIcon: visibilityIcon,
8912
- checked: isEnabled,
8913
- disableFocusRipple: true,
8914
- tabIndex: -1
8915
- }),
8916
- testId: "enableLayer",
8917
- isEnabled: isEnabled
8918
- });
8991
+ disabled: true
8992
+ }, "Dimension value (", valuesToDisplay.length, " options)"), valuesToDisplay.map(function (dimValue) {
8993
+ return /*#__PURE__*/React.createElement(MenuItem, {
8994
+ key: dimValue,
8995
+ value: dimValue
8996
+ }, "".concat(dimValue), /*#__PURE__*/React.createElement(React.Fragment, null, "\xA0", /*#__PURE__*/React.createElement("i", null, "".concat(activeDim.units))));
8997
+ }))));
8919
8998
  };
8920
8999
 
8921
- var useStyles$w = makeStyles(function (theme) {
9000
+ var useStyles$v = makeStyles(function (theme) {
8922
9001
  return createStyles({
8923
9002
  dropdownEmpty: {
8924
9003
  paddingLeft: 8,
@@ -8968,7 +9047,7 @@ var RenderLayers = function RenderLayers(_ref) {
8968
9047
  layers = _ref$layers === void 0 ? [] : _ref$layers,
8969
9048
  _ref$isEnabled = _ref.isEnabled,
8970
9049
  isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
8971
- var classes = useStyles$w();
9050
+ var classes = useStyles$v();
8972
9051
  var containerClass = useTooltipContainerStyles(isEnabled);
8973
9052
 
8974
9053
  if (!layers || !layers.length) {
@@ -9014,7 +9093,7 @@ var RenderLayers = function RenderLayers(_ref) {
9014
9093
  requiresCtrlToChange: true
9015
9094
  }, /*#__PURE__*/React.createElement(MenuItem, {
9016
9095
  disabled: true
9017
- }, "Select layer"), extendedLayers.map(function (layerFromServiceLayers) {
9096
+ }, "Layer"), extendedLayers.map(function (layerFromServiceLayers) {
9018
9097
  return /*#__PURE__*/React.createElement(MenuItem, {
9019
9098
  key: layerFromServiceLayers.name,
9020
9099
  value: layerFromServiceLayers.name,
@@ -9023,7 +9102,7 @@ var RenderLayers = function RenderLayers(_ref) {
9023
9102
  }));
9024
9103
  };
9025
9104
 
9026
- var useStyles$v = makeStyles(function (theme) {
9105
+ var useStyles$u = makeStyles(function (theme) {
9027
9106
  return {
9028
9107
  opacityDiv: {
9029
9108
  height: 'calc(100% - 5px)',
@@ -9084,7 +9163,7 @@ var OpacitySelect = function OpacitySelect(_ref) {
9084
9163
  onLayerChangeOpacity = _ref.onLayerChangeOpacity,
9085
9164
  _ref$isEnabled = _ref.isEnabled,
9086
9165
  isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
9087
- var classes = useStyles$v();
9166
+ var classes = useStyles$u();
9088
9167
  var sliderClasses = sliderStyles();
9089
9168
  var containerClass = useTooltipContainerStyles(isEnabled);
9090
9169
 
@@ -9288,7 +9367,7 @@ var RenderStyles = function RenderStyles(_ref) {
9288
9367
  requiresCtrlToChange: true
9289
9368
  }, /*#__PURE__*/React.createElement(MenuItem, {
9290
9369
  disabled: true
9291
- }, "Select style"), styles.map(function (styleFromlayer) {
9370
+ }, "Style"), styles.map(function (styleFromlayer) {
9292
9371
  return /*#__PURE__*/React.createElement(MenuItem, {
9293
9372
  key: styleFromlayer.name,
9294
9373
  value: styleFromlayer.name
@@ -9296,48 +9375,6 @@ var RenderStyles = function RenderStyles(_ref) {
9296
9375
  }));
9297
9376
  };
9298
9377
 
9299
- /* *
9300
- * Licensed under the Apache License, Version 2.0 (the "License");
9301
- * you may not use this file except in compliance with the License.
9302
- * You may obtain a copy of the License at
9303
- *
9304
- * http://www.apache.org/licenses/LICENSE-2.0
9305
- *
9306
- * Unless required by applicable law or agreed to in writing, software
9307
- * distributed under the License is distributed on an "AS IS" BASIS,
9308
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9309
- * See the License for the specific language governing permissions and
9310
- * limitations under the License.
9311
- *
9312
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9313
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
9314
- * */
9315
- var useStyles$u = makeStyles(function () {
9316
- return createStyles({
9317
- icon: {
9318
- width: 20,
9319
- height: 20
9320
- }
9321
- });
9322
- });
9323
-
9324
- var DeleteButton = function DeleteButton(_ref) {
9325
- var tooltipTitle = _ref.tooltipTitle,
9326
- onClickDelete = _ref.onClickDelete,
9327
- _ref$isEnabled = _ref.isEnabled,
9328
- isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
9329
- var classes = useStyles$u();
9330
- return /*#__PURE__*/React.createElement(LayerManagerButton, {
9331
- tooltipTitle: tooltipTitle,
9332
- onClick: onClickDelete,
9333
- icon: /*#__PURE__*/React.createElement(Delete, {
9334
- className: classes.icon
9335
- }),
9336
- testId: "deleteButton",
9337
- isEnabled: isEnabled
9338
- });
9339
- };
9340
-
9341
9378
  /* *
9342
9379
  * Licensed under the Apache License, Version 2.0 (the "License");
9343
9380
  * you may not use this file except in compliance with the License.
@@ -9358,13 +9395,18 @@ var useStyles$t = makeStyles(function (theme) {
9358
9395
  return createStyles({
9359
9396
  svgIcon: {
9360
9397
  fill: function fill(_ref) {
9361
- var isActive = _ref.isActive;
9398
+ var isActive = _ref.isActive,
9399
+ isEnabled = _ref.isEnabled;
9362
9400
 
9363
9401
  if (isActive) {
9364
9402
  return theme.palette.common.white;
9365
9403
  }
9366
9404
 
9367
- return theme.palette.geowebColors.buttons.flat["default"].color;
9405
+ if (isEnabled) {
9406
+ return theme.palette.geowebColors.buttons.flat["default"].color;
9407
+ }
9408
+
9409
+ return theme.palette.geowebColors.buttons.flat.disabled.color;
9368
9410
  }
9369
9411
  }
9370
9412
  });
@@ -9406,7 +9448,7 @@ var ActivateLayer = function ActivateLayer(_ref2) {
9406
9448
  }))));
9407
9449
  };
9408
9450
 
9409
- return /*#__PURE__*/React.createElement(LayerManagerButton, {
9451
+ return /*#__PURE__*/React.createElement(ManagerButton, {
9410
9452
  tooltipTitle: tooltipTitle,
9411
9453
  onClick: onClickActivate,
9412
9454
  icon: /*#__PURE__*/React.createElement(Icon, null),
@@ -9465,6 +9507,8 @@ var LayerRow = function LayerRow(_ref) {
9465
9507
  } : _ref$onLayerRowClick,
9466
9508
  _ref$isEnabled = _ref.isEnabled,
9467
9509
  isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled,
9510
+ _ref$isLayerMissing = _ref.isLayerMissing,
9511
+ isLayerMissing = _ref$isLayerMissing === void 0 ? false : _ref$isLayerMissing,
9468
9512
  onLayerEnable = _ref.onLayerEnable,
9469
9513
  onLayerChangeName = _ref.onLayerChangeName,
9470
9514
  onLayerChangeStyle = _ref.onLayerChangeStyle,
@@ -9497,7 +9541,7 @@ var LayerRow = function LayerRow(_ref) {
9497
9541
  }, /*#__PURE__*/React__default.createElement(Grid, {
9498
9542
  item: true,
9499
9543
  className: columnSizes.column1
9500
- }, dragHandle, layerEnableLayout || /*#__PURE__*/React__default.createElement(EnableLayer, {
9544
+ }, dragHandle, layerEnableLayout || /*#__PURE__*/React__default.createElement(EnableButton, {
9501
9545
  isEnabled: layer.enabled,
9502
9546
  title: layer.name,
9503
9547
  onChangeEnableLayer: function onChangeEnableLayer() {
@@ -9520,7 +9564,13 @@ var LayerRow = function LayerRow(_ref) {
9520
9564
  name: name
9521
9565
  });
9522
9566
  }
9523
- })), /*#__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, {
9524
9574
  item: true,
9525
9575
  className: "".concat(columnSizes.column3)
9526
9576
  }, layerStylesLayout || /*#__PURE__*/React__default.createElement(RenderStyles, {
@@ -9563,10 +9613,10 @@ var LayerRow = function LayerRow(_ref) {
9563
9613
  dimension: dimension
9564
9614
  });
9565
9615
  }
9566
- })), /*#__PURE__*/React__default.createElement(Grid, {
9616
+ }))), /*#__PURE__*/React__default.createElement(Grid, {
9567
9617
  item: true,
9568
9618
  className: columnSizes.column6
9569
- }, layerDeleteLayout || /*#__PURE__*/React__default.createElement(DeleteButton, {
9619
+ }, layerDeleteLayout || /*#__PURE__*/React__default.createElement(ManagerDeleteButton, {
9570
9620
  tooltipTitle: "Remove layer",
9571
9621
  onClickDelete: function onClickDelete() {
9572
9622
  onLayerDelete({
@@ -9616,7 +9666,7 @@ var DeleteLayerConnect = function DeleteLayerConnect(_ref) {
9616
9666
  var isLayerEnabled = useSelector(function (store) {
9617
9667
  return getLayerEnabled(store, layerId);
9618
9668
  });
9619
- return /*#__PURE__*/React.createElement(DeleteButton, {
9669
+ return /*#__PURE__*/React.createElement(ManagerDeleteButton, {
9620
9670
  tooltipTitle: "Remove layer",
9621
9671
  onClickDelete: function onClickDelete() {
9622
9672
  layerDelete$1({
@@ -9660,7 +9710,7 @@ var EnableLayerConnect = function EnableLayerConnect(_ref) {
9660
9710
  enabled: enabled
9661
9711
  }));
9662
9712
  }, [dispatch]);
9663
- return /*#__PURE__*/React.createElement(EnableLayer, {
9713
+ return /*#__PURE__*/React.createElement(EnableButton, {
9664
9714
  isEnabled: isEnabled,
9665
9715
  title: "Toggle this layer's visibility",
9666
9716
  onChangeEnableLayer: function onChangeEnableLayer(enable) {
@@ -10004,10 +10054,23 @@ var LayerRowConnect = function LayerRowConnect(_ref) {
10004
10054
  var isEnabled = useSelector(function (store) {
10005
10055
  return getLayerEnabled(store, layerId);
10006
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
+ });
10007
10069
  return /*#__PURE__*/React.createElement(LayerRow, {
10008
10070
  isEnabled: isEnabled,
10009
10071
  mapId: mapId,
10010
10072
  layerId: layerId,
10073
+ isLayerMissing: isLayerMissing,
10011
10074
  layerEnableLayout: /*#__PURE__*/React.createElement(EnableLayerConnect, {
10012
10075
  layerId: layerId
10013
10076
  }),
@@ -10067,7 +10130,7 @@ var DragHandle = function DragHandle(_ref) {
10067
10130
  _ref$hideTooltip = _ref.hideTooltip,
10068
10131
  hideTooltip = _ref$hideTooltip === void 0 ? false : _ref$hideTooltip;
10069
10132
  var tooltipTitle = hideTooltip ? '' : TOOLTIP_TITLE;
10070
- return /*#__PURE__*/React__default.createElement(LayerManagerButton, {
10133
+ return /*#__PURE__*/React__default.createElement(ManagerButton, {
10071
10134
  tooltipTitle: tooltipTitle,
10072
10135
  icon: /*#__PURE__*/React__default.createElement(DragIndicator, null),
10073
10136
  testId: "dragHandle".concat(index !== undefined ? "-".concat(index) : ''),
@@ -10254,7 +10317,7 @@ var BaseLayers = function BaseLayers(_ref) {
10254
10317
  }
10255
10318
  }, /*#__PURE__*/React.createElement(MenuItem, {
10256
10319
  disabled: true
10257
- }, "Select base layer"), availableBaseLayers.map(function (baseLayer) {
10320
+ }, "Base layer"), availableBaseLayers.map(function (baseLayer) {
10258
10321
  return /*#__PURE__*/React.createElement(MenuItem, {
10259
10322
  key: baseLayer.id,
10260
10323
  value: baseLayer.id
@@ -14962,13 +15025,15 @@ var isColorIntervalEven = function isColorIntervalEven(scale, timestep) {
14962
15025
  }
14963
15026
  };
14964
15027
 
14965
- var drawBackground = function drawBackground(context, theme, visibleTimeStart, visibleTimeEnd, canvasWidth, height, scale) {
15028
+ var drawBackground = function drawBackground(context, theme, visibleTimeStart, visibleTimeEnd, animationStartPx, animationEndPx, canvasWidth, height, scale) {
14966
15029
  var ctx = context;
14967
15030
  var _theme$palette$geoweb7 = theme.palette.geowebColors.timeSlider,
14968
15031
  timelineTimelineSurface = _theme$palette$geoweb7.timelineTimelineSurface,
14969
15032
  timelineNightTime = _theme$palette$geoweb7.timelineNightTime;
14970
15033
  ctx.fillStyle = timelineTimelineSurface.fill;
14971
15034
  ctx.fillRect(0, 0, canvasWidth, height);
15035
+ ctx.fillStyle = theme.palette.geowebColors.timeSlider.timelineSelectionBackground.rgba;
15036
+ ctx.fillRect(animationStartPx, 0, Math.max(animationEndPx - animationStartPx, 0), height);
14972
15037
  var colorChangeUnit = getColorChangeTimestepUnit(scale);
14973
15038
 
14974
15039
  var _getCustomRoundedStar = getCustomRoundedStartAndEnd(visibleTimeStart, visibleTimeEnd, colorChangeUnit),
@@ -15067,7 +15132,7 @@ var drawTimeScale = function drawTimeScale(context, theme, visibleTimeStart, vis
15067
15132
  drawLeftSideDateText(ctx, theme, dateText, height);
15068
15133
  };
15069
15134
 
15070
- var renderTimeSliderLegend = function renderTimeSliderLegend(context, theme, canvasWidth, height, centerTime, secondsPerPx, dataScaleToSecondsPerPx, selectedTimeUnix, scale, currentTimeUnix) {
15135
+ var renderTimeSliderLegend = function renderTimeSliderLegend(context, theme, canvasWidth, height, centerTime, secondsPerPx, dataScaleToSecondsPerPx, selectedTimeUnix, scale, currentTimeUnix, animationStartTime, animationEndTime) {
15071
15136
  var ctx = context;
15072
15137
 
15073
15138
  var _map3 = [0, canvasWidth].map(function (px) {
@@ -15077,7 +15142,14 @@ var renderTimeSliderLegend = function renderTimeSliderLegend(context, theme, can
15077
15142
  visibleTimeStart = _map4[0],
15078
15143
  visibleTimeEnd = _map4[1];
15079
15144
 
15080
- drawBackground(ctx, theme, visibleTimeStart, visibleTimeEnd, canvasWidth, height, scale);
15145
+ var _map5 = [animationStartTime, animationEndTime].map(function (time) {
15146
+ return timestampToPixel(time, centerTime, canvasWidth, secondsPerPx);
15147
+ }),
15148
+ _map6 = _slicedToArray(_map5, 2),
15149
+ animationStartPx = _map6[0],
15150
+ animationEndPx = _map6[1];
15151
+
15152
+ drawBackground(ctx, theme, visibleTimeStart, visibleTimeEnd, animationStartPx, animationEndPx, canvasWidth, height, scale);
15081
15153
  drawTimeScale(ctx, theme, visibleTimeStart, visibleTimeEnd, canvasWidth, height, scale, dataScaleToSecondsPerPx);
15082
15154
  drawNeedle(ctx, theme, canvasWidth, height, visibleTimeStart, visibleTimeEnd, selectedTimeUnix);
15083
15155
  drawCurrentTime(ctx, theme, canvasWidth, height, visibleTimeStart, visibleTimeEnd, currentTimeUnix);
@@ -15498,6 +15570,8 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
15498
15570
  currentTime = _ref.currentTime,
15499
15571
  dataStartTime = _ref.dataStartTime,
15500
15572
  dataEndTime = _ref.dataEndTime,
15573
+ animationStartTime = _ref.animationStartTime,
15574
+ animationEndTime = _ref.animationEndTime,
15501
15575
  isTimeSliderHoverOn = _ref.isTimeSliderHoverOn,
15502
15576
  timeStep = _ref.timeStep,
15503
15577
  onSetNewDate = _ref.onSetNewDate,
@@ -15525,6 +15599,20 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
15525
15599
  isNewSelectionTimeRequested = _React$useState6[0],
15526
15600
  setNewSelectionTimeRequested = _React$useState6[1];
15527
15601
 
15602
+ var _React$useState7 = React.useState(animationStartTime && moment.utc(animationStartTime).unix()),
15603
+ _React$useState8 = _slicedToArray(_React$useState7, 2),
15604
+ localAnimationStartTime = _React$useState8[0],
15605
+ setLocalAnimationStartTime = _React$useState8[1];
15606
+
15607
+ var _React$useState9 = React.useState(animationEndTime && moment.utc(animationEndTime).unix()),
15608
+ _React$useState10 = _slicedToArray(_React$useState9, 2),
15609
+ localAnimationEndTime = _React$useState10[0],
15610
+ setLocalAnimationEndTime = _React$useState10[1];
15611
+
15612
+ React.useEffect(function () {
15613
+ setLocalAnimationStartTime(animationStartTime && moment.utc(animationStartTime).unix());
15614
+ setLocalAnimationEndTime(animationEndTime && moment.utc(animationEndTime).unix());
15615
+ }, [animationStartTime, animationEndTime]);
15528
15616
  React.useEffect(function () {
15529
15617
  var handleKeyDown = function handleKeyDown(event) {
15530
15618
  if (event.key === 'Home') {
@@ -15622,7 +15710,7 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
15622
15710
  }
15623
15711
  },
15624
15712
  onRenderCanvas: function onRenderCanvas(ctx, width, height) {
15625
- renderTimeSliderLegend(ctx, theme, width, height, centerTime, secondsPerPx, dataScaleToSecondsPerPx, selectedTime, scale, currentTime);
15713
+ renderTimeSliderLegend(ctx, theme, width, height, centerTime, secondsPerPx, dataScaleToSecondsPerPx, selectedTime, scale, currentTime, localAnimationStartTime, localAnimationEndTime);
15626
15714
  }
15627
15715
  }));
15628
15716
  };
@@ -15914,6 +16002,9 @@ var drawPlayerLoopIcon = function drawPlayerLoopIcon(ctx, x, y, theme) {
15914
16002
  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');
15915
16003
  ctx.fillStyle = playerTimeMarkers.fill;
15916
16004
  ctx.fill(svgIconPath);
16005
+ ctx.strokeStyle = theme.palette.geowebColors.timeSlider.playerNeedlePlayer.rgba;
16006
+ ctx.lineWidth = 1;
16007
+ ctx.stroke(svgIconPath);
15917
16008
  ctx.restore();
15918
16009
  };
15919
16010
 
@@ -16690,10 +16781,10 @@ var OptionsMenuButtonConnect = function OptionsMenuButtonConnect(_ref) {
16690
16781
  var animationIntervalDefault = 5;
16691
16782
  var connectRedux$3 = connect(function (store, props) {
16692
16783
  return {
16693
- isAnimating: isAnimating(store, props.mapId),
16694
16784
  animationStartTime: getAnimationStartTime(store, props.mapId),
16695
16785
  animationEndTime: getAnimationEndTime(store, props.mapId),
16696
- timeStep: getMapTimeStep(store, props.mapId)
16786
+ timeStep: getMapTimeStep(store, props.mapId),
16787
+ linkedMapAnimationInfo: linkedMapAnimationInfo(store, props.mapId)
16697
16788
  };
16698
16789
  }, {
16699
16790
  mapStartAnimation: mapStartAnimation,
@@ -16701,19 +16792,19 @@ var connectRedux$3 = connect(function (store, props) {
16701
16792
  });
16702
16793
  var PlayButtonConnect = connectRedux$3(function (_ref) {
16703
16794
  var mapId = _ref.mapId,
16704
- isAnimating = _ref.isAnimating,
16705
16795
  animationStartTime = _ref.animationStartTime,
16706
16796
  animationEndTime = _ref.animationEndTime,
16707
16797
  isDisabled = _ref.isDisabled,
16708
16798
  timeStep = _ref.timeStep,
16799
+ linkedMapAnimationInfo = _ref.linkedMapAnimationInfo,
16709
16800
  mapStartAnimation = _ref.mapStartAnimation,
16710
16801
  mapStopAnimation = _ref.mapStopAnimation;
16711
16802
  var animationInterval = timeStep || animationIntervalDefault;
16712
16803
 
16713
16804
  var onTogglePlay = function onTogglePlay() {
16714
- if (isAnimating) {
16805
+ if (linkedMapAnimationInfo.isAnimating) {
16715
16806
  mapStopAnimation({
16716
- mapId: mapId
16807
+ mapId: linkedMapAnimationInfo.id
16717
16808
  });
16718
16809
  } else {
16719
16810
  mapStartAnimation({
@@ -16726,7 +16817,7 @@ var PlayButtonConnect = connectRedux$3(function (_ref) {
16726
16817
  };
16727
16818
 
16728
16819
  return /*#__PURE__*/React__default.createElement(PlayButton, {
16729
- isAnimating: isAnimating,
16820
+ isAnimating: linkedMapAnimationInfo.isAnimating,
16730
16821
  isDisabled: isDisabled,
16731
16822
  onTogglePlayButton: function onTogglePlayButton() {
16732
16823
  onTogglePlay();
@@ -16783,52 +16874,6 @@ var TimeSliderButtonsConnect = function TimeSliderButtonsConnect(_ref) {
16783
16874
  });
16784
16875
  };
16785
16876
 
16786
- /* *
16787
- * Licensed under the Apache License, Version 2.0 (the "License");
16788
- * you may not use this file except in compliance with the License.
16789
- * You may obtain a copy of the License at
16790
- *
16791
- * http://www.apache.org/licenses/LICENSE-2.0
16792
- *
16793
- * Unless required by applicable law or agreed to in writing, software
16794
- * distributed under the License is distributed on an "AS IS" BASIS,
16795
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16796
- * See the License for the specific language governing permissions and
16797
- * limitations under the License.
16798
- *
16799
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16800
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
16801
- * */
16802
-
16803
- var synchronizationGroupStore = function synchronizationGroupStore(store) {
16804
- return store && store.syncronizationGroupStore ? store.syncronizationGroupStore : null;
16805
- };
16806
-
16807
- var getSynchronizationGroupStore = createSelector(synchronizationGroupStore, function (store) {
16808
- return store;
16809
- });
16810
- /**
16811
- * Returns the synchronization source by id
16812
- * @param store The app store
16813
- * @param id The source id to find
16814
- */
16815
-
16816
- var getSyncSourceBySourceId = function getSyncSourceBySourceId(state, id) {
16817
- if (state && state.sources) {
16818
- var sources = state.sources;
16819
-
16820
- if (sources.byId[id]) {
16821
- return sources.byId[id];
16822
- }
16823
- }
16824
-
16825
- return null;
16826
- };
16827
-
16828
- var getTime = createSelector(getSyncSourceBySourceId, function (store) {
16829
- return store && store.payloadByType && store.payloadByType[SYNCGROUPS_TYPE_SETTIME] ? store.payloadByType[SYNCGROUPS_TYPE_SETTIME].value : null;
16830
- });
16831
-
16832
16877
  var connectRedux$2 = connect(function (store, props) {
16833
16878
  return {
16834
16879
  layers: getMapLayers(store, props.mapId),
@@ -16840,7 +16885,9 @@ var connectRedux$2 = connect(function (store, props) {
16840
16885
  isAnimating: isAnimating(store, props.mapId),
16841
16886
  timeStep: getMapTimeStep(store, props.mapId),
16842
16887
  isTimeSliderHoverOn: isTimeSliderHoverOn(store, props.mapId),
16843
- timeValue: getTime(getSynchronizationGroupStore(store), props.sourceId)
16888
+ timeValue: getTime(getSynchronizationGroupStore(store), props.sourceId),
16889
+ animationStartTime: getAnimationStartTime(store, props.mapId),
16890
+ animationEndTime: getAnimationEndTime(store, props.mapId)
16844
16891
  };
16845
16892
  }, {
16846
16893
  stopMapAnimation: mapStopAnimation,
@@ -16863,6 +16910,8 @@ var TimeSliderLegendConnect = function TimeSliderLegendConnect(_ref) {
16863
16910
  isAnimating = _ref.isAnimating,
16864
16911
  timeStep = _ref.timeStep,
16865
16912
  isTimeSliderHoverOn = _ref.isTimeSliderHoverOn,
16913
+ animationStartTime = _ref.animationStartTime,
16914
+ animationEndTime = _ref.animationEndTime,
16866
16915
  stopMapAnimation = _ref.stopMapAnimation,
16867
16916
  setTime = _ref.setTime,
16868
16917
  syncGroupAddSource = _ref.syncGroupAddSource,
@@ -16901,6 +16950,8 @@ var TimeSliderLegendConnect = function TimeSliderLegendConnect(_ref) {
16901
16950
  isTimeSliderHoverOn: isTimeSliderHoverOn,
16902
16951
  dataStartTime: dataStartTime,
16903
16952
  dataEndTime: dataEndTime,
16953
+ animationStartTime: animationStartTime,
16954
+ animationEndTime: animationEndTime,
16904
16955
  timeStep: timeStep,
16905
16956
  onSetNewDate: function onSetNewDate(newDate) {
16906
16957
  if (isAnimating) {
@@ -22825,103 +22876,6 @@ var useStyles = makeStyles(function (theme) {
22825
22876
  });
22826
22877
  });
22827
22878
 
22828
- /* *
22829
- * Licensed under the Apache License, Version 2.0 (the "License");
22830
- * you may not use this file except in compliance with the License.
22831
- * You may obtain a copy of the License at
22832
- *
22833
- * http://www.apache.org/licenses/LICENSE-2.0
22834
- *
22835
- * Unless required by applicable law or agreed to in writing, software
22836
- * distributed under the License is distributed on an "AS IS" BASIS,
22837
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22838
- * See the License for the specific language governing permissions and
22839
- * limitations under the License.
22840
- *
22841
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
22842
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
22843
- * */
22844
- var emptyState = {
22845
- timeslider: {
22846
- groups: [],
22847
- sourcesById: []
22848
- },
22849
- zoompane: {
22850
- groups: [],
22851
- sourcesById: []
22852
- },
22853
- level: {
22854
- groups: [],
22855
- sourcesById: []
22856
- }
22857
- };
22858
- var groupTypes = [{
22859
- title: 'Timeslider',
22860
- syncType: 'SYNCGROUPS_TYPE_SETTIME',
22861
- groupType: 'timeslider'
22862
- }, {
22863
- title: 'Zoompane',
22864
- syncType: 'SYNCGROUPS_TYPE_SETBBOX',
22865
- groupType: 'zoompane'
22866
- }];
22867
- /*
22868
- _____ Creates viewState _____
22869
- - Runs Each time viewState is created:
22870
- - Fill arrays inside initialState with objects containing new values from Redux
22871
- */
22872
-
22873
- var createSyncGroupViewState = function createSyncGroupViewState(syncState) {
22874
- var initialState = produce(emptyState, function (draft) {
22875
- /*
22876
- _____ 1. Fill groups _____
22877
- 1. Goes through all groups by ID
22878
- 2. Collects original timeslider or zoompane values into an array
22879
- 3. Sorts and adds selected sources to ViewState based on ID type
22880
- */
22881
- Object.keys(syncState.groups.byId).forEach(function (id) {
22882
- var _a;
22883
-
22884
- var groupType = (_a = groupTypes.find(function (object) {
22885
- return object.syncType === syncState.groups.byId[id].type;
22886
- })) === null || _a === void 0 ? void 0 : _a.groupType;
22887
-
22888
- if (groupType) {
22889
- draft[groupType].groups.push({
22890
- id: id,
22891
- selected: syncState.groups.byId[id].targets.allIds
22892
- });
22893
- }
22894
- });
22895
- /*
22896
- _____ 2. Fill sourcesById _____
22897
- 1. Loop though sources and add source to each group type
22898
- */
22899
-
22900
- Object.keys(syncState.sources.byId).forEach(function (id) {
22901
- groupTypes.forEach(function (_ref) {
22902
- var syncType = _ref.syncType,
22903
- groupType = _ref.groupType;
22904
-
22905
- if (syncState.sources.byId[id].types.includes(syncType)) {
22906
- draft[groupType].sourcesById.push({
22907
- id: id,
22908
- name: id
22909
- });
22910
- }
22911
- });
22912
- });
22913
- });
22914
- return initialState;
22915
- }; // TODO
22916
- // Improve selector to reduce unnecessary re-rendering
22917
- // https://gitlab.com/opengeoweb/opengeoweb/-/issues/1333
22918
-
22919
- var syncState = function syncState(store) {
22920
- return store.syncronizationGroupStore;
22921
- };
22922
-
22923
- var createSyncGroupViewStateSelector = createSelector(syncState, createSyncGroupViewState);
22924
-
22925
22879
  var SyncGroupViewer = function SyncGroupViewer(_ref) {
22926
22880
  var onClose = _ref.onClose,
22927
22881
  isOpen = _ref.isOpen,
@@ -22929,7 +22883,10 @@ var SyncGroupViewer = function SyncGroupViewer(_ref) {
22929
22883
  syncGroupAddTarget = _ref.syncGroupAddTarget,
22930
22884
  syncGroupRemoveTarget = _ref.syncGroupRemoveTarget,
22931
22885
  syncGroupAddGroup = _ref.syncGroupAddGroup,
22932
- syncGroupRemoveGroup = _ref.syncGroupRemoveGroup;
22886
+ syncGroupRemoveGroup = _ref.syncGroupRemoveGroup,
22887
+ onMouseDown = _ref.onMouseDown,
22888
+ _ref$order = _ref.order,
22889
+ order = _ref$order === void 0 ? 0 : _ref$order;
22933
22890
 
22934
22891
  /*
22935
22892
  _____ Handle Toggle _____
@@ -23030,7 +22987,9 @@ var SyncGroupViewer = function SyncGroupViewer(_ref) {
23030
22987
  headerSize: "medium",
23031
22988
  isOpen: isOpen,
23032
22989
  onClose: onClose,
23033
- "data-testid": "syncGroupViewer"
22990
+ "data-testid": "syncGroupViewer",
22991
+ onMouseDown: onMouseDown,
22992
+ order: order
23034
22993
  }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SyncGroupList, {
23035
22994
  viewStateData: syncGroupViewState.zoompane,
23036
22995
  title: "ZoomPane",
@@ -23086,14 +23045,12 @@ var SyncGroupViewer = function SyncGroupViewer(_ref) {
23086
23045
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
23087
23046
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
23088
23047
  * */
23089
- var SyncGroupViewerConnect = function SyncGroupViewerConnect(_ref) {
23090
- var onClose = _ref.onClose,
23091
- isOpen = _ref.isOpen;
23048
+ var SyncGroupViewerConnect = function SyncGroupViewerConnect() {
23092
23049
  var dispatch = useDispatch(); // TODO
23093
23050
  // Improve the selector to prevent re-renders
23094
23051
  // For example dusting anination syncgroups should not re-render
23095
23052
 
23096
- var viewState = useSelector(createSyncGroupViewStateSelector);
23053
+ var viewState = useSelector(syncGroupGetViewState);
23097
23054
  var syncGroupAddGroup$1 = React.useCallback(function (payload) {
23098
23055
  return dispatch(syncGroupAddGroup(payload));
23099
23056
  }, [dispatch]);
@@ -23106,14 +23063,55 @@ var SyncGroupViewerConnect = function SyncGroupViewerConnect(_ref) {
23106
23063
  var syncGroupRemoveTarget$1 = React.useCallback(function (payload) {
23107
23064
  return dispatch(syncGroupRemoveTarget(payload));
23108
23065
  }, [dispatch]);
23066
+ var isOpenInStore = useSelector(function (store) {
23067
+ return getisDialogOpen(store, 'syncGroups');
23068
+ });
23069
+ var onClose = React.useCallback(function () {
23070
+ return dispatch(setToggleOpenDialog({
23071
+ type: 'syncGroups',
23072
+ setOpen: false
23073
+ }));
23074
+ }, [dispatch]);
23075
+ var uiOrder = useSelector(function (store) {
23076
+ return getDialogOrder(store, 'syncGroups');
23077
+ });
23078
+ var uiIsOrderedOnTop = useSelector(function (store) {
23079
+ return getDialogIsOrderedOnTop(store, 'syncGroups');
23080
+ });
23081
+ var registerDialog$1 = React.useCallback(function () {
23082
+ return dispatch(registerDialog({
23083
+ type: 'syncGroups',
23084
+ setOpen: false
23085
+ }));
23086
+ }, [dispatch]);
23087
+ var unregisterDialog$1 = React.useCallback(function () {
23088
+ return dispatch(unregisterDialog({
23089
+ type: 'syncGroups'
23090
+ }));
23091
+ }, [dispatch]);
23092
+ var onOrderDialog = React.useCallback(function () {
23093
+ if (!uiIsOrderedOnTop) {
23094
+ dispatch(orderDialog({
23095
+ type: 'syncGroups'
23096
+ }));
23097
+ }
23098
+ }, [dispatch, uiIsOrderedOnTop]);
23099
+ React.useEffect(function () {
23100
+ registerDialog$1();
23101
+ return function () {
23102
+ unregisterDialog$1();
23103
+ }; // eslint-disable-next-line react-hooks/exhaustive-deps
23104
+ }, []);
23109
23105
  return /*#__PURE__*/React.createElement(SyncGroupViewer, {
23110
23106
  onClose: onClose,
23111
- isOpen: isOpen,
23107
+ isOpen: isOpenInStore,
23112
23108
  syncGroupViewState: viewState,
23113
23109
  syncGroupAddTarget: syncGroupAddTarget$1,
23114
23110
  syncGroupRemoveTarget: syncGroupRemoveTarget$1,
23115
23111
  syncGroupAddGroup: syncGroupAddGroup$1,
23116
- syncGroupRemoveGroup: syncGroupRemoveGroup$1
23112
+ syncGroupRemoveGroup: syncGroupRemoveGroup$1,
23113
+ order: uiOrder,
23114
+ onMouseDown: onOrderDialog
23117
23115
  });
23118
23116
  };
23119
23117
 
@@ -23305,4 +23303,4 @@ var CoreThemeStoreProvider = function CoreThemeStoreProvider(_ref2) {
23305
23303
  }, children)));
23306
23304
  };
23307
23305
 
23308
- export { ConfigurableConnectedMap, ConfigurableMapWithSliderConnect, CoreThemeProvider, CoreThemeStoreProvider, HarmRefTimePreset, HarmonieTempAndPrecipPreset, LayerManagerConnect, LayerManagerMapButtonConnect, Legend, LegendConnect, LegendMapButtonConnect, MapControls, MapView, MapViewConnect, MapViewLayer, MultiDimensionSelectMapButtonsConnect, MultiMapMultiDimensionSelectConnect as MultiMapDimensionSelectConnect, MultiMapViewConnect, ReactMapView, ReactMapViewLayer, SyncGroupViewerConnect, index as SyncGroups, TimeSliderConnect, TooltipSelect, ZoomControlConnect, ZoomControls, componentsLookUp, coreModuleConfig, dateFormat, defaultConfigurations, filterBaseLayers, filterBbox, filterDimensions, filterMapLayers, filterMapPresets, filterNonTimeDimensions, filterServices, filterSrs, generateLayerId, generateMapId, generateTimesliderId, getFirstTimeStepForLayerId, getInitialPresets, getLastTimeStepForLayerId, getNextTimeStepForLayerId, getPreviousTimeStepForLayerId, getWMJSDimensionForLayerAndDimension, getWMJSMapById, getWMJSTimeDimensionForLayerId, getWMLayerById, reducer$6 as layerReducer, makeMapPreset, actions$3 as mapActions, constants$1 as mapConstants, moduleConfig as mapModuleConfig, selectors$1 as mapSelectors, types$2 as mapTypes, utils as mapUtils, publicLayers, publicServices, registerWMJSMap, registerWMLayer, store, actions as syncGroupActions, synchronizationGroupConfig as synchronizationGroupModuleConfig, testLayers, actions$2 as uiActions, uiModuleConfig, selectors as uiSelectors, types$1 as uiTypes, useStyles$3 as useStyles };
23306
+ export { ConfigurableConnectedMap, ConfigurableMapWithSliderConnect, CoreThemeProvider, CoreThemeStoreProvider, HarmRefTimePreset, HarmonieTempAndPrecipPreset, LayerManagerConnect, LayerManagerMapButtonConnect, Legend, LegendConnect, LegendMapButtonConnect, MapControls, MapView, MapViewConnect, MapViewLayer, MultiDimensionSelectMapButtonsConnect, MultiMapMultiDimensionSelectConnect as MultiMapDimensionSelectConnect, MultiMapViewConnect, ReactMapView, ReactMapViewLayer, SyncGroupViewerConnect, index as SyncGroups, TimeSliderConnect, TooltipSelect, ZoomControlConnect, ZoomControls, componentsLookUp, coreModuleConfig, dateFormat, defaultConfigurations, filterBaseLayers, filterBbox, filterDimensions, filterMapLayers, filterMapPresets, filterNonTimeDimensions, filterServices, filterSrs, generateLayerId, generateMapId, generateTimesliderId, getFirstTimeStepForLayerId, getInitialPresets, getLastTimeStepForLayerId, getNextTimeStepForLayerId, getPreviousTimeStepForLayerId, getWMJSDimensionForLayerAndDimension, getWMJSMapById, getWMJSTimeDimensionForLayerId, getWMLayerById, reducer$6 as layerReducer, makeMapPreset, actions$3 as mapActions, constants as mapConstants, moduleConfig as mapModuleConfig, selectors$1 as mapSelectors, types$2 as mapTypes, utils as mapUtils, publicLayers, publicServices, registerWMJSMap, registerWMLayer, store, actions as syncGroupActions, synchronizationGroupConfig as synchronizationGroupModuleConfig, testLayers, actions$2 as uiActions, uiModuleConfig, selectors as uiSelectors, types$1 as uiTypes, useStyles$3 as useStyles };