@opengeoweb/core 4.17.0 → 4.18.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.
- package/index.esm.js +1425 -778
- package/index.umd.js +1410 -722
- package/lib/components/ConfigurableMap/ConfigurableMapConnect.d.ts +4 -2
- package/lib/components/LayerManager/LayerManager.custom.stories.d.ts +6 -0
- package/lib/components/LayerManager/LayerManager.d.ts +1 -0
- package/lib/components/LayerManager/LayerManagerHeaderOptions.d.ts +1 -0
- package/lib/components/LayerManager/LayerManagerHeaderOptionsConnect.d.ts +11 -0
- package/lib/components/LayerManager/LayerManagerHeaderOptionsConnect.spec.d.ts +1 -0
- package/lib/components/LayerManager/useFetchServices.d.ts +2 -0
- package/lib/components/MultiMapView/MultiMapViewConnect.d.ts +4 -2
- package/lib/components/SyncGroups/utils.d.ts +6 -4
- package/lib/hooks/useSetupDialog/useSetupDialog.d.ts +1 -0
- package/lib/index.d.ts +4 -3
- package/lib/store/generic/sagas.d.ts +1 -1
- package/lib/store/generic/synchronizationGroups/types.d.ts +1 -0
- package/lib/store/generic/types.d.ts +2 -2
- package/lib/store/layerSelect/reducer.d.ts +2 -3
- package/lib/store/layerSelect/sagas.d.ts +1 -2
- package/lib/store/layerSelect/types.d.ts +0 -10
- package/lib/store/mapStore/layers/selectors.d.ts +3 -3
- package/lib/store/mapStore/layers/types.d.ts +2 -1
- package/lib/store/mapStore/map/reducer.d.ts +3 -3
- package/lib/store/mapStore/map/selectors.d.ts +73 -35
- package/lib/store/mapStore/map/types.d.ts +9 -3
- package/lib/store/mapStore/map/utils.d.ts +4 -3
- package/lib/store/mapStore/service/reducer.d.ts +2 -1
- package/lib/store/mapStore/service/sagas.d.ts +7 -0
- package/lib/store/mapStore/service/sagas.spec.d.ts +1 -0
- package/lib/store/mapStore/service/types.d.ts +10 -0
- package/lib/store/ui/reducer.d.ts +3 -1
- package/lib/store/ui/selectors.d.ts +12 -0
- package/lib/store/ui/types.d.ts +5 -0
- package/lib/storybookUtils/defaultStorySettings.d.ts +0 -1
- package/package.json +6 -6
package/index.esm.js
CHANGED
|
@@ -3,11 +3,11 @@ import produce$1, { current, produce } from 'immer';
|
|
|
3
3
|
import moment from 'moment';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import React__default, { Component, useRef, useState, useEffect, useCallback } from 'react';
|
|
6
|
-
import _, { debounce, isEqual, escapeRegExp, groupBy, throttle, range } from 'lodash';
|
|
6
|
+
import _, { debounce, isEqual, compact, escapeRegExp, groupBy, throttle, range } from 'lodash';
|
|
7
7
|
import { takeLatest, put, select, call, takeEvery, all, delay } from 'redux-saga/effects';
|
|
8
8
|
import { connect, useDispatch, useSelector, Provider } from 'react-redux';
|
|
9
|
-
import { CustomTooltip, ToolButton, ToolContainerDraggable, TooltipSelect, AlertIcon, useControlledTooltip, tooltipContainerStyles, sliderHeaderStyle, CustomSlider, ToggleMenu, CustomAccordion,
|
|
10
|
-
import { Pause, Play, CollapseSmall, CollapseMedium, CollapseLarge, CollapseWindow, ExpandWindow, Add, Copy, None, Both, DragHandle as DragHandle$1, Cached, Filter, Search, Clear, Info, DimensionsOther, DimensionsElevation, DimensionsRefTime, DimensionsTime, Edit,
|
|
9
|
+
import { CustomTooltip, ToolButton, ToolContainerDraggable, TooltipSelect, AlertIcon, useControlledTooltip, tooltipContainerStyles, sliderHeaderStyle, CustomSlider, ToggleMenu, CustomAccordion, ManagerButton, AlertBanner, calculateDialogSizeAndPosition, CustomToggleButton, useMakeSureContainerStaysInsideWindow, withEggs } from '@opengeoweb/shared';
|
|
10
|
+
import { Pause, Play, CollapseSmall, CollapseMedium, CollapseLarge, CollapseWindow, ExpandWindow, Add, Copy, None, Both, Visibility, VisibilityOff, Delete, DragHandle as DragHandle$1, Cached, Filter, Search, Clear, Info, DimensionsOther, DimensionsElevation, DimensionsRefTime, DimensionsTime, Edit, Close, Home, Minus, Layers, Equalizer, Link, LinkOff, AutoUpdateActive, AutoUpdateInActive, Speed, FastForward, Clock, Now, Animation, Options, StepForward, StepBackward, dragHandlePath, ChevronDown, ChevronUp, List as List$1, ChevronRight, ChevronLeft, Resize, ExitDomain, ThemeWrapper, lightTheme } from '@opengeoweb/theme';
|
|
11
11
|
import { Paper, Box, Typography, IconButton, Grid, MenuItem, Button, Popper, ListItemText, ListItemIcon, FormControl, InputLabel, List, ListItem, CircularProgress, ListSubheader, Dialog, DialogTitle, DialogContent, DialogContentText, TextField, DialogActions, LinearProgress, InputAdornment, Backdrop, ListItemSecondaryAction, Checkbox, Switch, styled, Slider, Menu, useTheme, Snackbar } from '@mui/material';
|
|
12
12
|
import { legendImageStore, WMImageEventType, getLegendGraphicURLForLayer, WMGetServiceFromStore, LayerType as LayerType$1, clearImageCache, getMapImageStore, WMBBOX, debug, DebugType, WMJSMap, WMLayer } from '@opengeoweb/webmap';
|
|
13
13
|
import { ReactSortable } from 'react-sortablejs';
|
|
@@ -588,7 +588,11 @@ var getWMJSTimeDimensionForLayerId = function getWMJSTimeDimensionForLayerId(lay
|
|
|
588
588
|
|
|
589
589
|
var getPreviousTimeStepForLayerId = function getPreviousTimeStepForLayerId(layerId) {
|
|
590
590
|
var wmjsTimeDim = getWMJSTimeDimensionForLayerId(layerId);
|
|
591
|
-
|
|
591
|
+
|
|
592
|
+
if (!wmjsTimeDim) {
|
|
593
|
+
return null;
|
|
594
|
+
}
|
|
595
|
+
|
|
592
596
|
var currentIndex = wmjsTimeDim.getIndexForValue(wmjsTimeDim.currentValue, false);
|
|
593
597
|
|
|
594
598
|
if (currentIndex < 0 || currentIndex - 1 < 0) {
|
|
@@ -624,7 +628,11 @@ var getNextTimeStepForLayerId = function getNextTimeStepForLayerId(layerId) {
|
|
|
624
628
|
|
|
625
629
|
var getFirstTimeStepForLayerId = function getFirstTimeStepForLayerId(layerId) {
|
|
626
630
|
var wmjsTimeDim = getWMJSTimeDimensionForLayerId(layerId);
|
|
627
|
-
|
|
631
|
+
|
|
632
|
+
if (!wmjsTimeDim) {
|
|
633
|
+
return null;
|
|
634
|
+
}
|
|
635
|
+
|
|
628
636
|
return wmjsTimeDim.getFirstValue();
|
|
629
637
|
};
|
|
630
638
|
/**
|
|
@@ -634,7 +642,11 @@ var getFirstTimeStepForLayerId = function getFirstTimeStepForLayerId(layerId) {
|
|
|
634
642
|
|
|
635
643
|
var getLastTimeStepForLayerId = function getLastTimeStepForLayerId(layerId) {
|
|
636
644
|
var wmjsTimeDim = getWMJSTimeDimensionForLayerId(layerId);
|
|
637
|
-
|
|
645
|
+
|
|
646
|
+
if (!wmjsTimeDim) {
|
|
647
|
+
return null;
|
|
648
|
+
}
|
|
649
|
+
|
|
638
650
|
return wmjsTimeDim.getLastValue();
|
|
639
651
|
};
|
|
640
652
|
|
|
@@ -1135,8 +1147,8 @@ var createMap = function createMap(_ref) {
|
|
|
1135
1147
|
featureLayers = _ref$featureLayers === void 0 ? [] : _ref$featureLayers,
|
|
1136
1148
|
_ref$dimensions = _ref.dimensions,
|
|
1137
1149
|
dimensions = _ref$dimensions === void 0 ? [] : _ref$dimensions,
|
|
1138
|
-
|
|
1139
|
-
|
|
1150
|
+
autoUpdateLayerId = _ref.autoUpdateLayerId,
|
|
1151
|
+
autoTimeStepLayerId = _ref.autoTimeStepLayerId,
|
|
1140
1152
|
_ref$timeSliderScale = _ref.timeSliderScale,
|
|
1141
1153
|
timeSliderScale = _ref$timeSliderScale === void 0 ? Scale.Hour : _ref$timeSliderScale,
|
|
1142
1154
|
_ref$timeStep = _ref.timeStep,
|
|
@@ -1175,7 +1187,8 @@ var createMap = function createMap(_ref) {
|
|
|
1175
1187
|
mapLayers: mapLayers,
|
|
1176
1188
|
featureLayers: featureLayers,
|
|
1177
1189
|
dimensions: dimensions,
|
|
1178
|
-
|
|
1190
|
+
autoUpdateLayerId: autoUpdateLayerId,
|
|
1191
|
+
autoTimeStepLayerId: autoTimeStepLayerId,
|
|
1179
1192
|
timeSliderScale: timeSliderScale,
|
|
1180
1193
|
timeStep: timeStep,
|
|
1181
1194
|
animationDelay: animationDelay,
|
|
@@ -1222,7 +1235,10 @@ var checkValidLayersPayload = function checkValidLayersPayload(layers, mapId) {
|
|
|
1222
1235
|
|
|
1223
1236
|
var getDraftMapById = function getDraftMapById(mapId, draft) {
|
|
1224
1237
|
var map = draft.byId[mapId];
|
|
1225
|
-
|
|
1238
|
+
|
|
1239
|
+
if (map) {
|
|
1240
|
+
return map;
|
|
1241
|
+
}
|
|
1226
1242
|
|
|
1227
1243
|
if (!draft.allIds.includes(mapId)) {
|
|
1228
1244
|
draft.byId[mapId] = createMap({
|
|
@@ -1247,7 +1263,10 @@ var produceDraftStateSetWebMapDimension = function produceDraftStateSetWebMapDim
|
|
|
1247
1263
|
var map = getDraftMapById(mapId, draft);
|
|
1248
1264
|
|
|
1249
1265
|
if (dimensionFromAction) {
|
|
1250
|
-
if (!map.dimensions)
|
|
1266
|
+
if (!map.dimensions) {
|
|
1267
|
+
map.dimensions = [];
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1251
1270
|
var dimensions = map.dimensions;
|
|
1252
1271
|
var mapDim = dimensions.find(function (dim) {
|
|
1253
1272
|
return dim.name === dimensionFromAction.name;
|
|
@@ -1272,6 +1291,10 @@ var produceDraftStateSetWebMapDimension = function produceDraftStateSetWebMapDim
|
|
|
1272
1291
|
*/
|
|
1273
1292
|
|
|
1274
1293
|
var findMapIdFromLayerId = function findMapIdFromLayerId(draft, layerId) {
|
|
1294
|
+
if (!draft || !layerId) {
|
|
1295
|
+
return null;
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1275
1298
|
for (var i = 0; i < draft.allIds.length; i += 1) {
|
|
1276
1299
|
var mapId = draft.allIds[i];
|
|
1277
1300
|
var layerIds = draft.byId[mapId].mapLayers;
|
|
@@ -1403,7 +1426,10 @@ var utils = /*#__PURE__*/Object.freeze({
|
|
|
1403
1426
|
*/
|
|
1404
1427
|
|
|
1405
1428
|
var produceLayerDimensionDraftState = function produceLayerDimensionDraftState(draft, layerId, dimensionValueToUpdate) {
|
|
1406
|
-
if (!draft.byId[layerId].dimensions)
|
|
1429
|
+
if (!draft.byId[layerId].dimensions) {
|
|
1430
|
+
draft.byId[layerId].dimensions = [];
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1407
1433
|
var existingLayerDimIndex = draft.byId[layerId].dimensions.findIndex(function (layerDim) {
|
|
1408
1434
|
return layerDim.name === dimensionValueToUpdate.name;
|
|
1409
1435
|
});
|
|
@@ -1426,13 +1452,24 @@ var produceLayerDimensionDraftState = function produceLayerDimensionDraftState(d
|
|
|
1426
1452
|
};
|
|
1427
1453
|
|
|
1428
1454
|
var isActionLayerSynced = function isActionLayerSynced(state, layerIdFromAction, dimension) {
|
|
1429
|
-
if (dimension.synced !== undefined)
|
|
1455
|
+
if (dimension.synced !== undefined) {
|
|
1456
|
+
return dimension.synced;
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1430
1459
|
var actionLayer = state.byId[layerIdFromAction];
|
|
1431
|
-
|
|
1460
|
+
|
|
1461
|
+
if (!actionLayer) {
|
|
1462
|
+
return false;
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1432
1465
|
var layerDimensionIndex = actionLayer.dimensions.findIndex(function (layerDim) {
|
|
1433
1466
|
return layerDim.name === dimension.name;
|
|
1434
1467
|
});
|
|
1435
|
-
|
|
1468
|
+
|
|
1469
|
+
if (layerDimensionIndex < 0) {
|
|
1470
|
+
return false;
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1436
1473
|
return actionLayer.dimensions[layerDimensionIndex].synced === true;
|
|
1437
1474
|
};
|
|
1438
1475
|
var produceDimensionActionForMapLayer = function produceDimensionActionForMapLayer(layerDim, wmjsDimension, newDimension) {
|
|
@@ -1464,7 +1501,10 @@ var produceDimensionActionForMapLayer = function produceDimensionActionForMapLay
|
|
|
1464
1501
|
var produceDraftStateForAllLayersForDimensionWithinMap = function produceDraftStateForAllLayersForDimensionWithinMap(draft, dimension, mapId, layerIdFromAction
|
|
1465
1502
|
/* Layer ID or null if not known */
|
|
1466
1503
|
) {
|
|
1467
|
-
if (!mapId)
|
|
1504
|
+
if (!mapId) {
|
|
1505
|
+
return;
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1468
1508
|
var actionLayerSynced = isActionLayerSynced(draft, layerIdFromAction, dimension);
|
|
1469
1509
|
|
|
1470
1510
|
for (var li = 0; li < draft.allIds.length; li += 1) {
|
|
@@ -1701,7 +1741,11 @@ var slice$8 = createSlice({
|
|
|
1701
1741
|
layerIdFromAction = _action$payload2.layerId,
|
|
1702
1742
|
dimension = _action$payload2.dimension;
|
|
1703
1743
|
var layerFromAction = draft.byId[layerIdFromAction];
|
|
1704
|
-
|
|
1744
|
+
|
|
1745
|
+
if (!layerFromAction) {
|
|
1746
|
+
return;
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1705
1749
|
var mapId = layerFromAction.mapId;
|
|
1706
1750
|
produceDraftStateForAllLayersForDimensionWithinMap(draft, dimension, mapId, layerIdFromAction);
|
|
1707
1751
|
},
|
|
@@ -1924,7 +1968,10 @@ var slice$8 = createSlice({
|
|
|
1924
1968
|
}); // add new available baselayers
|
|
1925
1969
|
|
|
1926
1970
|
layers.forEach(function (layer) {
|
|
1927
|
-
if (layer.layerType !== LayerType.baseLayer || !layer.mapId)
|
|
1971
|
+
if (layer.layerType !== LayerType.baseLayer || !layer.mapId) {
|
|
1972
|
+
return;
|
|
1973
|
+
}
|
|
1974
|
+
|
|
1928
1975
|
draft.availableBaseLayers.byId[layer.id] = createLayer(Object.assign({}, layer));
|
|
1929
1976
|
draft.availableBaseLayers.allIds.push(layer.id);
|
|
1930
1977
|
});
|
|
@@ -2043,7 +2090,10 @@ var slice$7 = createSlice({
|
|
|
2043
2090
|
serviceSetLayers: function serviceSetLayers(draft, action) {
|
|
2044
2091
|
var id = action.payload.id;
|
|
2045
2092
|
draft.byId[id] = Object.assign({}, action.payload);
|
|
2046
|
-
|
|
2093
|
+
|
|
2094
|
+
if (!draft.allIds.includes(id)) {
|
|
2095
|
+
draft.allIds.push(id);
|
|
2096
|
+
}
|
|
2047
2097
|
},
|
|
2048
2098
|
mapStoreRemoveService: function mapStoreRemoveService(draft, action) {
|
|
2049
2099
|
var foundServiceIndex = draft.allIds.findIndex(function (id) {
|
|
@@ -2057,12 +2107,19 @@ var slice$7 = createSlice({
|
|
|
2057
2107
|
});
|
|
2058
2108
|
delete draft.byId[serviceId];
|
|
2059
2109
|
}
|
|
2060
|
-
}
|
|
2110
|
+
},
|
|
2111
|
+
fetchInitialServices: function fetchInitialServices( // eslint-disable-next-line no-unused-vars
|
|
2112
|
+
draft, // eslint-disable-next-line no-unused-vars
|
|
2113
|
+
action) {}
|
|
2061
2114
|
},
|
|
2062
2115
|
extraReducers: function extraReducers(builder) {
|
|
2063
2116
|
return builder.addCase(layerActions.onUpdateLayerInformation, function (draft, action) {
|
|
2064
2117
|
var serviceLayers = action.payload.serviceLayers;
|
|
2065
|
-
|
|
2118
|
+
|
|
2119
|
+
if (serviceLayers === null) {
|
|
2120
|
+
return draft;
|
|
2121
|
+
}
|
|
2122
|
+
|
|
2066
2123
|
var mapAction = serviceActions.serviceSetLayers(serviceLayers);
|
|
2067
2124
|
var newState = reducer$7(draft, mapAction);
|
|
2068
2125
|
return newState;
|
|
@@ -2194,7 +2251,10 @@ var getLayerFromService = createSelector(function (store, serviceUrl) {
|
|
|
2194
2251
|
}, function (store, serviceUrl, layerName) {
|
|
2195
2252
|
return layerName;
|
|
2196
2253
|
}, function (layers, serviceUrl, layerName) {
|
|
2197
|
-
if (!layers)
|
|
2254
|
+
if (!layers) {
|
|
2255
|
+
return null;
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2198
2258
|
var index = layers.findIndex(function (serviceLayer) {
|
|
2199
2259
|
return serviceLayer.name === layerName;
|
|
2200
2260
|
});
|
|
@@ -2238,7 +2298,8 @@ var createUIDialogElement = function createUIDialogElement(_ref) {
|
|
|
2238
2298
|
type: type,
|
|
2239
2299
|
source: source,
|
|
2240
2300
|
isLoading: false,
|
|
2241
|
-
error: undefined
|
|
2301
|
+
error: undefined,
|
|
2302
|
+
focused: false
|
|
2242
2303
|
};
|
|
2243
2304
|
};
|
|
2244
2305
|
var initialState$6 = {
|
|
@@ -2313,6 +2374,10 @@ var slice$6 = createSlice({
|
|
|
2313
2374
|
if (setOpen) {
|
|
2314
2375
|
draft.order = moveToTop(draft.order, type);
|
|
2315
2376
|
}
|
|
2377
|
+
|
|
2378
|
+
if (!setOpen) {
|
|
2379
|
+
draft.dialogs[type].focused = false;
|
|
2380
|
+
}
|
|
2316
2381
|
},
|
|
2317
2382
|
orderDialog: function orderDialog(draft, action) {
|
|
2318
2383
|
var type = action.payload.type;
|
|
@@ -2333,6 +2398,17 @@ var slice$6 = createSlice({
|
|
|
2333
2398
|
error = _action$payload4.error,
|
|
2334
2399
|
type = _action$payload4.type;
|
|
2335
2400
|
draft.dialogs[type].error = error;
|
|
2401
|
+
},
|
|
2402
|
+
setDialogFocused: function setDialogFocused(draft, action) {
|
|
2403
|
+
var _action$payload5 = action.payload,
|
|
2404
|
+
focused = _action$payload5.focused,
|
|
2405
|
+
type = _action$payload5.type;
|
|
2406
|
+
|
|
2407
|
+
if (!draft.dialogs[type]) {
|
|
2408
|
+
return;
|
|
2409
|
+
}
|
|
2410
|
+
|
|
2411
|
+
draft.dialogs[type].focused = focused;
|
|
2336
2412
|
}
|
|
2337
2413
|
}
|
|
2338
2414
|
});
|
|
@@ -2373,7 +2449,10 @@ var checkIfMapLayerIdIsAlreadyTaken = function checkIfMapLayerIdIsAlreadyTaken(s
|
|
|
2373
2449
|
*/
|
|
2374
2450
|
|
|
2375
2451
|
var createLayersWithIds = function createLayersWithIds(state, layers) {
|
|
2376
|
-
if (!layers)
|
|
2452
|
+
if (!layers) {
|
|
2453
|
+
return layers;
|
|
2454
|
+
}
|
|
2455
|
+
|
|
2377
2456
|
return produce(layers, function (draft) {
|
|
2378
2457
|
for (var j = 0; j < draft.length; j += 1) {
|
|
2379
2458
|
var layer = draft[j];
|
|
@@ -2426,7 +2505,10 @@ var slice$5 = createSlice({
|
|
|
2426
2505
|
|
|
2427
2506
|
var srs = action.payload.srs || null;
|
|
2428
2507
|
draft.byId[mapId].bbox = bbox;
|
|
2429
|
-
|
|
2508
|
+
|
|
2509
|
+
if (srs) {
|
|
2510
|
+
draft.byId[mapId].srs = srs;
|
|
2511
|
+
}
|
|
2430
2512
|
},
|
|
2431
2513
|
mapUpdateAllMapDimensions: function mapUpdateAllMapDimensions(draft, action) {
|
|
2432
2514
|
var _action$payload2 = action.payload,
|
|
@@ -2437,7 +2519,6 @@ var slice$5 = createSlice({
|
|
|
2437
2519
|
return;
|
|
2438
2520
|
}
|
|
2439
2521
|
|
|
2440
|
-
draft.byId[mapId].dimensions.length = 0;
|
|
2441
2522
|
dimensions.forEach(function (dimension) {
|
|
2442
2523
|
return produceDraftStateSetWebMapDimension(draft, mapId, dimension, true);
|
|
2443
2524
|
});
|
|
@@ -2542,16 +2623,28 @@ var slice$5 = createSlice({
|
|
|
2542
2623
|
|
|
2543
2624
|
draft.byId[mapId].mapLayers = moveArrayElements(draft.byId[mapId].mapLayers, oldIndex, newIndex);
|
|
2544
2625
|
},
|
|
2545
|
-
|
|
2626
|
+
setAutoLayerId: function setAutoLayerId(draft, action) {
|
|
2546
2627
|
var _action$payload9 = action.payload,
|
|
2547
2628
|
mapId = _action$payload9.mapId,
|
|
2548
|
-
layerId = _action$payload9.layerId
|
|
2629
|
+
layerId = _action$payload9.layerId,
|
|
2630
|
+
autoTimeStepLayerId = _action$payload9.autoTimeStepLayerId,
|
|
2631
|
+
autoUpdateLayerId = _action$payload9.autoUpdateLayerId;
|
|
2632
|
+
var map = draft.byId[mapId];
|
|
2549
2633
|
|
|
2550
|
-
if (!
|
|
2634
|
+
if (!map) {
|
|
2551
2635
|
return;
|
|
2552
2636
|
}
|
|
2553
2637
|
|
|
2554
|
-
|
|
2638
|
+
if (autoUpdateLayerId || autoTimeStepLayerId) {
|
|
2639
|
+
map.autoUpdateLayerId = autoUpdateLayerId;
|
|
2640
|
+
map.autoTimeStepLayerId = autoTimeStepLayerId;
|
|
2641
|
+
} else if (layerId) {
|
|
2642
|
+
map.autoUpdateLayerId = layerId;
|
|
2643
|
+
map.autoTimeStepLayerId = layerId;
|
|
2644
|
+
} else {
|
|
2645
|
+
map.autoTimeStepLayerId = undefined;
|
|
2646
|
+
map.autoUpdateLayerId = undefined;
|
|
2647
|
+
}
|
|
2555
2648
|
},
|
|
2556
2649
|
setTimeSliderCenterTime: function setTimeSliderCenterTime(draft, action) {
|
|
2557
2650
|
var _action$payload10 = action.payload,
|
|
@@ -2727,7 +2820,8 @@ var slice$5 = createSlice({
|
|
|
2727
2820
|
}
|
|
2728
2821
|
|
|
2729
2822
|
if (!draft.byId[mapId].mapLayers.length) {
|
|
2730
|
-
draft.byId[mapId].
|
|
2823
|
+
draft.byId[mapId].autoUpdateLayerId = layerId;
|
|
2824
|
+
draft.byId[mapId].autoTimeStepLayerId = layerId;
|
|
2731
2825
|
}
|
|
2732
2826
|
|
|
2733
2827
|
draft.byId[mapId].mapLayers.unshift(layerId);
|
|
@@ -2767,19 +2861,36 @@ var slice$5 = createSlice({
|
|
|
2767
2861
|
|
|
2768
2862
|
if (draft.byId[mapId]) {
|
|
2769
2863
|
draft.byId[mapId].mapLayers = layerIds;
|
|
2770
|
-
draft.byId[mapId].
|
|
2864
|
+
draft.byId[mapId].autoUpdateLayerId = activeLayerId;
|
|
2865
|
+
draft.byId[mapId].autoTimeStepLayerId = activeLayerId;
|
|
2771
2866
|
var webmapInstance = getWMJSMapById(mapId);
|
|
2772
2867
|
|
|
2773
2868
|
if (webmapInstance) {
|
|
2774
2869
|
var mapDims = webmapInstance.getDimensionList();
|
|
2775
2870
|
|
|
2776
|
-
if (
|
|
2777
|
-
draft.byId[mapId].dimensions =
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2871
|
+
if (!draft.byId[mapId].dimensions) {
|
|
2872
|
+
draft.byId[mapId].dimensions = [];
|
|
2873
|
+
}
|
|
2874
|
+
|
|
2875
|
+
var draftDims = draft.byId[mapId].dimensions;
|
|
2876
|
+
|
|
2877
|
+
if (mapDims && draftDims) {
|
|
2878
|
+
mapDims.forEach(function (dim) {
|
|
2879
|
+
var draftMapDimIndex = draftDims.findIndex(function (draftDim) {
|
|
2880
|
+
return draftDim.name === dim.name;
|
|
2881
|
+
});
|
|
2882
|
+
|
|
2883
|
+
if (draftMapDimIndex !== -1) {
|
|
2884
|
+
draftDims[draftMapDimIndex].name = dim.name;
|
|
2885
|
+
draftDims[draftMapDimIndex].units = dim.units;
|
|
2886
|
+
draftDims[draftMapDimIndex].currentValue = dim.currentValue;
|
|
2887
|
+
} else {
|
|
2888
|
+
draftDims.push({
|
|
2889
|
+
name: dim.name,
|
|
2890
|
+
units: dim.units,
|
|
2891
|
+
currentValue: dim.currentValue
|
|
2892
|
+
});
|
|
2893
|
+
}
|
|
2783
2894
|
});
|
|
2784
2895
|
}
|
|
2785
2896
|
}
|
|
@@ -2822,24 +2933,31 @@ var slice$5 = createSlice({
|
|
|
2822
2933
|
var _action$payload27 = action.payload,
|
|
2823
2934
|
mapId = _action$payload27.mapId,
|
|
2824
2935
|
layerId = _action$payload27.layerId;
|
|
2936
|
+
var map = draft.byId[mapId];
|
|
2825
2937
|
|
|
2826
|
-
if (!
|
|
2938
|
+
if (!map) {
|
|
2827
2939
|
return;
|
|
2828
2940
|
}
|
|
2829
2941
|
|
|
2830
|
-
|
|
2942
|
+
map.mapLayers = map.mapLayers.filter(function (id) {
|
|
2831
2943
|
return id !== layerId;
|
|
2832
|
-
}); // if
|
|
2944
|
+
}); // if auto layer is deleted, change auto layer ids
|
|
2833
2945
|
|
|
2834
|
-
if (
|
|
2835
|
-
|
|
2836
|
-
|
|
2946
|
+
if (!map.mapLayers.length) {
|
|
2947
|
+
map.autoUpdateLayerId = undefined;
|
|
2948
|
+
map.autoTimeStepLayerId = undefined;
|
|
2949
|
+
return;
|
|
2950
|
+
}
|
|
2837
2951
|
|
|
2838
|
-
|
|
2952
|
+
var _map$mapLayers = _slicedToArray(map.mapLayers, 1),
|
|
2953
|
+
activeLayerId = _map$mapLayers[0];
|
|
2954
|
+
|
|
2955
|
+
if (map.autoUpdateLayerId === layerId) {
|
|
2956
|
+
map.autoUpdateLayerId = activeLayerId;
|
|
2839
2957
|
}
|
|
2840
2958
|
|
|
2841
|
-
if (
|
|
2842
|
-
|
|
2959
|
+
if (map.autoTimeStepLayerId === layerId) {
|
|
2960
|
+
map.autoTimeStepLayerId = activeLayerId;
|
|
2843
2961
|
}
|
|
2844
2962
|
}).addCase(baseLayerDelete, function (draft, action) {
|
|
2845
2963
|
var _action$payload28 = action.payload,
|
|
@@ -2911,7 +3029,9 @@ var slice$5 = createSlice({
|
|
|
2911
3029
|
draft.byId[targetId].bbox = bbox;
|
|
2912
3030
|
}
|
|
2913
3031
|
|
|
2914
|
-
if (srs)
|
|
3032
|
+
if (srs) {
|
|
3033
|
+
draft.byId[targetId].srs = srs;
|
|
3034
|
+
}
|
|
2915
3035
|
}
|
|
2916
3036
|
});
|
|
2917
3037
|
}).addCase(setLayerActionSync, function (draft, action) {
|
|
@@ -2935,7 +3055,11 @@ var slice$5 = createSlice({
|
|
|
2935
3055
|
}, draft);
|
|
2936
3056
|
}).addCase(onUpdateLayerInformation, function (draft, action) {
|
|
2937
3057
|
var mapDimensions = action.payload.mapDimensions;
|
|
2938
|
-
|
|
3058
|
+
|
|
3059
|
+
if (mapDimensions === null) {
|
|
3060
|
+
return draft;
|
|
3061
|
+
}
|
|
3062
|
+
|
|
2939
3063
|
var mapAction = mapActions$1.mapUpdateAllMapDimensions(mapDimensions);
|
|
2940
3064
|
return reducer$5(draft, mapAction);
|
|
2941
3065
|
}).addCase(mapChangeDimension, function (draft, action) {
|
|
@@ -2999,7 +3123,7 @@ var reducer$5 = slice$5.reducer;
|
|
|
2999
3123
|
* */
|
|
3000
3124
|
|
|
3001
3125
|
var layerStore = function layerStore(store) {
|
|
3002
|
-
return store
|
|
3126
|
+
return store === null || store === void 0 ? void 0 : store.layers;
|
|
3003
3127
|
};
|
|
3004
3128
|
/**
|
|
3005
3129
|
* Gets a layer from the layers part of the store by its Id
|
|
@@ -3027,7 +3151,9 @@ var getLayerById = function getLayerById(store, layerId) {
|
|
|
3027
3151
|
*/
|
|
3028
3152
|
|
|
3029
3153
|
var getLayersById = createSelector(layerStore, function (store) {
|
|
3030
|
-
|
|
3154
|
+
var _a;
|
|
3155
|
+
|
|
3156
|
+
return (_a = store === null || store === void 0 ? void 0 : store.byId) !== null && _a !== void 0 ? _a : null;
|
|
3031
3157
|
}, selectorMemoizationOptions);
|
|
3032
3158
|
/**
|
|
3033
3159
|
* Retrieves all layerIds
|
|
@@ -3298,7 +3424,7 @@ var getDimensionLayerIds = createSelector(getLayersIds, getLayersById, function
|
|
|
3298
3424
|
}, []);
|
|
3299
3425
|
}, selectorMemoizationOptions);
|
|
3300
3426
|
|
|
3301
|
-
var selectors$
|
|
3427
|
+
var selectors$3 = /*#__PURE__*/Object.freeze({
|
|
3302
3428
|
__proto__: null,
|
|
3303
3429
|
getLayerById: getLayerById,
|
|
3304
3430
|
getLayersById: getLayersById,
|
|
@@ -3336,8 +3462,8 @@ var selectors$2 = /*#__PURE__*/Object.freeze({
|
|
|
3336
3462
|
* See the License for the specific language governing permissions and
|
|
3337
3463
|
* limitations under the License.
|
|
3338
3464
|
*
|
|
3339
|
-
* Copyright
|
|
3340
|
-
* Copyright
|
|
3465
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
3466
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
3341
3467
|
* */
|
|
3342
3468
|
var getUiStore = function getUiStore(store) {
|
|
3343
3469
|
if (store && store.ui) {
|
|
@@ -3462,8 +3588,11 @@ var getDialogIsLoading = createSelector(getDialogDetailsByType, function (detail
|
|
|
3462
3588
|
var getDialogError = createSelector(getDialogDetailsByType, function (details) {
|
|
3463
3589
|
return details && details.error || '';
|
|
3464
3590
|
});
|
|
3591
|
+
var getDialogFocused = createSelector(getDialogDetailsByType, function (details) {
|
|
3592
|
+
return details && details.focused || false;
|
|
3593
|
+
});
|
|
3465
3594
|
|
|
3466
|
-
var selectors$
|
|
3595
|
+
var selectors$2 = /*#__PURE__*/Object.freeze({
|
|
3467
3596
|
__proto__: null,
|
|
3468
3597
|
getUiStore: getUiStore,
|
|
3469
3598
|
getDialogDetailsByType: getDialogDetailsByType,
|
|
@@ -3474,7 +3603,8 @@ var selectors$1 = /*#__PURE__*/Object.freeze({
|
|
|
3474
3603
|
getDialogSource: getDialogSource,
|
|
3475
3604
|
getActiveWindowId: getActiveWindowId,
|
|
3476
3605
|
getDialogIsLoading: getDialogIsLoading,
|
|
3477
|
-
getDialogError: getDialogError
|
|
3606
|
+
getDialogError: getDialogError,
|
|
3607
|
+
getDialogFocused: getDialogFocused
|
|
3478
3608
|
});
|
|
3479
3609
|
|
|
3480
3610
|
/* *
|
|
@@ -3537,8 +3667,11 @@ var removeInPlace = function removeInPlace(inDraftArray, condition) {
|
|
|
3537
3667
|
var j = 0;
|
|
3538
3668
|
inDraftArray.forEach(function (e, i) {
|
|
3539
3669
|
if (!condition(e)) {
|
|
3540
|
-
|
|
3541
|
-
|
|
3670
|
+
if (i !== j) {
|
|
3671
|
+
// eslint-disable-next-line no-param-reassign
|
|
3672
|
+
inDraftArray[j] = e;
|
|
3673
|
+
}
|
|
3674
|
+
|
|
3542
3675
|
j += 1;
|
|
3543
3676
|
}
|
|
3544
3677
|
}); // eslint-disable-next-line no-param-reassign
|
|
@@ -3675,8 +3808,15 @@ var slice$4 = createSlice({
|
|
|
3675
3808
|
var _action$payload3 = action.payload,
|
|
3676
3809
|
groupId = _action$payload3.groupId,
|
|
3677
3810
|
targetId = _action$payload3.targetId;
|
|
3678
|
-
|
|
3679
|
-
if (!draft.groups.byId[groupId]
|
|
3811
|
+
|
|
3812
|
+
if (!draft.groups.byId[groupId]) {
|
|
3813
|
+
return;
|
|
3814
|
+
}
|
|
3815
|
+
|
|
3816
|
+
if (!draft.groups.byId[groupId].targets.allIds.includes(targetId)) {
|
|
3817
|
+
return;
|
|
3818
|
+
}
|
|
3819
|
+
|
|
3680
3820
|
delete draft.groups.byId[groupId].targets.byId[targetId];
|
|
3681
3821
|
removeInPlace(draft.groups.byId[groupId].targets.allIds, function (_id) {
|
|
3682
3822
|
return _id === targetId;
|
|
@@ -3916,10 +4056,16 @@ var getSyncSourceBySourceId = function getSyncSourceBySourceId(state, id) {
|
|
|
3916
4056
|
return null;
|
|
3917
4057
|
};
|
|
3918
4058
|
|
|
3919
|
-
createSelector(getSyncSourceBySourceId, function (store) {
|
|
4059
|
+
var getTime = createSelector(getSyncSourceBySourceId, function (store) {
|
|
3920
4060
|
return store && store.payloadByType && store.payloadByType[SYNCGROUPS_TYPE_SETTIME] ? store.payloadByType[SYNCGROUPS_TYPE_SETTIME].value : null;
|
|
3921
4061
|
});
|
|
3922
4062
|
|
|
4063
|
+
var selectors$1 = /*#__PURE__*/Object.freeze({
|
|
4064
|
+
__proto__: null,
|
|
4065
|
+
getSynchronizationGroupStore: getSynchronizationGroupStore,
|
|
4066
|
+
getTime: getTime
|
|
4067
|
+
});
|
|
4068
|
+
|
|
3923
4069
|
/* *
|
|
3924
4070
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3925
4071
|
* you may not use this file except in compliance with the License.
|
|
@@ -3951,11 +4097,9 @@ var genericActions = Object.assign(Object.assign({}, actions), {
|
|
|
3951
4097
|
*/
|
|
3952
4098
|
|
|
3953
4099
|
var getMapById = function getMapById(store, mapId) {
|
|
3954
|
-
|
|
3955
|
-
return store.webmap.byId[mapId];
|
|
3956
|
-
}
|
|
4100
|
+
var _a;
|
|
3957
4101
|
|
|
3958
|
-
return null;
|
|
4102
|
+
return (_a = store === null || store === void 0 ? void 0 : store.webmap) === null || _a === void 0 ? void 0 : _a.byId[mapId];
|
|
3959
4103
|
};
|
|
3960
4104
|
/**
|
|
3961
4105
|
* Gets all mapIds
|
|
@@ -4022,8 +4166,10 @@ var getIsMapPresent = createSelector(function (store, mapId) {
|
|
|
4022
4166
|
* @returns {array} returnType: array - array containing all layerIds
|
|
4023
4167
|
*/
|
|
4024
4168
|
|
|
4025
|
-
var getLayerIds = createSelector(getMapById, function (
|
|
4026
|
-
|
|
4169
|
+
var getLayerIds = createSelector(getMapById, function (map) {
|
|
4170
|
+
var _a;
|
|
4171
|
+
|
|
4172
|
+
return (_a = map === null || map === void 0 ? void 0 : map.mapLayers) !== null && _a !== void 0 ? _a : [];
|
|
4027
4173
|
}, selectorMemoizationOptions);
|
|
4028
4174
|
/**
|
|
4029
4175
|
* Gets all layer states for a map
|
|
@@ -4034,10 +4180,12 @@ var getLayerIds = createSelector(getMapById, function (store) {
|
|
|
4034
4180
|
* @returns {array} returnType: array - array containing all layer states for the map
|
|
4035
4181
|
*/
|
|
4036
4182
|
|
|
4037
|
-
var getMapLayers = createSelector(getLayerIds, getLayersById, function (
|
|
4038
|
-
|
|
4039
|
-
return
|
|
4183
|
+
var getMapLayers = createSelector(getLayerIds, getLayersById, function (layerIdsInMap, allLayers) {
|
|
4184
|
+
var layersWithUndefined = layerIdsInMap.map(function (layerId) {
|
|
4185
|
+
return allLayers === null || allLayers === void 0 ? void 0 : allLayers[layerId];
|
|
4040
4186
|
});
|
|
4187
|
+
var layersWithoutUndefined = compact(layersWithUndefined);
|
|
4188
|
+
return layersWithoutUndefined;
|
|
4041
4189
|
}, selectorMemoizationOptions);
|
|
4042
4190
|
/**
|
|
4043
4191
|
* Gets an array of baselayers ids for a map
|
|
@@ -4245,7 +4393,33 @@ var isEndTimeOverriding = createSelector(getMapById, function (store) {
|
|
|
4245
4393
|
*/
|
|
4246
4394
|
|
|
4247
4395
|
var getActiveLayerId = createSelector(getMapById, function (store) {
|
|
4248
|
-
|
|
4396
|
+
if ((store === null || store === void 0 ? void 0 : store.autoUpdateLayerId) && store.autoUpdateLayerId === store.autoTimeStepLayerId) {
|
|
4397
|
+
return store.autoUpdateLayerId;
|
|
4398
|
+
}
|
|
4399
|
+
|
|
4400
|
+
return undefined;
|
|
4401
|
+
});
|
|
4402
|
+
/**
|
|
4403
|
+
* Gets autoUpdateLayerId for map
|
|
4404
|
+
*
|
|
4405
|
+
* example: autoUpdateLayerId = getAutoUpdateLayerId(store, 'mapid_1')
|
|
4406
|
+
* @param {object} store store: object - store object
|
|
4407
|
+
* @param {string} mapId mapId: string - Id of the map
|
|
4408
|
+
*/
|
|
4409
|
+
|
|
4410
|
+
var getAutoUpdateLayerId = createSelector(getMapById, function (store) {
|
|
4411
|
+
return store === null || store === void 0 ? void 0 : store.autoUpdateLayerId;
|
|
4412
|
+
});
|
|
4413
|
+
/**
|
|
4414
|
+
* Gets autoUpdateLayerId for map
|
|
4415
|
+
*
|
|
4416
|
+
* example: autoUpdateLayerId = getAutoUpdateLayerId(store, 'mapid_1')
|
|
4417
|
+
* @param {object} store store: object - store object
|
|
4418
|
+
* @param {string} mapId mapId: string - Id of the map
|
|
4419
|
+
*/
|
|
4420
|
+
|
|
4421
|
+
var getAutoTimeStepLayerId = createSelector(getMapById, function (store) {
|
|
4422
|
+
return store === null || store === void 0 ? void 0 : store.autoTimeStepLayerId;
|
|
4249
4423
|
});
|
|
4250
4424
|
/**
|
|
4251
4425
|
* Gets scale of a time slider of a map
|
|
@@ -4409,8 +4583,8 @@ var getIsLayerActiveLayer = createSelector(getActiveLayerId, function (_store, _
|
|
|
4409
4583
|
* @returns {string} returnType: string - the mapId, or null if not found
|
|
4410
4584
|
*/
|
|
4411
4585
|
|
|
4412
|
-
var getMapIdFromLayerId
|
|
4413
|
-
return store
|
|
4586
|
+
var getMapIdFromLayerId = createSelector(function (store) {
|
|
4587
|
+
return store === null || store === void 0 ? void 0 : store.webmap;
|
|
4414
4588
|
}, function (_store, layerId) {
|
|
4415
4589
|
return layerId;
|
|
4416
4590
|
}, findMapIdFromLayerId, selectorMemoizationOptions);
|
|
@@ -4447,7 +4621,7 @@ var getLayerIdByLayerName = createSelector(getMapLayers, function (_store, _mapI
|
|
|
4447
4621
|
* @returns {number} returnType: index number or -1 if not found
|
|
4448
4622
|
*/
|
|
4449
4623
|
|
|
4450
|
-
var getLayerIndexByLayerId
|
|
4624
|
+
var getLayerIndexByLayerId = createSelector(getMapLayers, function (_store, _mapId, layerId) {
|
|
4451
4625
|
return layerId;
|
|
4452
4626
|
}, function (layers, layerId) {
|
|
4453
4627
|
return layers.findIndex(function (layer) {
|
|
@@ -4464,7 +4638,7 @@ var getLayerIndexByLayerId$1 = createSelector(getMapLayers, function (_store, _m
|
|
|
4464
4638
|
* @returns {object} returnType: layer, or null if not found
|
|
4465
4639
|
*/
|
|
4466
4640
|
|
|
4467
|
-
var getLayerByLayerIndex
|
|
4641
|
+
var getLayerByLayerIndex = createSelector(getMapLayers, function (_store, _mapId, layerIndex) {
|
|
4468
4642
|
return layerIndex;
|
|
4469
4643
|
}, function (layers, layerIndex) {
|
|
4470
4644
|
if (layerIndex >= 0 && layerIndex < layers.length) {
|
|
@@ -4553,7 +4727,7 @@ var getLegendId = createSelector(getMapById, function (store) {
|
|
|
4553
4727
|
* @returns {MapPreset} returnType: MapPreset
|
|
4554
4728
|
*/
|
|
4555
4729
|
|
|
4556
|
-
var getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLayers, getBbox, getSrs, getActiveLayerId, isAnimating, isAutoUpdating, isTimeSliderVisible, getDisplayMapPin, isZoomControlsVisible, getMapTimeStep, getMapAnimationDelay, isTimestepAuto, getLegendId, getUiStore, function (mapLayers, baseLayers, overLayers, bbox, srs, activeLayerId, isAnimating, isAutoUpdating, isTimeSliderVisible, displayMapPin, isZoomControlsVisible, mapTimeStep, mapAnimationDelay, isTimestepAuto, legendId, uiStore) {
|
|
4730
|
+
var getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLayers, getBbox, getSrs, getActiveLayerId, getAutoTimeStepLayerId, getAutoUpdateLayerId, isAnimating, isAutoUpdating, isTimeSliderVisible, getDisplayMapPin, isZoomControlsVisible, getMapTimeStep, getMapAnimationDelay, isTimestepAuto, getLegendId, getUiStore, function (mapLayers, baseLayers, overLayers, bbox, srs, activeLayerId, autoUpdateLayerId, autoTimeStepLayerId, isAnimating, isAutoUpdating, isTimeSliderVisible, displayMapPin, isZoomControlsVisible, mapTimeStep, mapAnimationDelay, isTimestepAuto, legendId, uiStore) {
|
|
4557
4731
|
var _a;
|
|
4558
4732
|
|
|
4559
4733
|
var allLayers = [].concat(_toConsumableArray(baseLayers), _toConsumableArray(overLayers), _toConsumableArray(mapLayers)).map(function (_a) {
|
|
@@ -4580,6 +4754,8 @@ var getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLaye
|
|
|
4580
4754
|
return Object.assign({
|
|
4581
4755
|
layers: allLayers,
|
|
4582
4756
|
activeLayerId: activeLayerId,
|
|
4757
|
+
autoTimeStepLayerId: autoTimeStepLayerId,
|
|
4758
|
+
autoUpdateLayerId: autoUpdateLayerId,
|
|
4583
4759
|
proj: {
|
|
4584
4760
|
bbox: bbox,
|
|
4585
4761
|
srs: srs
|
|
@@ -4667,6 +4843,8 @@ var selectors = /*#__PURE__*/Object.freeze({
|
|
|
4667
4843
|
isAutoUpdating: isAutoUpdating,
|
|
4668
4844
|
isEndTimeOverriding: isEndTimeOverriding,
|
|
4669
4845
|
getActiveLayerId: getActiveLayerId,
|
|
4846
|
+
getAutoUpdateLayerId: getAutoUpdateLayerId,
|
|
4847
|
+
getAutoTimeStepLayerId: getAutoTimeStepLayerId,
|
|
4670
4848
|
getMapTimeSliderScale: getMapTimeSliderScale,
|
|
4671
4849
|
getMapTimeStep: getMapTimeStep,
|
|
4672
4850
|
getMapTimeStepWithoutDefault: getMapTimeStepWithoutDefault,
|
|
@@ -4680,10 +4858,10 @@ var selectors = /*#__PURE__*/Object.freeze({
|
|
|
4680
4858
|
isZoomControlsVisible: isZoomControlsVisible,
|
|
4681
4859
|
isTimeSliderVisible: isTimeSliderVisible,
|
|
4682
4860
|
getIsLayerActiveLayer: getIsLayerActiveLayer,
|
|
4683
|
-
getMapIdFromLayerId: getMapIdFromLayerId
|
|
4861
|
+
getMapIdFromLayerId: getMapIdFromLayerId,
|
|
4684
4862
|
getLayerIdByLayerName: getLayerIdByLayerName,
|
|
4685
|
-
getLayerIndexByLayerId: getLayerIndexByLayerId
|
|
4686
|
-
getLayerByLayerIndex: getLayerByLayerIndex
|
|
4863
|
+
getLayerIndexByLayerId: getLayerIndexByLayerId,
|
|
4864
|
+
getLayerByLayerIndex: getLayerByLayerIndex,
|
|
4687
4865
|
getAllUniqueDimensions: getAllUniqueDimensions,
|
|
4688
4866
|
getPinLocation: getPinLocation,
|
|
4689
4867
|
getDisableMapPin: getDisableMapPin,
|
|
@@ -4827,62 +5005,6 @@ var slice$3 = createSlice({
|
|
|
4827
5005
|
draft.servicePopup.variant = variant;
|
|
4828
5006
|
draft.servicePopup.serviceId = action.payload.serviceId ? action.payload.serviceId : '';
|
|
4829
5007
|
},
|
|
4830
|
-
addFiltersAndActiveServices: function addFiltersAndActiveServices(draft, action) {
|
|
4831
|
-
var _a, _b;
|
|
4832
|
-
|
|
4833
|
-
var _action$payload2 = action.payload,
|
|
4834
|
-
serviceId = _action$payload2.serviceId,
|
|
4835
|
-
serviceName = _action$payload2.serviceName,
|
|
4836
|
-
serviceUrl = _action$payload2.serviceUrl,
|
|
4837
|
-
_abstract = _action$payload2["abstract"],
|
|
4838
|
-
keywords = _action$payload2.keywords,
|
|
4839
|
-
scope = _action$payload2.scope,
|
|
4840
|
-
groups = _action$payload2.groups,
|
|
4841
|
-
isLoading = _action$payload2.isLoading;
|
|
4842
|
-
|
|
4843
|
-
if (isLoading) {
|
|
4844
|
-
// If service is still loading, add without filters
|
|
4845
|
-
draft.filters.activeServices.entities[serviceId] = {
|
|
4846
|
-
serviceId: serviceId,
|
|
4847
|
-
enabled: draft.allServicesEnabled,
|
|
4848
|
-
filterIds: [],
|
|
4849
|
-
scope: scope,
|
|
4850
|
-
serviceName: serviceName,
|
|
4851
|
-
serviceUrl: serviceUrl,
|
|
4852
|
-
"abstract": _abstract,
|
|
4853
|
-
isLoading: isLoading
|
|
4854
|
-
};
|
|
4855
|
-
}
|
|
4856
|
-
|
|
4857
|
-
if (!isLoading) {
|
|
4858
|
-
// If service is done loading, add with filters
|
|
4859
|
-
if (!((_b = (_a = draft.filters.activeServices.entities[serviceId]) === null || _a === void 0 ? void 0 : _a.filterIds) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
4860
|
-
// If the service has no filters yet, add them
|
|
4861
|
-
produceFilters(groups, FilterType.Group, draft, layerSelectFilterAdapter);
|
|
4862
|
-
produceFilters(keywords, FilterType.Keyword, draft, layerSelectFilterAdapter);
|
|
4863
|
-
}
|
|
4864
|
-
|
|
4865
|
-
var filterIds = groups.map(function (group) {
|
|
4866
|
-
return getFilterId(FilterType.Group, group);
|
|
4867
|
-
}).concat(keywords.map(function (keyword) {
|
|
4868
|
-
return getFilterId(FilterType.Keyword, keyword);
|
|
4869
|
-
}));
|
|
4870
|
-
draft.filters.activeServices.entities[serviceId] = {
|
|
4871
|
-
serviceId: serviceId,
|
|
4872
|
-
enabled: draft.allServicesEnabled,
|
|
4873
|
-
filterIds: filterIds,
|
|
4874
|
-
scope: scope,
|
|
4875
|
-
serviceName: serviceName,
|
|
4876
|
-
serviceUrl: serviceUrl,
|
|
4877
|
-
"abstract": _abstract,
|
|
4878
|
-
isLoading: isLoading
|
|
4879
|
-
};
|
|
4880
|
-
}
|
|
4881
|
-
|
|
4882
|
-
if (!draft.filters.activeServices.ids.includes(serviceId)) {
|
|
4883
|
-
draft.filters.activeServices.ids.push(serviceId);
|
|
4884
|
-
}
|
|
4885
|
-
},
|
|
4886
5008
|
layerSelectRemoveService: function layerSelectRemoveService(draft, action) {
|
|
4887
5009
|
var serviceId = action.payload.serviceId; // 1. Find a service that is to be removed
|
|
4888
5010
|
|
|
@@ -4907,9 +5029,9 @@ var slice$3 = createSlice({
|
|
|
4907
5029
|
layerSelectActiveServicesAdapter.removeOne(draft.filters.activeServices, serviceId);
|
|
4908
5030
|
},
|
|
4909
5031
|
enableActiveService: function enableActiveService(draft, action) {
|
|
4910
|
-
var _action$
|
|
4911
|
-
serviceId = _action$
|
|
4912
|
-
keywords = _action$
|
|
5032
|
+
var _action$payload2 = action.payload,
|
|
5033
|
+
serviceId = _action$payload2.serviceId,
|
|
5034
|
+
keywords = _action$payload2.filters;
|
|
4913
5035
|
draft.filters.activeServices.entities[serviceId].enabled = true;
|
|
4914
5036
|
|
|
4915
5037
|
var _iterator = _createForOfIteratorHelper(keywords),
|
|
@@ -4927,9 +5049,9 @@ var slice$3 = createSlice({
|
|
|
4927
5049
|
}
|
|
4928
5050
|
},
|
|
4929
5051
|
disableActiveService: function disableActiveService(draft, action) {
|
|
4930
|
-
var _action$
|
|
4931
|
-
serviceId = _action$
|
|
4932
|
-
keywords = _action$
|
|
5052
|
+
var _action$payload3 = action.payload,
|
|
5053
|
+
serviceId = _action$payload3.serviceId,
|
|
5054
|
+
keywords = _action$payload3.filters;
|
|
4933
5055
|
draft.filters.activeServices.entities[serviceId].enabled = false;
|
|
4934
5056
|
|
|
4935
5057
|
var _iterator2 = _createForOfIteratorHelper(keywords),
|
|
@@ -4963,6 +5085,92 @@ var slice$3 = createSlice({
|
|
|
4963
5085
|
var layer = action.payload.layer;
|
|
4964
5086
|
draft.activeLayerInfo = layer;
|
|
4965
5087
|
}
|
|
5088
|
+
},
|
|
5089
|
+
extraReducers: function extraReducers(builder) {
|
|
5090
|
+
builder.addCase(serviceActions.serviceSetLayers, function (draft, action) {
|
|
5091
|
+
var _a, _b;
|
|
5092
|
+
|
|
5093
|
+
var _action$payload4 = action.payload,
|
|
5094
|
+
serviceId = _action$payload4.id,
|
|
5095
|
+
serviceUrl = _action$payload4.serviceUrl,
|
|
5096
|
+
serviceName = _action$payload4.name,
|
|
5097
|
+
scope = _action$payload4.scope,
|
|
5098
|
+
_abstract = _action$payload4["abstract"],
|
|
5099
|
+
layers = _action$payload4.layers,
|
|
5100
|
+
isUpdating = _action$payload4.isUpdating;
|
|
5101
|
+
|
|
5102
|
+
if (isUpdating) {
|
|
5103
|
+
return;
|
|
5104
|
+
}
|
|
5105
|
+
|
|
5106
|
+
var keywords = layers.reduce(function (keywords, layer) {
|
|
5107
|
+
var _a;
|
|
5108
|
+
|
|
5109
|
+
if (layer.leaf) {
|
|
5110
|
+
return keywords.concat((_a = layer.keywords) !== null && _a !== void 0 ? _a : []);
|
|
5111
|
+
}
|
|
5112
|
+
|
|
5113
|
+
return keywords;
|
|
5114
|
+
}, []);
|
|
5115
|
+
var groups = layers.reduce(function (groups, layer) {
|
|
5116
|
+
var _a;
|
|
5117
|
+
|
|
5118
|
+
if (layer.leaf) {
|
|
5119
|
+
return groups.concat((_a = layer.path) !== null && _a !== void 0 ? _a : []);
|
|
5120
|
+
}
|
|
5121
|
+
|
|
5122
|
+
return groups;
|
|
5123
|
+
}, []);
|
|
5124
|
+
|
|
5125
|
+
if (!((_b = (_a = draft.filters.activeServices.entities[serviceId]) === null || _a === void 0 ? void 0 : _a.filterIds) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
5126
|
+
// If the service has no filters yet, add them
|
|
5127
|
+
produceFilters(groups, FilterType.Group, draft, layerSelectFilterAdapter);
|
|
5128
|
+
produceFilters(keywords, FilterType.Keyword, draft, layerSelectFilterAdapter);
|
|
5129
|
+
}
|
|
5130
|
+
|
|
5131
|
+
var filterIds = groups.map(function (group) {
|
|
5132
|
+
return getFilterId(FilterType.Group, group);
|
|
5133
|
+
}).concat(keywords.map(function (keyword) {
|
|
5134
|
+
return getFilterId(FilterType.Keyword, keyword);
|
|
5135
|
+
}));
|
|
5136
|
+
draft.filters.activeServices.entities[serviceId] = {
|
|
5137
|
+
serviceId: serviceId,
|
|
5138
|
+
enabled: draft.allServicesEnabled,
|
|
5139
|
+
filterIds: filterIds,
|
|
5140
|
+
scope: scope,
|
|
5141
|
+
serviceName: serviceName,
|
|
5142
|
+
serviceUrl: serviceUrl,
|
|
5143
|
+
"abstract": _abstract,
|
|
5144
|
+
isLoading: false
|
|
5145
|
+
};
|
|
5146
|
+
|
|
5147
|
+
if (!draft.filters.activeServices.ids.includes(serviceId)) {
|
|
5148
|
+
draft.filters.activeServices.ids.push(serviceId);
|
|
5149
|
+
}
|
|
5150
|
+
}).addCase(serviceActions.fetchInitialServices, function (draft, action) {
|
|
5151
|
+
var services = action.payload.services;
|
|
5152
|
+
services.forEach(function (service) {
|
|
5153
|
+
var serviceId = service.id,
|
|
5154
|
+
serviceName = service.name,
|
|
5155
|
+
serviceUrl = service.serviceUrl,
|
|
5156
|
+
_abstract2 = service["abstract"],
|
|
5157
|
+
scope = service.scope;
|
|
5158
|
+
draft.filters.activeServices.entities[serviceId] = {
|
|
5159
|
+
serviceId: serviceId,
|
|
5160
|
+
enabled: draft.allServicesEnabled,
|
|
5161
|
+
filterIds: [],
|
|
5162
|
+
scope: scope,
|
|
5163
|
+
serviceName: serviceName,
|
|
5164
|
+
serviceUrl: serviceUrl,
|
|
5165
|
+
"abstract": _abstract2,
|
|
5166
|
+
isLoading: true
|
|
5167
|
+
};
|
|
5168
|
+
|
|
5169
|
+
if (!draft.filters.activeServices.ids.includes(serviceId)) {
|
|
5170
|
+
draft.filters.activeServices.ids.push(serviceId);
|
|
5171
|
+
}
|
|
5172
|
+
});
|
|
5173
|
+
});
|
|
4966
5174
|
}
|
|
4967
5175
|
});
|
|
4968
5176
|
var reducer$3 = slice$3.reducer;
|
|
@@ -4986,7 +5194,10 @@ var layerSelectActions = slice$3.actions;
|
|
|
4986
5194
|
* */
|
|
4987
5195
|
var filterLayersFromService = function filterLayersFromService(serviceId, services, filterIds, allFiltersActive, searchString) {
|
|
4988
5196
|
var mapStoreService = services[serviceId];
|
|
4989
|
-
|
|
5197
|
+
|
|
5198
|
+
if (!mapStoreService) {
|
|
5199
|
+
return [];
|
|
5200
|
+
}
|
|
4990
5201
|
|
|
4991
5202
|
if (searchString === '' && allFiltersActive) {
|
|
4992
5203
|
return mapStoreService.layers.filter(function (layer) {
|
|
@@ -5500,9 +5711,6 @@ var getSyncedMapIdsForTimeslider = createSelector(syncGroupStore, function (stor
|
|
|
5500
5711
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
5501
5712
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
5502
5713
|
* */
|
|
5503
|
-
var getLayerByLayerIndex = getLayerByLayerIndex$1,
|
|
5504
|
-
getMapIdFromLayerId = getMapIdFromLayerId$1,
|
|
5505
|
-
getLayerIndexByLayerId = getLayerIndexByLayerId$1;
|
|
5506
5714
|
/**
|
|
5507
5715
|
* Tries to find the layerId's in the other map based on the payload of the action. It works for all layer actions.
|
|
5508
5716
|
* @param state
|
|
@@ -5513,9 +5721,12 @@ var getLayerByLayerIndex = getLayerByLayerIndex$1,
|
|
|
5513
5721
|
*/
|
|
5514
5722
|
|
|
5515
5723
|
var getTargetLayerIdFromPayload = function getTargetLayerIdFromPayload(state, mapId, targetMapId, payload) {
|
|
5516
|
-
if (!payload)
|
|
5724
|
+
if (!payload) {
|
|
5725
|
+
return null;
|
|
5726
|
+
}
|
|
5517
5727
|
/* Try to find the layer for the DeleteLayerPayload, it uses layerIndex to reference the layer */
|
|
5518
5728
|
|
|
5729
|
+
|
|
5519
5730
|
if ('layerIndex' in payload) {
|
|
5520
5731
|
var targetLayer = getLayerByLayerIndex(state, targetMapId, payload.layerIndex);
|
|
5521
5732
|
return !targetLayer ? null : targetLayer.id;
|
|
@@ -5701,15 +5912,15 @@ var getMapBaseLayerActionsTargets = function getMapBaseLayerActionsTargets(state
|
|
|
5701
5912
|
});
|
|
5702
5913
|
};
|
|
5703
5914
|
|
|
5704
|
-
var _marked$
|
|
5705
|
-
_marked2$
|
|
5706
|
-
_marked3$
|
|
5707
|
-
_marked4$
|
|
5915
|
+
var _marked$7 = /*#__PURE__*/regeneratorRuntime.mark(setTimeSaga),
|
|
5916
|
+
_marked2$7 = /*#__PURE__*/regeneratorRuntime.mark(setBBoxSaga),
|
|
5917
|
+
_marked3$5 = /*#__PURE__*/regeneratorRuntime.mark(layerActionsSaga),
|
|
5918
|
+
_marked4$2 = /*#__PURE__*/regeneratorRuntime.mark(addLayerActionsSaga),
|
|
5708
5919
|
_marked5$2 = /*#__PURE__*/regeneratorRuntime.mark(deleteLayerActionsSaga),
|
|
5709
5920
|
_marked6$1 = /*#__PURE__*/regeneratorRuntime.mark(moveLayerActionsSaga),
|
|
5710
|
-
_marked7$1 = /*#__PURE__*/regeneratorRuntime.mark(
|
|
5921
|
+
_marked7$1 = /*#__PURE__*/regeneratorRuntime.mark(setAutoLayerIdActionsSaga),
|
|
5711
5922
|
_marked8$1 = /*#__PURE__*/regeneratorRuntime.mark(mapBaseLayerActionsSaga),
|
|
5712
|
-
_marked9$1 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$
|
|
5923
|
+
_marked9$1 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$7);
|
|
5713
5924
|
var setBaseLayers = layerActions.setBaseLayers,
|
|
5714
5925
|
addLayer = layerActions.addLayer,
|
|
5715
5926
|
layerChangeDimension = layerActions.layerChangeDimension,
|
|
@@ -5757,7 +5968,7 @@ function setTimeSaga(_ref) {
|
|
|
5757
5968
|
return _context.stop();
|
|
5758
5969
|
}
|
|
5759
5970
|
}
|
|
5760
|
-
}, _marked$
|
|
5971
|
+
}, _marked$7);
|
|
5761
5972
|
}
|
|
5762
5973
|
function setBBoxSaga(_ref2) {
|
|
5763
5974
|
var payload, targets, groups;
|
|
@@ -5784,7 +5995,7 @@ function setBBoxSaga(_ref2) {
|
|
|
5784
5995
|
return _context2.stop();
|
|
5785
5996
|
}
|
|
5786
5997
|
}
|
|
5787
|
-
}, _marked2$
|
|
5998
|
+
}, _marked2$7);
|
|
5788
5999
|
}
|
|
5789
6000
|
function layerActionsSaga(_ref3) {
|
|
5790
6001
|
var payload, type, targets;
|
|
@@ -5821,7 +6032,7 @@ function layerActionsSaga(_ref3) {
|
|
|
5821
6032
|
return _context3.stop();
|
|
5822
6033
|
}
|
|
5823
6034
|
}
|
|
5824
|
-
}, _marked3$
|
|
6035
|
+
}, _marked3$5);
|
|
5825
6036
|
}
|
|
5826
6037
|
function addLayerActionsSaga(_ref4) {
|
|
5827
6038
|
var payload, type, targets;
|
|
@@ -5858,7 +6069,7 @@ function addLayerActionsSaga(_ref4) {
|
|
|
5858
6069
|
return _context4.stop();
|
|
5859
6070
|
}
|
|
5860
6071
|
}
|
|
5861
|
-
}, _marked4$
|
|
6072
|
+
}, _marked4$2);
|
|
5862
6073
|
}
|
|
5863
6074
|
function deleteLayerActionsSaga(_ref5) {
|
|
5864
6075
|
var payload, type, targets;
|
|
@@ -5934,9 +6145,9 @@ function moveLayerActionsSaga(_ref6) {
|
|
|
5934
6145
|
}
|
|
5935
6146
|
}, _marked6$1);
|
|
5936
6147
|
}
|
|
5937
|
-
function
|
|
6148
|
+
function setAutoLayerIdActionsSaga(_ref7) {
|
|
5938
6149
|
var payload, type, targets;
|
|
5939
|
-
return regeneratorRuntime.wrap(function
|
|
6150
|
+
return regeneratorRuntime.wrap(function setAutoLayerIdActionsSaga$(_context7) {
|
|
5940
6151
|
while (1) {
|
|
5941
6152
|
switch (_context7.prev = _context7.next) {
|
|
5942
6153
|
case 0:
|
|
@@ -5999,7 +6210,7 @@ function mapBaseLayerActionsSaga(_ref8) {
|
|
|
5999
6210
|
}
|
|
6000
6211
|
}, _marked8$1);
|
|
6001
6212
|
}
|
|
6002
|
-
function rootSaga$
|
|
6213
|
+
function rootSaga$7() {
|
|
6003
6214
|
return regeneratorRuntime.wrap(function rootSaga$(_context9) {
|
|
6004
6215
|
while (1) {
|
|
6005
6216
|
switch (_context9.prev = _context9.next) {
|
|
@@ -6045,7 +6256,7 @@ function rootSaga$6() {
|
|
|
6045
6256
|
|
|
6046
6257
|
case 20:
|
|
6047
6258
|
_context9.next = 22;
|
|
6048
|
-
return takeLatest(mapActions$1.
|
|
6259
|
+
return takeLatest(mapActions$1.setAutoLayerId.type, setAutoLayerIdActionsSaga);
|
|
6049
6260
|
|
|
6050
6261
|
case 22:
|
|
6051
6262
|
_context9.next = 24;
|
|
@@ -6158,11 +6369,11 @@ var sources = function sources(store) {
|
|
|
6158
6369
|
|
|
6159
6370
|
var createSyncGroupViewStateSelector = createSelector(groups, sources, createSyncGroupViewState);
|
|
6160
6371
|
|
|
6161
|
-
var _marked$
|
|
6162
|
-
_marked2$
|
|
6163
|
-
_marked3$
|
|
6164
|
-
_marked4$
|
|
6165
|
-
_marked5$1 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$
|
|
6372
|
+
var _marked$6 = /*#__PURE__*/regeneratorRuntime.mark(updateSourceValueWhenLinkingComponentToGroupSaga),
|
|
6373
|
+
_marked2$6 = /*#__PURE__*/regeneratorRuntime.mark(addGroupTargetSaga),
|
|
6374
|
+
_marked3$4 = /*#__PURE__*/regeneratorRuntime.mark(linkGroupTargetSaga),
|
|
6375
|
+
_marked4$1 = /*#__PURE__*/regeneratorRuntime.mark(updateViewStateSaga),
|
|
6376
|
+
_marked5$1 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$6);
|
|
6166
6377
|
function updateSourceValueWhenLinkingComponentToGroupSaga(groupId, targetToUpdate) {
|
|
6167
6378
|
var group;
|
|
6168
6379
|
return regeneratorRuntime.wrap(function updateSourceValueWhenLinkingComponentToGroupSaga$(_context) {
|
|
@@ -6229,7 +6440,7 @@ function updateSourceValueWhenLinkingComponentToGroupSaga(groupId, targetToUpdat
|
|
|
6229
6440
|
return _context.stop();
|
|
6230
6441
|
}
|
|
6231
6442
|
}
|
|
6232
|
-
}, _marked$
|
|
6443
|
+
}, _marked$6);
|
|
6233
6444
|
}
|
|
6234
6445
|
function addGroupTargetSaga(_ref) {
|
|
6235
6446
|
var payload, groupId, linked, targetToUpdate;
|
|
@@ -6253,7 +6464,7 @@ function addGroupTargetSaga(_ref) {
|
|
|
6253
6464
|
return _context2.stop();
|
|
6254
6465
|
}
|
|
6255
6466
|
}
|
|
6256
|
-
}, _marked2$
|
|
6467
|
+
}, _marked2$6);
|
|
6257
6468
|
}
|
|
6258
6469
|
function linkGroupTargetSaga(_ref2) {
|
|
6259
6470
|
var payload, groupId, linked, targetToUpdate;
|
|
@@ -6277,7 +6488,7 @@ function linkGroupTargetSaga(_ref2) {
|
|
|
6277
6488
|
return _context3.stop();
|
|
6278
6489
|
}
|
|
6279
6490
|
}
|
|
6280
|
-
}, _marked3$
|
|
6491
|
+
}, _marked3$4);
|
|
6281
6492
|
}
|
|
6282
6493
|
function updateViewStateSaga() {
|
|
6283
6494
|
var viewState;
|
|
@@ -6300,10 +6511,10 @@ function updateViewStateSaga() {
|
|
|
6300
6511
|
return _context4.stop();
|
|
6301
6512
|
}
|
|
6302
6513
|
}
|
|
6303
|
-
}, _marked4$
|
|
6514
|
+
}, _marked4$1);
|
|
6304
6515
|
}
|
|
6305
6516
|
|
|
6306
|
-
function rootSaga$
|
|
6517
|
+
function rootSaga$6() {
|
|
6307
6518
|
return regeneratorRuntime.wrap(function rootSaga$(_context5) {
|
|
6308
6519
|
while (1) {
|
|
6309
6520
|
switch (_context5.prev = _context5.next) {
|
|
@@ -6356,12 +6567,12 @@ var synchronizationGroupConfig = {
|
|
|
6356
6567
|
reducersMap: {
|
|
6357
6568
|
syncronizationGroupStore: reducer$4
|
|
6358
6569
|
},
|
|
6359
|
-
sagas: [rootSaga$
|
|
6570
|
+
sagas: [rootSaga$7, rootSaga$6]
|
|
6360
6571
|
};
|
|
6361
6572
|
|
|
6362
|
-
var _marked$
|
|
6363
|
-
_marked2$
|
|
6364
|
-
_marked3$
|
|
6573
|
+
var _marked$5 = /*#__PURE__*/regeneratorRuntime.mark(registerMapUISaga),
|
|
6574
|
+
_marked2$5 = /*#__PURE__*/regeneratorRuntime.mark(unregisterUIMapSaga),
|
|
6575
|
+
_marked3$3 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$5);
|
|
6365
6576
|
function registerMapUISaga() {
|
|
6366
6577
|
var fields, source;
|
|
6367
6578
|
return regeneratorRuntime.wrap(function registerMapUISaga$(_context) {
|
|
@@ -6397,7 +6608,7 @@ function registerMapUISaga() {
|
|
|
6397
6608
|
return _context.stop();
|
|
6398
6609
|
}
|
|
6399
6610
|
}
|
|
6400
|
-
}, _marked$
|
|
6611
|
+
}, _marked$5);
|
|
6401
6612
|
}
|
|
6402
6613
|
function unregisterUIMapSaga() {
|
|
6403
6614
|
var fields, activeUI;
|
|
@@ -6449,9 +6660,9 @@ function unregisterUIMapSaga() {
|
|
|
6449
6660
|
return _context2.stop();
|
|
6450
6661
|
}
|
|
6451
6662
|
}
|
|
6452
|
-
}, _marked2$
|
|
6663
|
+
}, _marked2$5);
|
|
6453
6664
|
}
|
|
6454
|
-
function rootSaga$
|
|
6665
|
+
function rootSaga$5() {
|
|
6455
6666
|
return regeneratorRuntime.wrap(function rootSaga$(_context3) {
|
|
6456
6667
|
while (1) {
|
|
6457
6668
|
switch (_context3.prev = _context3.next) {
|
|
@@ -6468,7 +6679,7 @@ function rootSaga$4() {
|
|
|
6468
6679
|
return _context3.stop();
|
|
6469
6680
|
}
|
|
6470
6681
|
}
|
|
6471
|
-
}, _marked3$
|
|
6682
|
+
}, _marked3$3);
|
|
6472
6683
|
}
|
|
6473
6684
|
|
|
6474
6685
|
/* *
|
|
@@ -6492,7 +6703,7 @@ var uiModuleConfig = {
|
|
|
6492
6703
|
reducersMap: {
|
|
6493
6704
|
ui: reducer$6
|
|
6494
6705
|
},
|
|
6495
|
-
sagas: [rootSaga$
|
|
6706
|
+
sagas: [rootSaga$5]
|
|
6496
6707
|
};
|
|
6497
6708
|
|
|
6498
6709
|
/* *
|
|
@@ -6511,30 +6722,102 @@ var uiModuleConfig = {
|
|
|
6511
6722
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6512
6723
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
6513
6724
|
* */
|
|
6514
|
-
var
|
|
6515
|
-
|
|
6516
|
-
|
|
6725
|
+
var replaceLayerIdsToEnsureUniqueLayerIdsInStore = function replaceLayerIdsToEnsureUniqueLayerIdsInStore(layerIds) {
|
|
6726
|
+
var layers = layerIds.layers,
|
|
6727
|
+
autoTimeStepLayerId = layerIds.autoTimeStepLayerId,
|
|
6728
|
+
autoUpdateLayerId = layerIds.autoUpdateLayerId;
|
|
6729
|
+
var layerIdIsSameForTimestepAndUpdate = autoTimeStepLayerId && autoTimeStepLayerId === autoUpdateLayerId;
|
|
6730
|
+
|
|
6731
|
+
if (layerIdIsSameForTimestepAndUpdate) {
|
|
6732
|
+
var newAutoLayerId = generateLayerId();
|
|
6733
|
+
return {
|
|
6734
|
+
layers: replaceLayerIds(layers, autoTimeStepLayerId, newAutoLayerId),
|
|
6735
|
+
autoTimeStepLayerId: newAutoLayerId,
|
|
6736
|
+
autoUpdateLayerId: newAutoLayerId
|
|
6737
|
+
};
|
|
6738
|
+
}
|
|
6517
6739
|
|
|
6518
|
-
var
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
var layersNewIds = layers.map(function (layer, index) {
|
|
6522
|
-
if (layer.id && index === activeLayerIndex) {
|
|
6523
|
-
return Object.assign(Object.assign({}, layer), {
|
|
6524
|
-
id: activeLayerNewId
|
|
6525
|
-
});
|
|
6526
|
-
}
|
|
6740
|
+
var autoTimeStepLayerIdNew = autoTimeStepLayerId && generateLayerId();
|
|
6741
|
+
var autoUpdateLayerIdNew = autoUpdateLayerId && generateLayerId();
|
|
6742
|
+
var timestepAndUpdateLayerIdsAreProvided = autoTimeStepLayerId && autoUpdateLayerId;
|
|
6527
6743
|
|
|
6528
|
-
|
|
6529
|
-
|
|
6744
|
+
if (timestepAndUpdateLayerIdsAreProvided) {
|
|
6745
|
+
var autoTimeStepLayerIndex = layers.findIndex(function (layer) {
|
|
6746
|
+
return layer.id === autoTimeStepLayerId;
|
|
6530
6747
|
});
|
|
6531
|
-
|
|
6748
|
+
var autoUpdateLayerIndex = layers.findIndex(function (layer) {
|
|
6749
|
+
return layer.id === autoUpdateLayerId;
|
|
6750
|
+
});
|
|
6751
|
+
|
|
6752
|
+
var _layersWithNewIds = layers.map(function (layer, index) {
|
|
6753
|
+
if (layer.id && index === autoTimeStepLayerIndex) {
|
|
6754
|
+
return Object.assign(Object.assign({}, layer), {
|
|
6755
|
+
id: autoTimeStepLayerIdNew
|
|
6756
|
+
});
|
|
6757
|
+
}
|
|
6758
|
+
|
|
6759
|
+
if (layer.id && index === autoUpdateLayerIndex) {
|
|
6760
|
+
return Object.assign(Object.assign({}, layer), {
|
|
6761
|
+
id: autoUpdateLayerIdNew
|
|
6762
|
+
});
|
|
6763
|
+
}
|
|
6764
|
+
|
|
6765
|
+
return Object.assign(Object.assign({}, layer), {
|
|
6766
|
+
id: generateLayerId()
|
|
6767
|
+
});
|
|
6768
|
+
});
|
|
6769
|
+
|
|
6770
|
+
return {
|
|
6771
|
+
layers: _layersWithNewIds,
|
|
6772
|
+
autoTimeStepLayerId: autoTimeStepLayerIdNew,
|
|
6773
|
+
autoUpdateLayerId: autoUpdateLayerIdNew
|
|
6774
|
+
};
|
|
6775
|
+
}
|
|
6776
|
+
|
|
6777
|
+
if (autoTimeStepLayerIdNew) {
|
|
6778
|
+
return {
|
|
6779
|
+
layers: replaceLayerIds(layers, autoTimeStepLayerId, autoTimeStepLayerIdNew),
|
|
6780
|
+
autoTimeStepLayerId: autoTimeStepLayerIdNew
|
|
6781
|
+
};
|
|
6782
|
+
}
|
|
6783
|
+
|
|
6784
|
+
if (autoUpdateLayerIdNew) {
|
|
6785
|
+
return {
|
|
6786
|
+
layers: replaceLayerIds(layers, autoUpdateLayerId, autoUpdateLayerIdNew),
|
|
6787
|
+
autoUpdateLayerId: autoUpdateLayerIdNew
|
|
6788
|
+
};
|
|
6789
|
+
} // The code below is executed if neither auto timestep
|
|
6790
|
+
// nor auto update layer id was provided
|
|
6791
|
+
|
|
6792
|
+
|
|
6793
|
+
var layersWithNewIds = layers.map(function (layer) {
|
|
6794
|
+
return Object.assign(Object.assign({}, layer), {
|
|
6795
|
+
id: generateLayerId()
|
|
6796
|
+
});
|
|
6797
|
+
});
|
|
6532
6798
|
return {
|
|
6533
|
-
|
|
6534
|
-
activeLayerNewId: activeLayerNewId
|
|
6799
|
+
layers: layersWithNewIds
|
|
6535
6800
|
};
|
|
6536
6801
|
};
|
|
6537
6802
|
|
|
6803
|
+
function replaceLayerIds(layers, autoLayerIdOld, autoLayerIdNew) {
|
|
6804
|
+
var autoLayerIndex = layers.findIndex(function (layer) {
|
|
6805
|
+
return layer.id === autoLayerIdOld;
|
|
6806
|
+
});
|
|
6807
|
+
var layersWithNewIds = layers.map(function (layer, index) {
|
|
6808
|
+
if (layer.id && index === autoLayerIndex) {
|
|
6809
|
+
return Object.assign(Object.assign({}, layer), {
|
|
6810
|
+
id: autoLayerIdNew
|
|
6811
|
+
});
|
|
6812
|
+
}
|
|
6813
|
+
|
|
6814
|
+
return Object.assign(Object.assign({}, layer), {
|
|
6815
|
+
id: generateLayerId()
|
|
6816
|
+
});
|
|
6817
|
+
});
|
|
6818
|
+
return layersWithNewIds;
|
|
6819
|
+
}
|
|
6820
|
+
|
|
6538
6821
|
/* *
|
|
6539
6822
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6540
6823
|
* you may not use this file except in compliance with the License.
|
|
@@ -7362,7 +7645,11 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
|
|
|
7362
7645
|
var _this$props = this.props,
|
|
7363
7646
|
onKeyUp = _this$props.onKeyUp,
|
|
7364
7647
|
loopInterval = _this$props.redrawInterval;
|
|
7365
|
-
|
|
7648
|
+
|
|
7649
|
+
if (onKeyUp) {
|
|
7650
|
+
window.addEventListener('keyup', this.onKeyUp);
|
|
7651
|
+
}
|
|
7652
|
+
|
|
7366
7653
|
window.addEventListener('resize', this._handleWindowResize);
|
|
7367
7654
|
|
|
7368
7655
|
if (this.canvascontaineroutside && this.canvascontaineroutside.current && onKeyUp) {
|
|
@@ -7395,7 +7682,10 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
|
|
|
7395
7682
|
this.mounted = false;
|
|
7396
7683
|
window.removeEventListener('resize', this._handleWindowResize);
|
|
7397
7684
|
var onKeyUp = this.props.onKeyUp;
|
|
7398
|
-
|
|
7685
|
+
|
|
7686
|
+
if (onKeyUp) {
|
|
7687
|
+
window.removeEventListener('keyup', this.onKeyUp);
|
|
7688
|
+
}
|
|
7399
7689
|
|
|
7400
7690
|
if (this.canvas) {
|
|
7401
7691
|
this.canvas.removeEventListener('mousedown', this.handleMouseDownEvent);
|
|
@@ -7436,7 +7726,10 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
|
|
|
7436
7726
|
key: "onKeyUp",
|
|
7437
7727
|
value: function onKeyUp(event) {
|
|
7438
7728
|
var onKeyUp = this.props.onKeyUp;
|
|
7439
|
-
|
|
7729
|
+
|
|
7730
|
+
if (onKeyUp) {
|
|
7731
|
+
onKeyUp(event);
|
|
7732
|
+
}
|
|
7440
7733
|
|
|
7441
7734
|
if (this.canvascontaineroutside && this.canvascontaineroutside.current && onKeyUp) {
|
|
7442
7735
|
if (event.code === 'Escape') {
|
|
@@ -7449,7 +7742,10 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
|
|
|
7449
7742
|
value: function _documentKeyDown(event) {
|
|
7450
7743
|
if (this._isFocussed) {
|
|
7451
7744
|
var onKeyDown = this.props.onKeyDown;
|
|
7452
|
-
|
|
7745
|
+
|
|
7746
|
+
if (onKeyDown) {
|
|
7747
|
+
onKeyDown(event);
|
|
7748
|
+
}
|
|
7453
7749
|
}
|
|
7454
7750
|
}
|
|
7455
7751
|
}, {
|
|
@@ -7461,7 +7757,10 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
|
|
|
7461
7757
|
key: "startLoop",
|
|
7462
7758
|
value: function startLoop() {
|
|
7463
7759
|
var onRenderCanvas = this.props.onRenderCanvas;
|
|
7464
|
-
|
|
7760
|
+
|
|
7761
|
+
if (this.mounted === false || this.loopHasStarted === false) {
|
|
7762
|
+
return;
|
|
7763
|
+
}
|
|
7465
7764
|
|
|
7466
7765
|
if (this.canvas) {
|
|
7467
7766
|
onRenderCanvas(this.ctx, this.currentWidth, this.currentHeight, this.canvas);
|
|
@@ -7827,9 +8126,16 @@ var Legend = function Legend(_ref) {
|
|
|
7827
8126
|
}, [layerId]);
|
|
7828
8127
|
/* Should not do anything if no layer is given */
|
|
7829
8128
|
|
|
7830
|
-
if (!layer)
|
|
8129
|
+
if (!layer) {
|
|
8130
|
+
return null;
|
|
8131
|
+
}
|
|
8132
|
+
|
|
7831
8133
|
var isLayerEnabled = layer.enabled;
|
|
7832
|
-
|
|
8134
|
+
|
|
8135
|
+
if (!isLayerEnabled) {
|
|
8136
|
+
return null;
|
|
8137
|
+
}
|
|
8138
|
+
|
|
7833
8139
|
var layerOpacity = layer.opacity ? layer.opacity : 1;
|
|
7834
8140
|
/* Get the wmLayer, it has more detailed info about the WMS service,
|
|
7835
8141
|
like a title and the WMS legendgraphic url */
|
|
@@ -8085,16 +8391,16 @@ var LegendConnect = function LegendConnect(_a) {
|
|
|
8085
8391
|
}, props));
|
|
8086
8392
|
};
|
|
8087
8393
|
|
|
8088
|
-
var _marked$
|
|
8089
|
-
_marked2$
|
|
8090
|
-
_marked3$
|
|
8091
|
-
_marked4
|
|
8394
|
+
var _marked$4 = /*#__PURE__*/regeneratorRuntime.mark(startAnimationSaga),
|
|
8395
|
+
_marked2$4 = /*#__PURE__*/regeneratorRuntime.mark(stopAnimationSaga),
|
|
8396
|
+
_marked3$2 = /*#__PURE__*/regeneratorRuntime.mark(deleteLayerSaga),
|
|
8397
|
+
_marked4 = /*#__PURE__*/regeneratorRuntime.mark(updateAnimation),
|
|
8092
8398
|
_marked5 = /*#__PURE__*/regeneratorRuntime.mark(setLayerDimensionsSaga),
|
|
8093
8399
|
_marked6 = /*#__PURE__*/regeneratorRuntime.mark(toggleAutoUpdateSaga),
|
|
8094
8400
|
_marked7 = /*#__PURE__*/regeneratorRuntime.mark(handleBaseLayersSaga),
|
|
8095
8401
|
_marked8 = /*#__PURE__*/regeneratorRuntime.mark(setMapPresetSaga),
|
|
8096
8402
|
_marked9 = /*#__PURE__*/regeneratorRuntime.mark(unregisterMapSaga),
|
|
8097
|
-
_marked10 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$
|
|
8403
|
+
_marked10 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$4);
|
|
8098
8404
|
|
|
8099
8405
|
var generateTimeList = function generateTimeList(start, end, interval) {
|
|
8100
8406
|
var timeList = [];
|
|
@@ -8157,7 +8463,7 @@ function startAnimationSaga(_ref) {
|
|
|
8157
8463
|
return _context.stop();
|
|
8158
8464
|
}
|
|
8159
8465
|
}
|
|
8160
|
-
}, _marked$
|
|
8466
|
+
}, _marked$4);
|
|
8161
8467
|
}
|
|
8162
8468
|
function stopAnimationSaga(_ref2) {
|
|
8163
8469
|
var payload, mapId;
|
|
@@ -8175,7 +8481,7 @@ function stopAnimationSaga(_ref2) {
|
|
|
8175
8481
|
return _context2.stop();
|
|
8176
8482
|
}
|
|
8177
8483
|
}
|
|
8178
|
-
}, _marked2$
|
|
8484
|
+
}, _marked2$4);
|
|
8179
8485
|
}
|
|
8180
8486
|
function deleteLayerSaga(_ref3) {
|
|
8181
8487
|
var payload, mapId, layers;
|
|
@@ -8206,7 +8512,7 @@ function deleteLayerSaga(_ref3) {
|
|
|
8206
8512
|
return _context3.stop();
|
|
8207
8513
|
}
|
|
8208
8514
|
}
|
|
8209
|
-
}, _marked3$
|
|
8515
|
+
}, _marked3$2);
|
|
8210
8516
|
}
|
|
8211
8517
|
function updateAnimation(mapId, maxValue) {
|
|
8212
8518
|
var animationStart, animationStartUnix, animationEnd, animationEndUnix, t, deltaT, start, end, isAnimating$1, timeStep;
|
|
@@ -8273,10 +8579,10 @@ function updateAnimation(mapId, maxValue) {
|
|
|
8273
8579
|
return _context4.stop();
|
|
8274
8580
|
}
|
|
8275
8581
|
}
|
|
8276
|
-
}, _marked4
|
|
8582
|
+
}, _marked4);
|
|
8277
8583
|
}
|
|
8278
8584
|
function setLayerDimensionsSaga(_ref4) {
|
|
8279
|
-
var payload, layerDimensions, dimensions, layerId, layer, newTimeDimension, mapId,
|
|
8585
|
+
var payload, layerDimensions, dimensions, layerId, layer, newTimeDimension, mapId, autoUpdateLayerId, shouldAutoUpdate, shouldEndTimeOverride, prevTimeDimension, isAnimating$1, webmapInstance, isAutoUpdateLayer, syncedMapIds;
|
|
8280
8586
|
return regeneratorRuntime.wrap(function setLayerDimensionsSaga$(_context5) {
|
|
8281
8587
|
while (1) {
|
|
8282
8588
|
switch (_context5.prev = _context5.next) {
|
|
@@ -8313,10 +8619,10 @@ function setLayerDimensionsSaga(_ref4) {
|
|
|
8313
8619
|
});
|
|
8314
8620
|
mapId = layer.mapId;
|
|
8315
8621
|
_context5.next = 15;
|
|
8316
|
-
return select(
|
|
8622
|
+
return select(getAutoUpdateLayerId, mapId);
|
|
8317
8623
|
|
|
8318
8624
|
case 15:
|
|
8319
|
-
|
|
8625
|
+
autoUpdateLayerId = _context5.sent;
|
|
8320
8626
|
_context5.next = 18;
|
|
8321
8627
|
return select(isAutoUpdating, mapId);
|
|
8322
8628
|
|
|
@@ -8338,49 +8644,20 @@ function setLayerDimensionsSaga(_ref4) {
|
|
|
8338
8644
|
case 27:
|
|
8339
8645
|
isAnimating$1 = _context5.sent;
|
|
8340
8646
|
webmapInstance = getWMJSMapById(mapId);
|
|
8341
|
-
|
|
8342
|
-
_context5.next = 32;
|
|
8343
|
-
return select(getMapTimeStepWithoutDefault, mapId);
|
|
8344
|
-
|
|
8345
|
-
case 32:
|
|
8346
|
-
timeStep = _context5.sent;
|
|
8347
|
-
_context5.next = 35;
|
|
8348
|
-
return select(isTimestepAuto, mapId);
|
|
8349
|
-
|
|
8350
|
-
case 35:
|
|
8351
|
-
isTimestepAuto$1 = _context5.sent;
|
|
8352
|
-
|
|
8353
|
-
if (!(isTimestepAuto$1 && isActiveLayer && timeStep === undefined && newTimeDimension)) {
|
|
8354
|
-
_context5.next = 41;
|
|
8355
|
-
break;
|
|
8356
|
-
}
|
|
8357
|
-
|
|
8358
|
-
newTimeStep = getActiveLayerTimeStep(newTimeDimension);
|
|
8359
|
-
|
|
8360
|
-
if (!newTimeStep) {
|
|
8361
|
-
_context5.next = 41;
|
|
8362
|
-
break;
|
|
8363
|
-
}
|
|
8364
|
-
|
|
8365
|
-
_context5.next = 41;
|
|
8366
|
-
return put(mapActions$1.setTimeStep({
|
|
8367
|
-
mapId: mapId,
|
|
8368
|
-
timeStep: newTimeStep
|
|
8369
|
-
}));
|
|
8647
|
+
isAutoUpdateLayer = layerId === autoUpdateLayerId;
|
|
8370
8648
|
|
|
8371
|
-
|
|
8372
|
-
if (!(isActiveLayer && // only update the active layer
|
|
8649
|
+
if (!(isAutoUpdateLayer && // only update the active layer
|
|
8373
8650
|
shouldAutoUpdate && newTimeDimension && newTimeDimension.maxValue && prevTimeDimension && prevTimeDimension.currentValue && prevTimeDimension.currentValue !== newTimeDimension.maxValue && !shouldEndTimeOverride)) {
|
|
8374
|
-
_context5.next =
|
|
8651
|
+
_context5.next = 44;
|
|
8375
8652
|
break;
|
|
8376
8653
|
}
|
|
8377
8654
|
|
|
8378
8655
|
if (isAnimating$1) {
|
|
8379
|
-
_context5.next =
|
|
8656
|
+
_context5.next = 34;
|
|
8380
8657
|
break;
|
|
8381
8658
|
}
|
|
8382
8659
|
|
|
8383
|
-
_context5.next =
|
|
8660
|
+
_context5.next = 34;
|
|
8384
8661
|
return put(layerActions.layerChangeDimension({
|
|
8385
8662
|
layerId: layerId,
|
|
8386
8663
|
origin: LayerActionOrigin.setLayerDimensionSaga,
|
|
@@ -8390,19 +8667,19 @@ function setLayerDimensionsSaga(_ref4) {
|
|
|
8390
8667
|
}
|
|
8391
8668
|
}));
|
|
8392
8669
|
|
|
8393
|
-
case
|
|
8394
|
-
_context5.next =
|
|
8670
|
+
case 34:
|
|
8671
|
+
_context5.next = 36;
|
|
8395
8672
|
return select(getSyncedMapIdsForTimeslider);
|
|
8396
8673
|
|
|
8397
|
-
case
|
|
8674
|
+
case 36:
|
|
8398
8675
|
syncedMapIds = _context5.sent;
|
|
8399
8676
|
|
|
8400
8677
|
if (!syncedMapIds) {
|
|
8401
|
-
_context5.next =
|
|
8678
|
+
_context5.next = 40;
|
|
8402
8679
|
break;
|
|
8403
8680
|
}
|
|
8404
8681
|
|
|
8405
|
-
_context5.next =
|
|
8682
|
+
_context5.next = 40;
|
|
8406
8683
|
return all(syncedMapIds.map(function (syncedMapId) {
|
|
8407
8684
|
return put(setTime({
|
|
8408
8685
|
origin: 'mapStore saga',
|
|
@@ -8411,42 +8688,42 @@ function setLayerDimensionsSaga(_ref4) {
|
|
|
8411
8688
|
}));
|
|
8412
8689
|
}));
|
|
8413
8690
|
|
|
8414
|
-
case
|
|
8415
|
-
_context5.next =
|
|
8691
|
+
case 40:
|
|
8692
|
+
_context5.next = 42;
|
|
8416
8693
|
return call(updateAnimation, mapId, newTimeDimension.maxValue);
|
|
8417
8694
|
|
|
8418
|
-
case
|
|
8419
|
-
_context5.next =
|
|
8695
|
+
case 42:
|
|
8696
|
+
_context5.next = 47;
|
|
8420
8697
|
break;
|
|
8421
8698
|
|
|
8422
|
-
case
|
|
8699
|
+
case 44:
|
|
8423
8700
|
if (!(isAnimating$1 && !webmapInstance.isAnimating && newTimeDimension && newTimeDimension.maxValue && !shouldEndTimeOverride)) {
|
|
8424
|
-
_context5.next =
|
|
8701
|
+
_context5.next = 47;
|
|
8425
8702
|
break;
|
|
8426
8703
|
}
|
|
8427
8704
|
|
|
8428
|
-
_context5.next =
|
|
8705
|
+
_context5.next = 47;
|
|
8429
8706
|
return call(updateAnimation, mapId, newTimeDimension.maxValue);
|
|
8430
8707
|
|
|
8431
|
-
case
|
|
8432
|
-
_context5.next =
|
|
8708
|
+
case 47:
|
|
8709
|
+
_context5.next = 52;
|
|
8433
8710
|
break;
|
|
8434
8711
|
|
|
8435
|
-
case
|
|
8436
|
-
_context5.prev =
|
|
8712
|
+
case 49:
|
|
8713
|
+
_context5.prev = 49;
|
|
8437
8714
|
_context5.t0 = _context5["catch"](1);
|
|
8438
8715
|
// eslint-disable-next-line no-console
|
|
8439
8716
|
console.warn(_context5.t0);
|
|
8440
8717
|
|
|
8441
|
-
case
|
|
8718
|
+
case 52:
|
|
8442
8719
|
case "end":
|
|
8443
8720
|
return _context5.stop();
|
|
8444
8721
|
}
|
|
8445
8722
|
}
|
|
8446
|
-
}, _marked5, null, [[1,
|
|
8723
|
+
}, _marked5, null, [[1, 49]]);
|
|
8447
8724
|
}
|
|
8448
8725
|
function toggleAutoUpdateSaga(_ref5) {
|
|
8449
|
-
var payload, shouldAutoUpdate, mapId,
|
|
8726
|
+
var payload, shouldAutoUpdate, mapId, autoUpdateLayerId, timeDimension, syncedMapIds, payloads;
|
|
8450
8727
|
return regeneratorRuntime.wrap(function toggleAutoUpdateSaga$(_context6) {
|
|
8451
8728
|
while (1) {
|
|
8452
8729
|
switch (_context6.prev = _context6.next) {
|
|
@@ -8461,12 +8738,12 @@ function toggleAutoUpdateSaga(_ref5) {
|
|
|
8461
8738
|
}
|
|
8462
8739
|
|
|
8463
8740
|
_context6.next = 6;
|
|
8464
|
-
return select(
|
|
8741
|
+
return select(getAutoUpdateLayerId, mapId);
|
|
8465
8742
|
|
|
8466
8743
|
case 6:
|
|
8467
|
-
|
|
8744
|
+
autoUpdateLayerId = _context6.sent;
|
|
8468
8745
|
_context6.next = 9;
|
|
8469
|
-
return select(getLayerTimeDimension,
|
|
8746
|
+
return select(getLayerTimeDimension, autoUpdateLayerId);
|
|
8470
8747
|
|
|
8471
8748
|
case 9:
|
|
8472
8749
|
timeDimension = _context6.sent;
|
|
@@ -8478,7 +8755,7 @@ function toggleAutoUpdateSaga(_ref5) {
|
|
|
8478
8755
|
|
|
8479
8756
|
_context6.next = 13;
|
|
8480
8757
|
return put(layerActions.layerChangeDimension({
|
|
8481
|
-
layerId:
|
|
8758
|
+
layerId: autoUpdateLayerId,
|
|
8482
8759
|
origin: LayerActionOrigin.toggleAutoUpdateSaga,
|
|
8483
8760
|
dimension: {
|
|
8484
8761
|
name: 'time',
|
|
@@ -8606,7 +8883,7 @@ function handleBaseLayersSaga(mapId, baseLayers) {
|
|
|
8606
8883
|
}, _marked7);
|
|
8607
8884
|
}
|
|
8608
8885
|
function setMapPresetSaga(_ref6) {
|
|
8609
|
-
var payload, mapId, initialProps, mapPreset, layers, activeLayerId, proj, shouldAutoUpdate, shouldAnimate, animationPayload, toggleTimestepAuto, showTimeSlider, displayMapPin, shouldShowZoomControls, shouldShowLegend, dockedLayerManagerSize, _filterLayers, mapLayers, baseLayers, overLayers,
|
|
8886
|
+
var payload, _a, _b, _c, mapId, initialProps, mapPreset, layers, activeLayerId, autoTimeStepLayerId, autoUpdateLayerId, proj, shouldAutoUpdate, shouldAnimate, animationPayload, toggleTimestepAuto, showTimeSlider, displayMapPin, shouldShowZoomControls, shouldShowLegend, dockedLayerManagerSize, _filterLayers, mapLayers, baseLayers, overLayers, autoTimeStepLayerIdNew, autoUpdateLayerIdNew, onlyActiveLayerIdIsSet, newLayerIds, firstLayerId, baseLayersWithDefaultLayer, overLayersWithDefaultLayer, allBaseLayers, animationLength, animationEndTime, shouldEndtimeOverride, interval, animationEnd, _animationEnd, duration, _animationEnd2, animationStart, shouldOpenLegend, legendId, fiveMinuteDelayForAnimation, _animationEnd3, _animationStart;
|
|
8610
8887
|
|
|
8611
8888
|
return regeneratorRuntime.wrap(function setMapPresetSaga$(_context8) {
|
|
8612
8889
|
while (1) {
|
|
@@ -8618,41 +8895,54 @@ function setMapPresetSaga(_ref6) {
|
|
|
8618
8895
|
mapPreset = initialProps.mapPreset;
|
|
8619
8896
|
|
|
8620
8897
|
if (!mapPreset) {
|
|
8621
|
-
_context8.next =
|
|
8898
|
+
_context8.next = 122;
|
|
8622
8899
|
break;
|
|
8623
8900
|
}
|
|
8624
8901
|
|
|
8625
|
-
layers = mapPreset.layers, activeLayerId = mapPreset.activeLayerId, proj = mapPreset.proj, shouldAutoUpdate = mapPreset.shouldAutoUpdate, shouldAnimate = mapPreset.shouldAnimate, animationPayload = mapPreset.animationPayload, toggleTimestepAuto = mapPreset.toggleTimestepAuto, showTimeSlider = mapPreset.showTimeSlider, displayMapPin = mapPreset.displayMapPin, shouldShowZoomControls = mapPreset.shouldShowZoomControls, shouldShowLegend = mapPreset.shouldShowLegend, dockedLayerManagerSize = mapPreset.dockedLayerManagerSize;
|
|
8902
|
+
layers = mapPreset.layers, activeLayerId = mapPreset.activeLayerId, autoTimeStepLayerId = mapPreset.autoTimeStepLayerId, autoUpdateLayerId = mapPreset.autoUpdateLayerId, proj = mapPreset.proj, shouldAutoUpdate = mapPreset.shouldAutoUpdate, shouldAnimate = mapPreset.shouldAnimate, animationPayload = mapPreset.animationPayload, toggleTimestepAuto = mapPreset.toggleTimestepAuto, showTimeSlider = mapPreset.showTimeSlider, displayMapPin = mapPreset.displayMapPin, shouldShowZoomControls = mapPreset.shouldShowZoomControls, shouldShowLegend = mapPreset.shouldShowLegend, dockedLayerManagerSize = mapPreset.dockedLayerManagerSize;
|
|
8626
8903
|
_filterLayers = filterLayers(layers), mapLayers = _filterLayers.mapLayers, baseLayers = _filterLayers.baseLayers, overLayers = _filterLayers.overLayers;
|
|
8627
8904
|
|
|
8628
8905
|
if (!layers) {
|
|
8629
|
-
_context8.next =
|
|
8906
|
+
_context8.next = 20;
|
|
8630
8907
|
break;
|
|
8631
8908
|
}
|
|
8632
8909
|
|
|
8633
|
-
|
|
8634
|
-
|
|
8910
|
+
// make sure all layers have a unique id before going forward
|
|
8911
|
+
autoTimeStepLayerIdNew = autoTimeStepLayerId;
|
|
8912
|
+
autoUpdateLayerIdNew = autoUpdateLayerId;
|
|
8913
|
+
onlyActiveLayerIdIsSet = !autoTimeStepLayerId && !autoUpdateLayerId && activeLayerId;
|
|
8635
8914
|
|
|
8636
|
-
|
|
8637
|
-
|
|
8638
|
-
|
|
8639
|
-
|
|
8640
|
-
|
|
8915
|
+
if (onlyActiveLayerIdIsSet) {
|
|
8916
|
+
autoTimeStepLayerIdNew = activeLayerId;
|
|
8917
|
+
autoUpdateLayerIdNew = activeLayerId;
|
|
8918
|
+
}
|
|
8919
|
+
|
|
8920
|
+
_context8.next = 14;
|
|
8921
|
+
return call(replaceLayerIdsToEnsureUniqueLayerIdsInStore, {
|
|
8922
|
+
layers: mapLayers,
|
|
8923
|
+
autoTimeStepLayerId: autoTimeStepLayerIdNew,
|
|
8924
|
+
autoUpdateLayerId: autoUpdateLayerIdNew
|
|
8925
|
+
});
|
|
8926
|
+
|
|
8927
|
+
case 14:
|
|
8928
|
+
newLayerIds = _context8.sent;
|
|
8929
|
+
_context8.next = 17;
|
|
8641
8930
|
return put(layerActions.setLayers({
|
|
8642
8931
|
mapId: mapId,
|
|
8643
|
-
layers:
|
|
8932
|
+
layers: newLayerIds.layers
|
|
8644
8933
|
}));
|
|
8645
8934
|
|
|
8646
|
-
case
|
|
8935
|
+
case 17:
|
|
8647
8936
|
// set active layer if given otherwise to first layer
|
|
8648
|
-
|
|
8649
|
-
_context8.next =
|
|
8650
|
-
return put(mapActions$1.
|
|
8937
|
+
firstLayerId = (_a = newLayerIds.layers[0]) === null || _a === void 0 ? void 0 : _a.id;
|
|
8938
|
+
_context8.next = 20;
|
|
8939
|
+
return put(mapActions$1.setAutoLayerId({
|
|
8651
8940
|
mapId: mapId,
|
|
8652
|
-
|
|
8941
|
+
autoTimeStepLayerId: (_b = newLayerIds.autoTimeStepLayerId) !== null && _b !== void 0 ? _b : firstLayerId,
|
|
8942
|
+
autoUpdateLayerId: (_c = newLayerIds.autoUpdateLayerId) !== null && _c !== void 0 ? _c : firstLayerId
|
|
8653
8943
|
}));
|
|
8654
8944
|
|
|
8655
|
-
case
|
|
8945
|
+
case 20:
|
|
8656
8946
|
// sets (default) baseLayers
|
|
8657
8947
|
baseLayersWithDefaultLayer = baseLayers.length ? baseLayers : [baseLayerGrey$1]; // sets (default) overLayers
|
|
8658
8948
|
|
|
@@ -8662,206 +8952,206 @@ function setMapPresetSaga(_ref6) {
|
|
|
8662
8952
|
id: generateLayerId()
|
|
8663
8953
|
});
|
|
8664
8954
|
});
|
|
8665
|
-
_context8.next =
|
|
8955
|
+
_context8.next = 25;
|
|
8666
8956
|
return call(handleBaseLayersSaga, mapId, allBaseLayers);
|
|
8667
8957
|
|
|
8668
|
-
case
|
|
8958
|
+
case 25:
|
|
8669
8959
|
if (!proj) {
|
|
8670
|
-
_context8.next =
|
|
8960
|
+
_context8.next = 28;
|
|
8671
8961
|
break;
|
|
8672
8962
|
}
|
|
8673
8963
|
|
|
8674
|
-
_context8.next =
|
|
8964
|
+
_context8.next = 28;
|
|
8675
8965
|
return put(mapActions$1.setBbox({
|
|
8676
8966
|
mapId: mapId,
|
|
8677
8967
|
bbox: proj === null || proj === void 0 ? void 0 : proj.bbox,
|
|
8678
8968
|
srs: proj === null || proj === void 0 ? void 0 : proj.srs
|
|
8679
8969
|
}));
|
|
8680
8970
|
|
|
8681
|
-
case
|
|
8971
|
+
case 28:
|
|
8682
8972
|
animationLength = animationPayload && animationPayload.duration;
|
|
8683
8973
|
animationEndTime = animationPayload && animationPayload.endTime && isAnimationEndTimeValid(animationPayload.endTime) && animationPayload.endTime;
|
|
8684
8974
|
shouldEndtimeOverride = animationPayload ? animationPayload.shouldEndtimeOverride : false;
|
|
8685
8975
|
|
|
8686
8976
|
if (!shouldEndtimeOverride) {
|
|
8687
|
-
_context8.next =
|
|
8977
|
+
_context8.next = 34;
|
|
8688
8978
|
break;
|
|
8689
8979
|
}
|
|
8690
8980
|
|
|
8691
|
-
_context8.next =
|
|
8981
|
+
_context8.next = 34;
|
|
8692
8982
|
return put(mapActions$1.setEndTimeOverriding({
|
|
8693
8983
|
mapId: mapId,
|
|
8694
8984
|
shouldEndtimeOverride: shouldEndtimeOverride
|
|
8695
8985
|
}));
|
|
8696
8986
|
|
|
8697
|
-
case
|
|
8987
|
+
case 34:
|
|
8698
8988
|
if (!(shouldAutoUpdate !== undefined && !animationEndTime)) {
|
|
8699
|
-
_context8.next =
|
|
8989
|
+
_context8.next = 37;
|
|
8700
8990
|
break;
|
|
8701
8991
|
}
|
|
8702
8992
|
|
|
8703
|
-
_context8.next =
|
|
8993
|
+
_context8.next = 37;
|
|
8704
8994
|
return put(mapActions$1.toggleAutoUpdate({
|
|
8705
8995
|
mapId: mapId,
|
|
8706
8996
|
shouldAutoUpdate: shouldAutoUpdate
|
|
8707
8997
|
}));
|
|
8708
8998
|
|
|
8709
|
-
case
|
|
8999
|
+
case 37:
|
|
8710
9000
|
if (!(showTimeSlider !== undefined)) {
|
|
8711
|
-
_context8.next =
|
|
9001
|
+
_context8.next = 40;
|
|
8712
9002
|
break;
|
|
8713
9003
|
}
|
|
8714
9004
|
|
|
8715
|
-
_context8.next =
|
|
9005
|
+
_context8.next = 40;
|
|
8716
9006
|
return put(mapActions$1.toggleTimeSliderIsVisible({
|
|
8717
9007
|
mapId: mapId,
|
|
8718
9008
|
isTimeSliderVisible: showTimeSlider
|
|
8719
9009
|
}));
|
|
8720
9010
|
|
|
8721
|
-
case
|
|
9011
|
+
case 40:
|
|
8722
9012
|
if (!(shouldShowZoomControls !== undefined)) {
|
|
8723
|
-
_context8.next =
|
|
9013
|
+
_context8.next = 43;
|
|
8724
9014
|
break;
|
|
8725
9015
|
}
|
|
8726
9016
|
|
|
8727
|
-
_context8.next =
|
|
9017
|
+
_context8.next = 43;
|
|
8728
9018
|
return put(mapActions$1.toggleZoomControls({
|
|
8729
9019
|
mapId: mapId,
|
|
8730
9020
|
shouldShowZoomControls: shouldShowZoomControls
|
|
8731
9021
|
}));
|
|
8732
9022
|
|
|
8733
|
-
case
|
|
9023
|
+
case 43:
|
|
8734
9024
|
if (!(displayMapPin !== undefined)) {
|
|
8735
|
-
_context8.next =
|
|
9025
|
+
_context8.next = 46;
|
|
8736
9026
|
break;
|
|
8737
9027
|
}
|
|
8738
9028
|
|
|
8739
|
-
_context8.next =
|
|
9029
|
+
_context8.next = 46;
|
|
8740
9030
|
return put(mapActions$1.toggleMapPinIsVisible({
|
|
8741
9031
|
mapId: mapId,
|
|
8742
9032
|
displayMapPin: displayMapPin
|
|
8743
9033
|
}));
|
|
8744
9034
|
|
|
8745
|
-
case
|
|
9035
|
+
case 46:
|
|
8746
9036
|
// sets timestep by interval of animationPayload
|
|
8747
9037
|
interval = animationPayload && animationPayload.interval;
|
|
8748
9038
|
|
|
8749
9039
|
if (!interval) {
|
|
8750
|
-
_context8.next =
|
|
9040
|
+
_context8.next = 50;
|
|
8751
9041
|
break;
|
|
8752
9042
|
}
|
|
8753
9043
|
|
|
8754
|
-
_context8.next =
|
|
9044
|
+
_context8.next = 50;
|
|
8755
9045
|
return put(mapActions$1.setTimeStep({
|
|
8756
9046
|
mapId: mapId,
|
|
8757
9047
|
timeStep: interval
|
|
8758
9048
|
}));
|
|
8759
9049
|
|
|
8760
|
-
case
|
|
9050
|
+
case 50:
|
|
8761
9051
|
if (!animationEndTime) {
|
|
8762
|
-
_context8.next =
|
|
9052
|
+
_context8.next = 59;
|
|
8763
9053
|
break;
|
|
8764
9054
|
}
|
|
8765
9055
|
|
|
8766
|
-
_context8.next =
|
|
9056
|
+
_context8.next = 53;
|
|
8767
9057
|
return put(mapActions$1.setAnimationEndTime({
|
|
8768
9058
|
mapId: mapId,
|
|
8769
9059
|
animationEndTime: getAnimationEndTime(animationEndTime)
|
|
8770
9060
|
}));
|
|
8771
9061
|
|
|
8772
|
-
case
|
|
9062
|
+
case 53:
|
|
8773
9063
|
if (animationLength) {
|
|
8774
|
-
_context8.next =
|
|
9064
|
+
_context8.next = 59;
|
|
8775
9065
|
break;
|
|
8776
9066
|
}
|
|
8777
9067
|
|
|
8778
|
-
_context8.next =
|
|
9068
|
+
_context8.next = 56;
|
|
8779
9069
|
return select(getAnimationEndTime$1, mapId);
|
|
8780
9070
|
|
|
8781
|
-
case
|
|
9071
|
+
case 56:
|
|
8782
9072
|
animationEnd = _context8.sent;
|
|
8783
|
-
_context8.next =
|
|
9073
|
+
_context8.next = 59;
|
|
8784
9074
|
return put(mapActions$1.setAnimationStartTime({
|
|
8785
9075
|
mapId: mapId,
|
|
8786
9076
|
animationStartTime: moment(animationEnd).subtract(5 * 60, 'minutes') // set to default of 5 hours
|
|
8787
9077
|
.toISOString()
|
|
8788
9078
|
}));
|
|
8789
9079
|
|
|
8790
|
-
case
|
|
9080
|
+
case 59:
|
|
8791
9081
|
if (!animationLength) {
|
|
8792
|
-
_context8.next =
|
|
9082
|
+
_context8.next = 65;
|
|
8793
9083
|
break;
|
|
8794
9084
|
}
|
|
8795
9085
|
|
|
8796
|
-
_context8.next =
|
|
9086
|
+
_context8.next = 62;
|
|
8797
9087
|
return select(getAnimationEndTime$1, mapId);
|
|
8798
9088
|
|
|
8799
|
-
case
|
|
9089
|
+
case 62:
|
|
8800
9090
|
_animationEnd = _context8.sent;
|
|
8801
|
-
_context8.next =
|
|
9091
|
+
_context8.next = 65;
|
|
8802
9092
|
return put(mapActions$1.setAnimationStartTime({
|
|
8803
9093
|
mapId: mapId,
|
|
8804
9094
|
animationStartTime: moment(_animationEnd).subtract(animationLength, 'minutes').toISOString()
|
|
8805
9095
|
}));
|
|
8806
9096
|
|
|
8807
|
-
case
|
|
9097
|
+
case 65:
|
|
8808
9098
|
if (!(animationPayload && animationPayload.speed)) {
|
|
8809
|
-
_context8.next =
|
|
9099
|
+
_context8.next = 68;
|
|
8810
9100
|
break;
|
|
8811
9101
|
}
|
|
8812
9102
|
|
|
8813
|
-
_context8.next =
|
|
9103
|
+
_context8.next = 68;
|
|
8814
9104
|
return put(mapActions$1.setAnimationDelay({
|
|
8815
9105
|
mapId: mapId,
|
|
8816
9106
|
animationDelay: getSpeedDelay(animationPayload.speed)
|
|
8817
9107
|
}));
|
|
8818
9108
|
|
|
8819
|
-
case
|
|
9109
|
+
case 68:
|
|
8820
9110
|
if (!(shouldAnimate === true)) {
|
|
8821
|
-
_context8.next =
|
|
9111
|
+
_context8.next = 93;
|
|
8822
9112
|
break;
|
|
8823
9113
|
}
|
|
8824
9114
|
|
|
8825
9115
|
duration = animationPayload && animationPayload.duration ? animationPayload.duration : 5 * 60; // set to default of 5 hours
|
|
8826
9116
|
|
|
8827
9117
|
if (!(shouldEndtimeOverride && animationEndTime)) {
|
|
8828
|
-
_context8.next =
|
|
9118
|
+
_context8.next = 76;
|
|
8829
9119
|
break;
|
|
8830
9120
|
}
|
|
8831
9121
|
|
|
8832
|
-
_context8.next =
|
|
9122
|
+
_context8.next = 73;
|
|
8833
9123
|
return select(getAnimationEndTime$1, mapId);
|
|
8834
9124
|
|
|
8835
|
-
case
|
|
9125
|
+
case 73:
|
|
8836
9126
|
_context8.t0 = _context8.sent;
|
|
8837
|
-
_context8.next =
|
|
9127
|
+
_context8.next = 77;
|
|
8838
9128
|
break;
|
|
8839
9129
|
|
|
8840
|
-
case
|
|
9130
|
+
case 76:
|
|
8841
9131
|
_context8.t0 = moment.utc().format(dateFormat);
|
|
8842
9132
|
|
|
8843
|
-
case
|
|
9133
|
+
case 77:
|
|
8844
9134
|
_animationEnd2 = _context8.t0;
|
|
8845
9135
|
|
|
8846
9136
|
if (!(shouldEndtimeOverride && animationLength)) {
|
|
8847
|
-
_context8.next =
|
|
9137
|
+
_context8.next = 84;
|
|
8848
9138
|
break;
|
|
8849
9139
|
}
|
|
8850
9140
|
|
|
8851
|
-
_context8.next =
|
|
9141
|
+
_context8.next = 81;
|
|
8852
9142
|
return select(getAnimationStartTime, mapId);
|
|
8853
9143
|
|
|
8854
|
-
case
|
|
9144
|
+
case 81:
|
|
8855
9145
|
_context8.t1 = _context8.sent;
|
|
8856
|
-
_context8.next =
|
|
9146
|
+
_context8.next = 85;
|
|
8857
9147
|
break;
|
|
8858
9148
|
|
|
8859
|
-
case
|
|
9149
|
+
case 84:
|
|
8860
9150
|
_context8.t1 = moment.utc().subtract(duration, 'minutes').format(dateFormat);
|
|
8861
9151
|
|
|
8862
|
-
case
|
|
9152
|
+
case 85:
|
|
8863
9153
|
animationStart = _context8.t1;
|
|
8864
|
-
_context8.next =
|
|
9154
|
+
_context8.next = 88;
|
|
8865
9155
|
return put(mapActions$1.mapStartAnimation({
|
|
8866
9156
|
mapId: mapId,
|
|
8867
9157
|
start: animationStart,
|
|
@@ -8869,119 +9159,119 @@ function setMapPresetSaga(_ref6) {
|
|
|
8869
9159
|
interval: interval || animationIntervalDefault
|
|
8870
9160
|
}));
|
|
8871
9161
|
|
|
8872
|
-
case
|
|
9162
|
+
case 88:
|
|
8873
9163
|
if (!interval) {
|
|
8874
|
-
_context8.next =
|
|
9164
|
+
_context8.next = 91;
|
|
8875
9165
|
break;
|
|
8876
9166
|
}
|
|
8877
9167
|
|
|
8878
|
-
_context8.next =
|
|
9168
|
+
_context8.next = 91;
|
|
8879
9169
|
return put(mapActions$1.toggleTimestepAuto({
|
|
8880
9170
|
mapId: mapId,
|
|
8881
9171
|
timestepAuto: false
|
|
8882
9172
|
}));
|
|
8883
9173
|
|
|
8884
|
-
case
|
|
8885
|
-
_context8.next =
|
|
9174
|
+
case 91:
|
|
9175
|
+
_context8.next = 96;
|
|
8886
9176
|
break;
|
|
8887
9177
|
|
|
8888
|
-
case
|
|
9178
|
+
case 93:
|
|
8889
9179
|
if (!(toggleTimestepAuto !== undefined)) {
|
|
8890
|
-
_context8.next =
|
|
9180
|
+
_context8.next = 96;
|
|
8891
9181
|
break;
|
|
8892
9182
|
}
|
|
8893
9183
|
|
|
8894
|
-
_context8.next =
|
|
9184
|
+
_context8.next = 96;
|
|
8895
9185
|
return put(mapActions$1.toggleTimestepAuto({
|
|
8896
9186
|
mapId: mapId,
|
|
8897
9187
|
timestepAuto: toggleTimestepAuto
|
|
8898
9188
|
}));
|
|
8899
9189
|
|
|
8900
|
-
case
|
|
9190
|
+
case 96:
|
|
8901
9191
|
// show legend
|
|
8902
9192
|
shouldOpenLegend = shouldShowLegend !== undefined ? shouldShowLegend : IS_LEGEND_OPEN_BY_DEFAULT;
|
|
8903
|
-
_context8.next =
|
|
9193
|
+
_context8.next = 99;
|
|
8904
9194
|
return select(getLegendId, mapId);
|
|
8905
9195
|
|
|
8906
|
-
case
|
|
9196
|
+
case 99:
|
|
8907
9197
|
legendId = _context8.sent;
|
|
8908
9198
|
|
|
8909
9199
|
if (!legendId) {
|
|
8910
|
-
_context8.next =
|
|
9200
|
+
_context8.next = 103;
|
|
8911
9201
|
break;
|
|
8912
9202
|
}
|
|
8913
9203
|
|
|
8914
|
-
_context8.next =
|
|
9204
|
+
_context8.next = 103;
|
|
8915
9205
|
return put(uiActions.setToggleOpenDialog({
|
|
8916
9206
|
type: legendId,
|
|
8917
9207
|
setOpen: shouldOpenLegend
|
|
8918
9208
|
}));
|
|
8919
9209
|
|
|
8920
|
-
case
|
|
9210
|
+
case 103:
|
|
8921
9211
|
if (!dockedLayerManagerSize) {
|
|
8922
|
-
_context8.next =
|
|
9212
|
+
_context8.next = 106;
|
|
8923
9213
|
break;
|
|
8924
9214
|
}
|
|
8925
9215
|
|
|
8926
|
-
_context8.next =
|
|
9216
|
+
_context8.next = 106;
|
|
8927
9217
|
return put(mapActions$1.setDockedLayerManagerSize({
|
|
8928
9218
|
mapId: mapId,
|
|
8929
9219
|
dockedLayerManagerSize: dockedLayerManagerSize
|
|
8930
9220
|
}));
|
|
8931
9221
|
|
|
8932
|
-
case
|
|
9222
|
+
case 106:
|
|
8933
9223
|
if (!(animationEndTime && (shouldEndtimeOverride || !(shouldAutoUpdate || shouldAnimate)))) {
|
|
8934
|
-
_context8.next =
|
|
9224
|
+
_context8.next = 122;
|
|
8935
9225
|
break;
|
|
8936
9226
|
}
|
|
8937
9227
|
|
|
8938
9228
|
fiveMinuteDelayForAnimation = 1000 * 60 * 5;
|
|
8939
|
-
_context8.next =
|
|
9229
|
+
_context8.next = 110;
|
|
8940
9230
|
return delay(fiveMinuteDelayForAnimation);
|
|
8941
9231
|
|
|
8942
|
-
case
|
|
8943
|
-
_context8.next =
|
|
9232
|
+
case 110:
|
|
9233
|
+
_context8.next = 112;
|
|
8944
9234
|
return select(getAnimationEndTime$1, mapId);
|
|
8945
9235
|
|
|
8946
|
-
case
|
|
9236
|
+
case 112:
|
|
8947
9237
|
_animationEnd3 = _context8.sent;
|
|
8948
|
-
_context8.next =
|
|
9238
|
+
_context8.next = 115;
|
|
8949
9239
|
return put(mapActions$1.setAnimationEndTime({
|
|
8950
9240
|
mapId: mapId,
|
|
8951
9241
|
animationEndTime: moment(_animationEnd3).add(5, 'minutes').toISOString()
|
|
8952
9242
|
}));
|
|
8953
9243
|
|
|
8954
|
-
case
|
|
8955
|
-
_context8.next =
|
|
9244
|
+
case 115:
|
|
9245
|
+
_context8.next = 117;
|
|
8956
9246
|
return select(getAnimationStartTime, mapId);
|
|
8957
9247
|
|
|
8958
|
-
case
|
|
9248
|
+
case 117:
|
|
8959
9249
|
_animationStart = _context8.sent;
|
|
8960
|
-
_context8.next =
|
|
9250
|
+
_context8.next = 120;
|
|
8961
9251
|
return put(mapActions$1.setAnimationStartTime({
|
|
8962
9252
|
mapId: mapId,
|
|
8963
9253
|
animationStartTime: moment(_animationStart).add(5, 'minutes').toISOString()
|
|
8964
9254
|
}));
|
|
8965
9255
|
|
|
8966
|
-
case 118:
|
|
8967
|
-
_context8.next = 104;
|
|
8968
|
-
break;
|
|
8969
|
-
|
|
8970
9256
|
case 120:
|
|
8971
|
-
_context8.next =
|
|
9257
|
+
_context8.next = 106;
|
|
8972
9258
|
break;
|
|
8973
9259
|
|
|
8974
9260
|
case 122:
|
|
8975
|
-
_context8.
|
|
9261
|
+
_context8.next = 127;
|
|
9262
|
+
break;
|
|
9263
|
+
|
|
9264
|
+
case 124:
|
|
9265
|
+
_context8.prev = 124;
|
|
8976
9266
|
_context8.t2 = _context8["catch"](1);
|
|
8977
9267
|
console.error(_context8.t2);
|
|
8978
9268
|
|
|
8979
|
-
case
|
|
9269
|
+
case 127:
|
|
8980
9270
|
case "end":
|
|
8981
9271
|
return _context8.stop();
|
|
8982
9272
|
}
|
|
8983
9273
|
}
|
|
8984
|
-
}, _marked8, null, [[1,
|
|
9274
|
+
}, _marked8, null, [[1, 124]]);
|
|
8985
9275
|
}
|
|
8986
9276
|
function unregisterMapSaga(_ref7) {
|
|
8987
9277
|
var payload, mapId, layerList;
|
|
@@ -9013,7 +9303,7 @@ function unregisterMapSaga(_ref7) {
|
|
|
9013
9303
|
}
|
|
9014
9304
|
}, _marked9);
|
|
9015
9305
|
}
|
|
9016
|
-
function rootSaga$
|
|
9306
|
+
function rootSaga$4() {
|
|
9017
9307
|
return regeneratorRuntime.wrap(function rootSaga$(_context10) {
|
|
9018
9308
|
while (1) {
|
|
9019
9309
|
switch (_context10.prev = _context10.next) {
|
|
@@ -9053,6 +9343,157 @@ function rootSaga$3() {
|
|
|
9053
9343
|
}, _marked10);
|
|
9054
9344
|
}
|
|
9055
9345
|
|
|
9346
|
+
/* *
|
|
9347
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9348
|
+
* you may not use this file except in compliance with the License.
|
|
9349
|
+
* You may obtain a copy of the License at
|
|
9350
|
+
*
|
|
9351
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9352
|
+
*
|
|
9353
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9354
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9355
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9356
|
+
* See the License for the specific language governing permissions and
|
|
9357
|
+
* limitations under the License.
|
|
9358
|
+
*
|
|
9359
|
+
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9360
|
+
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
9361
|
+
* */
|
|
9362
|
+
/**
|
|
9363
|
+
* Converts webmapjs node structure to LayerTree
|
|
9364
|
+
* @param nodesToRecur THe WebMapJS node structure from service.getNodes();
|
|
9365
|
+
*/
|
|
9366
|
+
|
|
9367
|
+
var recurseNodes = function recurseNodes(nodesToRecur) {
|
|
9368
|
+
var newLayerTreeObj = {
|
|
9369
|
+
leaf: nodesToRecur.leaf,
|
|
9370
|
+
name: nodesToRecur.name,
|
|
9371
|
+
title: nodesToRecur.title,
|
|
9372
|
+
path: nodesToRecur.path || [],
|
|
9373
|
+
children: [],
|
|
9374
|
+
keywords: nodesToRecur.keywords || [],
|
|
9375
|
+
"abstract": nodesToRecur["abstract"] || '',
|
|
9376
|
+
styles: nodesToRecur.styles || [],
|
|
9377
|
+
dimensions: nodesToRecur.dimensions || [],
|
|
9378
|
+
geographicBoundingBox: nodesToRecur.geographicBoundingBox || null
|
|
9379
|
+
};
|
|
9380
|
+
|
|
9381
|
+
if (nodesToRecur.children) {
|
|
9382
|
+
for (var j = 0; j < nodesToRecur.children.length; j += 1) {
|
|
9383
|
+
newLayerTreeObj.children.push(recurseNodes(nodesToRecur.children[j]));
|
|
9384
|
+
}
|
|
9385
|
+
}
|
|
9386
|
+
|
|
9387
|
+
return newLayerTreeObj;
|
|
9388
|
+
};
|
|
9389
|
+
/**
|
|
9390
|
+
* Returns a promise with a hierarchical tree of layers from the WMS GetCapabilities document.
|
|
9391
|
+
* @param serviceUrl The URL of the WMS service
|
|
9392
|
+
* @param {boolean} forceReload **optional** forceReload: boolean, true will force the layers to be reloaded from the service, defaults to false
|
|
9393
|
+
*/
|
|
9394
|
+
|
|
9395
|
+
var getLayersFromService = function getLayersFromService(serviceUrl) {
|
|
9396
|
+
var forceReload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
9397
|
+
return new Promise(function (resolve, reject) {
|
|
9398
|
+
var serviceObject = WMGetServiceFromStore(serviceUrl);
|
|
9399
|
+
serviceObject.getNodes(function (nodes) {
|
|
9400
|
+
// TODO: Maarten Plieger, 2022-11-02: Harmonize types and use correct types: https://gitlab.com/opengeoweb/opengeoweb/-/issues/2817
|
|
9401
|
+
var layerTree = recurseNodes(nodes);
|
|
9402
|
+
resolve(layerTree);
|
|
9403
|
+
}, function (error) {
|
|
9404
|
+
reject(new Error(error));
|
|
9405
|
+
}, forceReload);
|
|
9406
|
+
});
|
|
9407
|
+
};
|
|
9408
|
+
/**
|
|
9409
|
+
* Returns a promise with an array of flattened layerobjects from the WMS GetCapabilities document.
|
|
9410
|
+
* @param serviceUrl The URL of the WMS service
|
|
9411
|
+
* @param {boolean} forceReload **optional** forceReload: boolean, true will force the layers to be reloaded from the service, defaults to false
|
|
9412
|
+
*/
|
|
9413
|
+
|
|
9414
|
+
var getLayersFlattenedFromService = function getLayersFlattenedFromService(serviceUrl) {
|
|
9415
|
+
var forceReload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
9416
|
+
return new Promise(function (resolve, reject) {
|
|
9417
|
+
var serviceObject = WMGetServiceFromStore(serviceUrl);
|
|
9418
|
+
serviceObject.getLayerObjectsFlat(function (layers) {
|
|
9419
|
+
resolve(layers);
|
|
9420
|
+
}, function (error) {
|
|
9421
|
+
reject(new Error(error));
|
|
9422
|
+
}, forceReload);
|
|
9423
|
+
});
|
|
9424
|
+
};
|
|
9425
|
+
|
|
9426
|
+
var _marked$3 = /*#__PURE__*/regeneratorRuntime.mark(fetchServiceSaga),
|
|
9427
|
+
_marked2$3 = /*#__PURE__*/regeneratorRuntime.mark(fetchInitialServicesSaga),
|
|
9428
|
+
_marked3$1 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$3);
|
|
9429
|
+
function fetchServiceSaga(service) {
|
|
9430
|
+
var layers;
|
|
9431
|
+
return regeneratorRuntime.wrap(function fetchServiceSaga$(_context) {
|
|
9432
|
+
while (1) {
|
|
9433
|
+
switch (_context.prev = _context.next) {
|
|
9434
|
+
case 0:
|
|
9435
|
+
_context.prev = 0;
|
|
9436
|
+
_context.next = 3;
|
|
9437
|
+
return call(getLayersFlattenedFromService, service.serviceUrl);
|
|
9438
|
+
|
|
9439
|
+
case 3:
|
|
9440
|
+
layers = _context.sent;
|
|
9441
|
+
_context.next = 6;
|
|
9442
|
+
return put(serviceActions.serviceSetLayers(Object.assign(Object.assign({}, service), {
|
|
9443
|
+
layers: layers
|
|
9444
|
+
})));
|
|
9445
|
+
|
|
9446
|
+
case 6:
|
|
9447
|
+
_context.next = 10;
|
|
9448
|
+
break;
|
|
9449
|
+
|
|
9450
|
+
case 8:
|
|
9451
|
+
_context.prev = 8;
|
|
9452
|
+
_context.t0 = _context["catch"](0);
|
|
9453
|
+
|
|
9454
|
+
case 10:
|
|
9455
|
+
case "end":
|
|
9456
|
+
return _context.stop();
|
|
9457
|
+
}
|
|
9458
|
+
}
|
|
9459
|
+
}, _marked$3, null, [[0, 8]]);
|
|
9460
|
+
}
|
|
9461
|
+
function fetchInitialServicesSaga(_ref) {
|
|
9462
|
+
var payload, services;
|
|
9463
|
+
return regeneratorRuntime.wrap(function fetchInitialServicesSaga$(_context2) {
|
|
9464
|
+
while (1) {
|
|
9465
|
+
switch (_context2.prev = _context2.next) {
|
|
9466
|
+
case 0:
|
|
9467
|
+
payload = _ref.payload;
|
|
9468
|
+
services = payload.services;
|
|
9469
|
+
_context2.next = 4;
|
|
9470
|
+
return all(services.map(function (service) {
|
|
9471
|
+
return call(fetchServiceSaga, service);
|
|
9472
|
+
}));
|
|
9473
|
+
|
|
9474
|
+
case 4:
|
|
9475
|
+
case "end":
|
|
9476
|
+
return _context2.stop();
|
|
9477
|
+
}
|
|
9478
|
+
}
|
|
9479
|
+
}, _marked2$3);
|
|
9480
|
+
}
|
|
9481
|
+
function rootSaga$3() {
|
|
9482
|
+
return regeneratorRuntime.wrap(function rootSaga$(_context3) {
|
|
9483
|
+
while (1) {
|
|
9484
|
+
switch (_context3.prev = _context3.next) {
|
|
9485
|
+
case 0:
|
|
9486
|
+
_context3.next = 2;
|
|
9487
|
+
return takeEvery(serviceActions.fetchInitialServices, fetchInitialServicesSaga);
|
|
9488
|
+
|
|
9489
|
+
case 2:
|
|
9490
|
+
case "end":
|
|
9491
|
+
return _context3.stop();
|
|
9492
|
+
}
|
|
9493
|
+
}
|
|
9494
|
+
}, _marked3$1);
|
|
9495
|
+
}
|
|
9496
|
+
|
|
9056
9497
|
var moduleConfig = {
|
|
9057
9498
|
id: 'webmap-module',
|
|
9058
9499
|
reducersMap: {
|
|
@@ -9060,7 +9501,7 @@ var moduleConfig = {
|
|
|
9060
9501
|
services: reducer$7,
|
|
9061
9502
|
layers: reducer$8
|
|
9062
9503
|
},
|
|
9063
|
-
sagas: [rootSaga$3]
|
|
9504
|
+
sagas: [rootSaga$4, rootSaga$3]
|
|
9064
9505
|
};
|
|
9065
9506
|
|
|
9066
9507
|
/* *
|
|
@@ -9114,153 +9555,97 @@ var isNoIdService = function isNoIdService(param) {
|
|
|
9114
9555
|
return !!((serviceParam === null || serviceParam === void 0 ? void 0 : serviceParam.name) && (serviceParam === null || serviceParam === void 0 ? void 0 : serviceParam.url));
|
|
9115
9556
|
};
|
|
9116
9557
|
|
|
9117
|
-
var _marked$2 = /*#__PURE__*/regeneratorRuntime.mark(
|
|
9118
|
-
_marked2$2 = /*#__PURE__*/regeneratorRuntime.mark(
|
|
9119
|
-
_marked3 = /*#__PURE__*/regeneratorRuntime.mark(
|
|
9120
|
-
_marked4 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$2);
|
|
9121
|
-
function newServiceAddedSaga(capturedAction) {
|
|
9122
|
-
var addedService, id, serviceUrl, name, scope, _abstract, isUpdating, keywords, groups;
|
|
9123
|
-
|
|
9124
|
-
return regeneratorRuntime.wrap(function newServiceAddedSaga$(_context) {
|
|
9125
|
-
while (1) {
|
|
9126
|
-
switch (_context.prev = _context.next) {
|
|
9127
|
-
case 0:
|
|
9128
|
-
addedService = capturedAction.payload;
|
|
9129
|
-
id = addedService.id, serviceUrl = addedService.serviceUrl, name = addedService.name, scope = addedService.scope, _abstract = addedService["abstract"], isUpdating = addedService.isUpdating;
|
|
9130
|
-
|
|
9131
|
-
if (!isUpdating) {
|
|
9132
|
-
_context.next = 4;
|
|
9133
|
-
break;
|
|
9134
|
-
}
|
|
9135
|
-
|
|
9136
|
-
return _context.abrupt("return");
|
|
9137
|
-
|
|
9138
|
-
case 4:
|
|
9139
|
-
keywords = addedService.layers.reduce(function (keywords, layer) {
|
|
9140
|
-
var _a;
|
|
9141
|
-
|
|
9142
|
-
if (layer.leaf) {
|
|
9143
|
-
return keywords.concat((_a = layer.keywords) !== null && _a !== void 0 ? _a : []);
|
|
9144
|
-
}
|
|
9145
|
-
|
|
9146
|
-
return keywords;
|
|
9147
|
-
}, []);
|
|
9148
|
-
groups = addedService.layers.reduce(function (groups, layer) {
|
|
9149
|
-
var _a;
|
|
9150
|
-
|
|
9151
|
-
if (layer.leaf) {
|
|
9152
|
-
return groups.concat((_a = layer.path) !== null && _a !== void 0 ? _a : []);
|
|
9153
|
-
}
|
|
9154
|
-
|
|
9155
|
-
return groups;
|
|
9156
|
-
}, []);
|
|
9157
|
-
_context.next = 8;
|
|
9158
|
-
return put(layerSelectActions.addFiltersAndActiveServices({
|
|
9159
|
-
serviceId: id,
|
|
9160
|
-
serviceName: name,
|
|
9161
|
-
serviceUrl: serviceUrl,
|
|
9162
|
-
keywords: keywords,
|
|
9163
|
-
scope: scope,
|
|
9164
|
-
groups: groups,
|
|
9165
|
-
"abstract": _abstract,
|
|
9166
|
-
isLoading: false
|
|
9167
|
-
}));
|
|
9168
|
-
|
|
9169
|
-
case 8:
|
|
9170
|
-
case "end":
|
|
9171
|
-
return _context.stop();
|
|
9172
|
-
}
|
|
9173
|
-
}
|
|
9174
|
-
}, _marked$2);
|
|
9175
|
-
}
|
|
9558
|
+
var _marked$2 = /*#__PURE__*/regeneratorRuntime.mark(layerSelectCloseInfoDialogSaga),
|
|
9559
|
+
_marked2$2 = /*#__PURE__*/regeneratorRuntime.mark(layerSelectRemoveServiceSaga),
|
|
9560
|
+
_marked3 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$2);
|
|
9176
9561
|
function layerSelectCloseInfoDialogSaga(_ref) {
|
|
9177
9562
|
var type, payload, togglePayload, activeMapIdPayload, isLayerInfoDialogOpen, _isLayerInfoDialogOpen, filteredLayers, dialogInfo;
|
|
9178
9563
|
|
|
9179
|
-
return regeneratorRuntime.wrap(function layerSelectCloseInfoDialogSaga$(
|
|
9564
|
+
return regeneratorRuntime.wrap(function layerSelectCloseInfoDialogSaga$(_context) {
|
|
9180
9565
|
while (1) {
|
|
9181
|
-
switch (
|
|
9566
|
+
switch (_context.prev = _context.next) {
|
|
9182
9567
|
case 0:
|
|
9183
9568
|
type = _ref.type, payload = _ref.payload;
|
|
9184
|
-
|
|
9185
|
-
|
|
9569
|
+
_context.t0 = type;
|
|
9570
|
+
_context.next = _context.t0 === uiActions.setToggleOpenDialog.type ? 4 : _context.t0 === uiActions.setActiveMapIdForDialog.type ? 9 : 18;
|
|
9186
9571
|
break;
|
|
9187
9572
|
|
|
9188
9573
|
case 4:
|
|
9189
9574
|
togglePayload = payload;
|
|
9190
9575
|
|
|
9191
9576
|
if (!(!togglePayload.setOpen && togglePayload.type === DialogTypes.LayerSelect)) {
|
|
9192
|
-
|
|
9577
|
+
_context.next = 8;
|
|
9193
9578
|
break;
|
|
9194
9579
|
}
|
|
9195
9580
|
|
|
9196
|
-
|
|
9581
|
+
_context.next = 8;
|
|
9197
9582
|
return put(uiActions.setToggleOpenDialog({
|
|
9198
9583
|
type: DialogTypes.LayerInfo,
|
|
9199
9584
|
setOpen: false
|
|
9200
9585
|
}));
|
|
9201
9586
|
|
|
9202
9587
|
case 8:
|
|
9203
|
-
return
|
|
9588
|
+
return _context.abrupt("break", 31);
|
|
9204
9589
|
|
|
9205
9590
|
case 9:
|
|
9206
9591
|
activeMapIdPayload = payload;
|
|
9207
9592
|
|
|
9208
9593
|
if (activeMapIdPayload.setOpen) {
|
|
9209
|
-
|
|
9594
|
+
_context.next = 17;
|
|
9210
9595
|
break;
|
|
9211
9596
|
}
|
|
9212
9597
|
|
|
9213
|
-
|
|
9598
|
+
_context.next = 13;
|
|
9214
9599
|
return select(getisDialogOpen, DialogTypes.LayerInfo);
|
|
9215
9600
|
|
|
9216
9601
|
case 13:
|
|
9217
|
-
isLayerInfoDialogOpen =
|
|
9602
|
+
isLayerInfoDialogOpen = _context.sent;
|
|
9218
9603
|
|
|
9219
9604
|
if (!isLayerInfoDialogOpen) {
|
|
9220
|
-
|
|
9605
|
+
_context.next = 17;
|
|
9221
9606
|
break;
|
|
9222
9607
|
}
|
|
9223
9608
|
|
|
9224
|
-
|
|
9609
|
+
_context.next = 17;
|
|
9225
9610
|
return put(uiActions.setToggleOpenDialog({
|
|
9226
9611
|
type: DialogTypes.LayerInfo,
|
|
9227
9612
|
setOpen: false
|
|
9228
9613
|
}));
|
|
9229
9614
|
|
|
9230
9615
|
case 17:
|
|
9231
|
-
return
|
|
9616
|
+
return _context.abrupt("break", 31);
|
|
9232
9617
|
|
|
9233
9618
|
case 18:
|
|
9234
|
-
|
|
9619
|
+
_context.next = 20;
|
|
9235
9620
|
return select(getisDialogOpen, DialogTypes.LayerInfo);
|
|
9236
9621
|
|
|
9237
9622
|
case 20:
|
|
9238
|
-
_isLayerInfoDialogOpen =
|
|
9623
|
+
_isLayerInfoDialogOpen = _context.sent;
|
|
9239
9624
|
|
|
9240
9625
|
if (!_isLayerInfoDialogOpen) {
|
|
9241
|
-
|
|
9626
|
+
_context.next = 31;
|
|
9242
9627
|
break;
|
|
9243
9628
|
}
|
|
9244
9629
|
|
|
9245
|
-
|
|
9630
|
+
_context.next = 24;
|
|
9246
9631
|
return select(getFilteredLayers);
|
|
9247
9632
|
|
|
9248
9633
|
case 24:
|
|
9249
|
-
filteredLayers =
|
|
9250
|
-
|
|
9634
|
+
filteredLayers = _context.sent;
|
|
9635
|
+
_context.next = 27;
|
|
9251
9636
|
return select(getActiveLayerInfo);
|
|
9252
9637
|
|
|
9253
9638
|
case 27:
|
|
9254
|
-
dialogInfo =
|
|
9639
|
+
dialogInfo = _context.sent;
|
|
9255
9640
|
|
|
9256
9641
|
if (filteredLayers.map(function (layer) {
|
|
9257
9642
|
return layer.title;
|
|
9258
9643
|
}).includes(dialogInfo.title)) {
|
|
9259
|
-
|
|
9644
|
+
_context.next = 31;
|
|
9260
9645
|
break;
|
|
9261
9646
|
}
|
|
9262
9647
|
|
|
9263
|
-
|
|
9648
|
+
_context.next = 31;
|
|
9264
9649
|
return put(uiActions.setToggleOpenDialog({
|
|
9265
9650
|
type: DialogTypes.LayerInfo,
|
|
9266
9651
|
setOpen: false
|
|
@@ -9268,35 +9653,35 @@ function layerSelectCloseInfoDialogSaga(_ref) {
|
|
|
9268
9653
|
|
|
9269
9654
|
case 31:
|
|
9270
9655
|
case "end":
|
|
9271
|
-
return
|
|
9656
|
+
return _context.stop();
|
|
9272
9657
|
}
|
|
9273
9658
|
}
|
|
9274
|
-
},
|
|
9659
|
+
}, _marked$2);
|
|
9275
9660
|
}
|
|
9276
9661
|
function layerSelectRemoveServiceSaga(capturedAction) {
|
|
9277
9662
|
var removedService, serviceId, serviceUrl, results, services, servicesEnabled;
|
|
9278
|
-
return regeneratorRuntime.wrap(function layerSelectRemoveServiceSaga$(
|
|
9663
|
+
return regeneratorRuntime.wrap(function layerSelectRemoveServiceSaga$(_context2) {
|
|
9279
9664
|
while (1) {
|
|
9280
|
-
switch (
|
|
9665
|
+
switch (_context2.prev = _context2.next) {
|
|
9281
9666
|
case 0:
|
|
9282
9667
|
removedService = capturedAction.payload;
|
|
9283
9668
|
serviceId = removedService.serviceId, serviceUrl = removedService.serviceUrl;
|
|
9284
|
-
|
|
9669
|
+
_context2.next = 4;
|
|
9285
9670
|
return select(getActiveServices);
|
|
9286
9671
|
|
|
9287
9672
|
case 4:
|
|
9288
|
-
results =
|
|
9673
|
+
results = _context2.sent;
|
|
9289
9674
|
services = results;
|
|
9290
9675
|
servicesEnabled = Object.values(services).find(function (service) {
|
|
9291
9676
|
return service === null || service === void 0 ? void 0 : service.enabled;
|
|
9292
9677
|
});
|
|
9293
9678
|
|
|
9294
9679
|
if (!(servicesEnabled === undefined)) {
|
|
9295
|
-
|
|
9680
|
+
_context2.next = 10;
|
|
9296
9681
|
break;
|
|
9297
9682
|
}
|
|
9298
9683
|
|
|
9299
|
-
|
|
9684
|
+
_context2.next = 10;
|
|
9300
9685
|
return all(Object.entries(services).map(function (_ref2) {
|
|
9301
9686
|
var _ref3 = _slicedToArray(_ref2, 2),
|
|
9302
9687
|
serviceId = _ref3[0],
|
|
@@ -9309,7 +9694,7 @@ function layerSelectRemoveServiceSaga(capturedAction) {
|
|
|
9309
9694
|
}));
|
|
9310
9695
|
|
|
9311
9696
|
case 10:
|
|
9312
|
-
|
|
9697
|
+
_context2.next = 12;
|
|
9313
9698
|
return put(serviceActions.mapStoreRemoveService({
|
|
9314
9699
|
id: serviceId,
|
|
9315
9700
|
serviceUrl: serviceUrl
|
|
@@ -9317,64 +9702,68 @@ function layerSelectRemoveServiceSaga(capturedAction) {
|
|
|
9317
9702
|
|
|
9318
9703
|
case 12:
|
|
9319
9704
|
case "end":
|
|
9320
|
-
return
|
|
9705
|
+
return _context2.stop();
|
|
9321
9706
|
}
|
|
9322
9707
|
}
|
|
9323
|
-
},
|
|
9708
|
+
}, _marked2$2);
|
|
9324
9709
|
}
|
|
9325
9710
|
function addServiceToLocalStorageSaga(_ref4) {
|
|
9326
9711
|
var payload = _ref4.payload;
|
|
9327
9712
|
var scope = payload.scope,
|
|
9328
9713
|
name = payload.name,
|
|
9329
9714
|
serviceUrl = payload.serviceUrl,
|
|
9330
|
-
|
|
9331
|
-
|
|
9715
|
+
_abstract = payload["abstract"];
|
|
9716
|
+
|
|
9717
|
+
if (!isUserAddedService(scope)) {
|
|
9718
|
+
return;
|
|
9719
|
+
}
|
|
9720
|
+
|
|
9332
9721
|
var localStorageServices = getUserAddedServices();
|
|
9333
9722
|
setUserAddedServices(Object.assign(Object.assign({}, localStorageServices), _defineProperty({}, serviceUrl, {
|
|
9334
9723
|
name: name,
|
|
9335
9724
|
url: serviceUrl,
|
|
9336
|
-
"abstract":
|
|
9725
|
+
"abstract": _abstract
|
|
9337
9726
|
})));
|
|
9338
9727
|
}
|
|
9339
9728
|
function removeServiceFromLocalStorageSaga(_ref5) {
|
|
9340
9729
|
var payload = _ref5.payload;
|
|
9341
9730
|
var serviceUrl = payload.serviceUrl;
|
|
9342
9731
|
var localStorageServices = getUserAddedServices();
|
|
9343
|
-
|
|
9732
|
+
|
|
9733
|
+
if (!localStorageServices[serviceUrl]) {
|
|
9734
|
+
return;
|
|
9735
|
+
}
|
|
9736
|
+
|
|
9344
9737
|
var updatedServices = Object.assign({}, localStorageServices);
|
|
9345
9738
|
delete updatedServices[serviceUrl];
|
|
9346
9739
|
setUserAddedServices(updatedServices);
|
|
9347
9740
|
}
|
|
9348
9741
|
function rootSaga$2() {
|
|
9349
|
-
return regeneratorRuntime.wrap(function rootSaga$(
|
|
9742
|
+
return regeneratorRuntime.wrap(function rootSaga$(_context3) {
|
|
9350
9743
|
while (1) {
|
|
9351
|
-
switch (
|
|
9744
|
+
switch (_context3.prev = _context3.next) {
|
|
9352
9745
|
case 0:
|
|
9353
|
-
|
|
9354
|
-
return takeEvery(serviceActions.serviceSetLayers.type, newServiceAddedSaga);
|
|
9355
|
-
|
|
9356
|
-
case 2:
|
|
9357
|
-
_context4.next = 4;
|
|
9746
|
+
_context3.next = 2;
|
|
9358
9747
|
return takeEvery(layerSelectActions.layerSelectRemoveService.type, layerSelectRemoveServiceSaga);
|
|
9359
9748
|
|
|
9360
|
-
case
|
|
9361
|
-
|
|
9749
|
+
case 2:
|
|
9750
|
+
_context3.next = 4;
|
|
9362
9751
|
return takeEvery(serviceActions.serviceSetLayers.type, addServiceToLocalStorageSaga);
|
|
9363
9752
|
|
|
9364
|
-
case
|
|
9365
|
-
|
|
9753
|
+
case 4:
|
|
9754
|
+
_context3.next = 6;
|
|
9366
9755
|
return takeEvery(serviceActions.mapStoreRemoveService.type, removeServiceFromLocalStorageSaga);
|
|
9367
9756
|
|
|
9368
|
-
case
|
|
9369
|
-
|
|
9757
|
+
case 6:
|
|
9758
|
+
_context3.next = 8;
|
|
9370
9759
|
return takeEvery([uiActions.setToggleOpenDialog.type, uiActions.setActiveMapIdForDialog.type, layerSelectActions.disableActiveService.type, layerSelectActions.toggleFilter.type, layerSelectActions.setSearchFilter.type], layerSelectCloseInfoDialogSaga);
|
|
9371
9760
|
|
|
9372
|
-
case
|
|
9761
|
+
case 8:
|
|
9373
9762
|
case "end":
|
|
9374
|
-
return
|
|
9763
|
+
return _context3.stop();
|
|
9375
9764
|
}
|
|
9376
9765
|
}
|
|
9377
|
-
},
|
|
9766
|
+
}, _marked3);
|
|
9378
9767
|
}
|
|
9379
9768
|
|
|
9380
9769
|
var layerSelectConfig = {
|
|
@@ -9517,8 +9906,8 @@ var coreModuleConfig = [moduleConfig, synchronizationGroupConfig, uiModuleConfig
|
|
|
9517
9906
|
* See the License for the specific language governing permissions and
|
|
9518
9907
|
* limitations under the License.
|
|
9519
9908
|
*
|
|
9520
|
-
* Copyright
|
|
9521
|
-
* Copyright
|
|
9909
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9910
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
9522
9911
|
* */
|
|
9523
9912
|
var iconStyle = {
|
|
9524
9913
|
height: 24,
|
|
@@ -9539,16 +9928,19 @@ var sizeLarge = {
|
|
|
9539
9928
|
|
|
9540
9929
|
var HeaderOptions = function HeaderOptions(_ref) {
|
|
9541
9930
|
var isDockedLayerManager = _ref.isDockedLayerManager,
|
|
9931
|
+
shortcutsEnabled = _ref.shortcutsEnabled,
|
|
9542
9932
|
onClickDockButton = _ref.onClickDockButton,
|
|
9543
9933
|
onChangeSize = _ref.onChangeSize;
|
|
9544
9934
|
React.useEffect(function () {
|
|
9545
9935
|
var handleKeyDown = function handleKeyDown(event) {
|
|
9546
|
-
if (
|
|
9547
|
-
|
|
9548
|
-
|
|
9549
|
-
|
|
9550
|
-
|
|
9551
|
-
|
|
9936
|
+
if (shortcutsEnabled) {
|
|
9937
|
+
if (event.ctrlKey && event.altKey && event.code === 'KeyS') {
|
|
9938
|
+
onChangeSize(sizeSmall);
|
|
9939
|
+
} else if (event.ctrlKey && event.altKey && event.code === 'KeyM') {
|
|
9940
|
+
onChangeSize(sizeMedium);
|
|
9941
|
+
} else if (event.ctrlKey && event.altKey && event.code === 'KeyL') {
|
|
9942
|
+
onChangeSize(sizeLarge);
|
|
9943
|
+
}
|
|
9552
9944
|
}
|
|
9553
9945
|
};
|
|
9554
9946
|
|
|
@@ -9556,7 +9948,7 @@ var HeaderOptions = function HeaderOptions(_ref) {
|
|
|
9556
9948
|
return function () {
|
|
9557
9949
|
document.removeEventListener('keydown', handleKeyDown);
|
|
9558
9950
|
};
|
|
9559
|
-
}, [onChangeSize]);
|
|
9951
|
+
}, [onChangeSize, shortcutsEnabled]);
|
|
9560
9952
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CustomTooltip, {
|
|
9561
9953
|
title: "small"
|
|
9562
9954
|
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
@@ -9780,9 +10172,18 @@ var layerManagerStyle = {
|
|
|
9780
10172
|
}
|
|
9781
10173
|
};
|
|
9782
10174
|
var returnCorrectSize = function returnCorrectSize(sizeResult) {
|
|
9783
|
-
if (sizeResult === 'sizeSmall')
|
|
9784
|
-
|
|
9785
|
-
|
|
10175
|
+
if (sizeResult === 'sizeSmall') {
|
|
10176
|
+
return sizeSmall;
|
|
10177
|
+
}
|
|
10178
|
+
|
|
10179
|
+
if (sizeResult === 'sizeMedium') {
|
|
10180
|
+
return sizeMedium;
|
|
10181
|
+
}
|
|
10182
|
+
|
|
10183
|
+
if (sizeResult === 'sizeLarge') {
|
|
10184
|
+
return sizeLarge;
|
|
10185
|
+
}
|
|
10186
|
+
|
|
9786
10187
|
return sizeLarge;
|
|
9787
10188
|
};
|
|
9788
10189
|
|
|
@@ -9937,11 +10338,18 @@ var DimensionSelect = function DimensionSelect(_ref) {
|
|
|
9937
10338
|
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
9938
10339
|
|
|
9939
10340
|
}, []);
|
|
9940
|
-
|
|
10341
|
+
|
|
10342
|
+
if (!layerDimensions.length || !layerId) {
|
|
10343
|
+
return null;
|
|
10344
|
+
}
|
|
9941
10345
|
|
|
9942
10346
|
var getValuesToDisplay = function getValuesToDisplay() {
|
|
9943
10347
|
var activeWMJSDim = getWMJSDimensionForLayerAndDimension(layerId, activeDimName) || getWMJSDimensionForLayerAndDimension(layerId, layerDimensions[0].name);
|
|
9944
|
-
|
|
10348
|
+
|
|
10349
|
+
if (!activeWMJSDim) {
|
|
10350
|
+
return null;
|
|
10351
|
+
}
|
|
10352
|
+
|
|
9945
10353
|
var availableDimValues = [];
|
|
9946
10354
|
|
|
9947
10355
|
for (var j = 0; j < activeWMJSDim.size(); j += 1) {
|
|
@@ -9955,11 +10363,18 @@ var DimensionSelect = function DimensionSelect(_ref) {
|
|
|
9955
10363
|
};
|
|
9956
10364
|
|
|
9957
10365
|
var valuesToDisplay = getValuesToDisplay();
|
|
9958
|
-
|
|
10366
|
+
|
|
10367
|
+
if (valuesToDisplay === null) {
|
|
10368
|
+
return null;
|
|
10369
|
+
}
|
|
10370
|
+
|
|
9959
10371
|
var activeDim = layerDimensions.find(function (dim) {
|
|
9960
10372
|
return dim.name === activeDimName;
|
|
9961
10373
|
});
|
|
9962
|
-
|
|
10374
|
+
|
|
10375
|
+
if (!activeDim) {
|
|
10376
|
+
return null;
|
|
10377
|
+
}
|
|
9963
10378
|
|
|
9964
10379
|
var selectDimensionValue = function selectDimensionValue(event) {
|
|
9965
10380
|
event.stopPropagation();
|
|
@@ -9990,7 +10405,11 @@ var DimensionSelect = function DimensionSelect(_ref) {
|
|
|
9990
10405
|
var dimValueCurrentIndex = valuesToDisplay.findIndex(function (value) {
|
|
9991
10406
|
return value === activeDim.currentValue;
|
|
9992
10407
|
});
|
|
9993
|
-
|
|
10408
|
+
|
|
10409
|
+
if (dimValueCurrentIndex === -1) {
|
|
10410
|
+
return null;
|
|
10411
|
+
}
|
|
10412
|
+
|
|
9994
10413
|
return /*#__PURE__*/React.createElement(Grid, {
|
|
9995
10414
|
container: true,
|
|
9996
10415
|
direction: "row",
|
|
@@ -10240,7 +10659,9 @@ var OpacitySelect = function OpacitySelect(_ref) {
|
|
|
10240
10659
|
}
|
|
10241
10660
|
}, [anchorEl]);
|
|
10242
10661
|
var onMouseEnter = React.useCallback(function () {
|
|
10243
|
-
if (!isOpen)
|
|
10662
|
+
if (!isOpen) {
|
|
10663
|
+
setTooltipOpen(true);
|
|
10664
|
+
}
|
|
10244
10665
|
}, [isOpen, setTooltipOpen]);
|
|
10245
10666
|
var onMouseLeave = React.useCallback(function () {
|
|
10246
10667
|
setTooltipOpen(false);
|
|
@@ -10472,15 +10893,15 @@ var ActivateLayer = function ActivateLayer(_ref) {
|
|
|
10472
10893
|
inputProps: {
|
|
10473
10894
|
IconComponent: function IconComponent() {
|
|
10474
10895
|
return null;
|
|
10475
|
-
}
|
|
10896
|
+
},
|
|
10897
|
+
tabIndex: -1
|
|
10476
10898
|
},
|
|
10477
10899
|
value: isActive ? 'Both' : 'None',
|
|
10478
10900
|
sx: {
|
|
10479
|
-
'&& .
|
|
10480
|
-
|
|
10481
|
-
|
|
10482
|
-
|
|
10483
|
-
paddingRight: 0
|
|
10901
|
+
'&& .MuiInput-input': {
|
|
10902
|
+
paddingRight: '2px',
|
|
10903
|
+
paddingLeft: '2px',
|
|
10904
|
+
backgroundColor: 'inherit'
|
|
10484
10905
|
}
|
|
10485
10906
|
},
|
|
10486
10907
|
renderValue: function renderValue(optionSelected) {
|
|
@@ -10518,8 +10939,6 @@ var AutoUpdateButton$1 = function AutoUpdateButton(_ref2) {
|
|
|
10518
10939
|
isActive = _ref2.isActive,
|
|
10519
10940
|
isEnabled = _ref2.isEnabled;
|
|
10520
10941
|
var style = {
|
|
10521
|
-
backgroundColor: isActive ? 'geowebColors.buttons.primary.active.fill' : 'transparent!important',
|
|
10522
|
-
borderRadius: '5px',
|
|
10523
10942
|
color: getIconColor(isActive, isEnabled)
|
|
10524
10943
|
};
|
|
10525
10944
|
var Icon = isActive ? /*#__PURE__*/React.createElement(Both, {
|
|
@@ -10532,9 +10951,10 @@ var AutoUpdateButton$1 = function AutoUpdateButton(_ref2) {
|
|
|
10532
10951
|
"aria-label": "Auto update ".concat(optionSelected),
|
|
10533
10952
|
sx: {
|
|
10534
10953
|
'&.MuiButtonBase-root': {
|
|
10535
|
-
backgroundColor: '
|
|
10954
|
+
backgroundColor: 'inherit'
|
|
10536
10955
|
}
|
|
10537
|
-
}
|
|
10956
|
+
},
|
|
10957
|
+
active: isActive
|
|
10538
10958
|
}, Icon);
|
|
10539
10959
|
};
|
|
10540
10960
|
|
|
@@ -10637,16 +11057,18 @@ var LayerRow = function LayerRow(_ref) {
|
|
|
10637
11057
|
padding: 0
|
|
10638
11058
|
}
|
|
10639
11059
|
},
|
|
10640
|
-
title: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, dragHandle, layerEnableLayout || /*#__PURE__*/React__default.createElement(
|
|
11060
|
+
title: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, dragHandle, layerEnableLayout || /*#__PURE__*/React__default.createElement(ManagerButton, {
|
|
10641
11061
|
isEnabled: layer.enabled,
|
|
10642
|
-
|
|
10643
|
-
|
|
11062
|
+
tooltipTitle: layer.name,
|
|
11063
|
+
onClick: function onClick(event) {
|
|
11064
|
+
event.stopPropagation();
|
|
10644
11065
|
onLayerEnable({
|
|
10645
11066
|
layerId: layerId,
|
|
10646
11067
|
enabled: !layer.enabled
|
|
10647
11068
|
});
|
|
10648
11069
|
},
|
|
10649
|
-
|
|
11070
|
+
"data-testid": "enableButton-medium",
|
|
11071
|
+
icon: isEnabled ? /*#__PURE__*/React__default.createElement(Visibility, null) : /*#__PURE__*/React__default.createElement(VisibilityOff, null)
|
|
10650
11072
|
}), layerActiveLayout || /*#__PURE__*/React__default.createElement(ActivateLayer, {
|
|
10651
11073
|
onChange: onClickRow,
|
|
10652
11074
|
isActive: false,
|
|
@@ -10708,26 +11130,31 @@ var LayerRow = function LayerRow(_ref) {
|
|
|
10708
11130
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
10709
11131
|
item: true,
|
|
10710
11132
|
sx: {}
|
|
10711
|
-
}, layerDeleteLayout || /*#__PURE__*/React__default.createElement(
|
|
11133
|
+
}, layerDeleteLayout || /*#__PURE__*/React__default.createElement(ManagerButton, {
|
|
10712
11134
|
tooltipTitle: "Delete",
|
|
10713
|
-
|
|
11135
|
+
onClick: function onClick() {
|
|
10714
11136
|
onLayerDelete({
|
|
10715
11137
|
mapId: mapId,
|
|
10716
11138
|
layerId: layerId
|
|
10717
11139
|
});
|
|
10718
|
-
}
|
|
11140
|
+
},
|
|
11141
|
+
icon: /*#__PURE__*/React__default.createElement(Delete, null),
|
|
11142
|
+
"data-testid": "deleteButton"
|
|
10719
11143
|
}))))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
10720
11144
|
item: true,
|
|
10721
11145
|
className: columnClasses.column1
|
|
10722
|
-
}, dragHandle, layerEnableLayout || /*#__PURE__*/React__default.createElement(
|
|
11146
|
+
}, dragHandle, layerEnableLayout || /*#__PURE__*/React__default.createElement(ManagerButton, {
|
|
10723
11147
|
isEnabled: layer.enabled,
|
|
10724
|
-
|
|
10725
|
-
|
|
11148
|
+
tooltipTitle: layer.name,
|
|
11149
|
+
onClick: function onClick(event) {
|
|
11150
|
+
event.stopPropagation();
|
|
10726
11151
|
onLayerEnable({
|
|
10727
11152
|
layerId: layerId,
|
|
10728
11153
|
enabled: !layer.enabled
|
|
10729
11154
|
});
|
|
10730
|
-
}
|
|
11155
|
+
},
|
|
11156
|
+
icon: layer.enabled ? /*#__PURE__*/React__default.createElement(Visibility, null) : /*#__PURE__*/React__default.createElement(VisibilityOff, null),
|
|
11157
|
+
"data-testid": "enableButton"
|
|
10731
11158
|
}), layerActiveLayout || /*#__PURE__*/React__default.createElement(ActivateLayer, {
|
|
10732
11159
|
onChange: onClickRow,
|
|
10733
11160
|
isActive: false,
|
|
@@ -10794,14 +11221,16 @@ var LayerRow = function LayerRow(_ref) {
|
|
|
10794
11221
|
}))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
10795
11222
|
item: true,
|
|
10796
11223
|
className: columnClasses.column6
|
|
10797
|
-
}, layerDeleteLayout || /*#__PURE__*/React__default.createElement(
|
|
11224
|
+
}, layerDeleteLayout || /*#__PURE__*/React__default.createElement(ManagerButton, {
|
|
10798
11225
|
tooltipTitle: "Delete",
|
|
10799
|
-
|
|
11226
|
+
onClick: function onClick() {
|
|
10800
11227
|
onLayerDelete({
|
|
10801
11228
|
mapId: mapId,
|
|
10802
11229
|
layerId: layerId
|
|
10803
11230
|
});
|
|
10804
|
-
}
|
|
11231
|
+
},
|
|
11232
|
+
icon: /*#__PURE__*/React__default.createElement(Delete, null),
|
|
11233
|
+
"data-testid": "deleteButton"
|
|
10805
11234
|
}), layerMenuLayout || /*#__PURE__*/React__default.createElement(LayerManagerMenuButton, {
|
|
10806
11235
|
mapId: mapId,
|
|
10807
11236
|
layerId: layerId,
|
|
@@ -10845,16 +11274,18 @@ var DeleteLayerConnect = function DeleteLayerConnect(_ref) {
|
|
|
10845
11274
|
var isLayerEnabled = useSelector(function (store) {
|
|
10846
11275
|
return getLayerEnabled(store, layerId);
|
|
10847
11276
|
});
|
|
10848
|
-
return /*#__PURE__*/React.createElement(
|
|
11277
|
+
return /*#__PURE__*/React.createElement(ManagerButton, {
|
|
10849
11278
|
tooltipTitle: "Delete",
|
|
10850
|
-
|
|
11279
|
+
onClick: function onClick() {
|
|
10851
11280
|
layerDelete({
|
|
10852
11281
|
mapId: mapId,
|
|
10853
11282
|
layerId: layerId,
|
|
10854
11283
|
layerIndex: layerIndex
|
|
10855
11284
|
});
|
|
10856
11285
|
},
|
|
10857
|
-
isEnabled: isLayerEnabled
|
|
11286
|
+
isEnabled: isLayerEnabled,
|
|
11287
|
+
icon: /*#__PURE__*/React.createElement(Delete, null),
|
|
11288
|
+
"data-testid": "deleteButton"
|
|
10858
11289
|
});
|
|
10859
11290
|
};
|
|
10860
11291
|
|
|
@@ -10893,26 +11324,32 @@ var EnableLayerConnect = function EnableLayerConnect(_ref) {
|
|
|
10893
11324
|
origin: LayerActionOrigin.layerManager
|
|
10894
11325
|
}));
|
|
10895
11326
|
}, [dispatch, mapId]);
|
|
10896
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(
|
|
11327
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ManagerButton, {
|
|
10897
11328
|
isEnabled: isEnabled,
|
|
10898
|
-
|
|
10899
|
-
|
|
11329
|
+
tooltipTitle: "Toggle visibility",
|
|
11330
|
+
onClick: function onClick(event) {
|
|
11331
|
+
event.stopPropagation();
|
|
10900
11332
|
layerChangeEnabled({
|
|
10901
11333
|
layerId: layerId,
|
|
10902
|
-
enabled:
|
|
11334
|
+
enabled: !isEnabled
|
|
10903
11335
|
});
|
|
10904
11336
|
},
|
|
10905
|
-
className: "enable-btn"
|
|
10906
|
-
|
|
11337
|
+
className: "enable-btn",
|
|
11338
|
+
icon: isEnabled ? /*#__PURE__*/React.createElement(Visibility, null) : /*#__PURE__*/React.createElement(VisibilityOff, null),
|
|
11339
|
+
"data-testid": "enableButton"
|
|
11340
|
+
}), /*#__PURE__*/React.createElement(ManagerButton, {
|
|
10907
11341
|
isEnabled: isEnabled,
|
|
10908
|
-
|
|
10909
|
-
|
|
11342
|
+
tooltipTitle: layerName,
|
|
11343
|
+
onClick: function onClick(event) {
|
|
11344
|
+
event.stopPropagation();
|
|
10910
11345
|
layerChangeEnabled({
|
|
10911
11346
|
layerId: layerId,
|
|
10912
|
-
enabled:
|
|
11347
|
+
enabled: !isEnabled
|
|
10913
11348
|
});
|
|
10914
11349
|
},
|
|
10915
|
-
className: "enable-btn-mini"
|
|
11350
|
+
className: "enable-btn-mini",
|
|
11351
|
+
icon: isEnabled ? /*#__PURE__*/React.createElement(Visibility, null) : /*#__PURE__*/React.createElement(VisibilityOff, null),
|
|
11352
|
+
"data-testid": "enableButton"
|
|
10916
11353
|
}));
|
|
10917
11354
|
};
|
|
10918
11355
|
|
|
@@ -11063,86 +11500,6 @@ var RenderStylesConnect = function RenderStylesConnect(_ref) {
|
|
|
11063
11500
|
});
|
|
11064
11501
|
};
|
|
11065
11502
|
|
|
11066
|
-
/* *
|
|
11067
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11068
|
-
* you may not use this file except in compliance with the License.
|
|
11069
|
-
* You may obtain a copy of the License at
|
|
11070
|
-
*
|
|
11071
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11072
|
-
*
|
|
11073
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11074
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11075
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11076
|
-
* See the License for the specific language governing permissions and
|
|
11077
|
-
* limitations under the License.
|
|
11078
|
-
*
|
|
11079
|
-
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11080
|
-
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
11081
|
-
* */
|
|
11082
|
-
/**
|
|
11083
|
-
* Converts webmapjs node structure to LayerTree
|
|
11084
|
-
* @param nodesToRecur THe WebMapJS node structure from service.getNodes();
|
|
11085
|
-
*/
|
|
11086
|
-
|
|
11087
|
-
var recurseNodes = function recurseNodes(nodesToRecur) {
|
|
11088
|
-
var newLayerTreeObj = {
|
|
11089
|
-
leaf: nodesToRecur.leaf,
|
|
11090
|
-
name: nodesToRecur.name,
|
|
11091
|
-
title: nodesToRecur.title,
|
|
11092
|
-
path: nodesToRecur.path || [],
|
|
11093
|
-
children: [],
|
|
11094
|
-
keywords: nodesToRecur.keywords || [],
|
|
11095
|
-
"abstract": nodesToRecur["abstract"] || '',
|
|
11096
|
-
styles: nodesToRecur.styles || [],
|
|
11097
|
-
dimensions: nodesToRecur.dimensions || [],
|
|
11098
|
-
geographicBoundingBox: nodesToRecur.geographicBoundingBox || null
|
|
11099
|
-
};
|
|
11100
|
-
|
|
11101
|
-
if (nodesToRecur.children) {
|
|
11102
|
-
for (var j = 0; j < nodesToRecur.children.length; j += 1) {
|
|
11103
|
-
newLayerTreeObj.children.push(recurseNodes(nodesToRecur.children[j]));
|
|
11104
|
-
}
|
|
11105
|
-
}
|
|
11106
|
-
|
|
11107
|
-
return newLayerTreeObj;
|
|
11108
|
-
};
|
|
11109
|
-
/**
|
|
11110
|
-
* Returns a promise with a hierarchical tree of layers from the WMS GetCapabilities document.
|
|
11111
|
-
* @param serviceUrl The URL of the WMS service
|
|
11112
|
-
* @param {boolean} forceReload **optional** forceReload: boolean, true will force the layers to be reloaded from the service, defaults to false
|
|
11113
|
-
*/
|
|
11114
|
-
|
|
11115
|
-
var getLayersFromService = function getLayersFromService(serviceUrl) {
|
|
11116
|
-
var forceReload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
11117
|
-
return new Promise(function (resolve, reject) {
|
|
11118
|
-
var serviceObject = WMGetServiceFromStore(serviceUrl);
|
|
11119
|
-
serviceObject.getNodes(function (nodes) {
|
|
11120
|
-
// TODO: Maarten Plieger, 2022-11-02: Harmonize types and use correct types: https://gitlab.com/opengeoweb/opengeoweb/-/issues/2817
|
|
11121
|
-
var layerTree = recurseNodes(nodes);
|
|
11122
|
-
resolve(layerTree);
|
|
11123
|
-
}, function (error) {
|
|
11124
|
-
reject(new Error(error));
|
|
11125
|
-
}, forceReload);
|
|
11126
|
-
});
|
|
11127
|
-
};
|
|
11128
|
-
/**
|
|
11129
|
-
* Returns a promise with an array of flattened layerobjects from the WMS GetCapabilities document.
|
|
11130
|
-
* @param serviceUrl The URL of the WMS service
|
|
11131
|
-
* @param {boolean} forceReload **optional** forceReload: boolean, true will force the layers to be reloaded from the service, defaults to false
|
|
11132
|
-
*/
|
|
11133
|
-
|
|
11134
|
-
var getLayersFlattenedFromService = function getLayersFlattenedFromService(serviceUrl) {
|
|
11135
|
-
var forceReload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
11136
|
-
return new Promise(function (resolve, reject) {
|
|
11137
|
-
var serviceObject = WMGetServiceFromStore(serviceUrl);
|
|
11138
|
-
serviceObject.getLayerObjectsFlat(function (layers) {
|
|
11139
|
-
resolve(layers);
|
|
11140
|
-
}, function (error) {
|
|
11141
|
-
reject(new Error(error));
|
|
11142
|
-
}, forceReload);
|
|
11143
|
-
});
|
|
11144
|
-
};
|
|
11145
|
-
|
|
11146
11503
|
/* *
|
|
11147
11504
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11148
11505
|
* you may not use this file except in compliance with the License.
|
|
@@ -11328,8 +11685,9 @@ var ActivateLayerConnect = function ActivateLayerConnect(_ref) {
|
|
|
11328
11685
|
var setActiveLayerId = React.useCallback(function (_ref2) {
|
|
11329
11686
|
var layerId = _ref2.layerId,
|
|
11330
11687
|
mapId = _ref2.mapId;
|
|
11331
|
-
return dispatch(mapActions$1.
|
|
11332
|
-
|
|
11688
|
+
return dispatch(mapActions$1.setAutoLayerId({
|
|
11689
|
+
autoTimeStepLayerId: layerId,
|
|
11690
|
+
autoUpdateLayerId: layerId,
|
|
11333
11691
|
mapId: mapId,
|
|
11334
11692
|
origin: LayerActionOrigin.layerManager
|
|
11335
11693
|
}));
|
|
@@ -11480,11 +11838,10 @@ var DragHandle = function DragHandle(_ref) {
|
|
|
11480
11838
|
return /*#__PURE__*/React__default.createElement(ManagerButton, {
|
|
11481
11839
|
tooltipTitle: tooltipTitle,
|
|
11482
11840
|
icon: /*#__PURE__*/React__default.createElement(DragHandle$1, null),
|
|
11483
|
-
|
|
11841
|
+
"data-testid": "dragHandle".concat(index !== undefined ? "-".concat(index) : ''),
|
|
11484
11842
|
className: "handle",
|
|
11485
11843
|
tabIndex: -1,
|
|
11486
11844
|
isEnabled: !isDisabled,
|
|
11487
|
-
disableFocusRipple: true,
|
|
11488
11845
|
disableTouchRipple: true,
|
|
11489
11846
|
disabled: isDisabled,
|
|
11490
11847
|
isAccessible: true,
|
|
@@ -11536,7 +11893,10 @@ var LayerContainerRow = function LayerContainerRow(_ref) {
|
|
|
11536
11893
|
var onStart = React.useCallback(function (_ref3) {
|
|
11537
11894
|
var oldIndex = _ref3.oldIndex;
|
|
11538
11895
|
setActiveDragIndex(oldIndex);
|
|
11539
|
-
|
|
11896
|
+
|
|
11897
|
+
if (Sortable.ghost) {
|
|
11898
|
+
Sortable.ghost.style.opacity = '1';
|
|
11899
|
+
}
|
|
11540
11900
|
}, []);
|
|
11541
11901
|
var onEnd = React.useCallback(function () {
|
|
11542
11902
|
if (activeDragIndex !== null) {
|
|
@@ -12126,7 +12486,9 @@ var ConnectedTree = function ConnectedTree(_ref) {
|
|
|
12126
12486
|
onClickLayer: function onClickLayer(serviceURL, layerName) {
|
|
12127
12487
|
if (layerType === LayerType.baseLayer) {
|
|
12128
12488
|
addBaseLayer(serviceURL, layerName);
|
|
12129
|
-
} else
|
|
12489
|
+
} else {
|
|
12490
|
+
addMapLayer(serviceURL, layerName);
|
|
12491
|
+
}
|
|
12130
12492
|
},
|
|
12131
12493
|
highlightedLayers: loadedLayers
|
|
12132
12494
|
});
|
|
@@ -12260,9 +12622,16 @@ var defaultConfigurations = /*#__PURE__*/Object.freeze({
|
|
|
12260
12622
|
});
|
|
12261
12623
|
|
|
12262
12624
|
var validateServiceUrl$1 = function validateServiceUrl(url) {
|
|
12263
|
-
if (url === '' || url === null || typeof url === 'undefined')
|
|
12625
|
+
if (url === '' || url === null || typeof url === 'undefined') {
|
|
12626
|
+
return false;
|
|
12627
|
+
}
|
|
12628
|
+
|
|
12264
12629
|
var matcher = /^(?:\w+:)?\/\/([^\s.]+\.\S{2}|[0-9a-zA-Z]+[:?\d]*)\S*$/;
|
|
12265
|
-
|
|
12630
|
+
|
|
12631
|
+
if (!matcher.test(url)) {
|
|
12632
|
+
return false;
|
|
12633
|
+
}
|
|
12634
|
+
|
|
12266
12635
|
return true;
|
|
12267
12636
|
};
|
|
12268
12637
|
|
|
@@ -12575,6 +12944,54 @@ var BaseLayerRow = function BaseLayerRow(_ref) {
|
|
|
12575
12944
|
})));
|
|
12576
12945
|
};
|
|
12577
12946
|
|
|
12947
|
+
/* *
|
|
12948
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12949
|
+
* you may not use this file except in compliance with the License.
|
|
12950
|
+
* You may obtain a copy of the License at
|
|
12951
|
+
*
|
|
12952
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12953
|
+
*
|
|
12954
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12955
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12956
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12957
|
+
* See the License for the specific language governing permissions and
|
|
12958
|
+
* limitations under the License.
|
|
12959
|
+
*
|
|
12960
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
12961
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
12962
|
+
* */
|
|
12963
|
+
var areShortcutsEnabled = function areShortcutsEnabled(activeMapId, mapId, floatingLmFocused, isDockedLayerManager) {
|
|
12964
|
+
if (floatingLmFocused && !isDockedLayerManager) {
|
|
12965
|
+
return true;
|
|
12966
|
+
}
|
|
12967
|
+
|
|
12968
|
+
if (activeMapId === mapId && isDockedLayerManager && !floatingLmFocused) {
|
|
12969
|
+
return true;
|
|
12970
|
+
}
|
|
12971
|
+
|
|
12972
|
+
return false;
|
|
12973
|
+
};
|
|
12974
|
+
|
|
12975
|
+
var HeaderOptionsConnect = function HeaderOptionsConnect(_ref) {
|
|
12976
|
+
var isDockedLayerManager = _ref.isDockedLayerManager,
|
|
12977
|
+
mapId = _ref.mapId,
|
|
12978
|
+
onClickDockButton = _ref.onClickDockButton,
|
|
12979
|
+
onChangeSize = _ref.onChangeSize;
|
|
12980
|
+
var activeMapId = useSelector(function (store) {
|
|
12981
|
+
return getActiveWindowId(store);
|
|
12982
|
+
});
|
|
12983
|
+
var floatingLmFocused = useSelector(function (store) {
|
|
12984
|
+
return getDialogFocused(store, DialogTypes.LayerManager);
|
|
12985
|
+
});
|
|
12986
|
+
var shortcutsEnabled = areShortcutsEnabled(activeMapId, mapId, floatingLmFocused, isDockedLayerManager);
|
|
12987
|
+
return /*#__PURE__*/React.createElement(HeaderOptions, {
|
|
12988
|
+
isDockedLayerManager: isDockedLayerManager,
|
|
12989
|
+
shortcutsEnabled: shortcutsEnabled,
|
|
12990
|
+
onClickDockButton: onClickDockButton,
|
|
12991
|
+
onChangeSize: onChangeSize
|
|
12992
|
+
});
|
|
12993
|
+
};
|
|
12994
|
+
|
|
12578
12995
|
var styles$2 = {
|
|
12579
12996
|
layerRowContainer: {
|
|
12580
12997
|
position: 'relative',
|
|
@@ -12630,7 +13047,9 @@ var LayerManager = function LayerManager(_ref) {
|
|
|
12630
13047
|
startPosition = _ref$startPosition === void 0 ? {
|
|
12631
13048
|
top: 85,
|
|
12632
13049
|
left: 50
|
|
12633
|
-
} : _ref$startPosition
|
|
13050
|
+
} : _ref$startPosition,
|
|
13051
|
+
_ref$setFocused = _ref.setFocused,
|
|
13052
|
+
setFocused = _ref$setFocused === void 0 ? function () {} : _ref$setFocused;
|
|
12634
13053
|
var minSize = {
|
|
12635
13054
|
width: 100,
|
|
12636
13055
|
height: 126
|
|
@@ -12660,11 +13079,18 @@ var LayerManager = function LayerManager(_ref) {
|
|
|
12660
13079
|
bounds: bounds,
|
|
12661
13080
|
"data-testid": "layerManagerWindow",
|
|
12662
13081
|
onMouseDown: onMouseDown,
|
|
13082
|
+
onFocus: function onFocus() {
|
|
13083
|
+
return setFocused(true);
|
|
13084
|
+
},
|
|
13085
|
+
onBlur: function onBlur() {
|
|
13086
|
+
return setFocused(false);
|
|
13087
|
+
},
|
|
12663
13088
|
order: order,
|
|
12664
13089
|
source: source,
|
|
12665
13090
|
leftHeaderComponent: leftHeaderComponent,
|
|
12666
|
-
rightHeaderComponent: /*#__PURE__*/React.createElement(
|
|
13091
|
+
rightHeaderComponent: /*#__PURE__*/React.createElement(HeaderOptionsConnect, {
|
|
12667
13092
|
isDockedLayerManager: isDockedLayerManager,
|
|
13093
|
+
mapId: mapId,
|
|
12668
13094
|
onClickDockButton: onToggleDock,
|
|
12669
13095
|
onChangeSize: function onChangeSize(_ref2) {
|
|
12670
13096
|
var width = _ref2.width;
|
|
@@ -12739,8 +13165,8 @@ var LayerManager = function LayerManager(_ref) {
|
|
|
12739
13165
|
* See the License for the specific language governing permissions and
|
|
12740
13166
|
* limitations under the License.
|
|
12741
13167
|
*
|
|
12742
|
-
* Copyright
|
|
12743
|
-
* Copyright
|
|
13168
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
13169
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
12744
13170
|
* */
|
|
12745
13171
|
var useSetupDialog = function useSetupDialog(dialogType) {
|
|
12746
13172
|
var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'app';
|
|
@@ -12807,6 +13233,14 @@ var useSetupDialog = function useSetupDialog(dialogType) {
|
|
|
12807
13233
|
var uiError = useSelector(function (store) {
|
|
12808
13234
|
return getDialogError(store, dialogType);
|
|
12809
13235
|
});
|
|
13236
|
+
|
|
13237
|
+
var setFocused = function setFocused(focused) {
|
|
13238
|
+
dispatch(uiActions.setDialogFocused({
|
|
13239
|
+
type: dialogType,
|
|
13240
|
+
focused: focused
|
|
13241
|
+
}));
|
|
13242
|
+
};
|
|
13243
|
+
|
|
12810
13244
|
return {
|
|
12811
13245
|
setDialogOrder: setDialogOrder,
|
|
12812
13246
|
dialogOrder: dialogOrder,
|
|
@@ -12814,63 +13248,41 @@ var useSetupDialog = function useSetupDialog(dialogType) {
|
|
|
12814
13248
|
uiSource: uiSource,
|
|
12815
13249
|
isDialogOpen: isDialogOpen,
|
|
12816
13250
|
uiIsLoading: uiIsLoading,
|
|
12817
|
-
uiError: uiError
|
|
13251
|
+
uiError: uiError,
|
|
13252
|
+
setFocused: setFocused
|
|
12818
13253
|
};
|
|
12819
13254
|
};
|
|
12820
13255
|
|
|
13256
|
+
var getServicesToLoad = function getServicesToLoad(services) {
|
|
13257
|
+
return services.map(function (service) {
|
|
13258
|
+
var wmService = WMGetServiceFromStore(service.url);
|
|
13259
|
+
var scope = service.scope ? service.scope : 'system';
|
|
13260
|
+
return {
|
|
13261
|
+
id: wmService.id,
|
|
13262
|
+
name: service.name,
|
|
13263
|
+
serviceUrl: service.url,
|
|
13264
|
+
scope: scope,
|
|
13265
|
+
"abstract": service["abstract"] || wmService["abstract"]
|
|
13266
|
+
};
|
|
13267
|
+
});
|
|
13268
|
+
};
|
|
12821
13269
|
var useFetchServices = function useFetchServices(dialogType) {
|
|
12822
13270
|
var preloadedServices = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : preloadedDefaultMapServices;
|
|
12823
13271
|
var dispatch = useDispatch();
|
|
12824
|
-
|
|
12825
|
-
var _useIsMounted = useIsMounted(),
|
|
12826
|
-
isMounted = _useIsMounted.isMounted;
|
|
12827
|
-
|
|
12828
13272
|
var isOpenInStore = useSelector(function (store) {
|
|
12829
13273
|
return getisDialogOpen(store, dialogType);
|
|
12830
13274
|
});
|
|
12831
|
-
var
|
|
12832
|
-
dispatch(serviceActions.
|
|
12833
|
-
|
|
12834
|
-
|
|
12835
|
-
dispatch(layerSelectActions.addFiltersAndActiveServices(payload));
|
|
13275
|
+
var fetchInitialServices = React.useCallback(function (services) {
|
|
13276
|
+
dispatch(serviceActions.fetchInitialServices({
|
|
13277
|
+
services: services
|
|
13278
|
+
}));
|
|
12836
13279
|
}, [dispatch]);
|
|
12837
13280
|
React.useEffect(function () {
|
|
12838
13281
|
if (isOpenInStore && preloadedServices && preloadedServices.length > 0) {
|
|
12839
|
-
mergePresetsAndUserAddedServices(preloadedServices, getUserAddedServices())
|
|
12840
|
-
|
|
12841
|
-
var scope = service.scope ? service.scope : 'system';
|
|
12842
|
-
|
|
12843
|
-
if (isMounted.current) {
|
|
12844
|
-
addFiltersAndActiveServices({
|
|
12845
|
-
serviceId: wmService.id,
|
|
12846
|
-
serviceName: service.name,
|
|
12847
|
-
serviceUrl: service.url,
|
|
12848
|
-
keywords: [],
|
|
12849
|
-
scope: scope,
|
|
12850
|
-
groups: [],
|
|
12851
|
-
"abstract": service["abstract"] || wmService["abstract"],
|
|
12852
|
-
isLoading: true
|
|
12853
|
-
});
|
|
12854
|
-
}
|
|
12855
|
-
|
|
12856
|
-
getLayersFlattenedFromService(service.url).then(function (layers) {
|
|
12857
|
-
if (isMounted.current) {
|
|
12858
|
-
serviceSetLayers({
|
|
12859
|
-
id: wmService.id,
|
|
12860
|
-
name: service.name,
|
|
12861
|
-
serviceUrl: service.url,
|
|
12862
|
-
layers: layers,
|
|
12863
|
-
scope: scope,
|
|
12864
|
-
// first try to load the user abstract, otherwise the service abstract
|
|
12865
|
-
"abstract": service["abstract"] || wmService["abstract"]
|
|
12866
|
-
});
|
|
12867
|
-
}
|
|
12868
|
-
})["catch"](function () {
|
|
12869
|
-
return null;
|
|
12870
|
-
});
|
|
12871
|
-
});
|
|
13282
|
+
var allServicesToLoad = mergePresetsAndUserAddedServices(preloadedServices, getUserAddedServices());
|
|
13283
|
+
fetchInitialServices(getServicesToLoad(allServicesToLoad));
|
|
12872
13284
|
}
|
|
12873
|
-
}, [
|
|
13285
|
+
}, [isOpenInStore, preloadedServices, fetchInitialServices]);
|
|
12874
13286
|
};
|
|
12875
13287
|
var mergePresetsAndUserAddedServices = function mergePresetsAndUserAddedServices(presets, userAddedServices) {
|
|
12876
13288
|
return Object.values(Object.assign(Object.assign({}, presets.reduce(function (byUrl, preset) {
|
|
@@ -12891,8 +13303,8 @@ var mergePresetsAndUserAddedServices = function mergePresetsAndUserAddedServices
|
|
|
12891
13303
|
* See the License for the specific language governing permissions and
|
|
12892
13304
|
* limitations under the License.
|
|
12893
13305
|
*
|
|
12894
|
-
* Copyright
|
|
12895
|
-
* Copyright
|
|
13306
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
13307
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
12896
13308
|
* */
|
|
12897
13309
|
var dialogType = DialogTypes.LayerManager;
|
|
12898
13310
|
/**
|
|
@@ -12928,7 +13340,8 @@ var LayerManagerConnect = function LayerManagerConnect(_ref) {
|
|
|
12928
13340
|
isDialogOpen = _useSetupDialog.isDialogOpen,
|
|
12929
13341
|
uiSource = _useSetupDialog.uiSource,
|
|
12930
13342
|
uiIsLoading = _useSetupDialog.uiIsLoading,
|
|
12931
|
-
uiError = _useSetupDialog.uiError
|
|
13343
|
+
uiError = _useSetupDialog.uiError,
|
|
13344
|
+
setFocused = _useSetupDialog.setFocused;
|
|
12932
13345
|
|
|
12933
13346
|
useFetchServices(dialogType, preloadedMapServices);
|
|
12934
13347
|
|
|
@@ -12956,7 +13369,8 @@ var LayerManagerConnect = function LayerManagerConnect(_ref) {
|
|
|
12956
13369
|
leftHeaderComponent: leftHeaderComponent,
|
|
12957
13370
|
isLoading: uiIsLoading,
|
|
12958
13371
|
error: uiError,
|
|
12959
|
-
onToggleDock: onToggleDock
|
|
13372
|
+
onToggleDock: onToggleDock,
|
|
13373
|
+
setFocused: setFocused
|
|
12960
13374
|
});
|
|
12961
13375
|
};
|
|
12962
13376
|
|
|
@@ -13179,7 +13593,12 @@ var SearchField = function SearchField(_ref) {
|
|
|
13179
13593
|
|
|
13180
13594
|
var handleChange = function handleChange(text) {
|
|
13181
13595
|
setLocalSearchString(text);
|
|
13182
|
-
|
|
13596
|
+
|
|
13597
|
+
if (!isURL(text)) {
|
|
13598
|
+
setSearchFilterDebounced(text);
|
|
13599
|
+
} else if (searchFilter) {
|
|
13600
|
+
setSearchFilterDebounced('');
|
|
13601
|
+
}
|
|
13183
13602
|
};
|
|
13184
13603
|
|
|
13185
13604
|
React.useEffect(function () {
|
|
@@ -13206,7 +13625,10 @@ var SearchField = function SearchField(_ref) {
|
|
|
13206
13625
|
}, [urlIsValid, localSearchString, onOpenServicePopup]); // mirror store unless typing a URL
|
|
13207
13626
|
|
|
13208
13627
|
React.useEffect(function () {
|
|
13209
|
-
if (isURL(localSearchString))
|
|
13628
|
+
if (isURL(localSearchString)) {
|
|
13629
|
+
return;
|
|
13630
|
+
}
|
|
13631
|
+
|
|
13210
13632
|
setLocalSearchString(searchFilter); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13211
13633
|
}, [searchFilter]);
|
|
13212
13634
|
return /*#__PURE__*/React.createElement(TextField, {
|
|
@@ -13870,13 +14292,19 @@ var layerSelectColumnsSmall = {
|
|
|
13870
14292
|
};
|
|
13871
14293
|
var breakpoint = 500;
|
|
13872
14294
|
var widthToColumns = function widthToColumns(width) {
|
|
13873
|
-
if (width <= breakpoint)
|
|
14295
|
+
if (width <= breakpoint) {
|
|
14296
|
+
return layerSelectColumnsSmall;
|
|
14297
|
+
}
|
|
14298
|
+
|
|
13874
14299
|
return layerSelectColumnsLarge;
|
|
13875
14300
|
};
|
|
13876
14301
|
var rowHeightLarge = 68;
|
|
13877
14302
|
var rowHeightSmall = 136;
|
|
13878
14303
|
var widthToRowHeight = function widthToRowHeight(width) {
|
|
13879
|
-
if (width <= breakpoint)
|
|
14304
|
+
if (width <= breakpoint) {
|
|
14305
|
+
return rowHeightSmall;
|
|
14306
|
+
}
|
|
14307
|
+
|
|
13880
14308
|
return rowHeightLarge;
|
|
13881
14309
|
};
|
|
13882
14310
|
var sortByService = function sortByService(serviceObj) {
|
|
@@ -14551,7 +14979,9 @@ var ServiceOptionsDialog = function ServiceOptionsDialog(_ref) {
|
|
|
14551
14979
|
sx: styles$1.servicesContainer,
|
|
14552
14980
|
"data-testid": "ServiceDialog",
|
|
14553
14981
|
onKeyDown: function onKeyDown(event) {
|
|
14554
|
-
if (event.key !== 'Escape')
|
|
14982
|
+
if (event.key !== 'Escape') {
|
|
14983
|
+
event.stopPropagation();
|
|
14984
|
+
}
|
|
14555
14985
|
},
|
|
14556
14986
|
tabIndex: -1,
|
|
14557
14987
|
ref: dialogRef
|
|
@@ -14612,7 +15042,11 @@ var Rows = function Rows(_ref2) {
|
|
|
14612
15042
|
var foundService = selectedLayers.find(function (object) {
|
|
14613
15043
|
return object.service === serviceUrl;
|
|
14614
15044
|
});
|
|
14615
|
-
|
|
15045
|
+
|
|
15046
|
+
if (foundService) {
|
|
15047
|
+
return true;
|
|
15048
|
+
}
|
|
15049
|
+
|
|
14616
15050
|
return false;
|
|
14617
15051
|
};
|
|
14618
15052
|
|
|
@@ -14825,7 +15259,11 @@ var getService = function getService(services, serviceUrl) {
|
|
|
14825
15259
|
|
|
14826
15260
|
return ((_a = services[serviceId]) === null || _a === void 0 ? void 0 : _a.serviceUrl) === serviceUrl;
|
|
14827
15261
|
});
|
|
14828
|
-
|
|
15262
|
+
|
|
15263
|
+
if (serviceIndex < 0) {
|
|
15264
|
+
return null;
|
|
15265
|
+
}
|
|
15266
|
+
|
|
14829
15267
|
return services[serviceIds[serviceIndex]];
|
|
14830
15268
|
};
|
|
14831
15269
|
|
|
@@ -15451,7 +15889,10 @@ var LayerInfoDialogConnect = function LayerInfoDialogConnect() {
|
|
|
15451
15889
|
uiSource = _useSetupDialog.uiSource,
|
|
15452
15890
|
isDialogOpen = _useSetupDialog.isDialogOpen;
|
|
15453
15891
|
|
|
15454
|
-
if (!layer)
|
|
15892
|
+
if (!layer) {
|
|
15893
|
+
return null;
|
|
15894
|
+
}
|
|
15895
|
+
|
|
15455
15896
|
return /*#__PURE__*/React__default.createElement(LayerInfoDialog, {
|
|
15456
15897
|
isOpen: isDialogOpen,
|
|
15457
15898
|
onClose: onCloseDialog,
|
|
@@ -16373,7 +16814,10 @@ var DimensionSelectSlider = function DimensionSelectSlider(_ref) {
|
|
|
16373
16814
|
onKeyDown: upDownNavigation,
|
|
16374
16815
|
onChange: function onChange(e, val) {
|
|
16375
16816
|
onChangeDimensionValue(values[val].toString());
|
|
16376
|
-
|
|
16817
|
+
|
|
16818
|
+
if (!managedValue) {
|
|
16819
|
+
setCurrentIndex(val);
|
|
16820
|
+
}
|
|
16377
16821
|
}
|
|
16378
16822
|
}))), /*#__PURE__*/React.createElement(CustomTooltip, {
|
|
16379
16823
|
title: layerTitle
|
|
@@ -16405,7 +16849,10 @@ var DimensionSelectSlider = function DimensionSelectSlider(_ref) {
|
|
|
16405
16849
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
16406
16850
|
* */
|
|
16407
16851
|
var marksByDimension = function marksByDimension(dim) {
|
|
16408
|
-
if (!dim || !dim.name)
|
|
16852
|
+
if (!dim || !dim.name) {
|
|
16853
|
+
return [];
|
|
16854
|
+
}
|
|
16855
|
+
|
|
16409
16856
|
var dimCnf = dimensionConfig.find(function (cnf) {
|
|
16410
16857
|
return cnf.name === dim.name;
|
|
16411
16858
|
});
|
|
@@ -16431,7 +16878,9 @@ var marksByDimension = function marksByDimension(dim) {
|
|
|
16431
16878
|
|
|
16432
16879
|
var handleMomentISOString = function handleMomentISOString(dateIn) {
|
|
16433
16880
|
/* Try to fix the timestrings generated by moment js made with moment.toISOString() */
|
|
16434
|
-
if (!dateIn)
|
|
16881
|
+
if (!dateIn) {
|
|
16882
|
+
return null;
|
|
16883
|
+
}
|
|
16435
16884
|
|
|
16436
16885
|
if (dateIn.length > 20) {
|
|
16437
16886
|
var fixedDate = dateIn.substring(0, 19);
|
|
@@ -17136,7 +17585,10 @@ var TimeStepButton = function TimeStepButton(_ref) {
|
|
|
17136
17585
|
};
|
|
17137
17586
|
|
|
17138
17587
|
var handleToggleTimeStep = function handleToggleTimeStep() {
|
|
17139
|
-
if (isTimestepAuto)
|
|
17588
|
+
if (isTimestepAuto) {
|
|
17589
|
+
return;
|
|
17590
|
+
}
|
|
17591
|
+
|
|
17140
17592
|
onToggleTimestepAuto();
|
|
17141
17593
|
timeStepFromLayer && onChangeTimeStep(timeStepFromLayer, MapActionOrigin.map);
|
|
17142
17594
|
};
|
|
@@ -17605,32 +18057,53 @@ var getStepPxLineHeight = function getStepPxLineHeight(scale, timestep) {
|
|
|
17605
18057
|
switch (scale) {
|
|
17606
18058
|
case Scale.Hour:
|
|
17607
18059
|
{
|
|
17608
|
-
if (rem === 0)
|
|
18060
|
+
if (rem === 0) {
|
|
18061
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18062
|
+
} // 15 min subdivisions
|
|
18063
|
+
|
|
18064
|
+
|
|
18065
|
+
if (rem % (15 * 60) === 0) {
|
|
18066
|
+
return TICK_MARK_HEIGHT_SECONDARY;
|
|
18067
|
+
}
|
|
17609
18068
|
|
|
17610
|
-
if (rem % (15 * 60) === 0) return TICK_MARK_HEIGHT_SECONDARY;
|
|
17611
18069
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
17612
18070
|
}
|
|
17613
18071
|
|
|
17614
18072
|
case Scale.Hours3:
|
|
17615
18073
|
{
|
|
17616
|
-
if (rem === 0)
|
|
18074
|
+
if (rem === 0) {
|
|
18075
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18076
|
+
}
|
|
18077
|
+
|
|
17617
18078
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
17618
18079
|
}
|
|
17619
18080
|
|
|
17620
18081
|
case Scale.Hours6:
|
|
17621
18082
|
{
|
|
17622
|
-
if (rem === 0)
|
|
18083
|
+
if (rem === 0) {
|
|
18084
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18085
|
+
} // 3 hour subdivisions
|
|
18086
|
+
|
|
18087
|
+
|
|
18088
|
+
if (rem % (3 * 60 * 60) === 0) {
|
|
18089
|
+
return TICK_MARK_HEIGHT_SECONDARY;
|
|
18090
|
+
}
|
|
17623
18091
|
|
|
17624
|
-
if (rem % (3 * 60 * 60) === 0) return TICK_MARK_HEIGHT_SECONDARY;
|
|
17625
18092
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
17626
18093
|
}
|
|
17627
18094
|
|
|
17628
18095
|
default:
|
|
17629
18096
|
{
|
|
17630
18097
|
// Scale.Day
|
|
17631
|
-
if (rem === 0)
|
|
18098
|
+
if (rem === 0) {
|
|
18099
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18100
|
+
} // 6 hour subdivisions
|
|
18101
|
+
|
|
18102
|
+
|
|
18103
|
+
if (rem % (6 * 60 * 60) === 0) {
|
|
18104
|
+
return TICK_MARK_HEIGHT_SECONDARY;
|
|
18105
|
+
}
|
|
17632
18106
|
|
|
17633
|
-
if (rem % (6 * 60 * 60) === 0) return TICK_MARK_HEIGHT_SECONDARY;
|
|
17634
18107
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
17635
18108
|
}
|
|
17636
18109
|
}
|
|
@@ -17640,7 +18113,10 @@ var getStepPxLineHeight = function getStepPxLineHeight(scale, timestep) {
|
|
|
17640
18113
|
{
|
|
17641
18114
|
var weekday = moment.unix(timestep).utc().isoWeekday(); // momentjs isoWeekdays range from 1(Monday) to 7(Sunday)
|
|
17642
18115
|
|
|
17643
|
-
if (weekday === 1)
|
|
18116
|
+
if (weekday === 1) {
|
|
18117
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18118
|
+
}
|
|
18119
|
+
|
|
17644
18120
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
17645
18121
|
}
|
|
17646
18122
|
|
|
@@ -17648,15 +18124,24 @@ var getStepPxLineHeight = function getStepPxLineHeight(scale, timestep) {
|
|
|
17648
18124
|
{
|
|
17649
18125
|
var month = moment.unix(timestep).utc().month(); // momentjs months are zero indexed
|
|
17650
18126
|
|
|
17651
|
-
if (month === 0)
|
|
17652
|
-
|
|
18127
|
+
if (month === 0) {
|
|
18128
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18129
|
+
}
|
|
18130
|
+
|
|
18131
|
+
if (month % 3 === 0) {
|
|
18132
|
+
return TICK_MARK_HEIGHT_SECONDARY;
|
|
18133
|
+
}
|
|
18134
|
+
|
|
17653
18135
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
17654
18136
|
}
|
|
17655
18137
|
|
|
17656
18138
|
case Scale.Minutes5:
|
|
17657
18139
|
{
|
|
17658
18140
|
// add primary line on day change
|
|
17659
|
-
if (timestep % (60 * 60 * 24) === 0)
|
|
18141
|
+
if (timestep % (60 * 60 * 24) === 0) {
|
|
18142
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18143
|
+
}
|
|
18144
|
+
|
|
17660
18145
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
17661
18146
|
}
|
|
17662
18147
|
|
|
@@ -17674,31 +18159,52 @@ var getStepPxLineHeightForDataScale = function getStepPxLineHeightForDataScale(s
|
|
|
17674
18159
|
switch (scale) {
|
|
17675
18160
|
case Scale.Hour:
|
|
17676
18161
|
{
|
|
17677
|
-
if (rem === 0)
|
|
18162
|
+
if (rem === 0) {
|
|
18163
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18164
|
+
} // 15 min subdivisions
|
|
18165
|
+
|
|
18166
|
+
|
|
18167
|
+
if (rem % (15 * 60) === 0) {
|
|
18168
|
+
return TICK_MARK_HEIGHT_SECONDARY;
|
|
18169
|
+
}
|
|
17678
18170
|
|
|
17679
|
-
if (rem % (15 * 60) === 0) return TICK_MARK_HEIGHT_SECONDARY;
|
|
17680
18171
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
17681
18172
|
}
|
|
17682
18173
|
|
|
17683
18174
|
case Scale.Hours3:
|
|
17684
18175
|
{
|
|
17685
|
-
if (rem === 0)
|
|
18176
|
+
if (rem === 0) {
|
|
18177
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18178
|
+
}
|
|
18179
|
+
|
|
17686
18180
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
17687
18181
|
}
|
|
17688
18182
|
|
|
17689
18183
|
case Scale.Hours6:
|
|
17690
18184
|
{
|
|
17691
|
-
if (rem === 0)
|
|
18185
|
+
if (rem === 0) {
|
|
18186
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18187
|
+
} // 3 hour subdivisions
|
|
18188
|
+
|
|
18189
|
+
|
|
18190
|
+
if (rem % (3 * 60 * 60) === 0) {
|
|
18191
|
+
return TICK_MARK_HEIGHT_SECONDARY;
|
|
18192
|
+
}
|
|
17692
18193
|
|
|
17693
|
-
if (rem % (3 * 60 * 60) === 0) return TICK_MARK_HEIGHT_SECONDARY;
|
|
17694
18194
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
17695
18195
|
}
|
|
17696
18196
|
|
|
17697
18197
|
case Scale.Day:
|
|
17698
18198
|
{
|
|
17699
|
-
if (rem === 0)
|
|
18199
|
+
if (rem === 0) {
|
|
18200
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18201
|
+
} // 6 hour subdivisions
|
|
18202
|
+
|
|
18203
|
+
|
|
18204
|
+
if (rem % (6 * 60 * 60) === 0) {
|
|
18205
|
+
return TICK_MARK_HEIGHT_SECONDARY;
|
|
18206
|
+
}
|
|
17700
18207
|
|
|
17701
|
-
if (rem % (6 * 60 * 60) === 0) return TICK_MARK_HEIGHT_SECONDARY;
|
|
17702
18208
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
17703
18209
|
}
|
|
17704
18210
|
|
|
@@ -17706,7 +18212,10 @@ var getStepPxLineHeightForDataScale = function getStepPxLineHeightForDataScale(s
|
|
|
17706
18212
|
{
|
|
17707
18213
|
var weekday = moment.unix(timestep).utc().isoWeekday(); // momentjs isoWeekdays range from 1(Monday) to 7(Sunday)
|
|
17708
18214
|
|
|
17709
|
-
if (weekday === 1)
|
|
18215
|
+
if (weekday === 1) {
|
|
18216
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18217
|
+
}
|
|
18218
|
+
|
|
17710
18219
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
17711
18220
|
}
|
|
17712
18221
|
|
|
@@ -17714,14 +18223,20 @@ var getStepPxLineHeightForDataScale = function getStepPxLineHeightForDataScale(s
|
|
|
17714
18223
|
{
|
|
17715
18224
|
var month = moment.unix(timestep).utc().month(); // momentjs months are zero indexed
|
|
17716
18225
|
|
|
17717
|
-
if (month === 0)
|
|
18226
|
+
if (month === 0) {
|
|
18227
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18228
|
+
}
|
|
18229
|
+
|
|
17718
18230
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
17719
18231
|
}
|
|
17720
18232
|
|
|
17721
18233
|
case Scale.Minutes5:
|
|
17722
18234
|
{
|
|
17723
18235
|
// add primary line on day change
|
|
17724
|
-
if (timestep % (60 * 60 * 24) === 0)
|
|
18236
|
+
if (timestep % (60 * 60 * 24) === 0) {
|
|
18237
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18238
|
+
}
|
|
18239
|
+
|
|
17725
18240
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
17726
18241
|
}
|
|
17727
18242
|
|
|
@@ -17761,7 +18276,10 @@ var drawTimeText = function drawTimeText(ctx, theme, stepPx, height, timeText, s
|
|
|
17761
18276
|
};
|
|
17762
18277
|
|
|
17763
18278
|
var drawUpperText = function drawUpperText(ctx, theme, newDate, stepPx, height, minOffset) {
|
|
17764
|
-
if (stepPx <= 0)
|
|
18279
|
+
if (stepPx <= 0) {
|
|
18280
|
+
return;
|
|
18281
|
+
}
|
|
18282
|
+
|
|
17765
18283
|
var ctx2 = ctx;
|
|
17766
18284
|
var _theme$palette$geoweb2 = theme.palette.geowebColors.timeSlider.timelineText,
|
|
17767
18285
|
fontSize = _theme$palette$geoweb2.fontSize,
|
|
@@ -18133,7 +18651,10 @@ var drawTimeScale = function drawTimeScale(context, theme, visibleTimeStart, vis
|
|
|
18133
18651
|
} // draw date change texts
|
|
18134
18652
|
|
|
18135
18653
|
|
|
18136
|
-
if (scale === Scale.Year && fundamentalScale === Scale.Year)
|
|
18654
|
+
if (scale === Scale.Year && fundamentalScale === Scale.Year) {
|
|
18655
|
+
return;
|
|
18656
|
+
}
|
|
18657
|
+
|
|
18137
18658
|
var timestepUnit = getDateChangeTimestepUnit(fundamentalScale);
|
|
18138
18659
|
|
|
18139
18660
|
var _getCustomRoundedStar3 = getCustomRoundedStartAndEnd(visibleTimeStart, visibleTimeEnd, timestepUnit),
|
|
@@ -18172,7 +18693,10 @@ var drawTimeScale = function drawTimeScale(context, theme, visibleTimeStart, vis
|
|
|
18172
18693
|
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
18173
18694
|
* */
|
|
18174
18695
|
var drawNeedle = function drawNeedle(context, theme, width, height, startTime, endTime, selectedTime) {
|
|
18175
|
-
if (!selectedTime)
|
|
18696
|
+
if (!selectedTime) {
|
|
18697
|
+
return;
|
|
18698
|
+
}
|
|
18699
|
+
|
|
18176
18700
|
var ctx = context;
|
|
18177
18701
|
var _theme$palette$geoweb = theme.palette.geowebColors.timeSlider,
|
|
18178
18702
|
playerNeedlePlayer = _theme$palette$geoweb.playerNeedlePlayer,
|
|
@@ -18297,7 +18821,9 @@ var drawBackground = function drawBackground(context, theme, visibleTimeStart, v
|
|
|
18297
18821
|
function drawNightOrAlternateTime() {
|
|
18298
18822
|
var colorChangeTimesteps = getColorChangeTimesteps(scale, visibleTimeStart, visibleTimeEnd);
|
|
18299
18823
|
colorChangeTimesteps.forEach(function (timestep, i, arr) {
|
|
18300
|
-
if (i === 0)
|
|
18824
|
+
if (i === 0) {
|
|
18825
|
+
return;
|
|
18826
|
+
}
|
|
18301
18827
|
|
|
18302
18828
|
var _map = [arr[i - 1], timestep].map(function (timestep) {
|
|
18303
18829
|
return timestampToPixelEdges(timestep, visibleTimeStart, visibleTimeEnd, canvasWidth);
|
|
@@ -18489,7 +19015,9 @@ function useAnimationTime(animationStartTime, animationEndTime, onSetAnimationSt
|
|
|
18489
19015
|
|
|
18490
19016
|
}, [leftMarkerDragging, rightMarkerDragging, animationAreaDragging]);
|
|
18491
19017
|
var handleAnimationDragging = useCallback(function (x) {
|
|
18492
|
-
if (!localAnimationStartTime || !localAnimationEndTime)
|
|
19018
|
+
if (!localAnimationStartTime || !localAnimationEndTime) {
|
|
19019
|
+
return;
|
|
19020
|
+
}
|
|
18493
19021
|
|
|
18494
19022
|
var _map = [localAnimationStartTime, localAnimationEndTime].map(function (timestamp) {
|
|
18495
19023
|
return timestampToPixel(timestamp, centerTime, canvasWidth, secondsPerPx);
|
|
@@ -18683,7 +19211,9 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
|
|
|
18683
19211
|
}, [canvasWidth, centerTime, dataEndTime, dataStartTime, onSetNewDate, secondsPerPx, setUnfilteredSelectedTime, timeStep, unfilteredSelectedTime]);
|
|
18684
19212
|
React.useEffect(function () {
|
|
18685
19213
|
var handleMouseMove = function handleMouseMove(event) {
|
|
18686
|
-
if (event.movementX === 0)
|
|
19214
|
+
if (event.movementX === 0) {
|
|
19215
|
+
return;
|
|
19216
|
+
}
|
|
18687
19217
|
|
|
18688
19218
|
if (mouseDownInLegend) {
|
|
18689
19219
|
var dragDistanceTime = event.movementX * secondsPerPx;
|
|
@@ -18891,7 +19421,10 @@ var HideSliderButton = function HideSliderButton(_ref) {
|
|
|
18891
19421
|
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
18892
19422
|
* */
|
|
18893
19423
|
var onMouseMove = function onMouseMove(x, width, selectedTime, centerTime, secondsPerPx, mouseDownInTimeBox, isTimeBoxArea, setCursorStyle) {
|
|
18894
|
-
if (!selectedTime || mouseDownInTimeBox)
|
|
19424
|
+
if (!selectedTime || mouseDownInTimeBox) {
|
|
19425
|
+
return;
|
|
19426
|
+
}
|
|
19427
|
+
|
|
18895
19428
|
var selectedTimePx = timestampToPixel(selectedTime, centerTime, width, secondsPerPx);
|
|
18896
19429
|
|
|
18897
19430
|
if (isTimeBoxArea(x, selectedTimePx)) {
|
|
@@ -18901,7 +19434,10 @@ var onMouseMove = function onMouseMove(x, width, selectedTime, centerTime, secon
|
|
|
18901
19434
|
}
|
|
18902
19435
|
};
|
|
18903
19436
|
var onMouseDown = function onMouseDown(x, width, selectedTime, centerTime, secondsPerPx, isTimeBoxArea, setCursorStyle, setMouseDownInTimeBox) {
|
|
18904
|
-
if (!selectedTime)
|
|
19437
|
+
if (!selectedTime) {
|
|
19438
|
+
return;
|
|
19439
|
+
}
|
|
19440
|
+
|
|
18905
19441
|
var selectedTimePx = timestampToPixel(selectedTime, centerTime, width, secondsPerPx);
|
|
18906
19442
|
|
|
18907
19443
|
if (isTimeBoxArea(x, selectedTimePx)) {
|
|
@@ -19075,12 +19611,16 @@ var TimeSliderCurrentTimeBox = function TimeSliderCurrentTimeBox(_ref) {
|
|
|
19075
19611
|
}, /*#__PURE__*/React__default.createElement(CanvasComponent, {
|
|
19076
19612
|
ref: node,
|
|
19077
19613
|
onMouseMove: function onMouseMove$1(x, y, event, width) {
|
|
19078
|
-
if (!selectedTime)
|
|
19614
|
+
if (!selectedTime) {
|
|
19615
|
+
return;
|
|
19616
|
+
}
|
|
19079
19617
|
|
|
19080
19618
|
onMouseMove(x, width, selectedTime, centerTime, secondsPerPx, mouseDownInTimeBox, isTimeBoxArea, setCursorStyle);
|
|
19081
19619
|
},
|
|
19082
19620
|
onMouseDown: function onMouseDown$1(x, y, width) {
|
|
19083
|
-
if (!selectedTime)
|
|
19621
|
+
if (!selectedTime) {
|
|
19622
|
+
return;
|
|
19623
|
+
}
|
|
19084
19624
|
|
|
19085
19625
|
onMouseDown(x, width, selectedTime, centerTime, secondsPerPx, isTimeBoxArea, setCursorStyle, setMouseDownInTimeBox);
|
|
19086
19626
|
},
|
|
@@ -19344,11 +19884,11 @@ var TimeStepButtonComponent = function TimeStepButtonComponent(_ref) {
|
|
|
19344
19884
|
var isTimestepAuto$1 = useSelector(function (store) {
|
|
19345
19885
|
return isTimestepAuto(store, mapId);
|
|
19346
19886
|
});
|
|
19347
|
-
var
|
|
19348
|
-
return
|
|
19887
|
+
var autoTimeStepLayerId = useSelector(function (store) {
|
|
19888
|
+
return getAutoTimeStepLayerId(store, mapId);
|
|
19349
19889
|
});
|
|
19350
19890
|
var activeLayerTimeDimension = useSelector(function (store) {
|
|
19351
|
-
return getLayerTimeDimension(store,
|
|
19891
|
+
return getLayerTimeDimension(store, autoTimeStepLayerId);
|
|
19352
19892
|
});
|
|
19353
19893
|
var timeStepFromLayer = getActiveLayerTimeStep(activeLayerTimeDimension);
|
|
19354
19894
|
var onToggleTimestepAuto = React.useCallback(function () {
|
|
@@ -19889,14 +20429,14 @@ var TimeSliderCurrentTimeBoxConnectComponent = function TimeSliderCurrentTimeBox
|
|
|
19889
20429
|
var TimeSliderCurrentTimeBoxConnect = connectRedux(TimeSliderCurrentTimeBoxConnectComponent);
|
|
19890
20430
|
|
|
19891
20431
|
var useUpdateTimestep = function useUpdateTimestep(mapId) {
|
|
19892
|
-
var
|
|
19893
|
-
return
|
|
20432
|
+
var autoTimeStepLayerId = useSelector(function (store) {
|
|
20433
|
+
return getAutoTimeStepLayerId(store, mapId);
|
|
19894
20434
|
});
|
|
19895
20435
|
var isTimeStepAuto = useSelector(function (store) {
|
|
19896
20436
|
return isTimestepAuto(store, mapId);
|
|
19897
20437
|
});
|
|
19898
20438
|
var timeDimension = useSelector(function (store) {
|
|
19899
|
-
return getLayerTimeDimension(store,
|
|
20439
|
+
return getLayerTimeDimension(store, autoTimeStepLayerId);
|
|
19900
20440
|
});
|
|
19901
20441
|
var dispatch = useDispatch();
|
|
19902
20442
|
React.useEffect(function () {
|
|
@@ -19907,7 +20447,7 @@ var useUpdateTimestep = function useUpdateTimestep(mapId) {
|
|
|
19907
20447
|
timeStep: timeStep
|
|
19908
20448
|
}));
|
|
19909
20449
|
}
|
|
19910
|
-
}, [
|
|
20450
|
+
}, [autoTimeStepLayerId, dispatch, isTimeStepAuto, mapId, timeDimension]);
|
|
19911
20451
|
};
|
|
19912
20452
|
|
|
19913
20453
|
var TimeSliderConnect = function TimeSliderConnect(_ref) {
|
|
@@ -21046,8 +21586,11 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
21046
21586
|
var to = getProj4(proj.crs);
|
|
21047
21587
|
|
|
21048
21588
|
for (var j = 0; j < featureCoords.length; j += 1) {
|
|
21049
|
-
|
|
21050
|
-
|
|
21589
|
+
if (featureCoords[j].length < 2) {
|
|
21590
|
+
// eslint-disable-next-line no-continue
|
|
21591
|
+
continue;
|
|
21592
|
+
}
|
|
21593
|
+
|
|
21051
21594
|
var coordinates = {
|
|
21052
21595
|
x: featureCoords[j][0],
|
|
21053
21596
|
y: featureCoords[j][1]
|
|
@@ -21367,12 +21910,16 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
21367
21910
|
isInEditMode = _this$props2.isInEditMode,
|
|
21368
21911
|
featureNrToEdit = _this$props2.featureNrToEdit,
|
|
21369
21912
|
onHoverFeature = _this$props2.onHoverFeature;
|
|
21370
|
-
|
|
21913
|
+
|
|
21914
|
+
if (event && event.rightButton === true) {
|
|
21915
|
+
return undefined;
|
|
21916
|
+
}
|
|
21371
21917
|
/* adagucMouseMove is an event callback function which is triggered when the mouse moves over the map
|
|
21372
21918
|
This event is only triggered if the map is in hover state.
|
|
21373
21919
|
E.g. when the map is dragging/panning, this event is not triggerd
|
|
21374
21920
|
*/
|
|
21375
21921
|
|
|
21922
|
+
|
|
21376
21923
|
var mouseX = event.mouseX,
|
|
21377
21924
|
mouseY = event.mouseY,
|
|
21378
21925
|
mouseDown = event.mouseDown;
|
|
@@ -21412,7 +21959,11 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
21412
21959
|
}
|
|
21413
21960
|
|
|
21414
21961
|
var feature = this.geojson.features[featureNrToEdit];
|
|
21415
|
-
|
|
21962
|
+
|
|
21963
|
+
if (!feature) {
|
|
21964
|
+
return undefined;
|
|
21965
|
+
}
|
|
21966
|
+
|
|
21416
21967
|
var webmapjs = this.props.webmapjs;
|
|
21417
21968
|
this.mouseGeoCoord = webmapjs.getLatLongFromPixelCoord({
|
|
21418
21969
|
x: mouseX,
|
|
@@ -21488,7 +22039,10 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
21488
22039
|
value: function triggerMouseDownTimer(event) {
|
|
21489
22040
|
var _this3 = this;
|
|
21490
22041
|
|
|
21491
|
-
if (!this.doubleClickTimer)
|
|
22042
|
+
if (!this.doubleClickTimer) {
|
|
22043
|
+
this.doubleClickTimer = {};
|
|
22044
|
+
}
|
|
22045
|
+
|
|
21492
22046
|
var mouseX = event.mouseX,
|
|
21493
22047
|
mouseY = event.mouseY;
|
|
21494
22048
|
|
|
@@ -21831,7 +22385,10 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
21831
22385
|
key: "adagucMouseDown",
|
|
21832
22386
|
value: function adagucMouseDown(event) {
|
|
21833
22387
|
var isInEditMode = this.props.isInEditMode;
|
|
21834
|
-
|
|
22388
|
+
|
|
22389
|
+
if (event && event.rightButton === true) {
|
|
22390
|
+
return;
|
|
22391
|
+
}
|
|
21835
22392
|
|
|
21836
22393
|
if (isInEditMode === false) {
|
|
21837
22394
|
return;
|
|
@@ -21857,11 +22414,14 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
21857
22414
|
// eslint-disable-next-line consistent-return
|
|
21858
22415
|
|
|
21859
22416
|
|
|
21860
|
-
if (this.insertVertexInEdge(event) === false)
|
|
22417
|
+
if (this.insertVertexInEdge(event) === false) {
|
|
22418
|
+
return false;
|
|
22419
|
+
}
|
|
21861
22420
|
/* This is trigged when a new feature is created. */
|
|
21862
22421
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
21863
22422
|
// @ts-ignore
|
|
21864
22423
|
|
|
22424
|
+
|
|
21865
22425
|
if (this.createNewFeature(event) === false) {
|
|
21866
22426
|
/* Start with mouse move from this mouse down location, enables sizing the box while moving the mouse */
|
|
21867
22427
|
this.adagucMouseMove(event);
|
|
@@ -21870,13 +22430,22 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
21870
22430
|
/* This is triggered when new points are added during the addmultipoint mode. One point is added per time */
|
|
21871
22431
|
|
|
21872
22432
|
|
|
21873
|
-
if (this.addPointToMultiPointFeature(event) === false)
|
|
22433
|
+
if (this.addPointToMultiPointFeature(event) === false) {
|
|
22434
|
+
return false;
|
|
22435
|
+
}
|
|
21874
22436
|
/* This is triggered when new points are added during the addpolygon mode. One point is added per time */
|
|
21875
22437
|
|
|
21876
|
-
|
|
22438
|
+
|
|
22439
|
+
if (this.addVerticesToPolygonFeature(event) === false) {
|
|
22440
|
+
return false;
|
|
22441
|
+
}
|
|
21877
22442
|
/* This is triggered when new points are added to a linestring */
|
|
21878
22443
|
|
|
21879
|
-
|
|
22444
|
+
|
|
22445
|
+
if (this.addPointToLineStringFeature(event) === false) {
|
|
22446
|
+
return false;
|
|
22447
|
+
}
|
|
22448
|
+
|
|
21880
22449
|
return false;
|
|
21881
22450
|
/* False means that this component will take over entire controll.
|
|
21882
22451
|
True means that it is still possible to pan and drag the map while editing */
|
|
@@ -21945,7 +22514,10 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
21945
22514
|
var _this$props10 = this.props,
|
|
21946
22515
|
isInEditMode = _this$props10.isInEditMode,
|
|
21947
22516
|
onClickFeature = _this$props10.onClickFeature;
|
|
21948
|
-
|
|
22517
|
+
|
|
22518
|
+
if (event && event.rightButton === true) {
|
|
22519
|
+
return;
|
|
22520
|
+
}
|
|
21949
22521
|
|
|
21950
22522
|
if (onClickFeature) {
|
|
21951
22523
|
var mouseX = event.mouseX,
|
|
@@ -22088,10 +22660,21 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
22088
22660
|
}, {
|
|
22089
22661
|
key: "validateFeature",
|
|
22090
22662
|
value: function validateFeature(feature) {
|
|
22091
|
-
if (!feature.properties)
|
|
22092
|
-
|
|
22093
|
-
|
|
22094
|
-
|
|
22663
|
+
if (!feature.properties) {
|
|
22664
|
+
feature.properties = {};
|
|
22665
|
+
}
|
|
22666
|
+
|
|
22667
|
+
if (!feature.geometry) {
|
|
22668
|
+
feature.geometry = {};
|
|
22669
|
+
}
|
|
22670
|
+
|
|
22671
|
+
if (!feature.type) {
|
|
22672
|
+
feature.type = 'Feature';
|
|
22673
|
+
}
|
|
22674
|
+
|
|
22675
|
+
if (!feature.geometry.coordinates) {
|
|
22676
|
+
feature.geometry.coordinates = [];
|
|
22677
|
+
}
|
|
22095
22678
|
}
|
|
22096
22679
|
}, {
|
|
22097
22680
|
key: "validatePolys",
|
|
@@ -22101,7 +22684,10 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
22101
22684
|
}
|
|
22102
22685
|
|
|
22103
22686
|
for (var featureIndex = 0; featureIndex < this.geojson.features.length; featureIndex += 1) {
|
|
22104
|
-
if (!this.geojson.features)
|
|
22687
|
+
if (!this.geojson.features) {
|
|
22688
|
+
this.geojson.features = [];
|
|
22689
|
+
}
|
|
22690
|
+
|
|
22105
22691
|
var feature = this.geojson.features[featureIndex];
|
|
22106
22692
|
this.validateFeature(feature);
|
|
22107
22693
|
var featureType = feature.geometry.type;
|
|
@@ -22672,12 +23258,23 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
22672
23258
|
isInEditMode = _this$props13.isInEditMode,
|
|
22673
23259
|
featureNrToEdit = _this$props13.featureNrToEdit;
|
|
22674
23260
|
var feature = this.geojson.features[featureIndex];
|
|
22675
|
-
|
|
22676
|
-
if (feature.geometry
|
|
23261
|
+
|
|
23262
|
+
if (!feature || !feature.geometry) {
|
|
23263
|
+
return;
|
|
23264
|
+
}
|
|
23265
|
+
|
|
23266
|
+
if (feature.geometry.type !== 'LineString') {
|
|
23267
|
+
return;
|
|
23268
|
+
}
|
|
23269
|
+
|
|
22677
23270
|
var lineProps = feature.properties;
|
|
22678
|
-
|
|
23271
|
+
|
|
23272
|
+
if (!lineProps) {
|
|
23273
|
+
lineProps = this.defaultLineStringProps;
|
|
23274
|
+
}
|
|
22679
23275
|
/* Draw polygons and calculate center of poly */
|
|
22680
23276
|
|
|
23277
|
+
|
|
22681
23278
|
var middle = {
|
|
22682
23279
|
x: 0,
|
|
22683
23280
|
y: 0,
|
|
@@ -22748,16 +23345,23 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
22748
23345
|
isInEditMode = _this$props14.isInEditMode,
|
|
22749
23346
|
featureNrToEdit = _this$props14.featureNrToEdit;
|
|
22750
23347
|
var feature = this.geojson.features[featureIndex];
|
|
22751
|
-
|
|
23348
|
+
|
|
23349
|
+
if (!feature || !feature.geometry) {
|
|
23350
|
+
return;
|
|
23351
|
+
}
|
|
22752
23352
|
|
|
22753
23353
|
if (feature.geometry.type !== 'Polygon' && feature.geometry.type !== 'MultiPolygon') {
|
|
22754
23354
|
return;
|
|
22755
23355
|
}
|
|
22756
23356
|
|
|
22757
23357
|
var polyProps = feature.properties;
|
|
22758
|
-
|
|
23358
|
+
|
|
23359
|
+
if (!polyProps) {
|
|
23360
|
+
polyProps = this.defaultPolyProps;
|
|
23361
|
+
}
|
|
22759
23362
|
/* Draw polygons and calculate center of poly */
|
|
22760
23363
|
|
|
23364
|
+
|
|
22761
23365
|
var middle = {
|
|
22762
23366
|
x: 0,
|
|
22763
23367
|
y: 0,
|
|
@@ -22831,8 +23435,11 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
22831
23435
|
var XYCoords = [];
|
|
22832
23436
|
|
|
22833
23437
|
for (var j = 0; j < featureCoords.length; j += 1) {
|
|
22834
|
-
|
|
22835
|
-
|
|
23438
|
+
if (featureCoords[j].length < 2) {
|
|
23439
|
+
// eslint-disable-next-line no-continue
|
|
23440
|
+
continue;
|
|
23441
|
+
}
|
|
23442
|
+
|
|
22836
23443
|
var coord = webmapjs.getPixelCoordFromLatLong({
|
|
22837
23444
|
x: featureCoords[j][0],
|
|
22838
23445
|
y: featureCoords[j][1]
|
|
@@ -23053,7 +23660,9 @@ var AdagucMapDrawContainer = function AdagucMapDrawContainer(_ref) {
|
|
|
23053
23660
|
}
|
|
23054
23661
|
},
|
|
23055
23662
|
exitDrawModeCallback: function exitDrawModeCallback() {
|
|
23056
|
-
if (layer.exitDrawModeCallback)
|
|
23663
|
+
if (layer.exitDrawModeCallback) {
|
|
23664
|
+
layer.exitDrawModeCallback();
|
|
23665
|
+
}
|
|
23057
23666
|
},
|
|
23058
23667
|
featureNrToEdit: parseInt(layer.featureNrToEdit || '0', 10)
|
|
23059
23668
|
}));
|
|
@@ -23341,7 +23950,11 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
|
|
|
23341
23950
|
mapId = _this2$props.mapId,
|
|
23342
23951
|
onMapZoomEnd = _this2$props.onMapZoomEnd;
|
|
23343
23952
|
var wmjsMap = getWMJSMapById(mapId);
|
|
23344
|
-
|
|
23953
|
+
|
|
23954
|
+
if (!wmjsMap) {
|
|
23955
|
+
return;
|
|
23956
|
+
}
|
|
23957
|
+
|
|
23345
23958
|
var projectionInfo = wmjsMap.getProjection();
|
|
23346
23959
|
/* Trigger onMapZoomEnd callback */
|
|
23347
23960
|
|
|
@@ -24515,7 +25128,7 @@ var MapViewConnect = function MapViewConnect(_a) {
|
|
|
24515
25128
|
onLayerError: function onLayerError(_, error) {
|
|
24516
25129
|
layerError({
|
|
24517
25130
|
layerId: layer.id,
|
|
24518
|
-
error: error
|
|
25131
|
+
error: "".concat(error)
|
|
24519
25132
|
});
|
|
24520
25133
|
}
|
|
24521
25134
|
}, layer));
|
|
@@ -24526,7 +25139,7 @@ var MapViewConnect = function MapViewConnect(_a) {
|
|
|
24526
25139
|
onLayerError: function onLayerError(_, error) {
|
|
24527
25140
|
layerError({
|
|
24528
25141
|
layerId: layer.id,
|
|
24529
|
-
error: error
|
|
25142
|
+
error: "".concat(error)
|
|
24530
25143
|
});
|
|
24531
25144
|
},
|
|
24532
25145
|
onClickFeature: layer.geojson ? function (event) {
|
|
@@ -24543,7 +25156,7 @@ var MapViewConnect = function MapViewConnect(_a) {
|
|
|
24543
25156
|
onLayerError: function onLayerError(_, error) {
|
|
24544
25157
|
layerError({
|
|
24545
25158
|
layerId: layer.id,
|
|
24546
|
-
error: error
|
|
25159
|
+
error: "".concat(error)
|
|
24547
25160
|
});
|
|
24548
25161
|
}
|
|
24549
25162
|
}, layer));
|
|
@@ -25129,7 +25742,11 @@ var getTitle = function getTitle(layerId) {
|
|
|
25129
25742
|
|
|
25130
25743
|
var getLayersToUpdate = function getLayersToUpdate(layers, mapId) {
|
|
25131
25744
|
var wmjsMap = getWMJSMapById(mapId);
|
|
25132
|
-
|
|
25745
|
+
|
|
25746
|
+
if (!wmjsMap || !layers || layers.length === 0) {
|
|
25747
|
+
return [];
|
|
25748
|
+
}
|
|
25749
|
+
|
|
25133
25750
|
return layers.filter(function (layer) {
|
|
25134
25751
|
return layer && layer.enabled && !!getWMLayerById(layer.id);
|
|
25135
25752
|
}).map(function (layer) {
|
|
@@ -25306,7 +25923,11 @@ var GetFeatureInfoDialog = function GetFeatureInfoDialog(_ref) {
|
|
|
25306
25923
|
title = layer.title,
|
|
25307
25924
|
url = layer.url;
|
|
25308
25925
|
var result = gfiResultMap.get(layerId);
|
|
25309
|
-
|
|
25926
|
+
|
|
25927
|
+
if (!result) {
|
|
25928
|
+
return null;
|
|
25929
|
+
}
|
|
25930
|
+
|
|
25310
25931
|
return /*#__PURE__*/React__default.createElement(Grid, {
|
|
25311
25932
|
key: layerId,
|
|
25312
25933
|
sx: {
|
|
@@ -25506,6 +26127,8 @@ var ConfigurableMapConnect = function ConfigurableMapConnect(_a) {
|
|
|
25506
26127
|
title = _a.title,
|
|
25507
26128
|
_a$layers = _a.layers,
|
|
25508
26129
|
layers = _a$layers === void 0 ? [] : _a$layers,
|
|
26130
|
+
_a$dimensions = _a.dimensions,
|
|
26131
|
+
dimensions = _a$dimensions === void 0 ? [] : _a$dimensions,
|
|
25509
26132
|
_a$shouldAutoUpdate = _a.shouldAutoUpdate,
|
|
25510
26133
|
shouldAutoUpdate = _a$shouldAutoUpdate === void 0 ? false : _a$shouldAutoUpdate,
|
|
25511
26134
|
_a$shouldAnimate = _a.shouldAnimate,
|
|
@@ -25537,7 +26160,7 @@ var ConfigurableMapConnect = function ConfigurableMapConnect(_a) {
|
|
|
25537
26160
|
_a$displayGetFeatureI = _a.displayGetFeatureInfoButtonInMap,
|
|
25538
26161
|
displayGetFeatureInfoButtonInMap = _a$displayGetFeatureI === void 0 ? false : _a$displayGetFeatureI,
|
|
25539
26162
|
children = _a.children,
|
|
25540
|
-
props = __rest(_a, ["id", "dockedLayerManagerSize", "title", "layers", "shouldAutoUpdate", "shouldAnimate", "bbox", "srs", "shouldShowZoomControls", "displayMapPin", "showTimeSlider", "disableTimeSlider", "displayTimeInMap", "displayLayerManagerAndLegendButtonInMap", "displayDimensionSelectButtonInMap", "multiLegend", "shouldShowLayerManager", "shouldShowDockedLayerManager", "showClock", "displayGetFeatureInfoButtonInMap", "children"]);
|
|
26163
|
+
props = __rest(_a, ["id", "dockedLayerManagerSize", "title", "layers", "dimensions", "shouldAutoUpdate", "shouldAnimate", "bbox", "srs", "shouldShowZoomControls", "displayMapPin", "showTimeSlider", "disableTimeSlider", "displayTimeInMap", "displayLayerManagerAndLegendButtonInMap", "displayDimensionSelectButtonInMap", "multiLegend", "shouldShowLayerManager", "shouldShowDockedLayerManager", "showClock", "displayGetFeatureInfoButtonInMap", "children"]);
|
|
25541
26164
|
|
|
25542
26165
|
var dispatch = useDispatch();
|
|
25543
26166
|
var mapId = React__default.useRef(id || generateMapId()).current;
|
|
@@ -25554,6 +26177,7 @@ var ConfigurableMapConnect = function ConfigurableMapConnect(_a) {
|
|
|
25554
26177
|
bbox: bbox,
|
|
25555
26178
|
srs: srs
|
|
25556
26179
|
},
|
|
26180
|
+
dimensions: dimensions,
|
|
25557
26181
|
shouldAutoUpdate: shouldAutoUpdate,
|
|
25558
26182
|
shouldAnimate: shouldAnimate,
|
|
25559
26183
|
shouldShowZoomControls: shouldShowZoomControls,
|
|
@@ -25700,7 +26324,8 @@ var MultiMapViewConnect = function MultiMapViewConnect(_ref) {
|
|
|
25700
26324
|
syncGroupAddTarget({
|
|
25701
26325
|
groupId: syncGroupsId,
|
|
25702
26326
|
targetId: map.id,
|
|
25703
|
-
linked: true
|
|
26327
|
+
linked: true,
|
|
26328
|
+
origin: 'system'
|
|
25704
26329
|
});
|
|
25705
26330
|
});
|
|
25706
26331
|
});
|
|
@@ -25744,9 +26369,11 @@ var MultiMapViewConnect = function MultiMapViewConnect(_ref) {
|
|
|
25744
26369
|
title: map.title || mapId,
|
|
25745
26370
|
id: mapId,
|
|
25746
26371
|
layers: map.layers || [],
|
|
25747
|
-
|
|
26372
|
+
autoTimeStepLayerId: map.autoTimeStepLayerId,
|
|
26373
|
+
autoUpdateLayerId: map.autoUpdateLayerId,
|
|
25748
26374
|
bbox: map.bbox,
|
|
25749
26375
|
srs: map.srs,
|
|
26376
|
+
dimensions: map.dimensions || [],
|
|
25750
26377
|
displayTimeInMap: map.displayTimeInMap || false,
|
|
25751
26378
|
displayLayerManagerAndLegendButtonInMap: map.displayLayerManagerAndLegendButtonInMap,
|
|
25752
26379
|
displayDimensionSelectButtonInMap: map.displayDimensionSelectButtonInMap,
|
|
@@ -25787,9 +26414,13 @@ var useHasSyncGroupWithLayerActions = function useHasSyncGroupWithLayerActions(s
|
|
|
25787
26414
|
var syncGroupState = useSelector(function (store) {
|
|
25788
26415
|
return getSynchronizationGroupState(store);
|
|
25789
26416
|
});
|
|
25790
|
-
|
|
26417
|
+
|
|
26418
|
+
if (!syncGroupState) {
|
|
26419
|
+
return false;
|
|
26420
|
+
}
|
|
25791
26421
|
/* Return all syncgroups configured for this component of type SYNCGROUPS_TYPE_SETLAYERACTIONS */
|
|
25792
26422
|
|
|
26423
|
+
|
|
25793
26424
|
var syncGroupsWithLayerActions = syncGroupState.groups.allIds.filter(function (syncGroupId) {
|
|
25794
26425
|
return syncGroupsIds && syncGroupsIds.includes(syncGroupId) && syncGroupState.groups.byId[syncGroupId].type === 'SYNCGROUPS_TYPE_SETLAYERACTIONS';
|
|
25795
26426
|
});
|
|
@@ -25844,9 +26475,13 @@ var ModelRunInterval = function ModelRunInterval(_ref) {
|
|
|
25844
26475
|
/* Get latest reference time for this layer */
|
|
25845
26476
|
|
|
25846
26477
|
var latestReferenceTime = useGetLatestReferenceTime(layers[0]);
|
|
25847
|
-
|
|
26478
|
+
|
|
26479
|
+
if (latestReferenceTime === '') {
|
|
26480
|
+
return /*#__PURE__*/React.createElement("div", null, "Loading...");
|
|
26481
|
+
}
|
|
25848
26482
|
/* Calculate the last time increment based on 15 maps */
|
|
25849
26483
|
|
|
26484
|
+
|
|
25850
26485
|
var lastTimeIncrement = startTimeIncrement + 15 * interval;
|
|
25851
26486
|
/* Make the preset */
|
|
25852
26487
|
|
|
@@ -25902,9 +26537,13 @@ var HarmonieTempAndPrecipPreset = function HarmonieTempAndPrecipPreset(_ref) {
|
|
|
25902
26537
|
/* Get all the reference times for this layer */
|
|
25903
26538
|
|
|
25904
26539
|
var referenceTimes = useGetReferenceTimes(layers.topRow);
|
|
25905
|
-
|
|
26540
|
+
|
|
26541
|
+
if (referenceTimes.length === 0) {
|
|
26542
|
+
return /*#__PURE__*/React.createElement("div", null, "Loading...");
|
|
26543
|
+
}
|
|
25906
26544
|
/* Helper to make a map layer prest */
|
|
25907
26545
|
|
|
26546
|
+
|
|
25908
26547
|
var makeMapPreset = function makeMapPreset(referenceTime, uniqueId, layer, syncGroupsIds, col) {
|
|
25909
26548
|
return {
|
|
25910
26549
|
id: uniqueId,
|
|
@@ -25992,7 +26631,11 @@ var componentsLookUp = function componentsLookUp(_ref) {
|
|
|
25992
26631
|
var _mapPreset = initialProps.mapPreset,
|
|
25993
26632
|
shouldShowZoomControls = initialProps.shouldShowZoomControls,
|
|
25994
26633
|
syncGroupsIds = initialProps.syncGroupsIds;
|
|
25995
|
-
|
|
26634
|
+
|
|
26635
|
+
if (!_mapPreset || _mapPreset.length === 0) {
|
|
26636
|
+
return null;
|
|
26637
|
+
}
|
|
26638
|
+
|
|
25996
26639
|
return /*#__PURE__*/React__default.createElement(MultiMapViewConnect, {
|
|
25997
26640
|
rows: 2,
|
|
25998
26641
|
cols: 2,
|
|
@@ -26000,11 +26643,15 @@ var componentsLookUp = function componentsLookUp(_ref) {
|
|
|
26000
26643
|
maps: _mapPreset.map(function (preset, index) {
|
|
26001
26644
|
var _a, _b, _c, _d;
|
|
26002
26645
|
|
|
26646
|
+
var layers = preset.layers,
|
|
26647
|
+
autoUpdateLayerId = preset.autoUpdateLayerId,
|
|
26648
|
+
autoTimeStepLayerId = preset.autoTimeStepLayerId;
|
|
26003
26649
|
return {
|
|
26004
26650
|
id: "".concat(id, "_").concat(index),
|
|
26005
26651
|
syncGroupsIds: syncGroupsIds,
|
|
26006
|
-
layers:
|
|
26007
|
-
|
|
26652
|
+
layers: layers,
|
|
26653
|
+
autoUpdateLayerId: autoUpdateLayerId,
|
|
26654
|
+
autoTimeStepLayerId: autoTimeStepLayerId,
|
|
26008
26655
|
bbox: (_b = (_a = _mapPreset[0]) === null || _a === void 0 ? void 0 : _a.proj) === null || _b === void 0 ? void 0 : _b.bbox,
|
|
26009
26656
|
srs: (_d = (_c = _mapPreset[0]) === null || _c === void 0 ? void 0 : _c.proj) === null || _d === void 0 ? void 0 : _d.srs
|
|
26010
26657
|
};
|
|
@@ -26909,4 +27556,4 @@ var MapWarningProperties = function MapWarningProperties(_ref) {
|
|
|
26909
27556
|
* */
|
|
26910
27557
|
var mapActions = Object.assign(Object.assign(Object.assign({}, layerActions), mapActions$1), serviceActions);
|
|
26911
27558
|
|
|
26912
|
-
export { AppWrapperConnect, ConfigurableMapConnect, CoreThemeProvider, CoreThemeStoreProvider, DockedLayerManagerConnect, HarmonieTempAndPrecipPreset, LayerManager, BaseLayerRow as LayerManagerBaseLayerRow, LayerManagerConnect, DescriptionRow as LayerManagerDescriptionRow, HeaderOptions as LayerManagerHeaderOptions, LayerContainerRow as LayerManagerLayerContainerRow, LayerManagerMapButtonConnect, LayerSelectConnect, Legend, LegendConnect, LegendMapButtonConnect, MapControls, MapView, MapViewConnect, MapViewLayer, MapWarningProperties, MultiDimensionSelectMapButtonsConnect, MultiMapMultiDimensionSelectConnect as MultiMapDimensionSelectConnect, MultiMapViewConnect, ReactMapView, ReactMapViewLayer, RouterWrapperConnect, SnackbarWrapperConnect, SyncGroupViewerConnect, index as SyncGroups, TimeSlider, BackwardForwardStepButtonConnect as TimeSliderBackwardForwardStepButtonConnect, TimeSliderButtonsConnect, TimeSliderConnect, OptionsMenuButtonConnect as TimeSliderOptionsMenuButtonConnect, PlayButtonConnect as TimeSliderPlayButtonConnect, ZoomControlConnect, ZoomControls, appActions, componentsLookUp, coreModuleConfig, dateFormat, defaultBbox, defaultConfigurations, filterLayers, filterMapPresets, filterNonTimeDimensions, filterServices, generateLayerId, generateMapId, generateTimesliderId, getDrawFunctionFromStore, getFirstTimeStepForLayerId, getInitialAppPresets, getLastTimeStepForLayerId, getNextTimeStepForLayerId, getPreviousTimeStepForLayerId, getWMJSDimensionForLayerAndDimension, getWMJSMapById, getWMJSTimeDimensionForLayerId, getWMLayerById, layerActions, reducer$8 as layerReducer, selectors$
|
|
27559
|
+
export { AppWrapperConnect, ConfigurableMapConnect, CoreThemeProvider, CoreThemeStoreProvider, DockedLayerManagerConnect, HarmonieTempAndPrecipPreset, LayerManager, BaseLayerRow as LayerManagerBaseLayerRow, LayerManagerConnect, DescriptionRow as LayerManagerDescriptionRow, HeaderOptions as LayerManagerHeaderOptions, LayerContainerRow as LayerManagerLayerContainerRow, LayerManagerMapButtonConnect, LayerSelectConnect, Legend, LegendConnect, LegendMapButtonConnect, MapControls, MapView, MapViewConnect, MapViewLayer, MapWarningProperties, MultiDimensionSelectMapButtonsConnect, MultiMapMultiDimensionSelectConnect as MultiMapDimensionSelectConnect, MultiMapViewConnect, ReactMapView, ReactMapViewLayer, RouterWrapperConnect, SnackbarWrapperConnect, SyncGroupViewerConnect, index as SyncGroups, TimeSlider, BackwardForwardStepButtonConnect as TimeSliderBackwardForwardStepButtonConnect, TimeSliderButtonsConnect, TimeSliderConnect, OptionsMenuButtonConnect as TimeSliderOptionsMenuButtonConnect, PlayButtonConnect as TimeSliderPlayButtonConnect, ZoomControlConnect, ZoomControls, appActions, componentsLookUp, coreModuleConfig, dateFormat, defaultBbox, defaultConfigurations, filterLayers, filterMapPresets, filterNonTimeDimensions, filterServices, generateLayerId, generateMapId, generateTimesliderId, selectors$1 as genericSelectors, getDrawFunctionFromStore, getFirstTimeStepForLayerId, getInitialAppPresets, getLastTimeStepForLayerId, getNextTimeStepForLayerId, getPreviousTimeStepForLayerId, getWMJSDimensionForLayerAndDimension, getWMJSMapById, getWMJSTimeDimensionForLayerId, getWMLayerById, layerActions, reducer$8 as layerReducer, selectors$3 as layerSelectors, types$3 as layerTypes, mapActions, moduleConfig as mapModuleConfig, selectors as mapSelectors, types$2 as mapTypes, utils as mapUtils, parseBoolean, parseLayer, publicLayers, publicServices, registerDrawFunction, registerWMJSMap, registerWMLayer, routerActions, snackbarActions, store, genericActions as syncGroupActions, synchronizationGroupConfig as synchronizationGroupModuleConfig, synchronizationGroupConfig as synchronizationGroupsConfig, testLayers, timeSliderUtils, uiActions, uiModuleConfig, selectors$2 as uiSelectors, types as uiTypes, unRegisterWMJSLayer, unRegisterWMJSMap, useSetupDialog };
|