@opengeoweb/core 4.16.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 +1581 -828
- package/index.umd.js +1606 -795
- 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,9 +588,17 @@ 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
|
+
|
|
598
|
+
if (currentIndex < 0 || currentIndex - 1 < 0) {
|
|
599
|
+
return wmjsTimeDim.getClosestValue(wmjsTimeDim.currentValue, true);
|
|
600
|
+
}
|
|
601
|
+
|
|
594
602
|
return wmjsTimeDim.getValueForIndex(currentIndex - 1);
|
|
595
603
|
};
|
|
596
604
|
/**
|
|
@@ -600,9 +608,17 @@ var getPreviousTimeStepForLayerId = function getPreviousTimeStepForLayerId(layer
|
|
|
600
608
|
|
|
601
609
|
var getNextTimeStepForLayerId = function getNextTimeStepForLayerId(layerId) {
|
|
602
610
|
var wmjsTimeDim = getWMJSTimeDimensionForLayerId(layerId);
|
|
603
|
-
|
|
611
|
+
|
|
612
|
+
if (!wmjsTimeDim) {
|
|
613
|
+
return null;
|
|
614
|
+
}
|
|
615
|
+
|
|
604
616
|
var currentIndex = wmjsTimeDim.getIndexForValue(wmjsTimeDim.currentValue, false);
|
|
605
|
-
|
|
617
|
+
|
|
618
|
+
if (currentIndex < 0 || currentIndex + 1 >= wmjsTimeDim.size()) {
|
|
619
|
+
return wmjsTimeDim.getClosestValue(wmjsTimeDim.currentValue, true);
|
|
620
|
+
}
|
|
621
|
+
|
|
606
622
|
return wmjsTimeDim.getValueForIndex(currentIndex + 1);
|
|
607
623
|
};
|
|
608
624
|
/**
|
|
@@ -612,7 +628,11 @@ var getNextTimeStepForLayerId = function getNextTimeStepForLayerId(layerId) {
|
|
|
612
628
|
|
|
613
629
|
var getFirstTimeStepForLayerId = function getFirstTimeStepForLayerId(layerId) {
|
|
614
630
|
var wmjsTimeDim = getWMJSTimeDimensionForLayerId(layerId);
|
|
615
|
-
|
|
631
|
+
|
|
632
|
+
if (!wmjsTimeDim) {
|
|
633
|
+
return null;
|
|
634
|
+
}
|
|
635
|
+
|
|
616
636
|
return wmjsTimeDim.getFirstValue();
|
|
617
637
|
};
|
|
618
638
|
/**
|
|
@@ -622,7 +642,11 @@ var getFirstTimeStepForLayerId = function getFirstTimeStepForLayerId(layerId) {
|
|
|
622
642
|
|
|
623
643
|
var getLastTimeStepForLayerId = function getLastTimeStepForLayerId(layerId) {
|
|
624
644
|
var wmjsTimeDim = getWMJSTimeDimensionForLayerId(layerId);
|
|
625
|
-
|
|
645
|
+
|
|
646
|
+
if (!wmjsTimeDim) {
|
|
647
|
+
return null;
|
|
648
|
+
}
|
|
649
|
+
|
|
626
650
|
return wmjsTimeDim.getLastValue();
|
|
627
651
|
};
|
|
628
652
|
|
|
@@ -1123,8 +1147,8 @@ var createMap = function createMap(_ref) {
|
|
|
1123
1147
|
featureLayers = _ref$featureLayers === void 0 ? [] : _ref$featureLayers,
|
|
1124
1148
|
_ref$dimensions = _ref.dimensions,
|
|
1125
1149
|
dimensions = _ref$dimensions === void 0 ? [] : _ref$dimensions,
|
|
1126
|
-
|
|
1127
|
-
|
|
1150
|
+
autoUpdateLayerId = _ref.autoUpdateLayerId,
|
|
1151
|
+
autoTimeStepLayerId = _ref.autoTimeStepLayerId,
|
|
1128
1152
|
_ref$timeSliderScale = _ref.timeSliderScale,
|
|
1129
1153
|
timeSliderScale = _ref$timeSliderScale === void 0 ? Scale.Hour : _ref$timeSliderScale,
|
|
1130
1154
|
_ref$timeStep = _ref.timeStep,
|
|
@@ -1163,7 +1187,8 @@ var createMap = function createMap(_ref) {
|
|
|
1163
1187
|
mapLayers: mapLayers,
|
|
1164
1188
|
featureLayers: featureLayers,
|
|
1165
1189
|
dimensions: dimensions,
|
|
1166
|
-
|
|
1190
|
+
autoUpdateLayerId: autoUpdateLayerId,
|
|
1191
|
+
autoTimeStepLayerId: autoTimeStepLayerId,
|
|
1167
1192
|
timeSliderScale: timeSliderScale,
|
|
1168
1193
|
timeStep: timeStep,
|
|
1169
1194
|
animationDelay: animationDelay,
|
|
@@ -1210,7 +1235,10 @@ var checkValidLayersPayload = function checkValidLayersPayload(layers, mapId) {
|
|
|
1210
1235
|
|
|
1211
1236
|
var getDraftMapById = function getDraftMapById(mapId, draft) {
|
|
1212
1237
|
var map = draft.byId[mapId];
|
|
1213
|
-
|
|
1238
|
+
|
|
1239
|
+
if (map) {
|
|
1240
|
+
return map;
|
|
1241
|
+
}
|
|
1214
1242
|
|
|
1215
1243
|
if (!draft.allIds.includes(mapId)) {
|
|
1216
1244
|
draft.byId[mapId] = createMap({
|
|
@@ -1235,7 +1263,10 @@ var produceDraftStateSetWebMapDimension = function produceDraftStateSetWebMapDim
|
|
|
1235
1263
|
var map = getDraftMapById(mapId, draft);
|
|
1236
1264
|
|
|
1237
1265
|
if (dimensionFromAction) {
|
|
1238
|
-
if (!map.dimensions)
|
|
1266
|
+
if (!map.dimensions) {
|
|
1267
|
+
map.dimensions = [];
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1239
1270
|
var dimensions = map.dimensions;
|
|
1240
1271
|
var mapDim = dimensions.find(function (dim) {
|
|
1241
1272
|
return dim.name === dimensionFromAction.name;
|
|
@@ -1260,6 +1291,10 @@ var produceDraftStateSetWebMapDimension = function produceDraftStateSetWebMapDim
|
|
|
1260
1291
|
*/
|
|
1261
1292
|
|
|
1262
1293
|
var findMapIdFromLayerId = function findMapIdFromLayerId(draft, layerId) {
|
|
1294
|
+
if (!draft || !layerId) {
|
|
1295
|
+
return null;
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1263
1298
|
for (var i = 0; i < draft.allIds.length; i += 1) {
|
|
1264
1299
|
var mapId = draft.allIds[i];
|
|
1265
1300
|
var layerIds = draft.byId[mapId].mapLayers;
|
|
@@ -1391,7 +1426,10 @@ var utils = /*#__PURE__*/Object.freeze({
|
|
|
1391
1426
|
*/
|
|
1392
1427
|
|
|
1393
1428
|
var produceLayerDimensionDraftState = function produceLayerDimensionDraftState(draft, layerId, dimensionValueToUpdate) {
|
|
1394
|
-
if (!draft.byId[layerId].dimensions)
|
|
1429
|
+
if (!draft.byId[layerId].dimensions) {
|
|
1430
|
+
draft.byId[layerId].dimensions = [];
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1395
1433
|
var existingLayerDimIndex = draft.byId[layerId].dimensions.findIndex(function (layerDim) {
|
|
1396
1434
|
return layerDim.name === dimensionValueToUpdate.name;
|
|
1397
1435
|
});
|
|
@@ -1414,13 +1452,24 @@ var produceLayerDimensionDraftState = function produceLayerDimensionDraftState(d
|
|
|
1414
1452
|
};
|
|
1415
1453
|
|
|
1416
1454
|
var isActionLayerSynced = function isActionLayerSynced(state, layerIdFromAction, dimension) {
|
|
1417
|
-
if (dimension.synced !== undefined)
|
|
1455
|
+
if (dimension.synced !== undefined) {
|
|
1456
|
+
return dimension.synced;
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1418
1459
|
var actionLayer = state.byId[layerIdFromAction];
|
|
1419
|
-
|
|
1460
|
+
|
|
1461
|
+
if (!actionLayer) {
|
|
1462
|
+
return false;
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1420
1465
|
var layerDimensionIndex = actionLayer.dimensions.findIndex(function (layerDim) {
|
|
1421
1466
|
return layerDim.name === dimension.name;
|
|
1422
1467
|
});
|
|
1423
|
-
|
|
1468
|
+
|
|
1469
|
+
if (layerDimensionIndex < 0) {
|
|
1470
|
+
return false;
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1424
1473
|
return actionLayer.dimensions[layerDimensionIndex].synced === true;
|
|
1425
1474
|
};
|
|
1426
1475
|
var produceDimensionActionForMapLayer = function produceDimensionActionForMapLayer(layerDim, wmjsDimension, newDimension) {
|
|
@@ -1452,7 +1501,10 @@ var produceDimensionActionForMapLayer = function produceDimensionActionForMapLay
|
|
|
1452
1501
|
var produceDraftStateForAllLayersForDimensionWithinMap = function produceDraftStateForAllLayersForDimensionWithinMap(draft, dimension, mapId, layerIdFromAction
|
|
1453
1502
|
/* Layer ID or null if not known */
|
|
1454
1503
|
) {
|
|
1455
|
-
if (!mapId)
|
|
1504
|
+
if (!mapId) {
|
|
1505
|
+
return;
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1456
1508
|
var actionLayerSynced = isActionLayerSynced(draft, layerIdFromAction, dimension);
|
|
1457
1509
|
|
|
1458
1510
|
for (var li = 0; li < draft.allIds.length; li += 1) {
|
|
@@ -1689,7 +1741,11 @@ var slice$8 = createSlice({
|
|
|
1689
1741
|
layerIdFromAction = _action$payload2.layerId,
|
|
1690
1742
|
dimension = _action$payload2.dimension;
|
|
1691
1743
|
var layerFromAction = draft.byId[layerIdFromAction];
|
|
1692
|
-
|
|
1744
|
+
|
|
1745
|
+
if (!layerFromAction) {
|
|
1746
|
+
return;
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1693
1749
|
var mapId = layerFromAction.mapId;
|
|
1694
1750
|
produceDraftStateForAllLayersForDimensionWithinMap(draft, dimension, mapId, layerIdFromAction);
|
|
1695
1751
|
},
|
|
@@ -1757,7 +1813,10 @@ var slice$8 = createSlice({
|
|
|
1757
1813
|
},
|
|
1758
1814
|
baseLayerDelete: function baseLayerDelete(draft, action) {
|
|
1759
1815
|
var layerId = action.payload.layerId;
|
|
1760
|
-
|
|
1816
|
+
|
|
1817
|
+
if (draft.byId[layerId].layerType !== LayerType.baseLayer && draft.byId[layerId].layerType !== LayerType.overLayer) {
|
|
1818
|
+
return;
|
|
1819
|
+
}
|
|
1761
1820
|
|
|
1762
1821
|
if (draft.byId[layerId]) {
|
|
1763
1822
|
draft.allIds = draft.allIds.filter(function (id) {
|
|
@@ -1812,8 +1871,13 @@ var slice$8 = createSlice({
|
|
|
1812
1871
|
|
|
1813
1872
|
var layerTypes = [];
|
|
1814
1873
|
filtererdBaseLayers.forEach(function (layer) {
|
|
1815
|
-
if (layer.layerType !== LayerType.baseLayer && layer.layerType !== LayerType.overLayer)
|
|
1816
|
-
|
|
1874
|
+
if (layer.layerType !== LayerType.baseLayer && layer.layerType !== LayerType.overLayer) {
|
|
1875
|
+
return;
|
|
1876
|
+
}
|
|
1877
|
+
|
|
1878
|
+
if (!layerTypes.includes(layer.layerType)) {
|
|
1879
|
+
layerTypes.push(layer.layerType);
|
|
1880
|
+
}
|
|
1817
1881
|
});
|
|
1818
1882
|
var state = current(draft); // remove current layers with same type as one of the passed layers
|
|
1819
1883
|
|
|
@@ -1836,7 +1900,10 @@ var slice$8 = createSlice({
|
|
|
1836
1900
|
},
|
|
1837
1901
|
addBaseLayer: function addBaseLayer(draft, action) {
|
|
1838
1902
|
var layer = action.payload.layer;
|
|
1839
|
-
|
|
1903
|
+
|
|
1904
|
+
if (layer.layerType !== LayerType.baseLayer && layer.layerType !== LayerType.overLayer) {
|
|
1905
|
+
return;
|
|
1906
|
+
}
|
|
1840
1907
|
|
|
1841
1908
|
if (!draft.byId[layer.id]) {
|
|
1842
1909
|
draft.byId[layer.id] = createLayer(Object.assign({
|
|
@@ -1857,7 +1924,10 @@ var slice$8 = createSlice({
|
|
|
1857
1924
|
},
|
|
1858
1925
|
addAvailableBaseLayer: function addAvailableBaseLayer(draft, action) {
|
|
1859
1926
|
var layer = action.payload.layer;
|
|
1860
|
-
|
|
1927
|
+
|
|
1928
|
+
if (layer.layerType !== LayerType.baseLayer && layer.layerType !== LayerType.overLayer || !layer.mapId) {
|
|
1929
|
+
return;
|
|
1930
|
+
}
|
|
1861
1931
|
|
|
1862
1932
|
if (!draft.availableBaseLayers.byId[layer.id]) {
|
|
1863
1933
|
draft.availableBaseLayers.byId[layer.id] = createLayer(Object.assign({
|
|
@@ -1871,7 +1941,10 @@ var slice$8 = createSlice({
|
|
|
1871
1941
|
var layers = action.payload.layers; // add new available baselayers
|
|
1872
1942
|
|
|
1873
1943
|
layers.forEach(function (layer) {
|
|
1874
|
-
if (layer.layerType !== LayerType.baseLayer || draft.availableBaseLayers.byId[layer.id] || !layer.mapId)
|
|
1944
|
+
if (layer.layerType !== LayerType.baseLayer || draft.availableBaseLayers.byId[layer.id] || !layer.mapId) {
|
|
1945
|
+
return;
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1875
1948
|
draft.availableBaseLayers.byId[layer.id] = createLayer(Object.assign({
|
|
1876
1949
|
id: layer.id,
|
|
1877
1950
|
layerType: layer.layerType
|
|
@@ -1895,7 +1968,10 @@ var slice$8 = createSlice({
|
|
|
1895
1968
|
}); // add new available baselayers
|
|
1896
1969
|
|
|
1897
1970
|
layers.forEach(function (layer) {
|
|
1898
|
-
if (layer.layerType !== LayerType.baseLayer || !layer.mapId)
|
|
1971
|
+
if (layer.layerType !== LayerType.baseLayer || !layer.mapId) {
|
|
1972
|
+
return;
|
|
1973
|
+
}
|
|
1974
|
+
|
|
1899
1975
|
draft.availableBaseLayers.byId[layer.id] = createLayer(Object.assign({}, layer));
|
|
1900
1976
|
draft.availableBaseLayers.allIds.push(layer.id);
|
|
1901
1977
|
});
|
|
@@ -2014,7 +2090,10 @@ var slice$7 = createSlice({
|
|
|
2014
2090
|
serviceSetLayers: function serviceSetLayers(draft, action) {
|
|
2015
2091
|
var id = action.payload.id;
|
|
2016
2092
|
draft.byId[id] = Object.assign({}, action.payload);
|
|
2017
|
-
|
|
2093
|
+
|
|
2094
|
+
if (!draft.allIds.includes(id)) {
|
|
2095
|
+
draft.allIds.push(id);
|
|
2096
|
+
}
|
|
2018
2097
|
},
|
|
2019
2098
|
mapStoreRemoveService: function mapStoreRemoveService(draft, action) {
|
|
2020
2099
|
var foundServiceIndex = draft.allIds.findIndex(function (id) {
|
|
@@ -2028,12 +2107,19 @@ var slice$7 = createSlice({
|
|
|
2028
2107
|
});
|
|
2029
2108
|
delete draft.byId[serviceId];
|
|
2030
2109
|
}
|
|
2031
|
-
}
|
|
2110
|
+
},
|
|
2111
|
+
fetchInitialServices: function fetchInitialServices( // eslint-disable-next-line no-unused-vars
|
|
2112
|
+
draft, // eslint-disable-next-line no-unused-vars
|
|
2113
|
+
action) {}
|
|
2032
2114
|
},
|
|
2033
2115
|
extraReducers: function extraReducers(builder) {
|
|
2034
2116
|
return builder.addCase(layerActions.onUpdateLayerInformation, function (draft, action) {
|
|
2035
2117
|
var serviceLayers = action.payload.serviceLayers;
|
|
2036
|
-
|
|
2118
|
+
|
|
2119
|
+
if (serviceLayers === null) {
|
|
2120
|
+
return draft;
|
|
2121
|
+
}
|
|
2122
|
+
|
|
2037
2123
|
var mapAction = serviceActions.serviceSetLayers(serviceLayers);
|
|
2038
2124
|
var newState = reducer$7(draft, mapAction);
|
|
2039
2125
|
return newState;
|
|
@@ -2165,7 +2251,10 @@ var getLayerFromService = createSelector(function (store, serviceUrl) {
|
|
|
2165
2251
|
}, function (store, serviceUrl, layerName) {
|
|
2166
2252
|
return layerName;
|
|
2167
2253
|
}, function (layers, serviceUrl, layerName) {
|
|
2168
|
-
if (!layers)
|
|
2254
|
+
if (!layers) {
|
|
2255
|
+
return null;
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2169
2258
|
var index = layers.findIndex(function (serviceLayer) {
|
|
2170
2259
|
return serviceLayer.name === layerName;
|
|
2171
2260
|
});
|
|
@@ -2209,7 +2298,8 @@ var createUIDialogElement = function createUIDialogElement(_ref) {
|
|
|
2209
2298
|
type: type,
|
|
2210
2299
|
source: source,
|
|
2211
2300
|
isLoading: false,
|
|
2212
|
-
error: undefined
|
|
2301
|
+
error: undefined,
|
|
2302
|
+
focused: false
|
|
2213
2303
|
};
|
|
2214
2304
|
};
|
|
2215
2305
|
var initialState$6 = {
|
|
@@ -2284,6 +2374,10 @@ var slice$6 = createSlice({
|
|
|
2284
2374
|
if (setOpen) {
|
|
2285
2375
|
draft.order = moveToTop(draft.order, type);
|
|
2286
2376
|
}
|
|
2377
|
+
|
|
2378
|
+
if (!setOpen) {
|
|
2379
|
+
draft.dialogs[type].focused = false;
|
|
2380
|
+
}
|
|
2287
2381
|
},
|
|
2288
2382
|
orderDialog: function orderDialog(draft, action) {
|
|
2289
2383
|
var type = action.payload.type;
|
|
@@ -2304,6 +2398,17 @@ var slice$6 = createSlice({
|
|
|
2304
2398
|
error = _action$payload4.error,
|
|
2305
2399
|
type = _action$payload4.type;
|
|
2306
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;
|
|
2307
2412
|
}
|
|
2308
2413
|
}
|
|
2309
2414
|
});
|
|
@@ -2344,7 +2449,10 @@ var checkIfMapLayerIdIsAlreadyTaken = function checkIfMapLayerIdIsAlreadyTaken(s
|
|
|
2344
2449
|
*/
|
|
2345
2450
|
|
|
2346
2451
|
var createLayersWithIds = function createLayersWithIds(state, layers) {
|
|
2347
|
-
if (!layers)
|
|
2452
|
+
if (!layers) {
|
|
2453
|
+
return layers;
|
|
2454
|
+
}
|
|
2455
|
+
|
|
2348
2456
|
return produce(layers, function (draft) {
|
|
2349
2457
|
for (var j = 0; j < draft.length; j += 1) {
|
|
2350
2458
|
var layer = draft[j];
|
|
@@ -2397,7 +2505,10 @@ var slice$5 = createSlice({
|
|
|
2397
2505
|
|
|
2398
2506
|
var srs = action.payload.srs || null;
|
|
2399
2507
|
draft.byId[mapId].bbox = bbox;
|
|
2400
|
-
|
|
2508
|
+
|
|
2509
|
+
if (srs) {
|
|
2510
|
+
draft.byId[mapId].srs = srs;
|
|
2511
|
+
}
|
|
2401
2512
|
},
|
|
2402
2513
|
mapUpdateAllMapDimensions: function mapUpdateAllMapDimensions(draft, action) {
|
|
2403
2514
|
var _action$payload2 = action.payload,
|
|
@@ -2408,7 +2519,6 @@ var slice$5 = createSlice({
|
|
|
2408
2519
|
return;
|
|
2409
2520
|
}
|
|
2410
2521
|
|
|
2411
|
-
draft.byId[mapId].dimensions.length = 0;
|
|
2412
2522
|
dimensions.forEach(function (dimension) {
|
|
2413
2523
|
return produceDraftStateSetWebMapDimension(draft, mapId, dimension, true);
|
|
2414
2524
|
});
|
|
@@ -2513,16 +2623,28 @@ var slice$5 = createSlice({
|
|
|
2513
2623
|
|
|
2514
2624
|
draft.byId[mapId].mapLayers = moveArrayElements(draft.byId[mapId].mapLayers, oldIndex, newIndex);
|
|
2515
2625
|
},
|
|
2516
|
-
|
|
2626
|
+
setAutoLayerId: function setAutoLayerId(draft, action) {
|
|
2517
2627
|
var _action$payload9 = action.payload,
|
|
2518
2628
|
mapId = _action$payload9.mapId,
|
|
2519
|
-
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];
|
|
2520
2633
|
|
|
2521
|
-
if (!
|
|
2634
|
+
if (!map) {
|
|
2522
2635
|
return;
|
|
2523
2636
|
}
|
|
2524
2637
|
|
|
2525
|
-
|
|
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
|
+
}
|
|
2526
2648
|
},
|
|
2527
2649
|
setTimeSliderCenterTime: function setTimeSliderCenterTime(draft, action) {
|
|
2528
2650
|
var _action$payload10 = action.payload,
|
|
@@ -2698,7 +2820,8 @@ var slice$5 = createSlice({
|
|
|
2698
2820
|
}
|
|
2699
2821
|
|
|
2700
2822
|
if (!draft.byId[mapId].mapLayers.length) {
|
|
2701
|
-
draft.byId[mapId].
|
|
2823
|
+
draft.byId[mapId].autoUpdateLayerId = layerId;
|
|
2824
|
+
draft.byId[mapId].autoTimeStepLayerId = layerId;
|
|
2702
2825
|
}
|
|
2703
2826
|
|
|
2704
2827
|
draft.byId[mapId].mapLayers.unshift(layerId);
|
|
@@ -2738,19 +2861,36 @@ var slice$5 = createSlice({
|
|
|
2738
2861
|
|
|
2739
2862
|
if (draft.byId[mapId]) {
|
|
2740
2863
|
draft.byId[mapId].mapLayers = layerIds;
|
|
2741
|
-
draft.byId[mapId].
|
|
2864
|
+
draft.byId[mapId].autoUpdateLayerId = activeLayerId;
|
|
2865
|
+
draft.byId[mapId].autoTimeStepLayerId = activeLayerId;
|
|
2742
2866
|
var webmapInstance = getWMJSMapById(mapId);
|
|
2743
2867
|
|
|
2744
2868
|
if (webmapInstance) {
|
|
2745
2869
|
var mapDims = webmapInstance.getDimensionList();
|
|
2746
2870
|
|
|
2747
|
-
if (
|
|
2748
|
-
draft.byId[mapId].dimensions =
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
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
|
+
}
|
|
2754
2894
|
});
|
|
2755
2895
|
}
|
|
2756
2896
|
}
|
|
@@ -2781,31 +2921,43 @@ var slice$5 = createSlice({
|
|
|
2781
2921
|
});
|
|
2782
2922
|
|
|
2783
2923
|
if (draft.byId[mapId]) {
|
|
2784
|
-
if (baseLayerIds.length !== 0)
|
|
2785
|
-
|
|
2924
|
+
if (baseLayerIds.length !== 0) {
|
|
2925
|
+
draft.byId[mapId].baseLayers = baseLayerIds;
|
|
2926
|
+
}
|
|
2927
|
+
|
|
2928
|
+
if (overLayerIds.length !== 0) {
|
|
2929
|
+
draft.byId[mapId].overLayers = overLayerIds;
|
|
2930
|
+
}
|
|
2786
2931
|
}
|
|
2787
2932
|
}).addCase(layerDelete$1, function (draft, action) {
|
|
2788
2933
|
var _action$payload27 = action.payload,
|
|
2789
2934
|
mapId = _action$payload27.mapId,
|
|
2790
2935
|
layerId = _action$payload27.layerId;
|
|
2936
|
+
var map = draft.byId[mapId];
|
|
2791
2937
|
|
|
2792
|
-
if (!
|
|
2938
|
+
if (!map) {
|
|
2793
2939
|
return;
|
|
2794
2940
|
}
|
|
2795
2941
|
|
|
2796
|
-
|
|
2942
|
+
map.mapLayers = map.mapLayers.filter(function (id) {
|
|
2797
2943
|
return id !== layerId;
|
|
2798
|
-
}); // if
|
|
2944
|
+
}); // if auto layer is deleted, change auto layer ids
|
|
2945
|
+
|
|
2946
|
+
if (!map.mapLayers.length) {
|
|
2947
|
+
map.autoUpdateLayerId = undefined;
|
|
2948
|
+
map.autoTimeStepLayerId = undefined;
|
|
2949
|
+
return;
|
|
2950
|
+
}
|
|
2799
2951
|
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
activeLayerId = _draft$byId$mapId$map[0];
|
|
2952
|
+
var _map$mapLayers = _slicedToArray(map.mapLayers, 1),
|
|
2953
|
+
activeLayerId = _map$mapLayers[0];
|
|
2803
2954
|
|
|
2804
|
-
|
|
2955
|
+
if (map.autoUpdateLayerId === layerId) {
|
|
2956
|
+
map.autoUpdateLayerId = activeLayerId;
|
|
2805
2957
|
}
|
|
2806
2958
|
|
|
2807
|
-
if (
|
|
2808
|
-
|
|
2959
|
+
if (map.autoTimeStepLayerId === layerId) {
|
|
2960
|
+
map.autoTimeStepLayerId = activeLayerId;
|
|
2809
2961
|
}
|
|
2810
2962
|
}).addCase(baseLayerDelete, function (draft, action) {
|
|
2811
2963
|
var _action$payload28 = action.payload,
|
|
@@ -2877,7 +3029,9 @@ var slice$5 = createSlice({
|
|
|
2877
3029
|
draft.byId[targetId].bbox = bbox;
|
|
2878
3030
|
}
|
|
2879
3031
|
|
|
2880
|
-
if (srs)
|
|
3032
|
+
if (srs) {
|
|
3033
|
+
draft.byId[targetId].srs = srs;
|
|
3034
|
+
}
|
|
2881
3035
|
}
|
|
2882
3036
|
});
|
|
2883
3037
|
}).addCase(setLayerActionSync, function (draft, action) {
|
|
@@ -2901,7 +3055,11 @@ var slice$5 = createSlice({
|
|
|
2901
3055
|
}, draft);
|
|
2902
3056
|
}).addCase(onUpdateLayerInformation, function (draft, action) {
|
|
2903
3057
|
var mapDimensions = action.payload.mapDimensions;
|
|
2904
|
-
|
|
3058
|
+
|
|
3059
|
+
if (mapDimensions === null) {
|
|
3060
|
+
return draft;
|
|
3061
|
+
}
|
|
3062
|
+
|
|
2905
3063
|
var mapAction = mapActions$1.mapUpdateAllMapDimensions(mapDimensions);
|
|
2906
3064
|
return reducer$5(draft, mapAction);
|
|
2907
3065
|
}).addCase(mapChangeDimension, function (draft, action) {
|
|
@@ -2965,7 +3123,7 @@ var reducer$5 = slice$5.reducer;
|
|
|
2965
3123
|
* */
|
|
2966
3124
|
|
|
2967
3125
|
var layerStore = function layerStore(store) {
|
|
2968
|
-
return store
|
|
3126
|
+
return store === null || store === void 0 ? void 0 : store.layers;
|
|
2969
3127
|
};
|
|
2970
3128
|
/**
|
|
2971
3129
|
* Gets a layer from the layers part of the store by its Id
|
|
@@ -2993,7 +3151,9 @@ var getLayerById = function getLayerById(store, layerId) {
|
|
|
2993
3151
|
*/
|
|
2994
3152
|
|
|
2995
3153
|
var getLayersById = createSelector(layerStore, function (store) {
|
|
2996
|
-
|
|
3154
|
+
var _a;
|
|
3155
|
+
|
|
3156
|
+
return (_a = store === null || store === void 0 ? void 0 : store.byId) !== null && _a !== void 0 ? _a : null;
|
|
2997
3157
|
}, selectorMemoizationOptions);
|
|
2998
3158
|
/**
|
|
2999
3159
|
* Retrieves all layerIds
|
|
@@ -3264,7 +3424,7 @@ var getDimensionLayerIds = createSelector(getLayersIds, getLayersById, function
|
|
|
3264
3424
|
}, []);
|
|
3265
3425
|
}, selectorMemoizationOptions);
|
|
3266
3426
|
|
|
3267
|
-
var selectors$
|
|
3427
|
+
var selectors$3 = /*#__PURE__*/Object.freeze({
|
|
3268
3428
|
__proto__: null,
|
|
3269
3429
|
getLayerById: getLayerById,
|
|
3270
3430
|
getLayersById: getLayersById,
|
|
@@ -3302,8 +3462,8 @@ var selectors$2 = /*#__PURE__*/Object.freeze({
|
|
|
3302
3462
|
* See the License for the specific language governing permissions and
|
|
3303
3463
|
* limitations under the License.
|
|
3304
3464
|
*
|
|
3305
|
-
* Copyright
|
|
3306
|
-
* Copyright
|
|
3465
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
3466
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
3307
3467
|
* */
|
|
3308
3468
|
var getUiStore = function getUiStore(store) {
|
|
3309
3469
|
if (store && store.ui) {
|
|
@@ -3428,8 +3588,11 @@ var getDialogIsLoading = createSelector(getDialogDetailsByType, function (detail
|
|
|
3428
3588
|
var getDialogError = createSelector(getDialogDetailsByType, function (details) {
|
|
3429
3589
|
return details && details.error || '';
|
|
3430
3590
|
});
|
|
3591
|
+
var getDialogFocused = createSelector(getDialogDetailsByType, function (details) {
|
|
3592
|
+
return details && details.focused || false;
|
|
3593
|
+
});
|
|
3431
3594
|
|
|
3432
|
-
var selectors$
|
|
3595
|
+
var selectors$2 = /*#__PURE__*/Object.freeze({
|
|
3433
3596
|
__proto__: null,
|
|
3434
3597
|
getUiStore: getUiStore,
|
|
3435
3598
|
getDialogDetailsByType: getDialogDetailsByType,
|
|
@@ -3440,7 +3603,8 @@ var selectors$1 = /*#__PURE__*/Object.freeze({
|
|
|
3440
3603
|
getDialogSource: getDialogSource,
|
|
3441
3604
|
getActiveWindowId: getActiveWindowId,
|
|
3442
3605
|
getDialogIsLoading: getDialogIsLoading,
|
|
3443
|
-
getDialogError: getDialogError
|
|
3606
|
+
getDialogError: getDialogError,
|
|
3607
|
+
getDialogFocused: getDialogFocused
|
|
3444
3608
|
});
|
|
3445
3609
|
|
|
3446
3610
|
/* *
|
|
@@ -3503,8 +3667,11 @@ var removeInPlace = function removeInPlace(inDraftArray, condition) {
|
|
|
3503
3667
|
var j = 0;
|
|
3504
3668
|
inDraftArray.forEach(function (e, i) {
|
|
3505
3669
|
if (!condition(e)) {
|
|
3506
|
-
|
|
3507
|
-
|
|
3670
|
+
if (i !== j) {
|
|
3671
|
+
// eslint-disable-next-line no-param-reassign
|
|
3672
|
+
inDraftArray[j] = e;
|
|
3673
|
+
}
|
|
3674
|
+
|
|
3508
3675
|
j += 1;
|
|
3509
3676
|
}
|
|
3510
3677
|
}); // eslint-disable-next-line no-param-reassign
|
|
@@ -3641,8 +3808,15 @@ var slice$4 = createSlice({
|
|
|
3641
3808
|
var _action$payload3 = action.payload,
|
|
3642
3809
|
groupId = _action$payload3.groupId,
|
|
3643
3810
|
targetId = _action$payload3.targetId;
|
|
3644
|
-
|
|
3645
|
-
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
|
+
|
|
3646
3820
|
delete draft.groups.byId[groupId].targets.byId[targetId];
|
|
3647
3821
|
removeInPlace(draft.groups.byId[groupId].targets.allIds, function (_id) {
|
|
3648
3822
|
return _id === targetId;
|
|
@@ -3882,10 +4056,16 @@ var getSyncSourceBySourceId = function getSyncSourceBySourceId(state, id) {
|
|
|
3882
4056
|
return null;
|
|
3883
4057
|
};
|
|
3884
4058
|
|
|
3885
|
-
createSelector(getSyncSourceBySourceId, function (store) {
|
|
4059
|
+
var getTime = createSelector(getSyncSourceBySourceId, function (store) {
|
|
3886
4060
|
return store && store.payloadByType && store.payloadByType[SYNCGROUPS_TYPE_SETTIME] ? store.payloadByType[SYNCGROUPS_TYPE_SETTIME].value : null;
|
|
3887
4061
|
});
|
|
3888
4062
|
|
|
4063
|
+
var selectors$1 = /*#__PURE__*/Object.freeze({
|
|
4064
|
+
__proto__: null,
|
|
4065
|
+
getSynchronizationGroupStore: getSynchronizationGroupStore,
|
|
4066
|
+
getTime: getTime
|
|
4067
|
+
});
|
|
4068
|
+
|
|
3889
4069
|
/* *
|
|
3890
4070
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3891
4071
|
* you may not use this file except in compliance with the License.
|
|
@@ -3917,11 +4097,9 @@ var genericActions = Object.assign(Object.assign({}, actions), {
|
|
|
3917
4097
|
*/
|
|
3918
4098
|
|
|
3919
4099
|
var getMapById = function getMapById(store, mapId) {
|
|
3920
|
-
|
|
3921
|
-
return store.webmap.byId[mapId];
|
|
3922
|
-
}
|
|
4100
|
+
var _a;
|
|
3923
4101
|
|
|
3924
|
-
return null;
|
|
4102
|
+
return (_a = store === null || store === void 0 ? void 0 : store.webmap) === null || _a === void 0 ? void 0 : _a.byId[mapId];
|
|
3925
4103
|
};
|
|
3926
4104
|
/**
|
|
3927
4105
|
* Gets all mapIds
|
|
@@ -3988,8 +4166,10 @@ var getIsMapPresent = createSelector(function (store, mapId) {
|
|
|
3988
4166
|
* @returns {array} returnType: array - array containing all layerIds
|
|
3989
4167
|
*/
|
|
3990
4168
|
|
|
3991
|
-
var getLayerIds = createSelector(getMapById, function (
|
|
3992
|
-
|
|
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 : [];
|
|
3993
4173
|
}, selectorMemoizationOptions);
|
|
3994
4174
|
/**
|
|
3995
4175
|
* Gets all layer states for a map
|
|
@@ -4000,10 +4180,12 @@ var getLayerIds = createSelector(getMapById, function (store) {
|
|
|
4000
4180
|
* @returns {array} returnType: array - array containing all layer states for the map
|
|
4001
4181
|
*/
|
|
4002
4182
|
|
|
4003
|
-
var getMapLayers = createSelector(getLayerIds, getLayersById, function (
|
|
4004
|
-
|
|
4005
|
-
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];
|
|
4006
4186
|
});
|
|
4187
|
+
var layersWithoutUndefined = compact(layersWithUndefined);
|
|
4188
|
+
return layersWithoutUndefined;
|
|
4007
4189
|
}, selectorMemoizationOptions);
|
|
4008
4190
|
/**
|
|
4009
4191
|
* Gets an array of baselayers ids for a map
|
|
@@ -4211,7 +4393,33 @@ var isEndTimeOverriding = createSelector(getMapById, function (store) {
|
|
|
4211
4393
|
*/
|
|
4212
4394
|
|
|
4213
4395
|
var getActiveLayerId = createSelector(getMapById, function (store) {
|
|
4214
|
-
|
|
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;
|
|
4215
4423
|
});
|
|
4216
4424
|
/**
|
|
4217
4425
|
* Gets scale of a time slider of a map
|
|
@@ -4375,8 +4583,8 @@ var getIsLayerActiveLayer = createSelector(getActiveLayerId, function (_store, _
|
|
|
4375
4583
|
* @returns {string} returnType: string - the mapId, or null if not found
|
|
4376
4584
|
*/
|
|
4377
4585
|
|
|
4378
|
-
var getMapIdFromLayerId
|
|
4379
|
-
return store
|
|
4586
|
+
var getMapIdFromLayerId = createSelector(function (store) {
|
|
4587
|
+
return store === null || store === void 0 ? void 0 : store.webmap;
|
|
4380
4588
|
}, function (_store, layerId) {
|
|
4381
4589
|
return layerId;
|
|
4382
4590
|
}, findMapIdFromLayerId, selectorMemoizationOptions);
|
|
@@ -4413,7 +4621,7 @@ var getLayerIdByLayerName = createSelector(getMapLayers, function (_store, _mapI
|
|
|
4413
4621
|
* @returns {number} returnType: index number or -1 if not found
|
|
4414
4622
|
*/
|
|
4415
4623
|
|
|
4416
|
-
var getLayerIndexByLayerId
|
|
4624
|
+
var getLayerIndexByLayerId = createSelector(getMapLayers, function (_store, _mapId, layerId) {
|
|
4417
4625
|
return layerId;
|
|
4418
4626
|
}, function (layers, layerId) {
|
|
4419
4627
|
return layers.findIndex(function (layer) {
|
|
@@ -4430,7 +4638,7 @@ var getLayerIndexByLayerId$1 = createSelector(getMapLayers, function (_store, _m
|
|
|
4430
4638
|
* @returns {object} returnType: layer, or null if not found
|
|
4431
4639
|
*/
|
|
4432
4640
|
|
|
4433
|
-
var getLayerByLayerIndex
|
|
4641
|
+
var getLayerByLayerIndex = createSelector(getMapLayers, function (_store, _mapId, layerIndex) {
|
|
4434
4642
|
return layerIndex;
|
|
4435
4643
|
}, function (layers, layerIndex) {
|
|
4436
4644
|
if (layerIndex >= 0 && layerIndex < layers.length) {
|
|
@@ -4519,7 +4727,7 @@ var getLegendId = createSelector(getMapById, function (store) {
|
|
|
4519
4727
|
* @returns {MapPreset} returnType: MapPreset
|
|
4520
4728
|
*/
|
|
4521
4729
|
|
|
4522
|
-
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) {
|
|
4523
4731
|
var _a;
|
|
4524
4732
|
|
|
4525
4733
|
var allLayers = [].concat(_toConsumableArray(baseLayers), _toConsumableArray(overLayers), _toConsumableArray(mapLayers)).map(function (_a) {
|
|
@@ -4546,6 +4754,8 @@ var getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLaye
|
|
|
4546
4754
|
return Object.assign({
|
|
4547
4755
|
layers: allLayers,
|
|
4548
4756
|
activeLayerId: activeLayerId,
|
|
4757
|
+
autoTimeStepLayerId: autoTimeStepLayerId,
|
|
4758
|
+
autoUpdateLayerId: autoUpdateLayerId,
|
|
4549
4759
|
proj: {
|
|
4550
4760
|
bbox: bbox,
|
|
4551
4761
|
srs: srs
|
|
@@ -4633,6 +4843,8 @@ var selectors = /*#__PURE__*/Object.freeze({
|
|
|
4633
4843
|
isAutoUpdating: isAutoUpdating,
|
|
4634
4844
|
isEndTimeOverriding: isEndTimeOverriding,
|
|
4635
4845
|
getActiveLayerId: getActiveLayerId,
|
|
4846
|
+
getAutoUpdateLayerId: getAutoUpdateLayerId,
|
|
4847
|
+
getAutoTimeStepLayerId: getAutoTimeStepLayerId,
|
|
4636
4848
|
getMapTimeSliderScale: getMapTimeSliderScale,
|
|
4637
4849
|
getMapTimeStep: getMapTimeStep,
|
|
4638
4850
|
getMapTimeStepWithoutDefault: getMapTimeStepWithoutDefault,
|
|
@@ -4646,10 +4858,10 @@ var selectors = /*#__PURE__*/Object.freeze({
|
|
|
4646
4858
|
isZoomControlsVisible: isZoomControlsVisible,
|
|
4647
4859
|
isTimeSliderVisible: isTimeSliderVisible,
|
|
4648
4860
|
getIsLayerActiveLayer: getIsLayerActiveLayer,
|
|
4649
|
-
getMapIdFromLayerId: getMapIdFromLayerId
|
|
4861
|
+
getMapIdFromLayerId: getMapIdFromLayerId,
|
|
4650
4862
|
getLayerIdByLayerName: getLayerIdByLayerName,
|
|
4651
|
-
getLayerIndexByLayerId: getLayerIndexByLayerId
|
|
4652
|
-
getLayerByLayerIndex: getLayerByLayerIndex
|
|
4863
|
+
getLayerIndexByLayerId: getLayerIndexByLayerId,
|
|
4864
|
+
getLayerByLayerIndex: getLayerByLayerIndex,
|
|
4653
4865
|
getAllUniqueDimensions: getAllUniqueDimensions,
|
|
4654
4866
|
getPinLocation: getPinLocation,
|
|
4655
4867
|
getDisableMapPin: getDisableMapPin,
|
|
@@ -4793,62 +5005,6 @@ var slice$3 = createSlice({
|
|
|
4793
5005
|
draft.servicePopup.variant = variant;
|
|
4794
5006
|
draft.servicePopup.serviceId = action.payload.serviceId ? action.payload.serviceId : '';
|
|
4795
5007
|
},
|
|
4796
|
-
addFiltersAndActiveServices: function addFiltersAndActiveServices(draft, action) {
|
|
4797
|
-
var _a, _b;
|
|
4798
|
-
|
|
4799
|
-
var _action$payload2 = action.payload,
|
|
4800
|
-
serviceId = _action$payload2.serviceId,
|
|
4801
|
-
serviceName = _action$payload2.serviceName,
|
|
4802
|
-
serviceUrl = _action$payload2.serviceUrl,
|
|
4803
|
-
_abstract = _action$payload2["abstract"],
|
|
4804
|
-
keywords = _action$payload2.keywords,
|
|
4805
|
-
scope = _action$payload2.scope,
|
|
4806
|
-
groups = _action$payload2.groups,
|
|
4807
|
-
isLoading = _action$payload2.isLoading;
|
|
4808
|
-
|
|
4809
|
-
if (isLoading) {
|
|
4810
|
-
// If service is still loading, add without filters
|
|
4811
|
-
draft.filters.activeServices.entities[serviceId] = {
|
|
4812
|
-
serviceId: serviceId,
|
|
4813
|
-
enabled: draft.allServicesEnabled,
|
|
4814
|
-
filterIds: [],
|
|
4815
|
-
scope: scope,
|
|
4816
|
-
serviceName: serviceName,
|
|
4817
|
-
serviceUrl: serviceUrl,
|
|
4818
|
-
"abstract": _abstract,
|
|
4819
|
-
isLoading: isLoading
|
|
4820
|
-
};
|
|
4821
|
-
}
|
|
4822
|
-
|
|
4823
|
-
if (!isLoading) {
|
|
4824
|
-
// If service is done loading, add with filters
|
|
4825
|
-
if (!((_b = (_a = draft.filters.activeServices.entities[serviceId]) === null || _a === void 0 ? void 0 : _a.filterIds) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
4826
|
-
// If the service has no filters yet, add them
|
|
4827
|
-
produceFilters(groups, FilterType.Group, draft, layerSelectFilterAdapter);
|
|
4828
|
-
produceFilters(keywords, FilterType.Keyword, draft, layerSelectFilterAdapter);
|
|
4829
|
-
}
|
|
4830
|
-
|
|
4831
|
-
var filterIds = groups.map(function (group) {
|
|
4832
|
-
return getFilterId(FilterType.Group, group);
|
|
4833
|
-
}).concat(keywords.map(function (keyword) {
|
|
4834
|
-
return getFilterId(FilterType.Keyword, keyword);
|
|
4835
|
-
}));
|
|
4836
|
-
draft.filters.activeServices.entities[serviceId] = {
|
|
4837
|
-
serviceId: serviceId,
|
|
4838
|
-
enabled: draft.allServicesEnabled,
|
|
4839
|
-
filterIds: filterIds,
|
|
4840
|
-
scope: scope,
|
|
4841
|
-
serviceName: serviceName,
|
|
4842
|
-
serviceUrl: serviceUrl,
|
|
4843
|
-
"abstract": _abstract,
|
|
4844
|
-
isLoading: isLoading
|
|
4845
|
-
};
|
|
4846
|
-
}
|
|
4847
|
-
|
|
4848
|
-
if (!draft.filters.activeServices.ids.includes(serviceId)) {
|
|
4849
|
-
draft.filters.activeServices.ids.push(serviceId);
|
|
4850
|
-
}
|
|
4851
|
-
},
|
|
4852
5008
|
layerSelectRemoveService: function layerSelectRemoveService(draft, action) {
|
|
4853
5009
|
var serviceId = action.payload.serviceId; // 1. Find a service that is to be removed
|
|
4854
5010
|
|
|
@@ -4873,9 +5029,9 @@ var slice$3 = createSlice({
|
|
|
4873
5029
|
layerSelectActiveServicesAdapter.removeOne(draft.filters.activeServices, serviceId);
|
|
4874
5030
|
},
|
|
4875
5031
|
enableActiveService: function enableActiveService(draft, action) {
|
|
4876
|
-
var _action$
|
|
4877
|
-
serviceId = _action$
|
|
4878
|
-
keywords = _action$
|
|
5032
|
+
var _action$payload2 = action.payload,
|
|
5033
|
+
serviceId = _action$payload2.serviceId,
|
|
5034
|
+
keywords = _action$payload2.filters;
|
|
4879
5035
|
draft.filters.activeServices.entities[serviceId].enabled = true;
|
|
4880
5036
|
|
|
4881
5037
|
var _iterator = _createForOfIteratorHelper(keywords),
|
|
@@ -4893,9 +5049,9 @@ var slice$3 = createSlice({
|
|
|
4893
5049
|
}
|
|
4894
5050
|
},
|
|
4895
5051
|
disableActiveService: function disableActiveService(draft, action) {
|
|
4896
|
-
var _action$
|
|
4897
|
-
serviceId = _action$
|
|
4898
|
-
keywords = _action$
|
|
5052
|
+
var _action$payload3 = action.payload,
|
|
5053
|
+
serviceId = _action$payload3.serviceId,
|
|
5054
|
+
keywords = _action$payload3.filters;
|
|
4899
5055
|
draft.filters.activeServices.entities[serviceId].enabled = false;
|
|
4900
5056
|
|
|
4901
5057
|
var _iterator2 = _createForOfIteratorHelper(keywords),
|
|
@@ -4929,6 +5085,92 @@ var slice$3 = createSlice({
|
|
|
4929
5085
|
var layer = action.payload.layer;
|
|
4930
5086
|
draft.activeLayerInfo = layer;
|
|
4931
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
|
+
});
|
|
4932
5174
|
}
|
|
4933
5175
|
});
|
|
4934
5176
|
var reducer$3 = slice$3.reducer;
|
|
@@ -4952,7 +5194,10 @@ var layerSelectActions = slice$3.actions;
|
|
|
4952
5194
|
* */
|
|
4953
5195
|
var filterLayersFromService = function filterLayersFromService(serviceId, services, filterIds, allFiltersActive, searchString) {
|
|
4954
5196
|
var mapStoreService = services[serviceId];
|
|
4955
|
-
|
|
5197
|
+
|
|
5198
|
+
if (!mapStoreService) {
|
|
5199
|
+
return [];
|
|
5200
|
+
}
|
|
4956
5201
|
|
|
4957
5202
|
if (searchString === '' && allFiltersActive) {
|
|
4958
5203
|
return mapStoreService.layers.filter(function (layer) {
|
|
@@ -5466,9 +5711,6 @@ var getSyncedMapIdsForTimeslider = createSelector(syncGroupStore, function (stor
|
|
|
5466
5711
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
5467
5712
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
5468
5713
|
* */
|
|
5469
|
-
var getLayerByLayerIndex = getLayerByLayerIndex$1,
|
|
5470
|
-
getMapIdFromLayerId = getMapIdFromLayerId$1,
|
|
5471
|
-
getLayerIndexByLayerId = getLayerIndexByLayerId$1;
|
|
5472
5714
|
/**
|
|
5473
5715
|
* Tries to find the layerId's in the other map based on the payload of the action. It works for all layer actions.
|
|
5474
5716
|
* @param state
|
|
@@ -5479,9 +5721,12 @@ var getLayerByLayerIndex = getLayerByLayerIndex$1,
|
|
|
5479
5721
|
*/
|
|
5480
5722
|
|
|
5481
5723
|
var getTargetLayerIdFromPayload = function getTargetLayerIdFromPayload(state, mapId, targetMapId, payload) {
|
|
5482
|
-
if (!payload)
|
|
5724
|
+
if (!payload) {
|
|
5725
|
+
return null;
|
|
5726
|
+
}
|
|
5483
5727
|
/* Try to find the layer for the DeleteLayerPayload, it uses layerIndex to reference the layer */
|
|
5484
5728
|
|
|
5729
|
+
|
|
5485
5730
|
if ('layerIndex' in payload) {
|
|
5486
5731
|
var targetLayer = getLayerByLayerIndex(state, targetMapId, payload.layerIndex);
|
|
5487
5732
|
return !targetLayer ? null : targetLayer.id;
|
|
@@ -5667,15 +5912,15 @@ var getMapBaseLayerActionsTargets = function getMapBaseLayerActionsTargets(state
|
|
|
5667
5912
|
});
|
|
5668
5913
|
};
|
|
5669
5914
|
|
|
5670
|
-
var _marked$
|
|
5671
|
-
_marked2$
|
|
5672
|
-
_marked3$
|
|
5673
|
-
_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),
|
|
5674
5919
|
_marked5$2 = /*#__PURE__*/regeneratorRuntime.mark(deleteLayerActionsSaga),
|
|
5675
5920
|
_marked6$1 = /*#__PURE__*/regeneratorRuntime.mark(moveLayerActionsSaga),
|
|
5676
|
-
_marked7$1 = /*#__PURE__*/regeneratorRuntime.mark(
|
|
5921
|
+
_marked7$1 = /*#__PURE__*/regeneratorRuntime.mark(setAutoLayerIdActionsSaga),
|
|
5677
5922
|
_marked8$1 = /*#__PURE__*/regeneratorRuntime.mark(mapBaseLayerActionsSaga),
|
|
5678
|
-
_marked9$1 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$
|
|
5923
|
+
_marked9$1 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$7);
|
|
5679
5924
|
var setBaseLayers = layerActions.setBaseLayers,
|
|
5680
5925
|
addLayer = layerActions.addLayer,
|
|
5681
5926
|
layerChangeDimension = layerActions.layerChangeDimension,
|
|
@@ -5723,7 +5968,7 @@ function setTimeSaga(_ref) {
|
|
|
5723
5968
|
return _context.stop();
|
|
5724
5969
|
}
|
|
5725
5970
|
}
|
|
5726
|
-
}, _marked$
|
|
5971
|
+
}, _marked$7);
|
|
5727
5972
|
}
|
|
5728
5973
|
function setBBoxSaga(_ref2) {
|
|
5729
5974
|
var payload, targets, groups;
|
|
@@ -5750,7 +5995,7 @@ function setBBoxSaga(_ref2) {
|
|
|
5750
5995
|
return _context2.stop();
|
|
5751
5996
|
}
|
|
5752
5997
|
}
|
|
5753
|
-
}, _marked2$
|
|
5998
|
+
}, _marked2$7);
|
|
5754
5999
|
}
|
|
5755
6000
|
function layerActionsSaga(_ref3) {
|
|
5756
6001
|
var payload, type, targets;
|
|
@@ -5787,7 +6032,7 @@ function layerActionsSaga(_ref3) {
|
|
|
5787
6032
|
return _context3.stop();
|
|
5788
6033
|
}
|
|
5789
6034
|
}
|
|
5790
|
-
}, _marked3$
|
|
6035
|
+
}, _marked3$5);
|
|
5791
6036
|
}
|
|
5792
6037
|
function addLayerActionsSaga(_ref4) {
|
|
5793
6038
|
var payload, type, targets;
|
|
@@ -5824,7 +6069,7 @@ function addLayerActionsSaga(_ref4) {
|
|
|
5824
6069
|
return _context4.stop();
|
|
5825
6070
|
}
|
|
5826
6071
|
}
|
|
5827
|
-
}, _marked4$
|
|
6072
|
+
}, _marked4$2);
|
|
5828
6073
|
}
|
|
5829
6074
|
function deleteLayerActionsSaga(_ref5) {
|
|
5830
6075
|
var payload, type, targets;
|
|
@@ -5900,9 +6145,9 @@ function moveLayerActionsSaga(_ref6) {
|
|
|
5900
6145
|
}
|
|
5901
6146
|
}, _marked6$1);
|
|
5902
6147
|
}
|
|
5903
|
-
function
|
|
6148
|
+
function setAutoLayerIdActionsSaga(_ref7) {
|
|
5904
6149
|
var payload, type, targets;
|
|
5905
|
-
return regeneratorRuntime.wrap(function
|
|
6150
|
+
return regeneratorRuntime.wrap(function setAutoLayerIdActionsSaga$(_context7) {
|
|
5906
6151
|
while (1) {
|
|
5907
6152
|
switch (_context7.prev = _context7.next) {
|
|
5908
6153
|
case 0:
|
|
@@ -5965,7 +6210,7 @@ function mapBaseLayerActionsSaga(_ref8) {
|
|
|
5965
6210
|
}
|
|
5966
6211
|
}, _marked8$1);
|
|
5967
6212
|
}
|
|
5968
|
-
function rootSaga$
|
|
6213
|
+
function rootSaga$7() {
|
|
5969
6214
|
return regeneratorRuntime.wrap(function rootSaga$(_context9) {
|
|
5970
6215
|
while (1) {
|
|
5971
6216
|
switch (_context9.prev = _context9.next) {
|
|
@@ -6011,7 +6256,7 @@ function rootSaga$6() {
|
|
|
6011
6256
|
|
|
6012
6257
|
case 20:
|
|
6013
6258
|
_context9.next = 22;
|
|
6014
|
-
return takeLatest(mapActions$1.
|
|
6259
|
+
return takeLatest(mapActions$1.setAutoLayerId.type, setAutoLayerIdActionsSaga);
|
|
6015
6260
|
|
|
6016
6261
|
case 22:
|
|
6017
6262
|
_context9.next = 24;
|
|
@@ -6124,11 +6369,11 @@ var sources = function sources(store) {
|
|
|
6124
6369
|
|
|
6125
6370
|
var createSyncGroupViewStateSelector = createSelector(groups, sources, createSyncGroupViewState);
|
|
6126
6371
|
|
|
6127
|
-
var _marked$
|
|
6128
|
-
_marked2$
|
|
6129
|
-
_marked3$
|
|
6130
|
-
_marked4$
|
|
6131
|
-
_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);
|
|
6132
6377
|
function updateSourceValueWhenLinkingComponentToGroupSaga(groupId, targetToUpdate) {
|
|
6133
6378
|
var group;
|
|
6134
6379
|
return regeneratorRuntime.wrap(function updateSourceValueWhenLinkingComponentToGroupSaga$(_context) {
|
|
@@ -6195,7 +6440,7 @@ function updateSourceValueWhenLinkingComponentToGroupSaga(groupId, targetToUpdat
|
|
|
6195
6440
|
return _context.stop();
|
|
6196
6441
|
}
|
|
6197
6442
|
}
|
|
6198
|
-
}, _marked$
|
|
6443
|
+
}, _marked$6);
|
|
6199
6444
|
}
|
|
6200
6445
|
function addGroupTargetSaga(_ref) {
|
|
6201
6446
|
var payload, groupId, linked, targetToUpdate;
|
|
@@ -6219,7 +6464,7 @@ function addGroupTargetSaga(_ref) {
|
|
|
6219
6464
|
return _context2.stop();
|
|
6220
6465
|
}
|
|
6221
6466
|
}
|
|
6222
|
-
}, _marked2$
|
|
6467
|
+
}, _marked2$6);
|
|
6223
6468
|
}
|
|
6224
6469
|
function linkGroupTargetSaga(_ref2) {
|
|
6225
6470
|
var payload, groupId, linked, targetToUpdate;
|
|
@@ -6243,7 +6488,7 @@ function linkGroupTargetSaga(_ref2) {
|
|
|
6243
6488
|
return _context3.stop();
|
|
6244
6489
|
}
|
|
6245
6490
|
}
|
|
6246
|
-
}, _marked3$
|
|
6491
|
+
}, _marked3$4);
|
|
6247
6492
|
}
|
|
6248
6493
|
function updateViewStateSaga() {
|
|
6249
6494
|
var viewState;
|
|
@@ -6266,10 +6511,10 @@ function updateViewStateSaga() {
|
|
|
6266
6511
|
return _context4.stop();
|
|
6267
6512
|
}
|
|
6268
6513
|
}
|
|
6269
|
-
}, _marked4$
|
|
6514
|
+
}, _marked4$1);
|
|
6270
6515
|
}
|
|
6271
6516
|
|
|
6272
|
-
function rootSaga$
|
|
6517
|
+
function rootSaga$6() {
|
|
6273
6518
|
return regeneratorRuntime.wrap(function rootSaga$(_context5) {
|
|
6274
6519
|
while (1) {
|
|
6275
6520
|
switch (_context5.prev = _context5.next) {
|
|
@@ -6322,12 +6567,12 @@ var synchronizationGroupConfig = {
|
|
|
6322
6567
|
reducersMap: {
|
|
6323
6568
|
syncronizationGroupStore: reducer$4
|
|
6324
6569
|
},
|
|
6325
|
-
sagas: [rootSaga$
|
|
6570
|
+
sagas: [rootSaga$7, rootSaga$6]
|
|
6326
6571
|
};
|
|
6327
6572
|
|
|
6328
|
-
var _marked$
|
|
6329
|
-
_marked2$
|
|
6330
|
-
_marked3$
|
|
6573
|
+
var _marked$5 = /*#__PURE__*/regeneratorRuntime.mark(registerMapUISaga),
|
|
6574
|
+
_marked2$5 = /*#__PURE__*/regeneratorRuntime.mark(unregisterUIMapSaga),
|
|
6575
|
+
_marked3$3 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$5);
|
|
6331
6576
|
function registerMapUISaga() {
|
|
6332
6577
|
var fields, source;
|
|
6333
6578
|
return regeneratorRuntime.wrap(function registerMapUISaga$(_context) {
|
|
@@ -6363,7 +6608,7 @@ function registerMapUISaga() {
|
|
|
6363
6608
|
return _context.stop();
|
|
6364
6609
|
}
|
|
6365
6610
|
}
|
|
6366
|
-
}, _marked$
|
|
6611
|
+
}, _marked$5);
|
|
6367
6612
|
}
|
|
6368
6613
|
function unregisterUIMapSaga() {
|
|
6369
6614
|
var fields, activeUI;
|
|
@@ -6415,9 +6660,9 @@ function unregisterUIMapSaga() {
|
|
|
6415
6660
|
return _context2.stop();
|
|
6416
6661
|
}
|
|
6417
6662
|
}
|
|
6418
|
-
}, _marked2$
|
|
6663
|
+
}, _marked2$5);
|
|
6419
6664
|
}
|
|
6420
|
-
function rootSaga$
|
|
6665
|
+
function rootSaga$5() {
|
|
6421
6666
|
return regeneratorRuntime.wrap(function rootSaga$(_context3) {
|
|
6422
6667
|
while (1) {
|
|
6423
6668
|
switch (_context3.prev = _context3.next) {
|
|
@@ -6434,7 +6679,7 @@ function rootSaga$4() {
|
|
|
6434
6679
|
return _context3.stop();
|
|
6435
6680
|
}
|
|
6436
6681
|
}
|
|
6437
|
-
}, _marked3$
|
|
6682
|
+
}, _marked3$3);
|
|
6438
6683
|
}
|
|
6439
6684
|
|
|
6440
6685
|
/* *
|
|
@@ -6458,7 +6703,7 @@ var uiModuleConfig = {
|
|
|
6458
6703
|
reducersMap: {
|
|
6459
6704
|
ui: reducer$6
|
|
6460
6705
|
},
|
|
6461
|
-
sagas: [rootSaga$
|
|
6706
|
+
sagas: [rootSaga$5]
|
|
6462
6707
|
};
|
|
6463
6708
|
|
|
6464
6709
|
/* *
|
|
@@ -6477,30 +6722,102 @@ var uiModuleConfig = {
|
|
|
6477
6722
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6478
6723
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
6479
6724
|
* */
|
|
6480
|
-
var
|
|
6481
|
-
|
|
6482
|
-
|
|
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
|
+
}
|
|
6739
|
+
|
|
6740
|
+
var autoTimeStepLayerIdNew = autoTimeStepLayerId && generateLayerId();
|
|
6741
|
+
var autoUpdateLayerIdNew = autoUpdateLayerId && generateLayerId();
|
|
6742
|
+
var timestepAndUpdateLayerIdsAreProvided = autoTimeStepLayerId && autoUpdateLayerId;
|
|
6743
|
+
|
|
6744
|
+
if (timestepAndUpdateLayerIdsAreProvided) {
|
|
6745
|
+
var autoTimeStepLayerIndex = layers.findIndex(function (layer) {
|
|
6746
|
+
return layer.id === autoTimeStepLayerId;
|
|
6747
|
+
});
|
|
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
|
+
}
|
|
6483
6764
|
|
|
6484
|
-
var activeLayerIndex = layers.findIndex(function (layer) {
|
|
6485
|
-
return layer.id === activeLayerId;
|
|
6486
|
-
});
|
|
6487
|
-
var layersNewIds = layers.map(function (layer, index) {
|
|
6488
|
-
if (layer.id && index === activeLayerIndex) {
|
|
6489
6765
|
return Object.assign(Object.assign({}, layer), {
|
|
6490
|
-
id:
|
|
6766
|
+
id: generateLayerId()
|
|
6491
6767
|
});
|
|
6492
|
-
}
|
|
6768
|
+
});
|
|
6493
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) {
|
|
6494
6794
|
return Object.assign(Object.assign({}, layer), {
|
|
6495
6795
|
id: generateLayerId()
|
|
6496
6796
|
});
|
|
6497
6797
|
});
|
|
6498
6798
|
return {
|
|
6499
|
-
|
|
6500
|
-
activeLayerNewId: activeLayerNewId
|
|
6799
|
+
layers: layersWithNewIds
|
|
6501
6800
|
};
|
|
6502
6801
|
};
|
|
6503
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
|
+
|
|
6504
6821
|
/* *
|
|
6505
6822
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6506
6823
|
* you may not use this file except in compliance with the License.
|
|
@@ -7328,7 +7645,11 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
|
|
|
7328
7645
|
var _this$props = this.props,
|
|
7329
7646
|
onKeyUp = _this$props.onKeyUp,
|
|
7330
7647
|
loopInterval = _this$props.redrawInterval;
|
|
7331
|
-
|
|
7648
|
+
|
|
7649
|
+
if (onKeyUp) {
|
|
7650
|
+
window.addEventListener('keyup', this.onKeyUp);
|
|
7651
|
+
}
|
|
7652
|
+
|
|
7332
7653
|
window.addEventListener('resize', this._handleWindowResize);
|
|
7333
7654
|
|
|
7334
7655
|
if (this.canvascontaineroutside && this.canvascontaineroutside.current && onKeyUp) {
|
|
@@ -7361,7 +7682,10 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
|
|
|
7361
7682
|
this.mounted = false;
|
|
7362
7683
|
window.removeEventListener('resize', this._handleWindowResize);
|
|
7363
7684
|
var onKeyUp = this.props.onKeyUp;
|
|
7364
|
-
|
|
7685
|
+
|
|
7686
|
+
if (onKeyUp) {
|
|
7687
|
+
window.removeEventListener('keyup', this.onKeyUp);
|
|
7688
|
+
}
|
|
7365
7689
|
|
|
7366
7690
|
if (this.canvas) {
|
|
7367
7691
|
this.canvas.removeEventListener('mousedown', this.handleMouseDownEvent);
|
|
@@ -7402,7 +7726,10 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
|
|
|
7402
7726
|
key: "onKeyUp",
|
|
7403
7727
|
value: function onKeyUp(event) {
|
|
7404
7728
|
var onKeyUp = this.props.onKeyUp;
|
|
7405
|
-
|
|
7729
|
+
|
|
7730
|
+
if (onKeyUp) {
|
|
7731
|
+
onKeyUp(event);
|
|
7732
|
+
}
|
|
7406
7733
|
|
|
7407
7734
|
if (this.canvascontaineroutside && this.canvascontaineroutside.current && onKeyUp) {
|
|
7408
7735
|
if (event.code === 'Escape') {
|
|
@@ -7415,7 +7742,10 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
|
|
|
7415
7742
|
value: function _documentKeyDown(event) {
|
|
7416
7743
|
if (this._isFocussed) {
|
|
7417
7744
|
var onKeyDown = this.props.onKeyDown;
|
|
7418
|
-
|
|
7745
|
+
|
|
7746
|
+
if (onKeyDown) {
|
|
7747
|
+
onKeyDown(event);
|
|
7748
|
+
}
|
|
7419
7749
|
}
|
|
7420
7750
|
}
|
|
7421
7751
|
}, {
|
|
@@ -7427,7 +7757,10 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
|
|
|
7427
7757
|
key: "startLoop",
|
|
7428
7758
|
value: function startLoop() {
|
|
7429
7759
|
var onRenderCanvas = this.props.onRenderCanvas;
|
|
7430
|
-
|
|
7760
|
+
|
|
7761
|
+
if (this.mounted === false || this.loopHasStarted === false) {
|
|
7762
|
+
return;
|
|
7763
|
+
}
|
|
7431
7764
|
|
|
7432
7765
|
if (this.canvas) {
|
|
7433
7766
|
onRenderCanvas(this.ctx, this.currentWidth, this.currentHeight, this.canvas);
|
|
@@ -7793,9 +8126,16 @@ var Legend = function Legend(_ref) {
|
|
|
7793
8126
|
}, [layerId]);
|
|
7794
8127
|
/* Should not do anything if no layer is given */
|
|
7795
8128
|
|
|
7796
|
-
if (!layer)
|
|
8129
|
+
if (!layer) {
|
|
8130
|
+
return null;
|
|
8131
|
+
}
|
|
8132
|
+
|
|
7797
8133
|
var isLayerEnabled = layer.enabled;
|
|
7798
|
-
|
|
8134
|
+
|
|
8135
|
+
if (!isLayerEnabled) {
|
|
8136
|
+
return null;
|
|
8137
|
+
}
|
|
8138
|
+
|
|
7799
8139
|
var layerOpacity = layer.opacity ? layer.opacity : 1;
|
|
7800
8140
|
/* Get the wmLayer, it has more detailed info about the WMS service,
|
|
7801
8141
|
like a title and the WMS legendgraphic url */
|
|
@@ -8051,16 +8391,16 @@ var LegendConnect = function LegendConnect(_a) {
|
|
|
8051
8391
|
}, props));
|
|
8052
8392
|
};
|
|
8053
8393
|
|
|
8054
|
-
var _marked$
|
|
8055
|
-
_marked2$
|
|
8056
|
-
_marked3$
|
|
8057
|
-
_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),
|
|
8058
8398
|
_marked5 = /*#__PURE__*/regeneratorRuntime.mark(setLayerDimensionsSaga),
|
|
8059
8399
|
_marked6 = /*#__PURE__*/regeneratorRuntime.mark(toggleAutoUpdateSaga),
|
|
8060
8400
|
_marked7 = /*#__PURE__*/regeneratorRuntime.mark(handleBaseLayersSaga),
|
|
8061
8401
|
_marked8 = /*#__PURE__*/regeneratorRuntime.mark(setMapPresetSaga),
|
|
8062
8402
|
_marked9 = /*#__PURE__*/regeneratorRuntime.mark(unregisterMapSaga),
|
|
8063
|
-
_marked10 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$
|
|
8403
|
+
_marked10 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$4);
|
|
8064
8404
|
|
|
8065
8405
|
var generateTimeList = function generateTimeList(start, end, interval) {
|
|
8066
8406
|
var timeList = [];
|
|
@@ -8123,7 +8463,7 @@ function startAnimationSaga(_ref) {
|
|
|
8123
8463
|
return _context.stop();
|
|
8124
8464
|
}
|
|
8125
8465
|
}
|
|
8126
|
-
}, _marked$
|
|
8466
|
+
}, _marked$4);
|
|
8127
8467
|
}
|
|
8128
8468
|
function stopAnimationSaga(_ref2) {
|
|
8129
8469
|
var payload, mapId;
|
|
@@ -8141,7 +8481,7 @@ function stopAnimationSaga(_ref2) {
|
|
|
8141
8481
|
return _context2.stop();
|
|
8142
8482
|
}
|
|
8143
8483
|
}
|
|
8144
|
-
}, _marked2$
|
|
8484
|
+
}, _marked2$4);
|
|
8145
8485
|
}
|
|
8146
8486
|
function deleteLayerSaga(_ref3) {
|
|
8147
8487
|
var payload, mapId, layers;
|
|
@@ -8172,7 +8512,7 @@ function deleteLayerSaga(_ref3) {
|
|
|
8172
8512
|
return _context3.stop();
|
|
8173
8513
|
}
|
|
8174
8514
|
}
|
|
8175
|
-
}, _marked3$
|
|
8515
|
+
}, _marked3$2);
|
|
8176
8516
|
}
|
|
8177
8517
|
function updateAnimation(mapId, maxValue) {
|
|
8178
8518
|
var animationStart, animationStartUnix, animationEnd, animationEndUnix, t, deltaT, start, end, isAnimating$1, timeStep;
|
|
@@ -8239,10 +8579,10 @@ function updateAnimation(mapId, maxValue) {
|
|
|
8239
8579
|
return _context4.stop();
|
|
8240
8580
|
}
|
|
8241
8581
|
}
|
|
8242
|
-
}, _marked4
|
|
8582
|
+
}, _marked4);
|
|
8243
8583
|
}
|
|
8244
8584
|
function setLayerDimensionsSaga(_ref4) {
|
|
8245
|
-
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;
|
|
8246
8586
|
return regeneratorRuntime.wrap(function setLayerDimensionsSaga$(_context5) {
|
|
8247
8587
|
while (1) {
|
|
8248
8588
|
switch (_context5.prev = _context5.next) {
|
|
@@ -8279,10 +8619,10 @@ function setLayerDimensionsSaga(_ref4) {
|
|
|
8279
8619
|
});
|
|
8280
8620
|
mapId = layer.mapId;
|
|
8281
8621
|
_context5.next = 15;
|
|
8282
|
-
return select(
|
|
8622
|
+
return select(getAutoUpdateLayerId, mapId);
|
|
8283
8623
|
|
|
8284
8624
|
case 15:
|
|
8285
|
-
|
|
8625
|
+
autoUpdateLayerId = _context5.sent;
|
|
8286
8626
|
_context5.next = 18;
|
|
8287
8627
|
return select(isAutoUpdating, mapId);
|
|
8288
8628
|
|
|
@@ -8304,49 +8644,20 @@ function setLayerDimensionsSaga(_ref4) {
|
|
|
8304
8644
|
case 27:
|
|
8305
8645
|
isAnimating$1 = _context5.sent;
|
|
8306
8646
|
webmapInstance = getWMJSMapById(mapId);
|
|
8307
|
-
|
|
8308
|
-
_context5.next = 32;
|
|
8309
|
-
return select(getMapTimeStepWithoutDefault, mapId);
|
|
8310
|
-
|
|
8311
|
-
case 32:
|
|
8312
|
-
timeStep = _context5.sent;
|
|
8313
|
-
_context5.next = 35;
|
|
8314
|
-
return select(isTimestepAuto, mapId);
|
|
8315
|
-
|
|
8316
|
-
case 35:
|
|
8317
|
-
isTimestepAuto$1 = _context5.sent;
|
|
8318
|
-
|
|
8319
|
-
if (!(isTimestepAuto$1 && isActiveLayer && timeStep === undefined && newTimeDimension)) {
|
|
8320
|
-
_context5.next = 41;
|
|
8321
|
-
break;
|
|
8322
|
-
}
|
|
8323
|
-
|
|
8324
|
-
newTimeStep = getActiveLayerTimeStep(newTimeDimension);
|
|
8325
|
-
|
|
8326
|
-
if (!newTimeStep) {
|
|
8327
|
-
_context5.next = 41;
|
|
8328
|
-
break;
|
|
8329
|
-
}
|
|
8330
|
-
|
|
8331
|
-
_context5.next = 41;
|
|
8332
|
-
return put(mapActions$1.setTimeStep({
|
|
8333
|
-
mapId: mapId,
|
|
8334
|
-
timeStep: newTimeStep
|
|
8335
|
-
}));
|
|
8647
|
+
isAutoUpdateLayer = layerId === autoUpdateLayerId;
|
|
8336
8648
|
|
|
8337
|
-
|
|
8338
|
-
if (!(isActiveLayer && // only update the active layer
|
|
8649
|
+
if (!(isAutoUpdateLayer && // only update the active layer
|
|
8339
8650
|
shouldAutoUpdate && newTimeDimension && newTimeDimension.maxValue && prevTimeDimension && prevTimeDimension.currentValue && prevTimeDimension.currentValue !== newTimeDimension.maxValue && !shouldEndTimeOverride)) {
|
|
8340
|
-
_context5.next =
|
|
8651
|
+
_context5.next = 44;
|
|
8341
8652
|
break;
|
|
8342
8653
|
}
|
|
8343
8654
|
|
|
8344
8655
|
if (isAnimating$1) {
|
|
8345
|
-
_context5.next =
|
|
8656
|
+
_context5.next = 34;
|
|
8346
8657
|
break;
|
|
8347
8658
|
}
|
|
8348
8659
|
|
|
8349
|
-
_context5.next =
|
|
8660
|
+
_context5.next = 34;
|
|
8350
8661
|
return put(layerActions.layerChangeDimension({
|
|
8351
8662
|
layerId: layerId,
|
|
8352
8663
|
origin: LayerActionOrigin.setLayerDimensionSaga,
|
|
@@ -8356,19 +8667,19 @@ function setLayerDimensionsSaga(_ref4) {
|
|
|
8356
8667
|
}
|
|
8357
8668
|
}));
|
|
8358
8669
|
|
|
8359
|
-
case
|
|
8360
|
-
_context5.next =
|
|
8670
|
+
case 34:
|
|
8671
|
+
_context5.next = 36;
|
|
8361
8672
|
return select(getSyncedMapIdsForTimeslider);
|
|
8362
8673
|
|
|
8363
|
-
case
|
|
8674
|
+
case 36:
|
|
8364
8675
|
syncedMapIds = _context5.sent;
|
|
8365
8676
|
|
|
8366
8677
|
if (!syncedMapIds) {
|
|
8367
|
-
_context5.next =
|
|
8678
|
+
_context5.next = 40;
|
|
8368
8679
|
break;
|
|
8369
8680
|
}
|
|
8370
8681
|
|
|
8371
|
-
_context5.next =
|
|
8682
|
+
_context5.next = 40;
|
|
8372
8683
|
return all(syncedMapIds.map(function (syncedMapId) {
|
|
8373
8684
|
return put(setTime({
|
|
8374
8685
|
origin: 'mapStore saga',
|
|
@@ -8377,42 +8688,42 @@ function setLayerDimensionsSaga(_ref4) {
|
|
|
8377
8688
|
}));
|
|
8378
8689
|
}));
|
|
8379
8690
|
|
|
8380
|
-
case
|
|
8381
|
-
_context5.next =
|
|
8691
|
+
case 40:
|
|
8692
|
+
_context5.next = 42;
|
|
8382
8693
|
return call(updateAnimation, mapId, newTimeDimension.maxValue);
|
|
8383
8694
|
|
|
8384
|
-
case
|
|
8385
|
-
_context5.next =
|
|
8695
|
+
case 42:
|
|
8696
|
+
_context5.next = 47;
|
|
8386
8697
|
break;
|
|
8387
8698
|
|
|
8388
|
-
case
|
|
8699
|
+
case 44:
|
|
8389
8700
|
if (!(isAnimating$1 && !webmapInstance.isAnimating && newTimeDimension && newTimeDimension.maxValue && !shouldEndTimeOverride)) {
|
|
8390
|
-
_context5.next =
|
|
8701
|
+
_context5.next = 47;
|
|
8391
8702
|
break;
|
|
8392
8703
|
}
|
|
8393
8704
|
|
|
8394
|
-
_context5.next =
|
|
8705
|
+
_context5.next = 47;
|
|
8395
8706
|
return call(updateAnimation, mapId, newTimeDimension.maxValue);
|
|
8396
8707
|
|
|
8397
|
-
case
|
|
8398
|
-
_context5.next =
|
|
8708
|
+
case 47:
|
|
8709
|
+
_context5.next = 52;
|
|
8399
8710
|
break;
|
|
8400
8711
|
|
|
8401
|
-
case
|
|
8402
|
-
_context5.prev =
|
|
8712
|
+
case 49:
|
|
8713
|
+
_context5.prev = 49;
|
|
8403
8714
|
_context5.t0 = _context5["catch"](1);
|
|
8404
8715
|
// eslint-disable-next-line no-console
|
|
8405
8716
|
console.warn(_context5.t0);
|
|
8406
8717
|
|
|
8407
|
-
case
|
|
8718
|
+
case 52:
|
|
8408
8719
|
case "end":
|
|
8409
8720
|
return _context5.stop();
|
|
8410
8721
|
}
|
|
8411
8722
|
}
|
|
8412
|
-
}, _marked5, null, [[1,
|
|
8723
|
+
}, _marked5, null, [[1, 49]]);
|
|
8413
8724
|
}
|
|
8414
8725
|
function toggleAutoUpdateSaga(_ref5) {
|
|
8415
|
-
var payload, shouldAutoUpdate, mapId,
|
|
8726
|
+
var payload, shouldAutoUpdate, mapId, autoUpdateLayerId, timeDimension, syncedMapIds, payloads;
|
|
8416
8727
|
return regeneratorRuntime.wrap(function toggleAutoUpdateSaga$(_context6) {
|
|
8417
8728
|
while (1) {
|
|
8418
8729
|
switch (_context6.prev = _context6.next) {
|
|
@@ -8427,12 +8738,12 @@ function toggleAutoUpdateSaga(_ref5) {
|
|
|
8427
8738
|
}
|
|
8428
8739
|
|
|
8429
8740
|
_context6.next = 6;
|
|
8430
|
-
return select(
|
|
8741
|
+
return select(getAutoUpdateLayerId, mapId);
|
|
8431
8742
|
|
|
8432
8743
|
case 6:
|
|
8433
|
-
|
|
8744
|
+
autoUpdateLayerId = _context6.sent;
|
|
8434
8745
|
_context6.next = 9;
|
|
8435
|
-
return select(getLayerTimeDimension,
|
|
8746
|
+
return select(getLayerTimeDimension, autoUpdateLayerId);
|
|
8436
8747
|
|
|
8437
8748
|
case 9:
|
|
8438
8749
|
timeDimension = _context6.sent;
|
|
@@ -8444,7 +8755,7 @@ function toggleAutoUpdateSaga(_ref5) {
|
|
|
8444
8755
|
|
|
8445
8756
|
_context6.next = 13;
|
|
8446
8757
|
return put(layerActions.layerChangeDimension({
|
|
8447
|
-
layerId:
|
|
8758
|
+
layerId: autoUpdateLayerId,
|
|
8448
8759
|
origin: LayerActionOrigin.toggleAutoUpdateSaga,
|
|
8449
8760
|
dimension: {
|
|
8450
8761
|
name: 'time',
|
|
@@ -8572,7 +8883,7 @@ function handleBaseLayersSaga(mapId, baseLayers) {
|
|
|
8572
8883
|
}, _marked7);
|
|
8573
8884
|
}
|
|
8574
8885
|
function setMapPresetSaga(_ref6) {
|
|
8575
|
-
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;
|
|
8576
8887
|
|
|
8577
8888
|
return regeneratorRuntime.wrap(function setMapPresetSaga$(_context8) {
|
|
8578
8889
|
while (1) {
|
|
@@ -8584,41 +8895,54 @@ function setMapPresetSaga(_ref6) {
|
|
|
8584
8895
|
mapPreset = initialProps.mapPreset;
|
|
8585
8896
|
|
|
8586
8897
|
if (!mapPreset) {
|
|
8587
|
-
_context8.next =
|
|
8898
|
+
_context8.next = 122;
|
|
8588
8899
|
break;
|
|
8589
8900
|
}
|
|
8590
8901
|
|
|
8591
|
-
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;
|
|
8592
8903
|
_filterLayers = filterLayers(layers), mapLayers = _filterLayers.mapLayers, baseLayers = _filterLayers.baseLayers, overLayers = _filterLayers.overLayers;
|
|
8593
8904
|
|
|
8594
8905
|
if (!layers) {
|
|
8595
|
-
_context8.next =
|
|
8906
|
+
_context8.next = 20;
|
|
8596
8907
|
break;
|
|
8597
8908
|
}
|
|
8598
8909
|
|
|
8599
|
-
|
|
8600
|
-
|
|
8910
|
+
// make sure all layers have a unique id before going forward
|
|
8911
|
+
autoTimeStepLayerIdNew = autoTimeStepLayerId;
|
|
8912
|
+
autoUpdateLayerIdNew = autoUpdateLayerId;
|
|
8913
|
+
onlyActiveLayerIdIsSet = !autoTimeStepLayerId && !autoUpdateLayerId && activeLayerId;
|
|
8601
8914
|
|
|
8602
|
-
|
|
8603
|
-
|
|
8604
|
-
|
|
8605
|
-
|
|
8606
|
-
|
|
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;
|
|
8607
8930
|
return put(layerActions.setLayers({
|
|
8608
8931
|
mapId: mapId,
|
|
8609
|
-
layers:
|
|
8932
|
+
layers: newLayerIds.layers
|
|
8610
8933
|
}));
|
|
8611
8934
|
|
|
8612
|
-
case
|
|
8935
|
+
case 17:
|
|
8613
8936
|
// set active layer if given otherwise to first layer
|
|
8614
|
-
|
|
8615
|
-
_context8.next =
|
|
8616
|
-
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({
|
|
8617
8940
|
mapId: mapId,
|
|
8618
|
-
|
|
8941
|
+
autoTimeStepLayerId: (_b = newLayerIds.autoTimeStepLayerId) !== null && _b !== void 0 ? _b : firstLayerId,
|
|
8942
|
+
autoUpdateLayerId: (_c = newLayerIds.autoUpdateLayerId) !== null && _c !== void 0 ? _c : firstLayerId
|
|
8619
8943
|
}));
|
|
8620
8944
|
|
|
8621
|
-
case
|
|
8945
|
+
case 20:
|
|
8622
8946
|
// sets (default) baseLayers
|
|
8623
8947
|
baseLayersWithDefaultLayer = baseLayers.length ? baseLayers : [baseLayerGrey$1]; // sets (default) overLayers
|
|
8624
8948
|
|
|
@@ -8628,206 +8952,206 @@ function setMapPresetSaga(_ref6) {
|
|
|
8628
8952
|
id: generateLayerId()
|
|
8629
8953
|
});
|
|
8630
8954
|
});
|
|
8631
|
-
_context8.next =
|
|
8955
|
+
_context8.next = 25;
|
|
8632
8956
|
return call(handleBaseLayersSaga, mapId, allBaseLayers);
|
|
8633
8957
|
|
|
8634
|
-
case
|
|
8958
|
+
case 25:
|
|
8635
8959
|
if (!proj) {
|
|
8636
|
-
_context8.next =
|
|
8960
|
+
_context8.next = 28;
|
|
8637
8961
|
break;
|
|
8638
8962
|
}
|
|
8639
8963
|
|
|
8640
|
-
_context8.next =
|
|
8964
|
+
_context8.next = 28;
|
|
8641
8965
|
return put(mapActions$1.setBbox({
|
|
8642
8966
|
mapId: mapId,
|
|
8643
8967
|
bbox: proj === null || proj === void 0 ? void 0 : proj.bbox,
|
|
8644
8968
|
srs: proj === null || proj === void 0 ? void 0 : proj.srs
|
|
8645
8969
|
}));
|
|
8646
8970
|
|
|
8647
|
-
case
|
|
8971
|
+
case 28:
|
|
8648
8972
|
animationLength = animationPayload && animationPayload.duration;
|
|
8649
8973
|
animationEndTime = animationPayload && animationPayload.endTime && isAnimationEndTimeValid(animationPayload.endTime) && animationPayload.endTime;
|
|
8650
8974
|
shouldEndtimeOverride = animationPayload ? animationPayload.shouldEndtimeOverride : false;
|
|
8651
8975
|
|
|
8652
8976
|
if (!shouldEndtimeOverride) {
|
|
8653
|
-
_context8.next =
|
|
8977
|
+
_context8.next = 34;
|
|
8654
8978
|
break;
|
|
8655
8979
|
}
|
|
8656
8980
|
|
|
8657
|
-
_context8.next =
|
|
8981
|
+
_context8.next = 34;
|
|
8658
8982
|
return put(mapActions$1.setEndTimeOverriding({
|
|
8659
8983
|
mapId: mapId,
|
|
8660
8984
|
shouldEndtimeOverride: shouldEndtimeOverride
|
|
8661
8985
|
}));
|
|
8662
8986
|
|
|
8663
|
-
case
|
|
8987
|
+
case 34:
|
|
8664
8988
|
if (!(shouldAutoUpdate !== undefined && !animationEndTime)) {
|
|
8665
|
-
_context8.next =
|
|
8989
|
+
_context8.next = 37;
|
|
8666
8990
|
break;
|
|
8667
8991
|
}
|
|
8668
8992
|
|
|
8669
|
-
_context8.next =
|
|
8993
|
+
_context8.next = 37;
|
|
8670
8994
|
return put(mapActions$1.toggleAutoUpdate({
|
|
8671
8995
|
mapId: mapId,
|
|
8672
8996
|
shouldAutoUpdate: shouldAutoUpdate
|
|
8673
8997
|
}));
|
|
8674
8998
|
|
|
8675
|
-
case
|
|
8999
|
+
case 37:
|
|
8676
9000
|
if (!(showTimeSlider !== undefined)) {
|
|
8677
|
-
_context8.next =
|
|
9001
|
+
_context8.next = 40;
|
|
8678
9002
|
break;
|
|
8679
9003
|
}
|
|
8680
9004
|
|
|
8681
|
-
_context8.next =
|
|
9005
|
+
_context8.next = 40;
|
|
8682
9006
|
return put(mapActions$1.toggleTimeSliderIsVisible({
|
|
8683
9007
|
mapId: mapId,
|
|
8684
9008
|
isTimeSliderVisible: showTimeSlider
|
|
8685
9009
|
}));
|
|
8686
9010
|
|
|
8687
|
-
case
|
|
9011
|
+
case 40:
|
|
8688
9012
|
if (!(shouldShowZoomControls !== undefined)) {
|
|
8689
|
-
_context8.next =
|
|
9013
|
+
_context8.next = 43;
|
|
8690
9014
|
break;
|
|
8691
9015
|
}
|
|
8692
9016
|
|
|
8693
|
-
_context8.next =
|
|
9017
|
+
_context8.next = 43;
|
|
8694
9018
|
return put(mapActions$1.toggleZoomControls({
|
|
8695
9019
|
mapId: mapId,
|
|
8696
9020
|
shouldShowZoomControls: shouldShowZoomControls
|
|
8697
9021
|
}));
|
|
8698
9022
|
|
|
8699
|
-
case
|
|
9023
|
+
case 43:
|
|
8700
9024
|
if (!(displayMapPin !== undefined)) {
|
|
8701
|
-
_context8.next =
|
|
9025
|
+
_context8.next = 46;
|
|
8702
9026
|
break;
|
|
8703
9027
|
}
|
|
8704
9028
|
|
|
8705
|
-
_context8.next =
|
|
9029
|
+
_context8.next = 46;
|
|
8706
9030
|
return put(mapActions$1.toggleMapPinIsVisible({
|
|
8707
9031
|
mapId: mapId,
|
|
8708
9032
|
displayMapPin: displayMapPin
|
|
8709
9033
|
}));
|
|
8710
9034
|
|
|
8711
|
-
case
|
|
9035
|
+
case 46:
|
|
8712
9036
|
// sets timestep by interval of animationPayload
|
|
8713
9037
|
interval = animationPayload && animationPayload.interval;
|
|
8714
9038
|
|
|
8715
9039
|
if (!interval) {
|
|
8716
|
-
_context8.next =
|
|
9040
|
+
_context8.next = 50;
|
|
8717
9041
|
break;
|
|
8718
9042
|
}
|
|
8719
9043
|
|
|
8720
|
-
_context8.next =
|
|
9044
|
+
_context8.next = 50;
|
|
8721
9045
|
return put(mapActions$1.setTimeStep({
|
|
8722
9046
|
mapId: mapId,
|
|
8723
9047
|
timeStep: interval
|
|
8724
9048
|
}));
|
|
8725
9049
|
|
|
8726
|
-
case
|
|
9050
|
+
case 50:
|
|
8727
9051
|
if (!animationEndTime) {
|
|
8728
|
-
_context8.next =
|
|
9052
|
+
_context8.next = 59;
|
|
8729
9053
|
break;
|
|
8730
9054
|
}
|
|
8731
9055
|
|
|
8732
|
-
_context8.next =
|
|
9056
|
+
_context8.next = 53;
|
|
8733
9057
|
return put(mapActions$1.setAnimationEndTime({
|
|
8734
9058
|
mapId: mapId,
|
|
8735
9059
|
animationEndTime: getAnimationEndTime(animationEndTime)
|
|
8736
9060
|
}));
|
|
8737
9061
|
|
|
8738
|
-
case
|
|
9062
|
+
case 53:
|
|
8739
9063
|
if (animationLength) {
|
|
8740
|
-
_context8.next =
|
|
9064
|
+
_context8.next = 59;
|
|
8741
9065
|
break;
|
|
8742
9066
|
}
|
|
8743
9067
|
|
|
8744
|
-
_context8.next =
|
|
9068
|
+
_context8.next = 56;
|
|
8745
9069
|
return select(getAnimationEndTime$1, mapId);
|
|
8746
9070
|
|
|
8747
|
-
case
|
|
9071
|
+
case 56:
|
|
8748
9072
|
animationEnd = _context8.sent;
|
|
8749
|
-
_context8.next =
|
|
9073
|
+
_context8.next = 59;
|
|
8750
9074
|
return put(mapActions$1.setAnimationStartTime({
|
|
8751
9075
|
mapId: mapId,
|
|
8752
9076
|
animationStartTime: moment(animationEnd).subtract(5 * 60, 'minutes') // set to default of 5 hours
|
|
8753
9077
|
.toISOString()
|
|
8754
9078
|
}));
|
|
8755
9079
|
|
|
8756
|
-
case
|
|
9080
|
+
case 59:
|
|
8757
9081
|
if (!animationLength) {
|
|
8758
|
-
_context8.next =
|
|
9082
|
+
_context8.next = 65;
|
|
8759
9083
|
break;
|
|
8760
9084
|
}
|
|
8761
9085
|
|
|
8762
|
-
_context8.next =
|
|
9086
|
+
_context8.next = 62;
|
|
8763
9087
|
return select(getAnimationEndTime$1, mapId);
|
|
8764
9088
|
|
|
8765
|
-
case
|
|
9089
|
+
case 62:
|
|
8766
9090
|
_animationEnd = _context8.sent;
|
|
8767
|
-
_context8.next =
|
|
9091
|
+
_context8.next = 65;
|
|
8768
9092
|
return put(mapActions$1.setAnimationStartTime({
|
|
8769
9093
|
mapId: mapId,
|
|
8770
9094
|
animationStartTime: moment(_animationEnd).subtract(animationLength, 'minutes').toISOString()
|
|
8771
9095
|
}));
|
|
8772
9096
|
|
|
8773
|
-
case
|
|
9097
|
+
case 65:
|
|
8774
9098
|
if (!(animationPayload && animationPayload.speed)) {
|
|
8775
|
-
_context8.next =
|
|
9099
|
+
_context8.next = 68;
|
|
8776
9100
|
break;
|
|
8777
9101
|
}
|
|
8778
9102
|
|
|
8779
|
-
_context8.next =
|
|
9103
|
+
_context8.next = 68;
|
|
8780
9104
|
return put(mapActions$1.setAnimationDelay({
|
|
8781
9105
|
mapId: mapId,
|
|
8782
9106
|
animationDelay: getSpeedDelay(animationPayload.speed)
|
|
8783
9107
|
}));
|
|
8784
9108
|
|
|
8785
|
-
case
|
|
9109
|
+
case 68:
|
|
8786
9110
|
if (!(shouldAnimate === true)) {
|
|
8787
|
-
_context8.next =
|
|
9111
|
+
_context8.next = 93;
|
|
8788
9112
|
break;
|
|
8789
9113
|
}
|
|
8790
9114
|
|
|
8791
9115
|
duration = animationPayload && animationPayload.duration ? animationPayload.duration : 5 * 60; // set to default of 5 hours
|
|
8792
9116
|
|
|
8793
9117
|
if (!(shouldEndtimeOverride && animationEndTime)) {
|
|
8794
|
-
_context8.next =
|
|
9118
|
+
_context8.next = 76;
|
|
8795
9119
|
break;
|
|
8796
9120
|
}
|
|
8797
9121
|
|
|
8798
|
-
_context8.next =
|
|
9122
|
+
_context8.next = 73;
|
|
8799
9123
|
return select(getAnimationEndTime$1, mapId);
|
|
8800
9124
|
|
|
8801
|
-
case
|
|
9125
|
+
case 73:
|
|
8802
9126
|
_context8.t0 = _context8.sent;
|
|
8803
|
-
_context8.next =
|
|
9127
|
+
_context8.next = 77;
|
|
8804
9128
|
break;
|
|
8805
9129
|
|
|
8806
|
-
case
|
|
9130
|
+
case 76:
|
|
8807
9131
|
_context8.t0 = moment.utc().format(dateFormat);
|
|
8808
9132
|
|
|
8809
|
-
case
|
|
9133
|
+
case 77:
|
|
8810
9134
|
_animationEnd2 = _context8.t0;
|
|
8811
9135
|
|
|
8812
9136
|
if (!(shouldEndtimeOverride && animationLength)) {
|
|
8813
|
-
_context8.next =
|
|
9137
|
+
_context8.next = 84;
|
|
8814
9138
|
break;
|
|
8815
9139
|
}
|
|
8816
9140
|
|
|
8817
|
-
_context8.next =
|
|
9141
|
+
_context8.next = 81;
|
|
8818
9142
|
return select(getAnimationStartTime, mapId);
|
|
8819
9143
|
|
|
8820
|
-
case
|
|
9144
|
+
case 81:
|
|
8821
9145
|
_context8.t1 = _context8.sent;
|
|
8822
|
-
_context8.next =
|
|
9146
|
+
_context8.next = 85;
|
|
8823
9147
|
break;
|
|
8824
9148
|
|
|
8825
|
-
case
|
|
9149
|
+
case 84:
|
|
8826
9150
|
_context8.t1 = moment.utc().subtract(duration, 'minutes').format(dateFormat);
|
|
8827
9151
|
|
|
8828
|
-
case
|
|
9152
|
+
case 85:
|
|
8829
9153
|
animationStart = _context8.t1;
|
|
8830
|
-
_context8.next =
|
|
9154
|
+
_context8.next = 88;
|
|
8831
9155
|
return put(mapActions$1.mapStartAnimation({
|
|
8832
9156
|
mapId: mapId,
|
|
8833
9157
|
start: animationStart,
|
|
@@ -8835,119 +9159,119 @@ function setMapPresetSaga(_ref6) {
|
|
|
8835
9159
|
interval: interval || animationIntervalDefault
|
|
8836
9160
|
}));
|
|
8837
9161
|
|
|
8838
|
-
case
|
|
9162
|
+
case 88:
|
|
8839
9163
|
if (!interval) {
|
|
8840
|
-
_context8.next =
|
|
9164
|
+
_context8.next = 91;
|
|
8841
9165
|
break;
|
|
8842
9166
|
}
|
|
8843
9167
|
|
|
8844
|
-
_context8.next =
|
|
9168
|
+
_context8.next = 91;
|
|
8845
9169
|
return put(mapActions$1.toggleTimestepAuto({
|
|
8846
9170
|
mapId: mapId,
|
|
8847
9171
|
timestepAuto: false
|
|
8848
9172
|
}));
|
|
8849
9173
|
|
|
8850
|
-
case
|
|
8851
|
-
_context8.next =
|
|
9174
|
+
case 91:
|
|
9175
|
+
_context8.next = 96;
|
|
8852
9176
|
break;
|
|
8853
9177
|
|
|
8854
|
-
case
|
|
9178
|
+
case 93:
|
|
8855
9179
|
if (!(toggleTimestepAuto !== undefined)) {
|
|
8856
|
-
_context8.next =
|
|
9180
|
+
_context8.next = 96;
|
|
8857
9181
|
break;
|
|
8858
9182
|
}
|
|
8859
9183
|
|
|
8860
|
-
_context8.next =
|
|
9184
|
+
_context8.next = 96;
|
|
8861
9185
|
return put(mapActions$1.toggleTimestepAuto({
|
|
8862
9186
|
mapId: mapId,
|
|
8863
9187
|
timestepAuto: toggleTimestepAuto
|
|
8864
9188
|
}));
|
|
8865
9189
|
|
|
8866
|
-
case
|
|
9190
|
+
case 96:
|
|
8867
9191
|
// show legend
|
|
8868
9192
|
shouldOpenLegend = shouldShowLegend !== undefined ? shouldShowLegend : IS_LEGEND_OPEN_BY_DEFAULT;
|
|
8869
|
-
_context8.next =
|
|
9193
|
+
_context8.next = 99;
|
|
8870
9194
|
return select(getLegendId, mapId);
|
|
8871
9195
|
|
|
8872
|
-
case
|
|
9196
|
+
case 99:
|
|
8873
9197
|
legendId = _context8.sent;
|
|
8874
9198
|
|
|
8875
9199
|
if (!legendId) {
|
|
8876
|
-
_context8.next =
|
|
9200
|
+
_context8.next = 103;
|
|
8877
9201
|
break;
|
|
8878
9202
|
}
|
|
8879
9203
|
|
|
8880
|
-
_context8.next =
|
|
9204
|
+
_context8.next = 103;
|
|
8881
9205
|
return put(uiActions.setToggleOpenDialog({
|
|
8882
9206
|
type: legendId,
|
|
8883
9207
|
setOpen: shouldOpenLegend
|
|
8884
9208
|
}));
|
|
8885
9209
|
|
|
8886
|
-
case
|
|
9210
|
+
case 103:
|
|
8887
9211
|
if (!dockedLayerManagerSize) {
|
|
8888
|
-
_context8.next =
|
|
9212
|
+
_context8.next = 106;
|
|
8889
9213
|
break;
|
|
8890
9214
|
}
|
|
8891
9215
|
|
|
8892
|
-
_context8.next =
|
|
9216
|
+
_context8.next = 106;
|
|
8893
9217
|
return put(mapActions$1.setDockedLayerManagerSize({
|
|
8894
9218
|
mapId: mapId,
|
|
8895
9219
|
dockedLayerManagerSize: dockedLayerManagerSize
|
|
8896
9220
|
}));
|
|
8897
9221
|
|
|
8898
|
-
case
|
|
9222
|
+
case 106:
|
|
8899
9223
|
if (!(animationEndTime && (shouldEndtimeOverride || !(shouldAutoUpdate || shouldAnimate)))) {
|
|
8900
|
-
_context8.next =
|
|
9224
|
+
_context8.next = 122;
|
|
8901
9225
|
break;
|
|
8902
9226
|
}
|
|
8903
9227
|
|
|
8904
9228
|
fiveMinuteDelayForAnimation = 1000 * 60 * 5;
|
|
8905
|
-
_context8.next =
|
|
9229
|
+
_context8.next = 110;
|
|
8906
9230
|
return delay(fiveMinuteDelayForAnimation);
|
|
8907
9231
|
|
|
8908
|
-
case
|
|
8909
|
-
_context8.next =
|
|
9232
|
+
case 110:
|
|
9233
|
+
_context8.next = 112;
|
|
8910
9234
|
return select(getAnimationEndTime$1, mapId);
|
|
8911
9235
|
|
|
8912
|
-
case
|
|
9236
|
+
case 112:
|
|
8913
9237
|
_animationEnd3 = _context8.sent;
|
|
8914
|
-
_context8.next =
|
|
9238
|
+
_context8.next = 115;
|
|
8915
9239
|
return put(mapActions$1.setAnimationEndTime({
|
|
8916
9240
|
mapId: mapId,
|
|
8917
9241
|
animationEndTime: moment(_animationEnd3).add(5, 'minutes').toISOString()
|
|
8918
9242
|
}));
|
|
8919
9243
|
|
|
8920
|
-
case
|
|
8921
|
-
_context8.next =
|
|
9244
|
+
case 115:
|
|
9245
|
+
_context8.next = 117;
|
|
8922
9246
|
return select(getAnimationStartTime, mapId);
|
|
8923
9247
|
|
|
8924
|
-
case
|
|
9248
|
+
case 117:
|
|
8925
9249
|
_animationStart = _context8.sent;
|
|
8926
|
-
_context8.next =
|
|
9250
|
+
_context8.next = 120;
|
|
8927
9251
|
return put(mapActions$1.setAnimationStartTime({
|
|
8928
9252
|
mapId: mapId,
|
|
8929
9253
|
animationStartTime: moment(_animationStart).add(5, 'minutes').toISOString()
|
|
8930
9254
|
}));
|
|
8931
9255
|
|
|
8932
|
-
case 118:
|
|
8933
|
-
_context8.next = 104;
|
|
8934
|
-
break;
|
|
8935
|
-
|
|
8936
9256
|
case 120:
|
|
8937
|
-
_context8.next =
|
|
9257
|
+
_context8.next = 106;
|
|
8938
9258
|
break;
|
|
8939
9259
|
|
|
8940
9260
|
case 122:
|
|
8941
|
-
_context8.
|
|
9261
|
+
_context8.next = 127;
|
|
9262
|
+
break;
|
|
9263
|
+
|
|
9264
|
+
case 124:
|
|
9265
|
+
_context8.prev = 124;
|
|
8942
9266
|
_context8.t2 = _context8["catch"](1);
|
|
8943
9267
|
console.error(_context8.t2);
|
|
8944
9268
|
|
|
8945
|
-
case
|
|
9269
|
+
case 127:
|
|
8946
9270
|
case "end":
|
|
8947
9271
|
return _context8.stop();
|
|
8948
9272
|
}
|
|
8949
9273
|
}
|
|
8950
|
-
}, _marked8, null, [[1,
|
|
9274
|
+
}, _marked8, null, [[1, 124]]);
|
|
8951
9275
|
}
|
|
8952
9276
|
function unregisterMapSaga(_ref7) {
|
|
8953
9277
|
var payload, mapId, layerList;
|
|
@@ -8979,7 +9303,7 @@ function unregisterMapSaga(_ref7) {
|
|
|
8979
9303
|
}
|
|
8980
9304
|
}, _marked9);
|
|
8981
9305
|
}
|
|
8982
|
-
function rootSaga$
|
|
9306
|
+
function rootSaga$4() {
|
|
8983
9307
|
return regeneratorRuntime.wrap(function rootSaga$(_context10) {
|
|
8984
9308
|
while (1) {
|
|
8985
9309
|
switch (_context10.prev = _context10.next) {
|
|
@@ -9019,6 +9343,157 @@ function rootSaga$3() {
|
|
|
9019
9343
|
}, _marked10);
|
|
9020
9344
|
}
|
|
9021
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
|
+
|
|
9022
9497
|
var moduleConfig = {
|
|
9023
9498
|
id: 'webmap-module',
|
|
9024
9499
|
reducersMap: {
|
|
@@ -9026,7 +9501,7 @@ var moduleConfig = {
|
|
|
9026
9501
|
services: reducer$7,
|
|
9027
9502
|
layers: reducer$8
|
|
9028
9503
|
},
|
|
9029
|
-
sagas: [rootSaga$3]
|
|
9504
|
+
sagas: [rootSaga$4, rootSaga$3]
|
|
9030
9505
|
};
|
|
9031
9506
|
|
|
9032
9507
|
/* *
|
|
@@ -9080,153 +9555,97 @@ var isNoIdService = function isNoIdService(param) {
|
|
|
9080
9555
|
return !!((serviceParam === null || serviceParam === void 0 ? void 0 : serviceParam.name) && (serviceParam === null || serviceParam === void 0 ? void 0 : serviceParam.url));
|
|
9081
9556
|
};
|
|
9082
9557
|
|
|
9083
|
-
var _marked$2 = /*#__PURE__*/regeneratorRuntime.mark(
|
|
9084
|
-
_marked2$2 = /*#__PURE__*/regeneratorRuntime.mark(
|
|
9085
|
-
_marked3 = /*#__PURE__*/regeneratorRuntime.mark(
|
|
9086
|
-
_marked4 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$2);
|
|
9087
|
-
function newServiceAddedSaga(capturedAction) {
|
|
9088
|
-
var addedService, id, serviceUrl, name, scope, _abstract, isUpdating, keywords, groups;
|
|
9089
|
-
|
|
9090
|
-
return regeneratorRuntime.wrap(function newServiceAddedSaga$(_context) {
|
|
9091
|
-
while (1) {
|
|
9092
|
-
switch (_context.prev = _context.next) {
|
|
9093
|
-
case 0:
|
|
9094
|
-
addedService = capturedAction.payload;
|
|
9095
|
-
id = addedService.id, serviceUrl = addedService.serviceUrl, name = addedService.name, scope = addedService.scope, _abstract = addedService["abstract"], isUpdating = addedService.isUpdating;
|
|
9096
|
-
|
|
9097
|
-
if (!isUpdating) {
|
|
9098
|
-
_context.next = 4;
|
|
9099
|
-
break;
|
|
9100
|
-
}
|
|
9101
|
-
|
|
9102
|
-
return _context.abrupt("return");
|
|
9103
|
-
|
|
9104
|
-
case 4:
|
|
9105
|
-
keywords = addedService.layers.reduce(function (keywords, layer) {
|
|
9106
|
-
var _a;
|
|
9107
|
-
|
|
9108
|
-
if (layer.leaf) {
|
|
9109
|
-
return keywords.concat((_a = layer.keywords) !== null && _a !== void 0 ? _a : []);
|
|
9110
|
-
}
|
|
9111
|
-
|
|
9112
|
-
return keywords;
|
|
9113
|
-
}, []);
|
|
9114
|
-
groups = addedService.layers.reduce(function (groups, layer) {
|
|
9115
|
-
var _a;
|
|
9116
|
-
|
|
9117
|
-
if (layer.leaf) {
|
|
9118
|
-
return groups.concat((_a = layer.path) !== null && _a !== void 0 ? _a : []);
|
|
9119
|
-
}
|
|
9120
|
-
|
|
9121
|
-
return groups;
|
|
9122
|
-
}, []);
|
|
9123
|
-
_context.next = 8;
|
|
9124
|
-
return put(layerSelectActions.addFiltersAndActiveServices({
|
|
9125
|
-
serviceId: id,
|
|
9126
|
-
serviceName: name,
|
|
9127
|
-
serviceUrl: serviceUrl,
|
|
9128
|
-
keywords: keywords,
|
|
9129
|
-
scope: scope,
|
|
9130
|
-
groups: groups,
|
|
9131
|
-
"abstract": _abstract,
|
|
9132
|
-
isLoading: false
|
|
9133
|
-
}));
|
|
9134
|
-
|
|
9135
|
-
case 8:
|
|
9136
|
-
case "end":
|
|
9137
|
-
return _context.stop();
|
|
9138
|
-
}
|
|
9139
|
-
}
|
|
9140
|
-
}, _marked$2);
|
|
9141
|
-
}
|
|
9558
|
+
var _marked$2 = /*#__PURE__*/regeneratorRuntime.mark(layerSelectCloseInfoDialogSaga),
|
|
9559
|
+
_marked2$2 = /*#__PURE__*/regeneratorRuntime.mark(layerSelectRemoveServiceSaga),
|
|
9560
|
+
_marked3 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$2);
|
|
9142
9561
|
function layerSelectCloseInfoDialogSaga(_ref) {
|
|
9143
9562
|
var type, payload, togglePayload, activeMapIdPayload, isLayerInfoDialogOpen, _isLayerInfoDialogOpen, filteredLayers, dialogInfo;
|
|
9144
9563
|
|
|
9145
|
-
return regeneratorRuntime.wrap(function layerSelectCloseInfoDialogSaga$(
|
|
9564
|
+
return regeneratorRuntime.wrap(function layerSelectCloseInfoDialogSaga$(_context) {
|
|
9146
9565
|
while (1) {
|
|
9147
|
-
switch (
|
|
9566
|
+
switch (_context.prev = _context.next) {
|
|
9148
9567
|
case 0:
|
|
9149
9568
|
type = _ref.type, payload = _ref.payload;
|
|
9150
|
-
|
|
9151
|
-
|
|
9569
|
+
_context.t0 = type;
|
|
9570
|
+
_context.next = _context.t0 === uiActions.setToggleOpenDialog.type ? 4 : _context.t0 === uiActions.setActiveMapIdForDialog.type ? 9 : 18;
|
|
9152
9571
|
break;
|
|
9153
9572
|
|
|
9154
9573
|
case 4:
|
|
9155
9574
|
togglePayload = payload;
|
|
9156
9575
|
|
|
9157
9576
|
if (!(!togglePayload.setOpen && togglePayload.type === DialogTypes.LayerSelect)) {
|
|
9158
|
-
|
|
9577
|
+
_context.next = 8;
|
|
9159
9578
|
break;
|
|
9160
9579
|
}
|
|
9161
9580
|
|
|
9162
|
-
|
|
9581
|
+
_context.next = 8;
|
|
9163
9582
|
return put(uiActions.setToggleOpenDialog({
|
|
9164
9583
|
type: DialogTypes.LayerInfo,
|
|
9165
9584
|
setOpen: false
|
|
9166
9585
|
}));
|
|
9167
9586
|
|
|
9168
9587
|
case 8:
|
|
9169
|
-
return
|
|
9588
|
+
return _context.abrupt("break", 31);
|
|
9170
9589
|
|
|
9171
9590
|
case 9:
|
|
9172
9591
|
activeMapIdPayload = payload;
|
|
9173
9592
|
|
|
9174
9593
|
if (activeMapIdPayload.setOpen) {
|
|
9175
|
-
|
|
9594
|
+
_context.next = 17;
|
|
9176
9595
|
break;
|
|
9177
9596
|
}
|
|
9178
9597
|
|
|
9179
|
-
|
|
9598
|
+
_context.next = 13;
|
|
9180
9599
|
return select(getisDialogOpen, DialogTypes.LayerInfo);
|
|
9181
9600
|
|
|
9182
9601
|
case 13:
|
|
9183
|
-
isLayerInfoDialogOpen =
|
|
9602
|
+
isLayerInfoDialogOpen = _context.sent;
|
|
9184
9603
|
|
|
9185
9604
|
if (!isLayerInfoDialogOpen) {
|
|
9186
|
-
|
|
9605
|
+
_context.next = 17;
|
|
9187
9606
|
break;
|
|
9188
9607
|
}
|
|
9189
9608
|
|
|
9190
|
-
|
|
9609
|
+
_context.next = 17;
|
|
9191
9610
|
return put(uiActions.setToggleOpenDialog({
|
|
9192
9611
|
type: DialogTypes.LayerInfo,
|
|
9193
9612
|
setOpen: false
|
|
9194
9613
|
}));
|
|
9195
9614
|
|
|
9196
9615
|
case 17:
|
|
9197
|
-
return
|
|
9616
|
+
return _context.abrupt("break", 31);
|
|
9198
9617
|
|
|
9199
9618
|
case 18:
|
|
9200
|
-
|
|
9619
|
+
_context.next = 20;
|
|
9201
9620
|
return select(getisDialogOpen, DialogTypes.LayerInfo);
|
|
9202
9621
|
|
|
9203
9622
|
case 20:
|
|
9204
|
-
_isLayerInfoDialogOpen =
|
|
9623
|
+
_isLayerInfoDialogOpen = _context.sent;
|
|
9205
9624
|
|
|
9206
9625
|
if (!_isLayerInfoDialogOpen) {
|
|
9207
|
-
|
|
9626
|
+
_context.next = 31;
|
|
9208
9627
|
break;
|
|
9209
9628
|
}
|
|
9210
9629
|
|
|
9211
|
-
|
|
9630
|
+
_context.next = 24;
|
|
9212
9631
|
return select(getFilteredLayers);
|
|
9213
9632
|
|
|
9214
9633
|
case 24:
|
|
9215
|
-
filteredLayers =
|
|
9216
|
-
|
|
9634
|
+
filteredLayers = _context.sent;
|
|
9635
|
+
_context.next = 27;
|
|
9217
9636
|
return select(getActiveLayerInfo);
|
|
9218
9637
|
|
|
9219
9638
|
case 27:
|
|
9220
|
-
dialogInfo =
|
|
9639
|
+
dialogInfo = _context.sent;
|
|
9221
9640
|
|
|
9222
9641
|
if (filteredLayers.map(function (layer) {
|
|
9223
9642
|
return layer.title;
|
|
9224
9643
|
}).includes(dialogInfo.title)) {
|
|
9225
|
-
|
|
9644
|
+
_context.next = 31;
|
|
9226
9645
|
break;
|
|
9227
9646
|
}
|
|
9228
9647
|
|
|
9229
|
-
|
|
9648
|
+
_context.next = 31;
|
|
9230
9649
|
return put(uiActions.setToggleOpenDialog({
|
|
9231
9650
|
type: DialogTypes.LayerInfo,
|
|
9232
9651
|
setOpen: false
|
|
@@ -9234,35 +9653,35 @@ function layerSelectCloseInfoDialogSaga(_ref) {
|
|
|
9234
9653
|
|
|
9235
9654
|
case 31:
|
|
9236
9655
|
case "end":
|
|
9237
|
-
return
|
|
9656
|
+
return _context.stop();
|
|
9238
9657
|
}
|
|
9239
9658
|
}
|
|
9240
|
-
},
|
|
9659
|
+
}, _marked$2);
|
|
9241
9660
|
}
|
|
9242
9661
|
function layerSelectRemoveServiceSaga(capturedAction) {
|
|
9243
9662
|
var removedService, serviceId, serviceUrl, results, services, servicesEnabled;
|
|
9244
|
-
return regeneratorRuntime.wrap(function layerSelectRemoveServiceSaga$(
|
|
9663
|
+
return regeneratorRuntime.wrap(function layerSelectRemoveServiceSaga$(_context2) {
|
|
9245
9664
|
while (1) {
|
|
9246
|
-
switch (
|
|
9665
|
+
switch (_context2.prev = _context2.next) {
|
|
9247
9666
|
case 0:
|
|
9248
9667
|
removedService = capturedAction.payload;
|
|
9249
9668
|
serviceId = removedService.serviceId, serviceUrl = removedService.serviceUrl;
|
|
9250
|
-
|
|
9669
|
+
_context2.next = 4;
|
|
9251
9670
|
return select(getActiveServices);
|
|
9252
9671
|
|
|
9253
9672
|
case 4:
|
|
9254
|
-
results =
|
|
9673
|
+
results = _context2.sent;
|
|
9255
9674
|
services = results;
|
|
9256
9675
|
servicesEnabled = Object.values(services).find(function (service) {
|
|
9257
9676
|
return service === null || service === void 0 ? void 0 : service.enabled;
|
|
9258
9677
|
});
|
|
9259
9678
|
|
|
9260
9679
|
if (!(servicesEnabled === undefined)) {
|
|
9261
|
-
|
|
9680
|
+
_context2.next = 10;
|
|
9262
9681
|
break;
|
|
9263
9682
|
}
|
|
9264
9683
|
|
|
9265
|
-
|
|
9684
|
+
_context2.next = 10;
|
|
9266
9685
|
return all(Object.entries(services).map(function (_ref2) {
|
|
9267
9686
|
var _ref3 = _slicedToArray(_ref2, 2),
|
|
9268
9687
|
serviceId = _ref3[0],
|
|
@@ -9275,7 +9694,7 @@ function layerSelectRemoveServiceSaga(capturedAction) {
|
|
|
9275
9694
|
}));
|
|
9276
9695
|
|
|
9277
9696
|
case 10:
|
|
9278
|
-
|
|
9697
|
+
_context2.next = 12;
|
|
9279
9698
|
return put(serviceActions.mapStoreRemoveService({
|
|
9280
9699
|
id: serviceId,
|
|
9281
9700
|
serviceUrl: serviceUrl
|
|
@@ -9283,64 +9702,68 @@ function layerSelectRemoveServiceSaga(capturedAction) {
|
|
|
9283
9702
|
|
|
9284
9703
|
case 12:
|
|
9285
9704
|
case "end":
|
|
9286
|
-
return
|
|
9705
|
+
return _context2.stop();
|
|
9287
9706
|
}
|
|
9288
9707
|
}
|
|
9289
|
-
},
|
|
9708
|
+
}, _marked2$2);
|
|
9290
9709
|
}
|
|
9291
9710
|
function addServiceToLocalStorageSaga(_ref4) {
|
|
9292
9711
|
var payload = _ref4.payload;
|
|
9293
9712
|
var scope = payload.scope,
|
|
9294
9713
|
name = payload.name,
|
|
9295
9714
|
serviceUrl = payload.serviceUrl,
|
|
9296
|
-
|
|
9297
|
-
|
|
9715
|
+
_abstract = payload["abstract"];
|
|
9716
|
+
|
|
9717
|
+
if (!isUserAddedService(scope)) {
|
|
9718
|
+
return;
|
|
9719
|
+
}
|
|
9720
|
+
|
|
9298
9721
|
var localStorageServices = getUserAddedServices();
|
|
9299
9722
|
setUserAddedServices(Object.assign(Object.assign({}, localStorageServices), _defineProperty({}, serviceUrl, {
|
|
9300
9723
|
name: name,
|
|
9301
9724
|
url: serviceUrl,
|
|
9302
|
-
"abstract":
|
|
9725
|
+
"abstract": _abstract
|
|
9303
9726
|
})));
|
|
9304
9727
|
}
|
|
9305
9728
|
function removeServiceFromLocalStorageSaga(_ref5) {
|
|
9306
9729
|
var payload = _ref5.payload;
|
|
9307
9730
|
var serviceUrl = payload.serviceUrl;
|
|
9308
9731
|
var localStorageServices = getUserAddedServices();
|
|
9309
|
-
|
|
9732
|
+
|
|
9733
|
+
if (!localStorageServices[serviceUrl]) {
|
|
9734
|
+
return;
|
|
9735
|
+
}
|
|
9736
|
+
|
|
9310
9737
|
var updatedServices = Object.assign({}, localStorageServices);
|
|
9311
9738
|
delete updatedServices[serviceUrl];
|
|
9312
9739
|
setUserAddedServices(updatedServices);
|
|
9313
9740
|
}
|
|
9314
9741
|
function rootSaga$2() {
|
|
9315
|
-
return regeneratorRuntime.wrap(function rootSaga$(
|
|
9742
|
+
return regeneratorRuntime.wrap(function rootSaga$(_context3) {
|
|
9316
9743
|
while (1) {
|
|
9317
|
-
switch (
|
|
9744
|
+
switch (_context3.prev = _context3.next) {
|
|
9318
9745
|
case 0:
|
|
9319
|
-
|
|
9320
|
-
return takeEvery(serviceActions.serviceSetLayers.type, newServiceAddedSaga);
|
|
9321
|
-
|
|
9322
|
-
case 2:
|
|
9323
|
-
_context4.next = 4;
|
|
9746
|
+
_context3.next = 2;
|
|
9324
9747
|
return takeEvery(layerSelectActions.layerSelectRemoveService.type, layerSelectRemoveServiceSaga);
|
|
9325
9748
|
|
|
9326
|
-
case
|
|
9327
|
-
|
|
9749
|
+
case 2:
|
|
9750
|
+
_context3.next = 4;
|
|
9328
9751
|
return takeEvery(serviceActions.serviceSetLayers.type, addServiceToLocalStorageSaga);
|
|
9329
9752
|
|
|
9330
|
-
case
|
|
9331
|
-
|
|
9753
|
+
case 4:
|
|
9754
|
+
_context3.next = 6;
|
|
9332
9755
|
return takeEvery(serviceActions.mapStoreRemoveService.type, removeServiceFromLocalStorageSaga);
|
|
9333
9756
|
|
|
9334
|
-
case
|
|
9335
|
-
|
|
9757
|
+
case 6:
|
|
9758
|
+
_context3.next = 8;
|
|
9336
9759
|
return takeEvery([uiActions.setToggleOpenDialog.type, uiActions.setActiveMapIdForDialog.type, layerSelectActions.disableActiveService.type, layerSelectActions.toggleFilter.type, layerSelectActions.setSearchFilter.type], layerSelectCloseInfoDialogSaga);
|
|
9337
9760
|
|
|
9338
|
-
case
|
|
9761
|
+
case 8:
|
|
9339
9762
|
case "end":
|
|
9340
|
-
return
|
|
9763
|
+
return _context3.stop();
|
|
9341
9764
|
}
|
|
9342
9765
|
}
|
|
9343
|
-
},
|
|
9766
|
+
}, _marked3);
|
|
9344
9767
|
}
|
|
9345
9768
|
|
|
9346
9769
|
var layerSelectConfig = {
|
|
@@ -9483,8 +9906,8 @@ var coreModuleConfig = [moduleConfig, synchronizationGroupConfig, uiModuleConfig
|
|
|
9483
9906
|
* See the License for the specific language governing permissions and
|
|
9484
9907
|
* limitations under the License.
|
|
9485
9908
|
*
|
|
9486
|
-
* Copyright
|
|
9487
|
-
* Copyright
|
|
9909
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9910
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
9488
9911
|
* */
|
|
9489
9912
|
var iconStyle = {
|
|
9490
9913
|
height: 24,
|
|
@@ -9505,16 +9928,19 @@ var sizeLarge = {
|
|
|
9505
9928
|
|
|
9506
9929
|
var HeaderOptions = function HeaderOptions(_ref) {
|
|
9507
9930
|
var isDockedLayerManager = _ref.isDockedLayerManager,
|
|
9931
|
+
shortcutsEnabled = _ref.shortcutsEnabled,
|
|
9508
9932
|
onClickDockButton = _ref.onClickDockButton,
|
|
9509
9933
|
onChangeSize = _ref.onChangeSize;
|
|
9510
9934
|
React.useEffect(function () {
|
|
9511
9935
|
var handleKeyDown = function handleKeyDown(event) {
|
|
9512
|
-
if (
|
|
9513
|
-
|
|
9514
|
-
|
|
9515
|
-
|
|
9516
|
-
|
|
9517
|
-
|
|
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
|
+
}
|
|
9518
9944
|
}
|
|
9519
9945
|
};
|
|
9520
9946
|
|
|
@@ -9522,7 +9948,7 @@ var HeaderOptions = function HeaderOptions(_ref) {
|
|
|
9522
9948
|
return function () {
|
|
9523
9949
|
document.removeEventListener('keydown', handleKeyDown);
|
|
9524
9950
|
};
|
|
9525
|
-
}, [onChangeSize]);
|
|
9951
|
+
}, [onChangeSize, shortcutsEnabled]);
|
|
9526
9952
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CustomTooltip, {
|
|
9527
9953
|
title: "small"
|
|
9528
9954
|
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
@@ -9746,9 +10172,18 @@ var layerManagerStyle = {
|
|
|
9746
10172
|
}
|
|
9747
10173
|
};
|
|
9748
10174
|
var returnCorrectSize = function returnCorrectSize(sizeResult) {
|
|
9749
|
-
if (sizeResult === 'sizeSmall')
|
|
9750
|
-
|
|
9751
|
-
|
|
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
|
+
|
|
9752
10187
|
return sizeLarge;
|
|
9753
10188
|
};
|
|
9754
10189
|
|
|
@@ -9903,11 +10338,18 @@ var DimensionSelect = function DimensionSelect(_ref) {
|
|
|
9903
10338
|
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
9904
10339
|
|
|
9905
10340
|
}, []);
|
|
9906
|
-
|
|
10341
|
+
|
|
10342
|
+
if (!layerDimensions.length || !layerId) {
|
|
10343
|
+
return null;
|
|
10344
|
+
}
|
|
9907
10345
|
|
|
9908
10346
|
var getValuesToDisplay = function getValuesToDisplay() {
|
|
9909
10347
|
var activeWMJSDim = getWMJSDimensionForLayerAndDimension(layerId, activeDimName) || getWMJSDimensionForLayerAndDimension(layerId, layerDimensions[0].name);
|
|
9910
|
-
|
|
10348
|
+
|
|
10349
|
+
if (!activeWMJSDim) {
|
|
10350
|
+
return null;
|
|
10351
|
+
}
|
|
10352
|
+
|
|
9911
10353
|
var availableDimValues = [];
|
|
9912
10354
|
|
|
9913
10355
|
for (var j = 0; j < activeWMJSDim.size(); j += 1) {
|
|
@@ -9921,11 +10363,18 @@ var DimensionSelect = function DimensionSelect(_ref) {
|
|
|
9921
10363
|
};
|
|
9922
10364
|
|
|
9923
10365
|
var valuesToDisplay = getValuesToDisplay();
|
|
9924
|
-
|
|
10366
|
+
|
|
10367
|
+
if (valuesToDisplay === null) {
|
|
10368
|
+
return null;
|
|
10369
|
+
}
|
|
10370
|
+
|
|
9925
10371
|
var activeDim = layerDimensions.find(function (dim) {
|
|
9926
10372
|
return dim.name === activeDimName;
|
|
9927
10373
|
});
|
|
9928
|
-
|
|
10374
|
+
|
|
10375
|
+
if (!activeDim) {
|
|
10376
|
+
return null;
|
|
10377
|
+
}
|
|
9929
10378
|
|
|
9930
10379
|
var selectDimensionValue = function selectDimensionValue(event) {
|
|
9931
10380
|
event.stopPropagation();
|
|
@@ -9956,7 +10405,11 @@ var DimensionSelect = function DimensionSelect(_ref) {
|
|
|
9956
10405
|
var dimValueCurrentIndex = valuesToDisplay.findIndex(function (value) {
|
|
9957
10406
|
return value === activeDim.currentValue;
|
|
9958
10407
|
});
|
|
9959
|
-
|
|
10408
|
+
|
|
10409
|
+
if (dimValueCurrentIndex === -1) {
|
|
10410
|
+
return null;
|
|
10411
|
+
}
|
|
10412
|
+
|
|
9960
10413
|
return /*#__PURE__*/React.createElement(Grid, {
|
|
9961
10414
|
container: true,
|
|
9962
10415
|
direction: "row",
|
|
@@ -10206,7 +10659,9 @@ var OpacitySelect = function OpacitySelect(_ref) {
|
|
|
10206
10659
|
}
|
|
10207
10660
|
}, [anchorEl]);
|
|
10208
10661
|
var onMouseEnter = React.useCallback(function () {
|
|
10209
|
-
if (!isOpen)
|
|
10662
|
+
if (!isOpen) {
|
|
10663
|
+
setTooltipOpen(true);
|
|
10664
|
+
}
|
|
10210
10665
|
}, [isOpen, setTooltipOpen]);
|
|
10211
10666
|
var onMouseLeave = React.useCallback(function () {
|
|
10212
10667
|
setTooltipOpen(false);
|
|
@@ -10438,15 +10893,15 @@ var ActivateLayer = function ActivateLayer(_ref) {
|
|
|
10438
10893
|
inputProps: {
|
|
10439
10894
|
IconComponent: function IconComponent() {
|
|
10440
10895
|
return null;
|
|
10441
|
-
}
|
|
10896
|
+
},
|
|
10897
|
+
tabIndex: -1
|
|
10442
10898
|
},
|
|
10443
10899
|
value: isActive ? 'Both' : 'None',
|
|
10444
10900
|
sx: {
|
|
10445
|
-
'&& .
|
|
10446
|
-
|
|
10447
|
-
|
|
10448
|
-
|
|
10449
|
-
paddingRight: 0
|
|
10901
|
+
'&& .MuiInput-input': {
|
|
10902
|
+
paddingRight: '2px',
|
|
10903
|
+
paddingLeft: '2px',
|
|
10904
|
+
backgroundColor: 'inherit'
|
|
10450
10905
|
}
|
|
10451
10906
|
},
|
|
10452
10907
|
renderValue: function renderValue(optionSelected) {
|
|
@@ -10484,8 +10939,6 @@ var AutoUpdateButton$1 = function AutoUpdateButton(_ref2) {
|
|
|
10484
10939
|
isActive = _ref2.isActive,
|
|
10485
10940
|
isEnabled = _ref2.isEnabled;
|
|
10486
10941
|
var style = {
|
|
10487
|
-
backgroundColor: isActive ? 'geowebColors.buttons.primary.active.fill' : 'transparent!important',
|
|
10488
|
-
borderRadius: '5px',
|
|
10489
10942
|
color: getIconColor(isActive, isEnabled)
|
|
10490
10943
|
};
|
|
10491
10944
|
var Icon = isActive ? /*#__PURE__*/React.createElement(Both, {
|
|
@@ -10498,9 +10951,10 @@ var AutoUpdateButton$1 = function AutoUpdateButton(_ref2) {
|
|
|
10498
10951
|
"aria-label": "Auto update ".concat(optionSelected),
|
|
10499
10952
|
sx: {
|
|
10500
10953
|
'&.MuiButtonBase-root': {
|
|
10501
|
-
backgroundColor: '
|
|
10954
|
+
backgroundColor: 'inherit'
|
|
10502
10955
|
}
|
|
10503
|
-
}
|
|
10956
|
+
},
|
|
10957
|
+
active: isActive
|
|
10504
10958
|
}, Icon);
|
|
10505
10959
|
};
|
|
10506
10960
|
|
|
@@ -10603,16 +11057,18 @@ var LayerRow = function LayerRow(_ref) {
|
|
|
10603
11057
|
padding: 0
|
|
10604
11058
|
}
|
|
10605
11059
|
},
|
|
10606
|
-
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, {
|
|
10607
11061
|
isEnabled: layer.enabled,
|
|
10608
|
-
|
|
10609
|
-
|
|
11062
|
+
tooltipTitle: layer.name,
|
|
11063
|
+
onClick: function onClick(event) {
|
|
11064
|
+
event.stopPropagation();
|
|
10610
11065
|
onLayerEnable({
|
|
10611
11066
|
layerId: layerId,
|
|
10612
11067
|
enabled: !layer.enabled
|
|
10613
11068
|
});
|
|
10614
11069
|
},
|
|
10615
|
-
|
|
11070
|
+
"data-testid": "enableButton-medium",
|
|
11071
|
+
icon: isEnabled ? /*#__PURE__*/React__default.createElement(Visibility, null) : /*#__PURE__*/React__default.createElement(VisibilityOff, null)
|
|
10616
11072
|
}), layerActiveLayout || /*#__PURE__*/React__default.createElement(ActivateLayer, {
|
|
10617
11073
|
onChange: onClickRow,
|
|
10618
11074
|
isActive: false,
|
|
@@ -10674,26 +11130,31 @@ var LayerRow = function LayerRow(_ref) {
|
|
|
10674
11130
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
10675
11131
|
item: true,
|
|
10676
11132
|
sx: {}
|
|
10677
|
-
}, layerDeleteLayout || /*#__PURE__*/React__default.createElement(
|
|
11133
|
+
}, layerDeleteLayout || /*#__PURE__*/React__default.createElement(ManagerButton, {
|
|
10678
11134
|
tooltipTitle: "Delete",
|
|
10679
|
-
|
|
11135
|
+
onClick: function onClick() {
|
|
10680
11136
|
onLayerDelete({
|
|
10681
11137
|
mapId: mapId,
|
|
10682
11138
|
layerId: layerId
|
|
10683
11139
|
});
|
|
10684
|
-
}
|
|
11140
|
+
},
|
|
11141
|
+
icon: /*#__PURE__*/React__default.createElement(Delete, null),
|
|
11142
|
+
"data-testid": "deleteButton"
|
|
10685
11143
|
}))))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
10686
11144
|
item: true,
|
|
10687
11145
|
className: columnClasses.column1
|
|
10688
|
-
}, dragHandle, layerEnableLayout || /*#__PURE__*/React__default.createElement(
|
|
11146
|
+
}, dragHandle, layerEnableLayout || /*#__PURE__*/React__default.createElement(ManagerButton, {
|
|
10689
11147
|
isEnabled: layer.enabled,
|
|
10690
|
-
|
|
10691
|
-
|
|
11148
|
+
tooltipTitle: layer.name,
|
|
11149
|
+
onClick: function onClick(event) {
|
|
11150
|
+
event.stopPropagation();
|
|
10692
11151
|
onLayerEnable({
|
|
10693
11152
|
layerId: layerId,
|
|
10694
11153
|
enabled: !layer.enabled
|
|
10695
11154
|
});
|
|
10696
|
-
}
|
|
11155
|
+
},
|
|
11156
|
+
icon: layer.enabled ? /*#__PURE__*/React__default.createElement(Visibility, null) : /*#__PURE__*/React__default.createElement(VisibilityOff, null),
|
|
11157
|
+
"data-testid": "enableButton"
|
|
10697
11158
|
}), layerActiveLayout || /*#__PURE__*/React__default.createElement(ActivateLayer, {
|
|
10698
11159
|
onChange: onClickRow,
|
|
10699
11160
|
isActive: false,
|
|
@@ -10760,14 +11221,16 @@ var LayerRow = function LayerRow(_ref) {
|
|
|
10760
11221
|
}))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
10761
11222
|
item: true,
|
|
10762
11223
|
className: columnClasses.column6
|
|
10763
|
-
}, layerDeleteLayout || /*#__PURE__*/React__default.createElement(
|
|
11224
|
+
}, layerDeleteLayout || /*#__PURE__*/React__default.createElement(ManagerButton, {
|
|
10764
11225
|
tooltipTitle: "Delete",
|
|
10765
|
-
|
|
11226
|
+
onClick: function onClick() {
|
|
10766
11227
|
onLayerDelete({
|
|
10767
11228
|
mapId: mapId,
|
|
10768
11229
|
layerId: layerId
|
|
10769
11230
|
});
|
|
10770
|
-
}
|
|
11231
|
+
},
|
|
11232
|
+
icon: /*#__PURE__*/React__default.createElement(Delete, null),
|
|
11233
|
+
"data-testid": "deleteButton"
|
|
10771
11234
|
}), layerMenuLayout || /*#__PURE__*/React__default.createElement(LayerManagerMenuButton, {
|
|
10772
11235
|
mapId: mapId,
|
|
10773
11236
|
layerId: layerId,
|
|
@@ -10811,16 +11274,18 @@ var DeleteLayerConnect = function DeleteLayerConnect(_ref) {
|
|
|
10811
11274
|
var isLayerEnabled = useSelector(function (store) {
|
|
10812
11275
|
return getLayerEnabled(store, layerId);
|
|
10813
11276
|
});
|
|
10814
|
-
return /*#__PURE__*/React.createElement(
|
|
11277
|
+
return /*#__PURE__*/React.createElement(ManagerButton, {
|
|
10815
11278
|
tooltipTitle: "Delete",
|
|
10816
|
-
|
|
11279
|
+
onClick: function onClick() {
|
|
10817
11280
|
layerDelete({
|
|
10818
11281
|
mapId: mapId,
|
|
10819
11282
|
layerId: layerId,
|
|
10820
11283
|
layerIndex: layerIndex
|
|
10821
11284
|
});
|
|
10822
11285
|
},
|
|
10823
|
-
isEnabled: isLayerEnabled
|
|
11286
|
+
isEnabled: isLayerEnabled,
|
|
11287
|
+
icon: /*#__PURE__*/React.createElement(Delete, null),
|
|
11288
|
+
"data-testid": "deleteButton"
|
|
10824
11289
|
});
|
|
10825
11290
|
};
|
|
10826
11291
|
|
|
@@ -10859,26 +11324,32 @@ var EnableLayerConnect = function EnableLayerConnect(_ref) {
|
|
|
10859
11324
|
origin: LayerActionOrigin.layerManager
|
|
10860
11325
|
}));
|
|
10861
11326
|
}, [dispatch, mapId]);
|
|
10862
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(
|
|
11327
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ManagerButton, {
|
|
10863
11328
|
isEnabled: isEnabled,
|
|
10864
|
-
|
|
10865
|
-
|
|
11329
|
+
tooltipTitle: "Toggle visibility",
|
|
11330
|
+
onClick: function onClick(event) {
|
|
11331
|
+
event.stopPropagation();
|
|
10866
11332
|
layerChangeEnabled({
|
|
10867
11333
|
layerId: layerId,
|
|
10868
|
-
enabled:
|
|
11334
|
+
enabled: !isEnabled
|
|
10869
11335
|
});
|
|
10870
11336
|
},
|
|
10871
|
-
className: "enable-btn"
|
|
10872
|
-
|
|
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, {
|
|
10873
11341
|
isEnabled: isEnabled,
|
|
10874
|
-
|
|
10875
|
-
|
|
11342
|
+
tooltipTitle: layerName,
|
|
11343
|
+
onClick: function onClick(event) {
|
|
11344
|
+
event.stopPropagation();
|
|
10876
11345
|
layerChangeEnabled({
|
|
10877
11346
|
layerId: layerId,
|
|
10878
|
-
enabled:
|
|
11347
|
+
enabled: !isEnabled
|
|
10879
11348
|
});
|
|
10880
11349
|
},
|
|
10881
|
-
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"
|
|
10882
11353
|
}));
|
|
10883
11354
|
};
|
|
10884
11355
|
|
|
@@ -11029,86 +11500,6 @@ var RenderStylesConnect = function RenderStylesConnect(_ref) {
|
|
|
11029
11500
|
});
|
|
11030
11501
|
};
|
|
11031
11502
|
|
|
11032
|
-
/* *
|
|
11033
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11034
|
-
* you may not use this file except in compliance with the License.
|
|
11035
|
-
* You may obtain a copy of the License at
|
|
11036
|
-
*
|
|
11037
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11038
|
-
*
|
|
11039
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11040
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11041
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11042
|
-
* See the License for the specific language governing permissions and
|
|
11043
|
-
* limitations under the License.
|
|
11044
|
-
*
|
|
11045
|
-
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11046
|
-
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
11047
|
-
* */
|
|
11048
|
-
/**
|
|
11049
|
-
* Converts webmapjs node structure to LayerTree
|
|
11050
|
-
* @param nodesToRecur THe WebMapJS node structure from service.getNodes();
|
|
11051
|
-
*/
|
|
11052
|
-
|
|
11053
|
-
var recurseNodes = function recurseNodes(nodesToRecur) {
|
|
11054
|
-
var newLayerTreeObj = {
|
|
11055
|
-
leaf: nodesToRecur.leaf,
|
|
11056
|
-
name: nodesToRecur.name,
|
|
11057
|
-
title: nodesToRecur.title,
|
|
11058
|
-
path: nodesToRecur.path || [],
|
|
11059
|
-
children: [],
|
|
11060
|
-
keywords: nodesToRecur.keywords || [],
|
|
11061
|
-
"abstract": nodesToRecur["abstract"] || '',
|
|
11062
|
-
styles: nodesToRecur.styles || [],
|
|
11063
|
-
dimensions: nodesToRecur.dimensions || [],
|
|
11064
|
-
geographicBoundingBox: nodesToRecur.geographicBoundingBox || null
|
|
11065
|
-
};
|
|
11066
|
-
|
|
11067
|
-
if (nodesToRecur.children) {
|
|
11068
|
-
for (var j = 0; j < nodesToRecur.children.length; j += 1) {
|
|
11069
|
-
newLayerTreeObj.children.push(recurseNodes(nodesToRecur.children[j]));
|
|
11070
|
-
}
|
|
11071
|
-
}
|
|
11072
|
-
|
|
11073
|
-
return newLayerTreeObj;
|
|
11074
|
-
};
|
|
11075
|
-
/**
|
|
11076
|
-
* Returns a promise with a hierarchical tree of layers from the WMS GetCapabilities document.
|
|
11077
|
-
* @param serviceUrl The URL of the WMS service
|
|
11078
|
-
* @param {boolean} forceReload **optional** forceReload: boolean, true will force the layers to be reloaded from the service, defaults to false
|
|
11079
|
-
*/
|
|
11080
|
-
|
|
11081
|
-
var getLayersFromService = function getLayersFromService(serviceUrl) {
|
|
11082
|
-
var forceReload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
11083
|
-
return new Promise(function (resolve, reject) {
|
|
11084
|
-
var serviceObject = WMGetServiceFromStore(serviceUrl);
|
|
11085
|
-
serviceObject.getNodes(function (nodes) {
|
|
11086
|
-
// TODO: Maarten Plieger, 2022-11-02: Harmonize types and use correct types: https://gitlab.com/opengeoweb/opengeoweb/-/issues/2817
|
|
11087
|
-
var layerTree = recurseNodes(nodes);
|
|
11088
|
-
resolve(layerTree);
|
|
11089
|
-
}, function (error) {
|
|
11090
|
-
reject(new Error(error));
|
|
11091
|
-
}, forceReload);
|
|
11092
|
-
});
|
|
11093
|
-
};
|
|
11094
|
-
/**
|
|
11095
|
-
* Returns a promise with an array of flattened layerobjects from the WMS GetCapabilities document.
|
|
11096
|
-
* @param serviceUrl The URL of the WMS service
|
|
11097
|
-
* @param {boolean} forceReload **optional** forceReload: boolean, true will force the layers to be reloaded from the service, defaults to false
|
|
11098
|
-
*/
|
|
11099
|
-
|
|
11100
|
-
var getLayersFlattenedFromService = function getLayersFlattenedFromService(serviceUrl) {
|
|
11101
|
-
var forceReload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
11102
|
-
return new Promise(function (resolve, reject) {
|
|
11103
|
-
var serviceObject = WMGetServiceFromStore(serviceUrl);
|
|
11104
|
-
serviceObject.getLayerObjectsFlat(function (layers) {
|
|
11105
|
-
resolve(layers);
|
|
11106
|
-
}, function (error) {
|
|
11107
|
-
reject(new Error(error));
|
|
11108
|
-
}, forceReload);
|
|
11109
|
-
});
|
|
11110
|
-
};
|
|
11111
|
-
|
|
11112
11503
|
/* *
|
|
11113
11504
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11114
11505
|
* you may not use this file except in compliance with the License.
|
|
@@ -11294,8 +11685,9 @@ var ActivateLayerConnect = function ActivateLayerConnect(_ref) {
|
|
|
11294
11685
|
var setActiveLayerId = React.useCallback(function (_ref2) {
|
|
11295
11686
|
var layerId = _ref2.layerId,
|
|
11296
11687
|
mapId = _ref2.mapId;
|
|
11297
|
-
return dispatch(mapActions$1.
|
|
11298
|
-
|
|
11688
|
+
return dispatch(mapActions$1.setAutoLayerId({
|
|
11689
|
+
autoTimeStepLayerId: layerId,
|
|
11690
|
+
autoUpdateLayerId: layerId,
|
|
11299
11691
|
mapId: mapId,
|
|
11300
11692
|
origin: LayerActionOrigin.layerManager
|
|
11301
11693
|
}));
|
|
@@ -11446,11 +11838,10 @@ var DragHandle = function DragHandle(_ref) {
|
|
|
11446
11838
|
return /*#__PURE__*/React__default.createElement(ManagerButton, {
|
|
11447
11839
|
tooltipTitle: tooltipTitle,
|
|
11448
11840
|
icon: /*#__PURE__*/React__default.createElement(DragHandle$1, null),
|
|
11449
|
-
|
|
11841
|
+
"data-testid": "dragHandle".concat(index !== undefined ? "-".concat(index) : ''),
|
|
11450
11842
|
className: "handle",
|
|
11451
11843
|
tabIndex: -1,
|
|
11452
11844
|
isEnabled: !isDisabled,
|
|
11453
|
-
disableFocusRipple: true,
|
|
11454
11845
|
disableTouchRipple: true,
|
|
11455
11846
|
disabled: isDisabled,
|
|
11456
11847
|
isAccessible: true,
|
|
@@ -11502,7 +11893,10 @@ var LayerContainerRow = function LayerContainerRow(_ref) {
|
|
|
11502
11893
|
var onStart = React.useCallback(function (_ref3) {
|
|
11503
11894
|
var oldIndex = _ref3.oldIndex;
|
|
11504
11895
|
setActiveDragIndex(oldIndex);
|
|
11505
|
-
|
|
11896
|
+
|
|
11897
|
+
if (Sortable.ghost) {
|
|
11898
|
+
Sortable.ghost.style.opacity = '1';
|
|
11899
|
+
}
|
|
11506
11900
|
}, []);
|
|
11507
11901
|
var onEnd = React.useCallback(function () {
|
|
11508
11902
|
if (activeDragIndex !== null) {
|
|
@@ -12092,7 +12486,9 @@ var ConnectedTree = function ConnectedTree(_ref) {
|
|
|
12092
12486
|
onClickLayer: function onClickLayer(serviceURL, layerName) {
|
|
12093
12487
|
if (layerType === LayerType.baseLayer) {
|
|
12094
12488
|
addBaseLayer(serviceURL, layerName);
|
|
12095
|
-
} else
|
|
12489
|
+
} else {
|
|
12490
|
+
addMapLayer(serviceURL, layerName);
|
|
12491
|
+
}
|
|
12096
12492
|
},
|
|
12097
12493
|
highlightedLayers: loadedLayers
|
|
12098
12494
|
});
|
|
@@ -12226,9 +12622,16 @@ var defaultConfigurations = /*#__PURE__*/Object.freeze({
|
|
|
12226
12622
|
});
|
|
12227
12623
|
|
|
12228
12624
|
var validateServiceUrl$1 = function validateServiceUrl(url) {
|
|
12229
|
-
if (url === '' || url === null || typeof url === 'undefined')
|
|
12625
|
+
if (url === '' || url === null || typeof url === 'undefined') {
|
|
12626
|
+
return false;
|
|
12627
|
+
}
|
|
12628
|
+
|
|
12230
12629
|
var matcher = /^(?:\w+:)?\/\/([^\s.]+\.\S{2}|[0-9a-zA-Z]+[:?\d]*)\S*$/;
|
|
12231
|
-
|
|
12630
|
+
|
|
12631
|
+
if (!matcher.test(url)) {
|
|
12632
|
+
return false;
|
|
12633
|
+
}
|
|
12634
|
+
|
|
12232
12635
|
return true;
|
|
12233
12636
|
};
|
|
12234
12637
|
|
|
@@ -12541,6 +12944,54 @@ var BaseLayerRow = function BaseLayerRow(_ref) {
|
|
|
12541
12944
|
})));
|
|
12542
12945
|
};
|
|
12543
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
|
+
|
|
12544
12995
|
var styles$2 = {
|
|
12545
12996
|
layerRowContainer: {
|
|
12546
12997
|
position: 'relative',
|
|
@@ -12596,7 +13047,9 @@ var LayerManager = function LayerManager(_ref) {
|
|
|
12596
13047
|
startPosition = _ref$startPosition === void 0 ? {
|
|
12597
13048
|
top: 85,
|
|
12598
13049
|
left: 50
|
|
12599
|
-
} : _ref$startPosition
|
|
13050
|
+
} : _ref$startPosition,
|
|
13051
|
+
_ref$setFocused = _ref.setFocused,
|
|
13052
|
+
setFocused = _ref$setFocused === void 0 ? function () {} : _ref$setFocused;
|
|
12600
13053
|
var minSize = {
|
|
12601
13054
|
width: 100,
|
|
12602
13055
|
height: 126
|
|
@@ -12626,11 +13079,18 @@ var LayerManager = function LayerManager(_ref) {
|
|
|
12626
13079
|
bounds: bounds,
|
|
12627
13080
|
"data-testid": "layerManagerWindow",
|
|
12628
13081
|
onMouseDown: onMouseDown,
|
|
13082
|
+
onFocus: function onFocus() {
|
|
13083
|
+
return setFocused(true);
|
|
13084
|
+
},
|
|
13085
|
+
onBlur: function onBlur() {
|
|
13086
|
+
return setFocused(false);
|
|
13087
|
+
},
|
|
12629
13088
|
order: order,
|
|
12630
13089
|
source: source,
|
|
12631
13090
|
leftHeaderComponent: leftHeaderComponent,
|
|
12632
|
-
rightHeaderComponent: /*#__PURE__*/React.createElement(
|
|
13091
|
+
rightHeaderComponent: /*#__PURE__*/React.createElement(HeaderOptionsConnect, {
|
|
12633
13092
|
isDockedLayerManager: isDockedLayerManager,
|
|
13093
|
+
mapId: mapId,
|
|
12634
13094
|
onClickDockButton: onToggleDock,
|
|
12635
13095
|
onChangeSize: function onChangeSize(_ref2) {
|
|
12636
13096
|
var width = _ref2.width;
|
|
@@ -12705,8 +13165,8 @@ var LayerManager = function LayerManager(_ref) {
|
|
|
12705
13165
|
* See the License for the specific language governing permissions and
|
|
12706
13166
|
* limitations under the License.
|
|
12707
13167
|
*
|
|
12708
|
-
* Copyright
|
|
12709
|
-
* Copyright
|
|
13168
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
13169
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
12710
13170
|
* */
|
|
12711
13171
|
var useSetupDialog = function useSetupDialog(dialogType) {
|
|
12712
13172
|
var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'app';
|
|
@@ -12773,6 +13233,14 @@ var useSetupDialog = function useSetupDialog(dialogType) {
|
|
|
12773
13233
|
var uiError = useSelector(function (store) {
|
|
12774
13234
|
return getDialogError(store, dialogType);
|
|
12775
13235
|
});
|
|
13236
|
+
|
|
13237
|
+
var setFocused = function setFocused(focused) {
|
|
13238
|
+
dispatch(uiActions.setDialogFocused({
|
|
13239
|
+
type: dialogType,
|
|
13240
|
+
focused: focused
|
|
13241
|
+
}));
|
|
13242
|
+
};
|
|
13243
|
+
|
|
12776
13244
|
return {
|
|
12777
13245
|
setDialogOrder: setDialogOrder,
|
|
12778
13246
|
dialogOrder: dialogOrder,
|
|
@@ -12780,63 +13248,41 @@ var useSetupDialog = function useSetupDialog(dialogType) {
|
|
|
12780
13248
|
uiSource: uiSource,
|
|
12781
13249
|
isDialogOpen: isDialogOpen,
|
|
12782
13250
|
uiIsLoading: uiIsLoading,
|
|
12783
|
-
uiError: uiError
|
|
13251
|
+
uiError: uiError,
|
|
13252
|
+
setFocused: setFocused
|
|
12784
13253
|
};
|
|
12785
13254
|
};
|
|
12786
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
|
+
};
|
|
12787
13269
|
var useFetchServices = function useFetchServices(dialogType) {
|
|
12788
13270
|
var preloadedServices = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : preloadedDefaultMapServices;
|
|
12789
13271
|
var dispatch = useDispatch();
|
|
12790
|
-
|
|
12791
|
-
var _useIsMounted = useIsMounted(),
|
|
12792
|
-
isMounted = _useIsMounted.isMounted;
|
|
12793
|
-
|
|
12794
13272
|
var isOpenInStore = useSelector(function (store) {
|
|
12795
13273
|
return getisDialogOpen(store, dialogType);
|
|
12796
13274
|
});
|
|
12797
|
-
var
|
|
12798
|
-
dispatch(serviceActions.
|
|
12799
|
-
|
|
12800
|
-
|
|
12801
|
-
dispatch(layerSelectActions.addFiltersAndActiveServices(payload));
|
|
13275
|
+
var fetchInitialServices = React.useCallback(function (services) {
|
|
13276
|
+
dispatch(serviceActions.fetchInitialServices({
|
|
13277
|
+
services: services
|
|
13278
|
+
}));
|
|
12802
13279
|
}, [dispatch]);
|
|
12803
13280
|
React.useEffect(function () {
|
|
12804
13281
|
if (isOpenInStore && preloadedServices && preloadedServices.length > 0) {
|
|
12805
|
-
mergePresetsAndUserAddedServices(preloadedServices, getUserAddedServices())
|
|
12806
|
-
|
|
12807
|
-
var scope = service.scope ? service.scope : 'system';
|
|
12808
|
-
|
|
12809
|
-
if (isMounted.current) {
|
|
12810
|
-
addFiltersAndActiveServices({
|
|
12811
|
-
serviceId: wmService.id,
|
|
12812
|
-
serviceName: service.name,
|
|
12813
|
-
serviceUrl: service.url,
|
|
12814
|
-
keywords: [],
|
|
12815
|
-
scope: scope,
|
|
12816
|
-
groups: [],
|
|
12817
|
-
"abstract": service["abstract"] || wmService["abstract"],
|
|
12818
|
-
isLoading: true
|
|
12819
|
-
});
|
|
12820
|
-
}
|
|
12821
|
-
|
|
12822
|
-
getLayersFlattenedFromService(service.url).then(function (layers) {
|
|
12823
|
-
if (isMounted.current) {
|
|
12824
|
-
serviceSetLayers({
|
|
12825
|
-
id: wmService.id,
|
|
12826
|
-
name: service.name,
|
|
12827
|
-
serviceUrl: service.url,
|
|
12828
|
-
layers: layers,
|
|
12829
|
-
scope: scope,
|
|
12830
|
-
// first try to load the user abstract, otherwise the service abstract
|
|
12831
|
-
"abstract": service["abstract"] || wmService["abstract"]
|
|
12832
|
-
});
|
|
12833
|
-
}
|
|
12834
|
-
})["catch"](function () {
|
|
12835
|
-
return null;
|
|
12836
|
-
});
|
|
12837
|
-
});
|
|
13282
|
+
var allServicesToLoad = mergePresetsAndUserAddedServices(preloadedServices, getUserAddedServices());
|
|
13283
|
+
fetchInitialServices(getServicesToLoad(allServicesToLoad));
|
|
12838
13284
|
}
|
|
12839
|
-
}, [
|
|
13285
|
+
}, [isOpenInStore, preloadedServices, fetchInitialServices]);
|
|
12840
13286
|
};
|
|
12841
13287
|
var mergePresetsAndUserAddedServices = function mergePresetsAndUserAddedServices(presets, userAddedServices) {
|
|
12842
13288
|
return Object.values(Object.assign(Object.assign({}, presets.reduce(function (byUrl, preset) {
|
|
@@ -12857,8 +13303,8 @@ var mergePresetsAndUserAddedServices = function mergePresetsAndUserAddedServices
|
|
|
12857
13303
|
* See the License for the specific language governing permissions and
|
|
12858
13304
|
* limitations under the License.
|
|
12859
13305
|
*
|
|
12860
|
-
* Copyright
|
|
12861
|
-
* Copyright
|
|
13306
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
13307
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
12862
13308
|
* */
|
|
12863
13309
|
var dialogType = DialogTypes.LayerManager;
|
|
12864
13310
|
/**
|
|
@@ -12894,7 +13340,8 @@ var LayerManagerConnect = function LayerManagerConnect(_ref) {
|
|
|
12894
13340
|
isDialogOpen = _useSetupDialog.isDialogOpen,
|
|
12895
13341
|
uiSource = _useSetupDialog.uiSource,
|
|
12896
13342
|
uiIsLoading = _useSetupDialog.uiIsLoading,
|
|
12897
|
-
uiError = _useSetupDialog.uiError
|
|
13343
|
+
uiError = _useSetupDialog.uiError,
|
|
13344
|
+
setFocused = _useSetupDialog.setFocused;
|
|
12898
13345
|
|
|
12899
13346
|
useFetchServices(dialogType, preloadedMapServices);
|
|
12900
13347
|
|
|
@@ -12922,7 +13369,8 @@ var LayerManagerConnect = function LayerManagerConnect(_ref) {
|
|
|
12922
13369
|
leftHeaderComponent: leftHeaderComponent,
|
|
12923
13370
|
isLoading: uiIsLoading,
|
|
12924
13371
|
error: uiError,
|
|
12925
|
-
onToggleDock: onToggleDock
|
|
13372
|
+
onToggleDock: onToggleDock,
|
|
13373
|
+
setFocused: setFocused
|
|
12926
13374
|
});
|
|
12927
13375
|
};
|
|
12928
13376
|
|
|
@@ -13099,17 +13547,23 @@ var SearchFieldButtonContainer = function SearchFieldButtonContainer(_ref) {
|
|
|
13099
13547
|
}, /*#__PURE__*/React__default.createElement(Clear, null)));
|
|
13100
13548
|
};
|
|
13101
13549
|
|
|
13102
|
-
if (isURL(localSearchString))
|
|
13103
|
-
|
|
13104
|
-
|
|
13105
|
-
|
|
13106
|
-
|
|
13107
|
-
|
|
13108
|
-
|
|
13109
|
-
|
|
13110
|
-
|
|
13111
|
-
|
|
13112
|
-
|
|
13550
|
+
if (isURL(localSearchString)) {
|
|
13551
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
13552
|
+
style: {
|
|
13553
|
+
marginRight: '15px'
|
|
13554
|
+
}
|
|
13555
|
+
}, /*#__PURE__*/React__default.createElement(ClearButton, null)), /*#__PURE__*/React__default.createElement(Button, {
|
|
13556
|
+
variant: "tertiary",
|
|
13557
|
+
onClick: function onClick() {
|
|
13558
|
+
return setPopupIsOpen(true);
|
|
13559
|
+
}
|
|
13560
|
+
}, "Save"));
|
|
13561
|
+
}
|
|
13562
|
+
|
|
13563
|
+
if (localSearchString) {
|
|
13564
|
+
return /*#__PURE__*/React__default.createElement(ClearButton, null);
|
|
13565
|
+
}
|
|
13566
|
+
|
|
13113
13567
|
return /*#__PURE__*/React__default.createElement(CustomTooltip, {
|
|
13114
13568
|
title: "Search",
|
|
13115
13569
|
placement: "top"
|
|
@@ -13139,7 +13593,12 @@ var SearchField = function SearchField(_ref) {
|
|
|
13139
13593
|
|
|
13140
13594
|
var handleChange = function handleChange(text) {
|
|
13141
13595
|
setLocalSearchString(text);
|
|
13142
|
-
|
|
13596
|
+
|
|
13597
|
+
if (!isURL(text)) {
|
|
13598
|
+
setSearchFilterDebounced(text);
|
|
13599
|
+
} else if (searchFilter) {
|
|
13600
|
+
setSearchFilterDebounced('');
|
|
13601
|
+
}
|
|
13143
13602
|
};
|
|
13144
13603
|
|
|
13145
13604
|
React.useEffect(function () {
|
|
@@ -13166,7 +13625,10 @@ var SearchField = function SearchField(_ref) {
|
|
|
13166
13625
|
}, [urlIsValid, localSearchString, onOpenServicePopup]); // mirror store unless typing a URL
|
|
13167
13626
|
|
|
13168
13627
|
React.useEffect(function () {
|
|
13169
|
-
if (isURL(localSearchString))
|
|
13628
|
+
if (isURL(localSearchString)) {
|
|
13629
|
+
return;
|
|
13630
|
+
}
|
|
13631
|
+
|
|
13170
13632
|
setLocalSearchString(searchFilter); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13171
13633
|
}, [searchFilter]);
|
|
13172
13634
|
return /*#__PURE__*/React.createElement(TextField, {
|
|
@@ -13830,13 +14292,19 @@ var layerSelectColumnsSmall = {
|
|
|
13830
14292
|
};
|
|
13831
14293
|
var breakpoint = 500;
|
|
13832
14294
|
var widthToColumns = function widthToColumns(width) {
|
|
13833
|
-
if (width <= breakpoint)
|
|
14295
|
+
if (width <= breakpoint) {
|
|
14296
|
+
return layerSelectColumnsSmall;
|
|
14297
|
+
}
|
|
14298
|
+
|
|
13834
14299
|
return layerSelectColumnsLarge;
|
|
13835
14300
|
};
|
|
13836
14301
|
var rowHeightLarge = 68;
|
|
13837
14302
|
var rowHeightSmall = 136;
|
|
13838
14303
|
var widthToRowHeight = function widthToRowHeight(width) {
|
|
13839
|
-
if (width <= breakpoint)
|
|
14304
|
+
if (width <= breakpoint) {
|
|
14305
|
+
return rowHeightSmall;
|
|
14306
|
+
}
|
|
14307
|
+
|
|
13840
14308
|
return rowHeightLarge;
|
|
13841
14309
|
};
|
|
13842
14310
|
var sortByService = function sortByService(serviceObj) {
|
|
@@ -14511,7 +14979,9 @@ var ServiceOptionsDialog = function ServiceOptionsDialog(_ref) {
|
|
|
14511
14979
|
sx: styles$1.servicesContainer,
|
|
14512
14980
|
"data-testid": "ServiceDialog",
|
|
14513
14981
|
onKeyDown: function onKeyDown(event) {
|
|
14514
|
-
if (event.key !== 'Escape')
|
|
14982
|
+
if (event.key !== 'Escape') {
|
|
14983
|
+
event.stopPropagation();
|
|
14984
|
+
}
|
|
14515
14985
|
},
|
|
14516
14986
|
tabIndex: -1,
|
|
14517
14987
|
ref: dialogRef
|
|
@@ -14572,7 +15042,11 @@ var Rows = function Rows(_ref2) {
|
|
|
14572
15042
|
var foundService = selectedLayers.find(function (object) {
|
|
14573
15043
|
return object.service === serviceUrl;
|
|
14574
15044
|
});
|
|
14575
|
-
|
|
15045
|
+
|
|
15046
|
+
if (foundService) {
|
|
15047
|
+
return true;
|
|
15048
|
+
}
|
|
15049
|
+
|
|
14576
15050
|
return false;
|
|
14577
15051
|
};
|
|
14578
15052
|
|
|
@@ -14785,7 +15259,11 @@ var getService = function getService(services, serviceUrl) {
|
|
|
14785
15259
|
|
|
14786
15260
|
return ((_a = services[serviceId]) === null || _a === void 0 ? void 0 : _a.serviceUrl) === serviceUrl;
|
|
14787
15261
|
});
|
|
14788
|
-
|
|
15262
|
+
|
|
15263
|
+
if (serviceIndex < 0) {
|
|
15264
|
+
return null;
|
|
15265
|
+
}
|
|
15266
|
+
|
|
14789
15267
|
return services[serviceIds[serviceIndex]];
|
|
14790
15268
|
};
|
|
14791
15269
|
|
|
@@ -15411,7 +15889,10 @@ var LayerInfoDialogConnect = function LayerInfoDialogConnect() {
|
|
|
15411
15889
|
uiSource = _useSetupDialog.uiSource,
|
|
15412
15890
|
isDialogOpen = _useSetupDialog.isDialogOpen;
|
|
15413
15891
|
|
|
15414
|
-
if (!layer)
|
|
15892
|
+
if (!layer) {
|
|
15893
|
+
return null;
|
|
15894
|
+
}
|
|
15895
|
+
|
|
15415
15896
|
return /*#__PURE__*/React__default.createElement(LayerInfoDialog, {
|
|
15416
15897
|
isOpen: isDialogOpen,
|
|
15417
15898
|
onClose: onCloseDialog,
|
|
@@ -16298,6 +16779,13 @@ var DimensionSelectSlider = function DimensionSelectSlider(_ref) {
|
|
|
16298
16779
|
var sliderValue = managedValue !== null ? values.findIndex(function (v) {
|
|
16299
16780
|
return v === managedValue;
|
|
16300
16781
|
}) : currentIndex;
|
|
16782
|
+
|
|
16783
|
+
var upDownNavigation = function upDownNavigation(event) {
|
|
16784
|
+
if (event.key === 'ArrowLeft' || event.key === 'ArrowRight' || event.metaKey || event.ctrlKey) {
|
|
16785
|
+
event.preventDefault();
|
|
16786
|
+
}
|
|
16787
|
+
};
|
|
16788
|
+
|
|
16301
16789
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, {
|
|
16302
16790
|
"data-testid": "slider-dimensionSelect",
|
|
16303
16791
|
sx: {
|
|
@@ -16323,9 +16811,13 @@ var DimensionSelectSlider = function DimensionSelectSlider(_ref) {
|
|
|
16323
16811
|
} : {},
|
|
16324
16812
|
disabled: isDisabled,
|
|
16325
16813
|
value: sliderValue,
|
|
16814
|
+
onKeyDown: upDownNavigation,
|
|
16326
16815
|
onChange: function onChange(e, val) {
|
|
16327
16816
|
onChangeDimensionValue(values[val].toString());
|
|
16328
|
-
|
|
16817
|
+
|
|
16818
|
+
if (!managedValue) {
|
|
16819
|
+
setCurrentIndex(val);
|
|
16820
|
+
}
|
|
16329
16821
|
}
|
|
16330
16822
|
}))), /*#__PURE__*/React.createElement(CustomTooltip, {
|
|
16331
16823
|
title: layerTitle
|
|
@@ -16357,7 +16849,10 @@ var DimensionSelectSlider = function DimensionSelectSlider(_ref) {
|
|
|
16357
16849
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
16358
16850
|
* */
|
|
16359
16851
|
var marksByDimension = function marksByDimension(dim) {
|
|
16360
|
-
if (!dim || !dim.name)
|
|
16852
|
+
if (!dim || !dim.name) {
|
|
16853
|
+
return [];
|
|
16854
|
+
}
|
|
16855
|
+
|
|
16361
16856
|
var dimCnf = dimensionConfig.find(function (cnf) {
|
|
16362
16857
|
return cnf.name === dim.name;
|
|
16363
16858
|
});
|
|
@@ -16383,7 +16878,9 @@ var marksByDimension = function marksByDimension(dim) {
|
|
|
16383
16878
|
|
|
16384
16879
|
var handleMomentISOString = function handleMomentISOString(dateIn) {
|
|
16385
16880
|
/* Try to fix the timestrings generated by moment js made with moment.toISOString() */
|
|
16386
|
-
if (!dateIn)
|
|
16881
|
+
if (!dateIn) {
|
|
16882
|
+
return null;
|
|
16883
|
+
}
|
|
16387
16884
|
|
|
16388
16885
|
if (dateIn.length > 20) {
|
|
16389
16886
|
var fixedDate = dateIn.substring(0, 19);
|
|
@@ -17088,7 +17585,10 @@ var TimeStepButton = function TimeStepButton(_ref) {
|
|
|
17088
17585
|
};
|
|
17089
17586
|
|
|
17090
17587
|
var handleToggleTimeStep = function handleToggleTimeStep() {
|
|
17091
|
-
if (isTimestepAuto)
|
|
17588
|
+
if (isTimestepAuto) {
|
|
17589
|
+
return;
|
|
17590
|
+
}
|
|
17591
|
+
|
|
17092
17592
|
onToggleTimestepAuto();
|
|
17093
17593
|
timeStepFromLayer && onChangeTimeStep(timeStepFromLayer, MapActionOrigin.map);
|
|
17094
17594
|
};
|
|
@@ -17557,32 +18057,53 @@ var getStepPxLineHeight = function getStepPxLineHeight(scale, timestep) {
|
|
|
17557
18057
|
switch (scale) {
|
|
17558
18058
|
case Scale.Hour:
|
|
17559
18059
|
{
|
|
17560
|
-
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
|
+
}
|
|
17561
18068
|
|
|
17562
|
-
if (rem % (15 * 60) === 0) return TICK_MARK_HEIGHT_SECONDARY;
|
|
17563
18069
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
17564
18070
|
}
|
|
17565
18071
|
|
|
17566
18072
|
case Scale.Hours3:
|
|
17567
18073
|
{
|
|
17568
|
-
if (rem === 0)
|
|
18074
|
+
if (rem === 0) {
|
|
18075
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18076
|
+
}
|
|
18077
|
+
|
|
17569
18078
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
17570
18079
|
}
|
|
17571
18080
|
|
|
17572
18081
|
case Scale.Hours6:
|
|
17573
18082
|
{
|
|
17574
|
-
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
|
+
}
|
|
17575
18091
|
|
|
17576
|
-
if (rem % (3 * 60 * 60) === 0) return TICK_MARK_HEIGHT_SECONDARY;
|
|
17577
18092
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
17578
18093
|
}
|
|
17579
18094
|
|
|
17580
18095
|
default:
|
|
17581
18096
|
{
|
|
17582
18097
|
// Scale.Day
|
|
17583
|
-
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
|
+
}
|
|
17584
18106
|
|
|
17585
|
-
if (rem % (6 * 60 * 60) === 0) return TICK_MARK_HEIGHT_SECONDARY;
|
|
17586
18107
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
17587
18108
|
}
|
|
17588
18109
|
}
|
|
@@ -17592,7 +18113,10 @@ var getStepPxLineHeight = function getStepPxLineHeight(scale, timestep) {
|
|
|
17592
18113
|
{
|
|
17593
18114
|
var weekday = moment.unix(timestep).utc().isoWeekday(); // momentjs isoWeekdays range from 1(Monday) to 7(Sunday)
|
|
17594
18115
|
|
|
17595
|
-
if (weekday === 1)
|
|
18116
|
+
if (weekday === 1) {
|
|
18117
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18118
|
+
}
|
|
18119
|
+
|
|
17596
18120
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
17597
18121
|
}
|
|
17598
18122
|
|
|
@@ -17600,15 +18124,24 @@ var getStepPxLineHeight = function getStepPxLineHeight(scale, timestep) {
|
|
|
17600
18124
|
{
|
|
17601
18125
|
var month = moment.unix(timestep).utc().month(); // momentjs months are zero indexed
|
|
17602
18126
|
|
|
17603
|
-
if (month === 0)
|
|
17604
|
-
|
|
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
|
+
|
|
17605
18135
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
17606
18136
|
}
|
|
17607
18137
|
|
|
17608
18138
|
case Scale.Minutes5:
|
|
17609
18139
|
{
|
|
17610
18140
|
// add primary line on day change
|
|
17611
|
-
if (timestep % (60 * 60 * 24) === 0)
|
|
18141
|
+
if (timestep % (60 * 60 * 24) === 0) {
|
|
18142
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18143
|
+
}
|
|
18144
|
+
|
|
17612
18145
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
17613
18146
|
}
|
|
17614
18147
|
|
|
@@ -17626,31 +18159,52 @@ var getStepPxLineHeightForDataScale = function getStepPxLineHeightForDataScale(s
|
|
|
17626
18159
|
switch (scale) {
|
|
17627
18160
|
case Scale.Hour:
|
|
17628
18161
|
{
|
|
17629
|
-
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
|
+
}
|
|
17630
18170
|
|
|
17631
|
-
if (rem % (15 * 60) === 0) return TICK_MARK_HEIGHT_SECONDARY;
|
|
17632
18171
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
17633
18172
|
}
|
|
17634
18173
|
|
|
17635
18174
|
case Scale.Hours3:
|
|
17636
18175
|
{
|
|
17637
|
-
if (rem === 0)
|
|
18176
|
+
if (rem === 0) {
|
|
18177
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18178
|
+
}
|
|
18179
|
+
|
|
17638
18180
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
17639
18181
|
}
|
|
17640
18182
|
|
|
17641
18183
|
case Scale.Hours6:
|
|
17642
18184
|
{
|
|
17643
|
-
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
|
+
}
|
|
17644
18193
|
|
|
17645
|
-
if (rem % (3 * 60 * 60) === 0) return TICK_MARK_HEIGHT_SECONDARY;
|
|
17646
18194
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
17647
18195
|
}
|
|
17648
18196
|
|
|
17649
18197
|
case Scale.Day:
|
|
17650
18198
|
{
|
|
17651
|
-
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
|
+
}
|
|
17652
18207
|
|
|
17653
|
-
if (rem % (6 * 60 * 60) === 0) return TICK_MARK_HEIGHT_SECONDARY;
|
|
17654
18208
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
17655
18209
|
}
|
|
17656
18210
|
|
|
@@ -17658,7 +18212,10 @@ var getStepPxLineHeightForDataScale = function getStepPxLineHeightForDataScale(s
|
|
|
17658
18212
|
{
|
|
17659
18213
|
var weekday = moment.unix(timestep).utc().isoWeekday(); // momentjs isoWeekdays range from 1(Monday) to 7(Sunday)
|
|
17660
18214
|
|
|
17661
|
-
if (weekday === 1)
|
|
18215
|
+
if (weekday === 1) {
|
|
18216
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18217
|
+
}
|
|
18218
|
+
|
|
17662
18219
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
17663
18220
|
}
|
|
17664
18221
|
|
|
@@ -17666,14 +18223,20 @@ var getStepPxLineHeightForDataScale = function getStepPxLineHeightForDataScale(s
|
|
|
17666
18223
|
{
|
|
17667
18224
|
var month = moment.unix(timestep).utc().month(); // momentjs months are zero indexed
|
|
17668
18225
|
|
|
17669
|
-
if (month === 0)
|
|
18226
|
+
if (month === 0) {
|
|
18227
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18228
|
+
}
|
|
18229
|
+
|
|
17670
18230
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
17671
18231
|
}
|
|
17672
18232
|
|
|
17673
18233
|
case Scale.Minutes5:
|
|
17674
18234
|
{
|
|
17675
18235
|
// add primary line on day change
|
|
17676
|
-
if (timestep % (60 * 60 * 24) === 0)
|
|
18236
|
+
if (timestep % (60 * 60 * 24) === 0) {
|
|
18237
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18238
|
+
}
|
|
18239
|
+
|
|
17677
18240
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
17678
18241
|
}
|
|
17679
18242
|
|
|
@@ -17713,7 +18276,10 @@ var drawTimeText = function drawTimeText(ctx, theme, stepPx, height, timeText, s
|
|
|
17713
18276
|
};
|
|
17714
18277
|
|
|
17715
18278
|
var drawUpperText = function drawUpperText(ctx, theme, newDate, stepPx, height, minOffset) {
|
|
17716
|
-
if (stepPx <= 0)
|
|
18279
|
+
if (stepPx <= 0) {
|
|
18280
|
+
return;
|
|
18281
|
+
}
|
|
18282
|
+
|
|
17717
18283
|
var ctx2 = ctx;
|
|
17718
18284
|
var _theme$palette$geoweb2 = theme.palette.geowebColors.timeSlider.timelineText,
|
|
17719
18285
|
fontSize = _theme$palette$geoweb2.fontSize,
|
|
@@ -18085,7 +18651,10 @@ var drawTimeScale = function drawTimeScale(context, theme, visibleTimeStart, vis
|
|
|
18085
18651
|
} // draw date change texts
|
|
18086
18652
|
|
|
18087
18653
|
|
|
18088
|
-
if (scale === Scale.Year && fundamentalScale === Scale.Year)
|
|
18654
|
+
if (scale === Scale.Year && fundamentalScale === Scale.Year) {
|
|
18655
|
+
return;
|
|
18656
|
+
}
|
|
18657
|
+
|
|
18089
18658
|
var timestepUnit = getDateChangeTimestepUnit(fundamentalScale);
|
|
18090
18659
|
|
|
18091
18660
|
var _getCustomRoundedStar3 = getCustomRoundedStartAndEnd(visibleTimeStart, visibleTimeEnd, timestepUnit),
|
|
@@ -18124,7 +18693,10 @@ var drawTimeScale = function drawTimeScale(context, theme, visibleTimeStart, vis
|
|
|
18124
18693
|
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
18125
18694
|
* */
|
|
18126
18695
|
var drawNeedle = function drawNeedle(context, theme, width, height, startTime, endTime, selectedTime) {
|
|
18127
|
-
if (!selectedTime)
|
|
18696
|
+
if (!selectedTime) {
|
|
18697
|
+
return;
|
|
18698
|
+
}
|
|
18699
|
+
|
|
18128
18700
|
var ctx = context;
|
|
18129
18701
|
var _theme$palette$geoweb = theme.palette.geowebColors.timeSlider,
|
|
18130
18702
|
playerNeedlePlayer = _theme$palette$geoweb.playerNeedlePlayer,
|
|
@@ -18249,7 +18821,9 @@ var drawBackground = function drawBackground(context, theme, visibleTimeStart, v
|
|
|
18249
18821
|
function drawNightOrAlternateTime() {
|
|
18250
18822
|
var colorChangeTimesteps = getColorChangeTimesteps(scale, visibleTimeStart, visibleTimeEnd);
|
|
18251
18823
|
colorChangeTimesteps.forEach(function (timestep, i, arr) {
|
|
18252
|
-
if (i === 0)
|
|
18824
|
+
if (i === 0) {
|
|
18825
|
+
return;
|
|
18826
|
+
}
|
|
18253
18827
|
|
|
18254
18828
|
var _map = [arr[i - 1], timestep].map(function (timestep) {
|
|
18255
18829
|
return timestampToPixelEdges(timestep, visibleTimeStart, visibleTimeEnd, canvasWidth);
|
|
@@ -18441,7 +19015,9 @@ function useAnimationTime(animationStartTime, animationEndTime, onSetAnimationSt
|
|
|
18441
19015
|
|
|
18442
19016
|
}, [leftMarkerDragging, rightMarkerDragging, animationAreaDragging]);
|
|
18443
19017
|
var handleAnimationDragging = useCallback(function (x) {
|
|
18444
|
-
if (!localAnimationStartTime || !localAnimationEndTime)
|
|
19018
|
+
if (!localAnimationStartTime || !localAnimationEndTime) {
|
|
19019
|
+
return;
|
|
19020
|
+
}
|
|
18445
19021
|
|
|
18446
19022
|
var _map = [localAnimationStartTime, localAnimationEndTime].map(function (timestamp) {
|
|
18447
19023
|
return timestampToPixel(timestamp, centerTime, canvasWidth, secondsPerPx);
|
|
@@ -18453,7 +19029,11 @@ function useAnimationTime(animationStartTime, animationEndTime, onSetAnimationSt
|
|
|
18453
19029
|
if (leftMarkerDragging) {
|
|
18454
19030
|
var mousePosition = leftMarkerPx + x;
|
|
18455
19031
|
var rightAnimationPosition = rightMarkerPx - DRAG_AREA_WIDTH * 2;
|
|
18456
|
-
|
|
19032
|
+
|
|
19033
|
+
if (mousePosition >= rightAnimationPosition || mousePosition <= 0) {
|
|
19034
|
+
return;
|
|
19035
|
+
} // eslint-disable-next-line no-param-reassign
|
|
19036
|
+
|
|
18457
19037
|
|
|
18458
19038
|
dragTooltipPosition.current = pixelsToLeft ? mousePosition + pixelsToLeft : mousePosition;
|
|
18459
19039
|
var mouseTimeUnix = pixelToTimestamp(mousePosition, centerTime, canvasWidth, secondsPerPx);
|
|
@@ -18466,7 +19046,11 @@ function useAnimationTime(animationStartTime, animationEndTime, onSetAnimationSt
|
|
|
18466
19046
|
var _mousePosition = rightMarkerPx + x;
|
|
18467
19047
|
|
|
18468
19048
|
var leftAnimationPosition = leftMarkerPx + DRAG_AREA_WIDTH * 2;
|
|
18469
|
-
|
|
19049
|
+
|
|
19050
|
+
if (leftAnimationPosition >= _mousePosition || _mousePosition >= canvasWidth) {
|
|
19051
|
+
return;
|
|
19052
|
+
} // eslint-disable-next-line no-param-reassign
|
|
19053
|
+
|
|
18470
19054
|
|
|
18471
19055
|
dragTooltipPosition.current = pixelsToLeft ? _mousePosition + pixelsToLeft : _mousePosition;
|
|
18472
19056
|
|
|
@@ -18627,7 +19211,9 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
|
|
|
18627
19211
|
}, [canvasWidth, centerTime, dataEndTime, dataStartTime, onSetNewDate, secondsPerPx, setUnfilteredSelectedTime, timeStep, unfilteredSelectedTime]);
|
|
18628
19212
|
React.useEffect(function () {
|
|
18629
19213
|
var handleMouseMove = function handleMouseMove(event) {
|
|
18630
|
-
if (event.movementX === 0)
|
|
19214
|
+
if (event.movementX === 0) {
|
|
19215
|
+
return;
|
|
19216
|
+
}
|
|
18631
19217
|
|
|
18632
19218
|
if (mouseDownInLegend) {
|
|
18633
19219
|
var dragDistanceTime = event.movementX * secondsPerPx;
|
|
@@ -18712,7 +19298,9 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
|
|
|
18712
19298
|
isClickOrDrag.current = 'drag';
|
|
18713
19299
|
}
|
|
18714
19300
|
|
|
18715
|
-
if (selectedTimeDragging || leftMarkerDragging || rightMarkerDragging)
|
|
19301
|
+
if (selectedTimeDragging || leftMarkerDragging || rightMarkerDragging) {
|
|
19302
|
+
return;
|
|
19303
|
+
}
|
|
18716
19304
|
|
|
18717
19305
|
var _map5 = [localAnimationStartTime, localAnimationEndTime, selectedTime].map(function (timestamp) {
|
|
18718
19306
|
return timestampToPixel(timestamp, centerTime, width, secondsPerPx);
|
|
@@ -18833,7 +19421,10 @@ var HideSliderButton = function HideSliderButton(_ref) {
|
|
|
18833
19421
|
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
18834
19422
|
* */
|
|
18835
19423
|
var onMouseMove = function onMouseMove(x, width, selectedTime, centerTime, secondsPerPx, mouseDownInTimeBox, isTimeBoxArea, setCursorStyle) {
|
|
18836
|
-
if (!selectedTime || mouseDownInTimeBox)
|
|
19424
|
+
if (!selectedTime || mouseDownInTimeBox) {
|
|
19425
|
+
return;
|
|
19426
|
+
}
|
|
19427
|
+
|
|
18837
19428
|
var selectedTimePx = timestampToPixel(selectedTime, centerTime, width, secondsPerPx);
|
|
18838
19429
|
|
|
18839
19430
|
if (isTimeBoxArea(x, selectedTimePx)) {
|
|
@@ -18843,7 +19434,10 @@ var onMouseMove = function onMouseMove(x, width, selectedTime, centerTime, secon
|
|
|
18843
19434
|
}
|
|
18844
19435
|
};
|
|
18845
19436
|
var onMouseDown = function onMouseDown(x, width, selectedTime, centerTime, secondsPerPx, isTimeBoxArea, setCursorStyle, setMouseDownInTimeBox) {
|
|
18846
|
-
if (!selectedTime)
|
|
19437
|
+
if (!selectedTime) {
|
|
19438
|
+
return;
|
|
19439
|
+
}
|
|
19440
|
+
|
|
18847
19441
|
var selectedTimePx = timestampToPixel(selectedTime, centerTime, width, secondsPerPx);
|
|
18848
19442
|
|
|
18849
19443
|
if (isTimeBoxArea(x, selectedTimePx)) {
|
|
@@ -19017,12 +19611,16 @@ var TimeSliderCurrentTimeBox = function TimeSliderCurrentTimeBox(_ref) {
|
|
|
19017
19611
|
}, /*#__PURE__*/React__default.createElement(CanvasComponent, {
|
|
19018
19612
|
ref: node,
|
|
19019
19613
|
onMouseMove: function onMouseMove$1(x, y, event, width) {
|
|
19020
|
-
if (!selectedTime)
|
|
19614
|
+
if (!selectedTime) {
|
|
19615
|
+
return;
|
|
19616
|
+
}
|
|
19021
19617
|
|
|
19022
19618
|
onMouseMove(x, width, selectedTime, centerTime, secondsPerPx, mouseDownInTimeBox, isTimeBoxArea, setCursorStyle);
|
|
19023
19619
|
},
|
|
19024
19620
|
onMouseDown: function onMouseDown$1(x, y, width) {
|
|
19025
|
-
if (!selectedTime)
|
|
19621
|
+
if (!selectedTime) {
|
|
19622
|
+
return;
|
|
19623
|
+
}
|
|
19026
19624
|
|
|
19027
19625
|
onMouseDown(x, width, selectedTime, centerTime, secondsPerPx, isTimeBoxArea, setCursorStyle, setMouseDownInTimeBox);
|
|
19028
19626
|
},
|
|
@@ -19286,11 +19884,11 @@ var TimeStepButtonComponent = function TimeStepButtonComponent(_ref) {
|
|
|
19286
19884
|
var isTimestepAuto$1 = useSelector(function (store) {
|
|
19287
19885
|
return isTimestepAuto(store, mapId);
|
|
19288
19886
|
});
|
|
19289
|
-
var
|
|
19290
|
-
return
|
|
19887
|
+
var autoTimeStepLayerId = useSelector(function (store) {
|
|
19888
|
+
return getAutoTimeStepLayerId(store, mapId);
|
|
19291
19889
|
});
|
|
19292
19890
|
var activeLayerTimeDimension = useSelector(function (store) {
|
|
19293
|
-
return getLayerTimeDimension(store,
|
|
19891
|
+
return getLayerTimeDimension(store, autoTimeStepLayerId);
|
|
19294
19892
|
});
|
|
19295
19893
|
var timeStepFromLayer = getActiveLayerTimeStep(activeLayerTimeDimension);
|
|
19296
19894
|
var onToggleTimestepAuto = React.useCallback(function () {
|
|
@@ -19805,10 +20403,12 @@ var TimeSliderCurrentTimeBoxConnectComponent = function TimeSliderCurrentTimeBox
|
|
|
19805
20403
|
isAutoUpdating: isAutoUpdating,
|
|
19806
20404
|
unfilteredSelectedTime: unfilteredSelectedTime || selectedTime,
|
|
19807
20405
|
setUnfilteredSelectedTime: function setUnfilteredSelectedTime(timeSliderUnfilteredSelectedTime) {
|
|
19808
|
-
if (setTimeSliderUnfilteredSelectedTime)
|
|
19809
|
-
|
|
19810
|
-
|
|
19811
|
-
|
|
20406
|
+
if (setTimeSliderUnfilteredSelectedTime) {
|
|
20407
|
+
setTimeSliderUnfilteredSelectedTime({
|
|
20408
|
+
timeSliderUnfilteredSelectedTime: timeSliderUnfilteredSelectedTime,
|
|
20409
|
+
mapId: mapId
|
|
20410
|
+
});
|
|
20411
|
+
}
|
|
19812
20412
|
},
|
|
19813
20413
|
onSetNewDate: function onSetNewDate(newDate) {
|
|
19814
20414
|
if (isAnimating) {
|
|
@@ -19829,14 +20429,14 @@ var TimeSliderCurrentTimeBoxConnectComponent = function TimeSliderCurrentTimeBox
|
|
|
19829
20429
|
var TimeSliderCurrentTimeBoxConnect = connectRedux(TimeSliderCurrentTimeBoxConnectComponent);
|
|
19830
20430
|
|
|
19831
20431
|
var useUpdateTimestep = function useUpdateTimestep(mapId) {
|
|
19832
|
-
var
|
|
19833
|
-
return
|
|
20432
|
+
var autoTimeStepLayerId = useSelector(function (store) {
|
|
20433
|
+
return getAutoTimeStepLayerId(store, mapId);
|
|
19834
20434
|
});
|
|
19835
20435
|
var isTimeStepAuto = useSelector(function (store) {
|
|
19836
20436
|
return isTimestepAuto(store, mapId);
|
|
19837
20437
|
});
|
|
19838
20438
|
var timeDimension = useSelector(function (store) {
|
|
19839
|
-
return getLayerTimeDimension(store,
|
|
20439
|
+
return getLayerTimeDimension(store, autoTimeStepLayerId);
|
|
19840
20440
|
});
|
|
19841
20441
|
var dispatch = useDispatch();
|
|
19842
20442
|
React.useEffect(function () {
|
|
@@ -19847,7 +20447,7 @@ var useUpdateTimestep = function useUpdateTimestep(mapId) {
|
|
|
19847
20447
|
timeStep: timeStep
|
|
19848
20448
|
}));
|
|
19849
20449
|
}
|
|
19850
|
-
}, [
|
|
20450
|
+
}, [autoTimeStepLayerId, dispatch, isTimeStepAuto, mapId, timeDimension]);
|
|
19851
20451
|
};
|
|
19852
20452
|
|
|
19853
20453
|
var TimeSliderConnect = function TimeSliderConnect(_ref) {
|
|
@@ -20986,8 +21586,11 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
20986
21586
|
var to = getProj4(proj.crs);
|
|
20987
21587
|
|
|
20988
21588
|
for (var j = 0; j < featureCoords.length; j += 1) {
|
|
20989
|
-
|
|
20990
|
-
|
|
21589
|
+
if (featureCoords[j].length < 2) {
|
|
21590
|
+
// eslint-disable-next-line no-continue
|
|
21591
|
+
continue;
|
|
21592
|
+
}
|
|
21593
|
+
|
|
20991
21594
|
var coordinates = {
|
|
20992
21595
|
x: featureCoords[j][0],
|
|
20993
21596
|
y: featureCoords[j][1]
|
|
@@ -21307,12 +21910,16 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
21307
21910
|
isInEditMode = _this$props2.isInEditMode,
|
|
21308
21911
|
featureNrToEdit = _this$props2.featureNrToEdit,
|
|
21309
21912
|
onHoverFeature = _this$props2.onHoverFeature;
|
|
21310
|
-
|
|
21913
|
+
|
|
21914
|
+
if (event && event.rightButton === true) {
|
|
21915
|
+
return undefined;
|
|
21916
|
+
}
|
|
21311
21917
|
/* adagucMouseMove is an event callback function which is triggered when the mouse moves over the map
|
|
21312
21918
|
This event is only triggered if the map is in hover state.
|
|
21313
21919
|
E.g. when the map is dragging/panning, this event is not triggerd
|
|
21314
21920
|
*/
|
|
21315
21921
|
|
|
21922
|
+
|
|
21316
21923
|
var mouseX = event.mouseX,
|
|
21317
21924
|
mouseY = event.mouseY,
|
|
21318
21925
|
mouseDown = event.mouseDown;
|
|
@@ -21352,7 +21959,11 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
21352
21959
|
}
|
|
21353
21960
|
|
|
21354
21961
|
var feature = this.geojson.features[featureNrToEdit];
|
|
21355
|
-
|
|
21962
|
+
|
|
21963
|
+
if (!feature) {
|
|
21964
|
+
return undefined;
|
|
21965
|
+
}
|
|
21966
|
+
|
|
21356
21967
|
var webmapjs = this.props.webmapjs;
|
|
21357
21968
|
this.mouseGeoCoord = webmapjs.getLatLongFromPixelCoord({
|
|
21358
21969
|
x: mouseX,
|
|
@@ -21428,7 +22039,10 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
21428
22039
|
value: function triggerMouseDownTimer(event) {
|
|
21429
22040
|
var _this3 = this;
|
|
21430
22041
|
|
|
21431
|
-
if (!this.doubleClickTimer)
|
|
22042
|
+
if (!this.doubleClickTimer) {
|
|
22043
|
+
this.doubleClickTimer = {};
|
|
22044
|
+
}
|
|
22045
|
+
|
|
21432
22046
|
var mouseX = event.mouseX,
|
|
21433
22047
|
mouseY = event.mouseY;
|
|
21434
22048
|
|
|
@@ -21558,12 +22172,19 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
21558
22172
|
if (this.myDrawMode === DRAWMODE.POINT || this.myDrawMode === DRAWMODE.MULTIPOINT) {
|
|
21559
22173
|
/* Create points */
|
|
21560
22174
|
var pointGeometry = feature.geometry;
|
|
21561
|
-
|
|
21562
|
-
|
|
22175
|
+
|
|
22176
|
+
if (pointGeometry) {
|
|
22177
|
+
if (pointGeometry.coordinates === undefined) {
|
|
22178
|
+
pointGeometry.coordinates = [];
|
|
22179
|
+
}
|
|
21563
22180
|
}
|
|
22181
|
+
|
|
21564
22182
|
var multiPointGeometry = feature.geometry;
|
|
21565
|
-
|
|
21566
|
-
|
|
22183
|
+
|
|
22184
|
+
if (multiPointGeometry) {
|
|
22185
|
+
if (multiPointGeometry.coordinates === undefined) {
|
|
22186
|
+
multiPointGeometry.coordinates = [[]];
|
|
22187
|
+
}
|
|
21567
22188
|
}
|
|
21568
22189
|
|
|
21569
22190
|
if (this.myDrawMode === DRAWMODE.POINT) {
|
|
@@ -21604,8 +22225,11 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
21604
22225
|
if (this.myDrawMode === DRAWMODE.POLYGON || this.myDrawMode === DRAWMODE.BOX) {
|
|
21605
22226
|
/* Create poly's and boxes */
|
|
21606
22227
|
this.myEditMode = EDITMODE.ADD_FEATURE;
|
|
21607
|
-
|
|
21608
|
-
|
|
22228
|
+
|
|
22229
|
+
if (feature.geometry) {
|
|
22230
|
+
if (feature.geometry.coordinates === undefined) {
|
|
22231
|
+
feature.geometry.coordinates = [[]];
|
|
22232
|
+
}
|
|
21609
22233
|
}
|
|
21610
22234
|
|
|
21611
22235
|
if (feature.geometry.coordinates[0] === undefined || feature.geometry.coordinates[0].length === 0) {
|
|
@@ -21761,7 +22385,10 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
21761
22385
|
key: "adagucMouseDown",
|
|
21762
22386
|
value: function adagucMouseDown(event) {
|
|
21763
22387
|
var isInEditMode = this.props.isInEditMode;
|
|
21764
|
-
|
|
22388
|
+
|
|
22389
|
+
if (event && event.rightButton === true) {
|
|
22390
|
+
return;
|
|
22391
|
+
}
|
|
21765
22392
|
|
|
21766
22393
|
if (isInEditMode === false) {
|
|
21767
22394
|
return;
|
|
@@ -21787,11 +22414,14 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
21787
22414
|
// eslint-disable-next-line consistent-return
|
|
21788
22415
|
|
|
21789
22416
|
|
|
21790
|
-
if (this.insertVertexInEdge(event) === false)
|
|
22417
|
+
if (this.insertVertexInEdge(event) === false) {
|
|
22418
|
+
return false;
|
|
22419
|
+
}
|
|
21791
22420
|
/* This is trigged when a new feature is created. */
|
|
21792
22421
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
21793
22422
|
// @ts-ignore
|
|
21794
22423
|
|
|
22424
|
+
|
|
21795
22425
|
if (this.createNewFeature(event) === false) {
|
|
21796
22426
|
/* Start with mouse move from this mouse down location, enables sizing the box while moving the mouse */
|
|
21797
22427
|
this.adagucMouseMove(event);
|
|
@@ -21800,13 +22430,22 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
21800
22430
|
/* This is triggered when new points are added during the addmultipoint mode. One point is added per time */
|
|
21801
22431
|
|
|
21802
22432
|
|
|
21803
|
-
if (this.addPointToMultiPointFeature(event) === false)
|
|
22433
|
+
if (this.addPointToMultiPointFeature(event) === false) {
|
|
22434
|
+
return false;
|
|
22435
|
+
}
|
|
21804
22436
|
/* This is triggered when new points are added during the addpolygon mode. One point is added per time */
|
|
21805
22437
|
|
|
21806
|
-
|
|
22438
|
+
|
|
22439
|
+
if (this.addVerticesToPolygonFeature(event) === false) {
|
|
22440
|
+
return false;
|
|
22441
|
+
}
|
|
21807
22442
|
/* This is triggered when new points are added to a linestring */
|
|
21808
22443
|
|
|
21809
|
-
|
|
22444
|
+
|
|
22445
|
+
if (this.addPointToLineStringFeature(event) === false) {
|
|
22446
|
+
return false;
|
|
22447
|
+
}
|
|
22448
|
+
|
|
21810
22449
|
return false;
|
|
21811
22450
|
/* False means that this component will take over entire controll.
|
|
21812
22451
|
True means that it is still possible to pan and drag the map while editing */
|
|
@@ -21875,7 +22514,10 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
21875
22514
|
var _this$props10 = this.props,
|
|
21876
22515
|
isInEditMode = _this$props10.isInEditMode,
|
|
21877
22516
|
onClickFeature = _this$props10.onClickFeature;
|
|
21878
|
-
|
|
22517
|
+
|
|
22518
|
+
if (event && event.rightButton === true) {
|
|
22519
|
+
return;
|
|
22520
|
+
}
|
|
21879
22521
|
|
|
21880
22522
|
if (onClickFeature) {
|
|
21881
22523
|
var mouseX = event.mouseX,
|
|
@@ -22018,18 +22660,34 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
22018
22660
|
}, {
|
|
22019
22661
|
key: "validateFeature",
|
|
22020
22662
|
value: function validateFeature(feature) {
|
|
22021
|
-
if (!feature.properties)
|
|
22022
|
-
|
|
22023
|
-
|
|
22024
|
-
|
|
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
|
+
}
|
|
22025
22678
|
}
|
|
22026
22679
|
}, {
|
|
22027
22680
|
key: "validatePolys",
|
|
22028
22681
|
value: function validatePolys(fixPolys) {
|
|
22029
|
-
if (!this.geojson || !this.geojson.features || !this.geojson.features.length)
|
|
22682
|
+
if (!this.geojson || !this.geojson.features || !this.geojson.features.length) {
|
|
22683
|
+
return;
|
|
22684
|
+
}
|
|
22030
22685
|
|
|
22031
22686
|
for (var featureIndex = 0; featureIndex < this.geojson.features.length; featureIndex += 1) {
|
|
22032
|
-
if (!this.geojson.features)
|
|
22687
|
+
if (!this.geojson.features) {
|
|
22688
|
+
this.geojson.features = [];
|
|
22689
|
+
}
|
|
22690
|
+
|
|
22033
22691
|
var feature = this.geojson.features[featureIndex];
|
|
22034
22692
|
this.validateFeature(feature);
|
|
22035
22693
|
var featureType = feature.geometry.type;
|
|
@@ -22111,7 +22769,11 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
22111
22769
|
var _this$props12 = this.props,
|
|
22112
22770
|
featureNrToEdit = _this$props12.featureNrToEdit,
|
|
22113
22771
|
isInEditMode = _this$props12.isInEditMode;
|
|
22114
|
-
|
|
22772
|
+
|
|
22773
|
+
if (!this.geojson || !this.geojson.features || !this.geojson.features.length) {
|
|
22774
|
+
return;
|
|
22775
|
+
}
|
|
22776
|
+
|
|
22115
22777
|
this.textPositions = [];
|
|
22116
22778
|
this.mouseOverPolygonCoordinates = [];
|
|
22117
22779
|
this.mouseOverPolygonFeatureIndex = -1;
|
|
@@ -22596,12 +23258,23 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
22596
23258
|
isInEditMode = _this$props13.isInEditMode,
|
|
22597
23259
|
featureNrToEdit = _this$props13.featureNrToEdit;
|
|
22598
23260
|
var feature = this.geojson.features[featureIndex];
|
|
22599
|
-
|
|
22600
|
-
if (feature.geometry
|
|
23261
|
+
|
|
23262
|
+
if (!feature || !feature.geometry) {
|
|
23263
|
+
return;
|
|
23264
|
+
}
|
|
23265
|
+
|
|
23266
|
+
if (feature.geometry.type !== 'LineString') {
|
|
23267
|
+
return;
|
|
23268
|
+
}
|
|
23269
|
+
|
|
22601
23270
|
var lineProps = feature.properties;
|
|
22602
|
-
|
|
23271
|
+
|
|
23272
|
+
if (!lineProps) {
|
|
23273
|
+
lineProps = this.defaultLineStringProps;
|
|
23274
|
+
}
|
|
22603
23275
|
/* Draw polygons and calculate center of poly */
|
|
22604
23276
|
|
|
23277
|
+
|
|
22605
23278
|
var middle = {
|
|
22606
23279
|
x: 0,
|
|
22607
23280
|
y: 0,
|
|
@@ -22672,12 +23345,23 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
22672
23345
|
isInEditMode = _this$props14.isInEditMode,
|
|
22673
23346
|
featureNrToEdit = _this$props14.featureNrToEdit;
|
|
22674
23347
|
var feature = this.geojson.features[featureIndex];
|
|
22675
|
-
|
|
22676
|
-
if (feature
|
|
23348
|
+
|
|
23349
|
+
if (!feature || !feature.geometry) {
|
|
23350
|
+
return;
|
|
23351
|
+
}
|
|
23352
|
+
|
|
23353
|
+
if (feature.geometry.type !== 'Polygon' && feature.geometry.type !== 'MultiPolygon') {
|
|
23354
|
+
return;
|
|
23355
|
+
}
|
|
23356
|
+
|
|
22677
23357
|
var polyProps = feature.properties;
|
|
22678
|
-
|
|
23358
|
+
|
|
23359
|
+
if (!polyProps) {
|
|
23360
|
+
polyProps = this.defaultPolyProps;
|
|
23361
|
+
}
|
|
22679
23362
|
/* Draw polygons and calculate center of poly */
|
|
22680
23363
|
|
|
23364
|
+
|
|
22681
23365
|
var middle = {
|
|
22682
23366
|
x: 0,
|
|
22683
23367
|
y: 0,
|
|
@@ -22751,8 +23435,11 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
22751
23435
|
var XYCoords = [];
|
|
22752
23436
|
|
|
22753
23437
|
for (var j = 0; j < featureCoords.length; j += 1) {
|
|
22754
|
-
|
|
22755
|
-
|
|
23438
|
+
if (featureCoords[j].length < 2) {
|
|
23439
|
+
// eslint-disable-next-line no-continue
|
|
23440
|
+
continue;
|
|
23441
|
+
}
|
|
23442
|
+
|
|
22756
23443
|
var coord = webmapjs.getPixelCoordFromLatLong({
|
|
22757
23444
|
x: featureCoords[j][0],
|
|
22758
23445
|
y: featureCoords[j][1]
|
|
@@ -22785,7 +23472,10 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
22785
23472
|
} else {
|
|
22786
23473
|
this.validateFeature(feature); // eslint-disable-next-line no-underscore-dangle
|
|
22787
23474
|
|
|
22788
|
-
if (feature.properties._adaguctype)
|
|
23475
|
+
if (feature.properties._adaguctype) {
|
|
23476
|
+
delete feature.properties._adaguctype;
|
|
23477
|
+
} // eslint-disable-next-line default-case
|
|
23478
|
+
|
|
22789
23479
|
|
|
22790
23480
|
switch (type) {
|
|
22791
23481
|
case DRAWMODE.POINT:
|
|
@@ -22794,8 +23484,12 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
22794
23484
|
|
|
22795
23485
|
case DRAWMODE.MULTIPOINT:
|
|
22796
23486
|
feature.geometry.type = 'MultiPoint';
|
|
22797
|
-
|
|
23487
|
+
|
|
23488
|
+
if (feature.geometry.coordinates.length === 0) {
|
|
23489
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22798
23490
|
feature.geometry.coordinates.push([]);
|
|
23491
|
+
}
|
|
23492
|
+
|
|
22799
23493
|
break;
|
|
22800
23494
|
|
|
22801
23495
|
case DRAWMODE.BOX:
|
|
@@ -22806,14 +23500,22 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
22806
23500
|
|
|
22807
23501
|
case DRAWMODE.POLYGON:
|
|
22808
23502
|
feature.geometry.type = 'Polygon';
|
|
22809
|
-
|
|
23503
|
+
|
|
23504
|
+
if (feature.geometry.coordinates.length === 0) {
|
|
23505
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22810
23506
|
feature.geometry.coordinates.push([]);
|
|
23507
|
+
}
|
|
23508
|
+
|
|
22811
23509
|
break;
|
|
22812
23510
|
|
|
22813
23511
|
case DRAWMODE.LINESTRING:
|
|
22814
23512
|
feature.geometry.type = 'LineString';
|
|
22815
|
-
|
|
23513
|
+
|
|
23514
|
+
if (feature.geometry.coordinates.length === 0) {
|
|
23515
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22816
23516
|
feature.geometry.coordinates.push([]);
|
|
23517
|
+
}
|
|
23518
|
+
|
|
22817
23519
|
break;
|
|
22818
23520
|
}
|
|
22819
23521
|
}
|
|
@@ -22824,7 +23526,10 @@ var AdagucMapDraw = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
22824
23526
|
}, {
|
|
22825
23527
|
key: "checkIfFeatureIsBox",
|
|
22826
23528
|
value: function checkIfFeatureIsBox(feature) {
|
|
22827
|
-
if (!feature || !feature.properties || !feature.properties._adaguctype)
|
|
23529
|
+
if (!feature || !feature.properties || !feature.properties._adaguctype) {
|
|
23530
|
+
return false;
|
|
23531
|
+
}
|
|
23532
|
+
|
|
22828
23533
|
return feature.properties._adaguctype === 'box';
|
|
22829
23534
|
}
|
|
22830
23535
|
}, {
|
|
@@ -22955,7 +23660,9 @@ var AdagucMapDrawContainer = function AdagucMapDrawContainer(_ref) {
|
|
|
22955
23660
|
}
|
|
22956
23661
|
},
|
|
22957
23662
|
exitDrawModeCallback: function exitDrawModeCallback() {
|
|
22958
|
-
if (layer.exitDrawModeCallback)
|
|
23663
|
+
if (layer.exitDrawModeCallback) {
|
|
23664
|
+
layer.exitDrawModeCallback();
|
|
23665
|
+
}
|
|
22959
23666
|
},
|
|
22960
23667
|
featureNrToEdit: parseInt(layer.featureNrToEdit || '0', 10)
|
|
22961
23668
|
}));
|
|
@@ -23017,24 +23724,31 @@ var getWMJSLayerFromReactLayer = function getWMJSLayerFromReactLayer(mapId, wmLa
|
|
|
23017
23724
|
var wmjsMap = getWMJSMapById(mapId);
|
|
23018
23725
|
/* Some safety checks */
|
|
23019
23726
|
|
|
23020
|
-
if (!wmjsMap || !wmLayers || !reactLayerId || !layerName)
|
|
23021
|
-
|
|
23022
|
-
|
|
23023
|
-
|
|
23727
|
+
if (!wmjsMap || !wmLayers || !reactLayerId || !layerName) {
|
|
23728
|
+
return {
|
|
23729
|
+
layer: null,
|
|
23730
|
+
layerArrayMutated: false
|
|
23731
|
+
};
|
|
23732
|
+
}
|
|
23024
23733
|
/* Find the wmlayer by its react layer id */
|
|
23025
23734
|
|
|
23735
|
+
|
|
23026
23736
|
var matchingLayerIndex = wmLayers.findIndex(function (wmLayer) {
|
|
23027
23737
|
return wmLayer.id === reactLayerId;
|
|
23028
23738
|
});
|
|
23029
|
-
|
|
23030
|
-
|
|
23031
|
-
|
|
23032
|
-
|
|
23739
|
+
|
|
23740
|
+
if (matchingLayerIndex === -1) {
|
|
23741
|
+
return {
|
|
23742
|
+
layer: null,
|
|
23743
|
+
layerArrayMutated: false
|
|
23744
|
+
};
|
|
23745
|
+
}
|
|
23033
23746
|
/*
|
|
23034
23747
|
The layer order in the react children array index is
|
|
23035
23748
|
reversed compared to the layer order in the wmLayer array index
|
|
23036
23749
|
*/
|
|
23037
23750
|
|
|
23751
|
+
|
|
23038
23752
|
var reactLayerIndex = wmLayers.length - 1 - wmLayerIndex;
|
|
23039
23753
|
var isMapLayer = isAMapLayer(reactWebMapJSLayer.props);
|
|
23040
23754
|
var mapLayerArrayShouldBeMutated = isMapLayer && matchingLayerIndex !== reactLayerIndex;
|
|
@@ -23236,7 +23950,11 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
|
|
|
23236
23950
|
mapId = _this2$props.mapId,
|
|
23237
23951
|
onMapZoomEnd = _this2$props.onMapZoomEnd;
|
|
23238
23952
|
var wmjsMap = getWMJSMapById(mapId);
|
|
23239
|
-
|
|
23953
|
+
|
|
23954
|
+
if (!wmjsMap) {
|
|
23955
|
+
return;
|
|
23956
|
+
}
|
|
23957
|
+
|
|
23240
23958
|
var projectionInfo = wmjsMap.getProjection();
|
|
23241
23959
|
/* Trigger onMapZoomEnd callback */
|
|
23242
23960
|
|
|
@@ -24410,7 +25128,7 @@ var MapViewConnect = function MapViewConnect(_a) {
|
|
|
24410
25128
|
onLayerError: function onLayerError(_, error) {
|
|
24411
25129
|
layerError({
|
|
24412
25130
|
layerId: layer.id,
|
|
24413
|
-
error: error
|
|
25131
|
+
error: "".concat(error)
|
|
24414
25132
|
});
|
|
24415
25133
|
}
|
|
24416
25134
|
}, layer));
|
|
@@ -24421,7 +25139,7 @@ var MapViewConnect = function MapViewConnect(_a) {
|
|
|
24421
25139
|
onLayerError: function onLayerError(_, error) {
|
|
24422
25140
|
layerError({
|
|
24423
25141
|
layerId: layer.id,
|
|
24424
|
-
error: error
|
|
25142
|
+
error: "".concat(error)
|
|
24425
25143
|
});
|
|
24426
25144
|
},
|
|
24427
25145
|
onClickFeature: layer.geojson ? function (event) {
|
|
@@ -24438,7 +25156,7 @@ var MapViewConnect = function MapViewConnect(_a) {
|
|
|
24438
25156
|
onLayerError: function onLayerError(_, error) {
|
|
24439
25157
|
layerError({
|
|
24440
25158
|
layerId: layer.id,
|
|
24441
|
-
error: error
|
|
25159
|
+
error: "".concat(error)
|
|
24442
25160
|
});
|
|
24443
25161
|
}
|
|
24444
25162
|
}, layer));
|
|
@@ -25024,7 +25742,11 @@ var getTitle = function getTitle(layerId) {
|
|
|
25024
25742
|
|
|
25025
25743
|
var getLayersToUpdate = function getLayersToUpdate(layers, mapId) {
|
|
25026
25744
|
var wmjsMap = getWMJSMapById(mapId);
|
|
25027
|
-
|
|
25745
|
+
|
|
25746
|
+
if (!wmjsMap || !layers || layers.length === 0) {
|
|
25747
|
+
return [];
|
|
25748
|
+
}
|
|
25749
|
+
|
|
25028
25750
|
return layers.filter(function (layer) {
|
|
25029
25751
|
return layer && layer.enabled && !!getWMLayerById(layer.id);
|
|
25030
25752
|
}).map(function (layer) {
|
|
@@ -25201,7 +25923,11 @@ var GetFeatureInfoDialog = function GetFeatureInfoDialog(_ref) {
|
|
|
25201
25923
|
title = layer.title,
|
|
25202
25924
|
url = layer.url;
|
|
25203
25925
|
var result = gfiResultMap.get(layerId);
|
|
25204
|
-
|
|
25926
|
+
|
|
25927
|
+
if (!result) {
|
|
25928
|
+
return null;
|
|
25929
|
+
}
|
|
25930
|
+
|
|
25205
25931
|
return /*#__PURE__*/React__default.createElement(Grid, {
|
|
25206
25932
|
key: layerId,
|
|
25207
25933
|
sx: {
|
|
@@ -25401,6 +26127,8 @@ var ConfigurableMapConnect = function ConfigurableMapConnect(_a) {
|
|
|
25401
26127
|
title = _a.title,
|
|
25402
26128
|
_a$layers = _a.layers,
|
|
25403
26129
|
layers = _a$layers === void 0 ? [] : _a$layers,
|
|
26130
|
+
_a$dimensions = _a.dimensions,
|
|
26131
|
+
dimensions = _a$dimensions === void 0 ? [] : _a$dimensions,
|
|
25404
26132
|
_a$shouldAutoUpdate = _a.shouldAutoUpdate,
|
|
25405
26133
|
shouldAutoUpdate = _a$shouldAutoUpdate === void 0 ? false : _a$shouldAutoUpdate,
|
|
25406
26134
|
_a$shouldAnimate = _a.shouldAnimate,
|
|
@@ -25432,7 +26160,7 @@ var ConfigurableMapConnect = function ConfigurableMapConnect(_a) {
|
|
|
25432
26160
|
_a$displayGetFeatureI = _a.displayGetFeatureInfoButtonInMap,
|
|
25433
26161
|
displayGetFeatureInfoButtonInMap = _a$displayGetFeatureI === void 0 ? false : _a$displayGetFeatureI,
|
|
25434
26162
|
children = _a.children,
|
|
25435
|
-
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"]);
|
|
25436
26164
|
|
|
25437
26165
|
var dispatch = useDispatch();
|
|
25438
26166
|
var mapId = React__default.useRef(id || generateMapId()).current;
|
|
@@ -25449,6 +26177,7 @@ var ConfigurableMapConnect = function ConfigurableMapConnect(_a) {
|
|
|
25449
26177
|
bbox: bbox,
|
|
25450
26178
|
srs: srs
|
|
25451
26179
|
},
|
|
26180
|
+
dimensions: dimensions,
|
|
25452
26181
|
shouldAutoUpdate: shouldAutoUpdate,
|
|
25453
26182
|
shouldAnimate: shouldAnimate,
|
|
25454
26183
|
shouldShowZoomControls: shouldShowZoomControls,
|
|
@@ -25487,6 +26216,7 @@ var ConfigurableMapConnect = function ConfigurableMapConnect(_a) {
|
|
|
25487
26216
|
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
25488
26217
|
|
|
25489
26218
|
}, []);
|
|
26219
|
+
var mapControlsPositionTop = title ? 24 : 8;
|
|
25490
26220
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
25491
26221
|
sx: {
|
|
25492
26222
|
width: '100%',
|
|
@@ -25495,13 +26225,13 @@ var ConfigurableMapConnect = function ConfigurableMapConnect(_a) {
|
|
|
25495
26225
|
overflow: 'hidden'
|
|
25496
26226
|
},
|
|
25497
26227
|
"data-testid": "ConfigurableMap"
|
|
25498
|
-
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
26228
|
+
}, title && /*#__PURE__*/React__default.createElement(Typography, {
|
|
25499
26229
|
"data-testid": "mapTitle",
|
|
25500
26230
|
sx: titleStyle
|
|
25501
|
-
}, title
|
|
26231
|
+
}, title), /*#__PURE__*/React__default.createElement(MapControls, {
|
|
25502
26232
|
"data-testid": "mapControls",
|
|
25503
26233
|
style: {
|
|
25504
|
-
top:
|
|
26234
|
+
top: mapControlsPositionTop
|
|
25505
26235
|
}
|
|
25506
26236
|
}, /*#__PURE__*/React__default.createElement(ZoomControlConnect, {
|
|
25507
26237
|
mapId: id
|
|
@@ -25594,7 +26324,8 @@ var MultiMapViewConnect = function MultiMapViewConnect(_ref) {
|
|
|
25594
26324
|
syncGroupAddTarget({
|
|
25595
26325
|
groupId: syncGroupsId,
|
|
25596
26326
|
targetId: map.id,
|
|
25597
|
-
linked: true
|
|
26327
|
+
linked: true,
|
|
26328
|
+
origin: 'system'
|
|
25598
26329
|
});
|
|
25599
26330
|
});
|
|
25600
26331
|
});
|
|
@@ -25635,12 +26366,14 @@ var MultiMapViewConnect = function MultiMapViewConnect(_ref) {
|
|
|
25635
26366
|
style: mapStyle,
|
|
25636
26367
|
sx: mapBoxStyle
|
|
25637
26368
|
}, /*#__PURE__*/React__default.createElement(ConfigurableMapConnect, {
|
|
25638
|
-
title: map.title,
|
|
26369
|
+
title: map.title || mapId,
|
|
25639
26370
|
id: mapId,
|
|
25640
26371
|
layers: map.layers || [],
|
|
25641
|
-
|
|
26372
|
+
autoTimeStepLayerId: map.autoTimeStepLayerId,
|
|
26373
|
+
autoUpdateLayerId: map.autoUpdateLayerId,
|
|
25642
26374
|
bbox: map.bbox,
|
|
25643
26375
|
srs: map.srs,
|
|
26376
|
+
dimensions: map.dimensions || [],
|
|
25644
26377
|
displayTimeInMap: map.displayTimeInMap || false,
|
|
25645
26378
|
displayLayerManagerAndLegendButtonInMap: map.displayLayerManagerAndLegendButtonInMap,
|
|
25646
26379
|
displayDimensionSelectButtonInMap: map.displayDimensionSelectButtonInMap,
|
|
@@ -25681,9 +26414,13 @@ var useHasSyncGroupWithLayerActions = function useHasSyncGroupWithLayerActions(s
|
|
|
25681
26414
|
var syncGroupState = useSelector(function (store) {
|
|
25682
26415
|
return getSynchronizationGroupState(store);
|
|
25683
26416
|
});
|
|
25684
|
-
|
|
26417
|
+
|
|
26418
|
+
if (!syncGroupState) {
|
|
26419
|
+
return false;
|
|
26420
|
+
}
|
|
25685
26421
|
/* Return all syncgroups configured for this component of type SYNCGROUPS_TYPE_SETLAYERACTIONS */
|
|
25686
26422
|
|
|
26423
|
+
|
|
25687
26424
|
var syncGroupsWithLayerActions = syncGroupState.groups.allIds.filter(function (syncGroupId) {
|
|
25688
26425
|
return syncGroupsIds && syncGroupsIds.includes(syncGroupId) && syncGroupState.groups.byId[syncGroupId].type === 'SYNCGROUPS_TYPE_SETLAYERACTIONS';
|
|
25689
26426
|
});
|
|
@@ -25738,9 +26475,13 @@ var ModelRunInterval = function ModelRunInterval(_ref) {
|
|
|
25738
26475
|
/* Get latest reference time for this layer */
|
|
25739
26476
|
|
|
25740
26477
|
var latestReferenceTime = useGetLatestReferenceTime(layers[0]);
|
|
25741
|
-
|
|
26478
|
+
|
|
26479
|
+
if (latestReferenceTime === '') {
|
|
26480
|
+
return /*#__PURE__*/React.createElement("div", null, "Loading...");
|
|
26481
|
+
}
|
|
25742
26482
|
/* Calculate the last time increment based on 15 maps */
|
|
25743
26483
|
|
|
26484
|
+
|
|
25744
26485
|
var lastTimeIncrement = startTimeIncrement + 15 * interval;
|
|
25745
26486
|
/* Make the preset */
|
|
25746
26487
|
|
|
@@ -25796,9 +26537,13 @@ var HarmonieTempAndPrecipPreset = function HarmonieTempAndPrecipPreset(_ref) {
|
|
|
25796
26537
|
/* Get all the reference times for this layer */
|
|
25797
26538
|
|
|
25798
26539
|
var referenceTimes = useGetReferenceTimes(layers.topRow);
|
|
25799
|
-
|
|
26540
|
+
|
|
26541
|
+
if (referenceTimes.length === 0) {
|
|
26542
|
+
return /*#__PURE__*/React.createElement("div", null, "Loading...");
|
|
26543
|
+
}
|
|
25800
26544
|
/* Helper to make a map layer prest */
|
|
25801
26545
|
|
|
26546
|
+
|
|
25802
26547
|
var makeMapPreset = function makeMapPreset(referenceTime, uniqueId, layer, syncGroupsIds, col) {
|
|
25803
26548
|
return {
|
|
25804
26549
|
id: uniqueId,
|
|
@@ -25886,7 +26631,11 @@ var componentsLookUp = function componentsLookUp(_ref) {
|
|
|
25886
26631
|
var _mapPreset = initialProps.mapPreset,
|
|
25887
26632
|
shouldShowZoomControls = initialProps.shouldShowZoomControls,
|
|
25888
26633
|
syncGroupsIds = initialProps.syncGroupsIds;
|
|
25889
|
-
|
|
26634
|
+
|
|
26635
|
+
if (!_mapPreset || _mapPreset.length === 0) {
|
|
26636
|
+
return null;
|
|
26637
|
+
}
|
|
26638
|
+
|
|
25890
26639
|
return /*#__PURE__*/React__default.createElement(MultiMapViewConnect, {
|
|
25891
26640
|
rows: 2,
|
|
25892
26641
|
cols: 2,
|
|
@@ -25894,11 +26643,15 @@ var componentsLookUp = function componentsLookUp(_ref) {
|
|
|
25894
26643
|
maps: _mapPreset.map(function (preset, index) {
|
|
25895
26644
|
var _a, _b, _c, _d;
|
|
25896
26645
|
|
|
26646
|
+
var layers = preset.layers,
|
|
26647
|
+
autoUpdateLayerId = preset.autoUpdateLayerId,
|
|
26648
|
+
autoTimeStepLayerId = preset.autoTimeStepLayerId;
|
|
25897
26649
|
return {
|
|
25898
26650
|
id: "".concat(id, "_").concat(index),
|
|
25899
26651
|
syncGroupsIds: syncGroupsIds,
|
|
25900
|
-
layers:
|
|
25901
|
-
|
|
26652
|
+
layers: layers,
|
|
26653
|
+
autoUpdateLayerId: autoUpdateLayerId,
|
|
26654
|
+
autoTimeStepLayerId: autoTimeStepLayerId,
|
|
25902
26655
|
bbox: (_b = (_a = _mapPreset[0]) === null || _a === void 0 ? void 0 : _a.proj) === null || _b === void 0 ? void 0 : _b.bbox,
|
|
25903
26656
|
srs: (_d = (_c = _mapPreset[0]) === null || _c === void 0 ? void 0 : _c.proj) === null || _d === void 0 ? void 0 : _d.srs
|
|
25904
26657
|
};
|
|
@@ -26803,4 +27556,4 @@ var MapWarningProperties = function MapWarningProperties(_ref) {
|
|
|
26803
27556
|
* */
|
|
26804
27557
|
var mapActions = Object.assign(Object.assign(Object.assign({}, layerActions), mapActions$1), serviceActions);
|
|
26805
27558
|
|
|
26806
|
-
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 };
|