@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.umd.js
CHANGED
|
@@ -429,9 +429,17 @@
|
|
|
429
429
|
|
|
430
430
|
var getPreviousTimeStepForLayerId = function getPreviousTimeStepForLayerId(layerId) {
|
|
431
431
|
var wmjsTimeDim = getWMJSTimeDimensionForLayerId(layerId);
|
|
432
|
-
|
|
432
|
+
|
|
433
|
+
if (!wmjsTimeDim) {
|
|
434
|
+
return null;
|
|
435
|
+
}
|
|
436
|
+
|
|
433
437
|
var currentIndex = wmjsTimeDim.getIndexForValue(wmjsTimeDim.currentValue, false);
|
|
434
|
-
|
|
438
|
+
|
|
439
|
+
if (currentIndex < 0 || currentIndex - 1 < 0) {
|
|
440
|
+
return wmjsTimeDim.getClosestValue(wmjsTimeDim.currentValue, true);
|
|
441
|
+
}
|
|
442
|
+
|
|
435
443
|
return wmjsTimeDim.getValueForIndex(currentIndex - 1);
|
|
436
444
|
};
|
|
437
445
|
/**
|
|
@@ -441,9 +449,17 @@
|
|
|
441
449
|
|
|
442
450
|
var getNextTimeStepForLayerId = function getNextTimeStepForLayerId(layerId) {
|
|
443
451
|
var wmjsTimeDim = getWMJSTimeDimensionForLayerId(layerId);
|
|
444
|
-
|
|
452
|
+
|
|
453
|
+
if (!wmjsTimeDim) {
|
|
454
|
+
return null;
|
|
455
|
+
}
|
|
456
|
+
|
|
445
457
|
var currentIndex = wmjsTimeDim.getIndexForValue(wmjsTimeDim.currentValue, false);
|
|
446
|
-
|
|
458
|
+
|
|
459
|
+
if (currentIndex < 0 || currentIndex + 1 >= wmjsTimeDim.size()) {
|
|
460
|
+
return wmjsTimeDim.getClosestValue(wmjsTimeDim.currentValue, true);
|
|
461
|
+
}
|
|
462
|
+
|
|
447
463
|
return wmjsTimeDim.getValueForIndex(currentIndex + 1);
|
|
448
464
|
};
|
|
449
465
|
/**
|
|
@@ -453,7 +469,11 @@
|
|
|
453
469
|
|
|
454
470
|
var getFirstTimeStepForLayerId = function getFirstTimeStepForLayerId(layerId) {
|
|
455
471
|
var wmjsTimeDim = getWMJSTimeDimensionForLayerId(layerId);
|
|
456
|
-
|
|
472
|
+
|
|
473
|
+
if (!wmjsTimeDim) {
|
|
474
|
+
return null;
|
|
475
|
+
}
|
|
476
|
+
|
|
457
477
|
return wmjsTimeDim.getFirstValue();
|
|
458
478
|
};
|
|
459
479
|
/**
|
|
@@ -463,7 +483,11 @@
|
|
|
463
483
|
|
|
464
484
|
var getLastTimeStepForLayerId = function getLastTimeStepForLayerId(layerId) {
|
|
465
485
|
var wmjsTimeDim = getWMJSTimeDimensionForLayerId(layerId);
|
|
466
|
-
|
|
486
|
+
|
|
487
|
+
if (!wmjsTimeDim) {
|
|
488
|
+
return null;
|
|
489
|
+
}
|
|
490
|
+
|
|
467
491
|
return wmjsTimeDim.getLastValue();
|
|
468
492
|
};
|
|
469
493
|
|
|
@@ -967,32 +991,32 @@
|
|
|
967
991
|
featureLayers = _m === void 0 ? [] : _m,
|
|
968
992
|
_o = _a.dimensions,
|
|
969
993
|
dimensions = _o === void 0 ? [] : _o,
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
timeSliderScale =
|
|
974
|
-
|
|
975
|
-
timeStep =
|
|
976
|
-
|
|
977
|
-
animationDelay =
|
|
978
|
-
|
|
979
|
-
timeSliderCenterTime =
|
|
980
|
-
|
|
981
|
-
timeSliderSecondsPerPx =
|
|
982
|
-
|
|
983
|
-
timeSliderDataScaleToSecondsPerPx =
|
|
984
|
-
|
|
985
|
-
isTimestepAuto =
|
|
986
|
-
|
|
987
|
-
isTimeSliderHoverOn =
|
|
988
|
-
|
|
989
|
-
isTimeSliderVisible =
|
|
990
|
-
|
|
991
|
-
displayMapPin =
|
|
992
|
-
|
|
993
|
-
disableMapPin =
|
|
994
|
-
|
|
995
|
-
shouldShowZoomControls =
|
|
994
|
+
autoUpdateLayerId = _a.autoUpdateLayerId,
|
|
995
|
+
autoTimeStepLayerId = _a.autoTimeStepLayerId,
|
|
996
|
+
_p = _a.timeSliderScale,
|
|
997
|
+
timeSliderScale = _p === void 0 ? Scale.Hour : _p,
|
|
998
|
+
_q = _a.timeStep,
|
|
999
|
+
timeStep = _q === void 0 ? 5 : _q,
|
|
1000
|
+
_r = _a.animationDelay,
|
|
1001
|
+
animationDelay = _r === void 0 ? defaultAnimationDelayAtStart : _r,
|
|
1002
|
+
_s = _a.timeSliderCenterTime,
|
|
1003
|
+
timeSliderCenterTime = _s === void 0 ? moment__default["default"].utc().unix() : _s,
|
|
1004
|
+
_t = _a.timeSliderSecondsPerPx,
|
|
1005
|
+
timeSliderSecondsPerPx = _t === void 0 ? 30 : _t,
|
|
1006
|
+
_u = _a.timeSliderDataScaleToSecondsPerPx,
|
|
1007
|
+
timeSliderDataScaleToSecondsPerPx = _u === void 0 ? defaultDataScaleToSecondsPerPx : _u,
|
|
1008
|
+
_v = _a.isTimestepAuto,
|
|
1009
|
+
isTimestepAuto = _v === void 0 ? true : _v,
|
|
1010
|
+
_w = _a.isTimeSliderHoverOn,
|
|
1011
|
+
isTimeSliderHoverOn = _w === void 0 ? false : _w,
|
|
1012
|
+
_x = _a.isTimeSliderVisible,
|
|
1013
|
+
isTimeSliderVisible = _x === void 0 ? true : _x,
|
|
1014
|
+
_y = _a.displayMapPin,
|
|
1015
|
+
displayMapPin = _y === void 0 ? false : _y,
|
|
1016
|
+
_z = _a.disableMapPin,
|
|
1017
|
+
disableMapPin = _z === void 0 ? false : _z,
|
|
1018
|
+
_0 = _a.shouldShowZoomControls,
|
|
1019
|
+
shouldShowZoomControls = _0 === void 0 ? true : _0;
|
|
996
1020
|
return {
|
|
997
1021
|
id: id,
|
|
998
1022
|
isAnimating: isAnimating,
|
|
@@ -1007,7 +1031,8 @@
|
|
|
1007
1031
|
mapLayers: mapLayers,
|
|
1008
1032
|
featureLayers: featureLayers,
|
|
1009
1033
|
dimensions: dimensions,
|
|
1010
|
-
|
|
1034
|
+
autoUpdateLayerId: autoUpdateLayerId,
|
|
1035
|
+
autoTimeStepLayerId: autoTimeStepLayerId,
|
|
1011
1036
|
timeSliderScale: timeSliderScale,
|
|
1012
1037
|
timeStep: timeStep,
|
|
1013
1038
|
animationDelay: animationDelay,
|
|
@@ -1054,7 +1079,10 @@
|
|
|
1054
1079
|
|
|
1055
1080
|
var getDraftMapById = function getDraftMapById(mapId, draft) {
|
|
1056
1081
|
var map = draft.byId[mapId];
|
|
1057
|
-
|
|
1082
|
+
|
|
1083
|
+
if (map) {
|
|
1084
|
+
return map;
|
|
1085
|
+
}
|
|
1058
1086
|
|
|
1059
1087
|
if (!draft.allIds.includes(mapId)) {
|
|
1060
1088
|
draft.byId[mapId] = createMap({
|
|
@@ -1079,7 +1107,10 @@
|
|
|
1079
1107
|
var map = getDraftMapById(mapId, draft);
|
|
1080
1108
|
|
|
1081
1109
|
if (dimensionFromAction) {
|
|
1082
|
-
if (!map.dimensions)
|
|
1110
|
+
if (!map.dimensions) {
|
|
1111
|
+
map.dimensions = [];
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1083
1114
|
var dimensions = map.dimensions;
|
|
1084
1115
|
var mapDim = dimensions.find(function (dim) {
|
|
1085
1116
|
return dim.name === dimensionFromAction.name;
|
|
@@ -1104,6 +1135,10 @@
|
|
|
1104
1135
|
*/
|
|
1105
1136
|
|
|
1106
1137
|
var findMapIdFromLayerId = function findMapIdFromLayerId(draft, layerId) {
|
|
1138
|
+
if (!draft || !layerId) {
|
|
1139
|
+
return null;
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1107
1142
|
for (var i = 0; i < draft.allIds.length; i += 1) {
|
|
1108
1143
|
var mapId = draft.allIds[i];
|
|
1109
1144
|
var layerIds = draft.byId[mapId].mapLayers;
|
|
@@ -1235,7 +1270,10 @@
|
|
|
1235
1270
|
*/
|
|
1236
1271
|
|
|
1237
1272
|
var produceLayerDimensionDraftState = function produceLayerDimensionDraftState(draft, layerId, dimensionValueToUpdate) {
|
|
1238
|
-
if (!draft.byId[layerId].dimensions)
|
|
1273
|
+
if (!draft.byId[layerId].dimensions) {
|
|
1274
|
+
draft.byId[layerId].dimensions = [];
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1239
1277
|
var existingLayerDimIndex = draft.byId[layerId].dimensions.findIndex(function (layerDim) {
|
|
1240
1278
|
return layerDim.name === dimensionValueToUpdate.name;
|
|
1241
1279
|
});
|
|
@@ -1258,13 +1296,24 @@
|
|
|
1258
1296
|
};
|
|
1259
1297
|
|
|
1260
1298
|
var isActionLayerSynced = function isActionLayerSynced(state, layerIdFromAction, dimension) {
|
|
1261
|
-
if (dimension.synced !== undefined)
|
|
1299
|
+
if (dimension.synced !== undefined) {
|
|
1300
|
+
return dimension.synced;
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1262
1303
|
var actionLayer = state.byId[layerIdFromAction];
|
|
1263
|
-
|
|
1304
|
+
|
|
1305
|
+
if (!actionLayer) {
|
|
1306
|
+
return false;
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1264
1309
|
var layerDimensionIndex = actionLayer.dimensions.findIndex(function (layerDim) {
|
|
1265
1310
|
return layerDim.name === dimension.name;
|
|
1266
1311
|
});
|
|
1267
|
-
|
|
1312
|
+
|
|
1313
|
+
if (layerDimensionIndex < 0) {
|
|
1314
|
+
return false;
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1268
1317
|
return actionLayer.dimensions[layerDimensionIndex].synced === true;
|
|
1269
1318
|
};
|
|
1270
1319
|
var produceDimensionActionForMapLayer = function produceDimensionActionForMapLayer(layerDim, wmjsDimension, newDimension) {
|
|
@@ -1296,7 +1345,10 @@
|
|
|
1296
1345
|
var produceDraftStateForAllLayersForDimensionWithinMap = function produceDraftStateForAllLayersForDimensionWithinMap(draft, dimension, mapId, layerIdFromAction
|
|
1297
1346
|
/* Layer ID or null if not known */
|
|
1298
1347
|
) {
|
|
1299
|
-
if (!mapId)
|
|
1348
|
+
if (!mapId) {
|
|
1349
|
+
return;
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1300
1352
|
var actionLayerSynced = isActionLayerSynced(draft, layerIdFromAction, dimension);
|
|
1301
1353
|
|
|
1302
1354
|
for (var li = 0; li < draft.allIds.length; li += 1) {
|
|
@@ -1549,7 +1601,11 @@
|
|
|
1549
1601
|
layerIdFromAction = _a.layerId,
|
|
1550
1602
|
dimension = _a.dimension;
|
|
1551
1603
|
var layerFromAction = draft.byId[layerIdFromAction];
|
|
1552
|
-
|
|
1604
|
+
|
|
1605
|
+
if (!layerFromAction) {
|
|
1606
|
+
return;
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1553
1609
|
var mapId = layerFromAction.mapId;
|
|
1554
1610
|
produceDraftStateForAllLayersForDimensionWithinMap(draft, dimension, mapId, layerIdFromAction);
|
|
1555
1611
|
},
|
|
@@ -1617,7 +1673,10 @@
|
|
|
1617
1673
|
},
|
|
1618
1674
|
baseLayerDelete: function baseLayerDelete(draft, action) {
|
|
1619
1675
|
var layerId = action.payload.layerId;
|
|
1620
|
-
|
|
1676
|
+
|
|
1677
|
+
if (draft.byId[layerId].layerType !== LayerType.baseLayer && draft.byId[layerId].layerType !== LayerType.overLayer) {
|
|
1678
|
+
return;
|
|
1679
|
+
}
|
|
1621
1680
|
|
|
1622
1681
|
if (draft.byId[layerId]) {
|
|
1623
1682
|
draft.allIds = draft.allIds.filter(function (id) {
|
|
@@ -1672,8 +1731,13 @@
|
|
|
1672
1731
|
|
|
1673
1732
|
var layerTypes = [];
|
|
1674
1733
|
filtererdBaseLayers.forEach(function (layer) {
|
|
1675
|
-
if (layer.layerType !== LayerType.baseLayer && layer.layerType !== LayerType.overLayer)
|
|
1676
|
-
|
|
1734
|
+
if (layer.layerType !== LayerType.baseLayer && layer.layerType !== LayerType.overLayer) {
|
|
1735
|
+
return;
|
|
1736
|
+
}
|
|
1737
|
+
|
|
1738
|
+
if (!layerTypes.includes(layer.layerType)) {
|
|
1739
|
+
layerTypes.push(layer.layerType);
|
|
1740
|
+
}
|
|
1677
1741
|
});
|
|
1678
1742
|
var state = produce.current(draft); // remove current layers with same type as one of the passed layers
|
|
1679
1743
|
|
|
@@ -1696,7 +1760,10 @@
|
|
|
1696
1760
|
},
|
|
1697
1761
|
addBaseLayer: function addBaseLayer(draft, action) {
|
|
1698
1762
|
var layer = action.payload.layer;
|
|
1699
|
-
|
|
1763
|
+
|
|
1764
|
+
if (layer.layerType !== LayerType.baseLayer && layer.layerType !== LayerType.overLayer) {
|
|
1765
|
+
return;
|
|
1766
|
+
}
|
|
1700
1767
|
|
|
1701
1768
|
if (!draft.byId[layer.id]) {
|
|
1702
1769
|
draft.byId[layer.id] = createLayer(__assign({
|
|
@@ -1717,7 +1784,10 @@
|
|
|
1717
1784
|
},
|
|
1718
1785
|
addAvailableBaseLayer: function addAvailableBaseLayer(draft, action) {
|
|
1719
1786
|
var layer = action.payload.layer;
|
|
1720
|
-
|
|
1787
|
+
|
|
1788
|
+
if (layer.layerType !== LayerType.baseLayer && layer.layerType !== LayerType.overLayer || !layer.mapId) {
|
|
1789
|
+
return;
|
|
1790
|
+
}
|
|
1721
1791
|
|
|
1722
1792
|
if (!draft.availableBaseLayers.byId[layer.id]) {
|
|
1723
1793
|
draft.availableBaseLayers.byId[layer.id] = createLayer(__assign({
|
|
@@ -1731,7 +1801,10 @@
|
|
|
1731
1801
|
var layers = action.payload.layers; // add new available baselayers
|
|
1732
1802
|
|
|
1733
1803
|
layers.forEach(function (layer) {
|
|
1734
|
-
if (layer.layerType !== LayerType.baseLayer || draft.availableBaseLayers.byId[layer.id] || !layer.mapId)
|
|
1804
|
+
if (layer.layerType !== LayerType.baseLayer || draft.availableBaseLayers.byId[layer.id] || !layer.mapId) {
|
|
1805
|
+
return;
|
|
1806
|
+
}
|
|
1807
|
+
|
|
1735
1808
|
draft.availableBaseLayers.byId[layer.id] = createLayer(__assign({
|
|
1736
1809
|
id: layer.id,
|
|
1737
1810
|
layerType: layer.layerType
|
|
@@ -1755,7 +1828,10 @@
|
|
|
1755
1828
|
}); // add new available baselayers
|
|
1756
1829
|
|
|
1757
1830
|
layers.forEach(function (layer) {
|
|
1758
|
-
if (layer.layerType !== LayerType.baseLayer || !layer.mapId)
|
|
1831
|
+
if (layer.layerType !== LayerType.baseLayer || !layer.mapId) {
|
|
1832
|
+
return;
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1759
1835
|
draft.availableBaseLayers.byId[layer.id] = createLayer(__assign({}, layer));
|
|
1760
1836
|
draft.availableBaseLayers.allIds.push(layer.id);
|
|
1761
1837
|
});
|
|
@@ -1874,7 +1950,10 @@
|
|
|
1874
1950
|
serviceSetLayers: function serviceSetLayers(draft, action) {
|
|
1875
1951
|
var id = action.payload.id;
|
|
1876
1952
|
draft.byId[id] = __assign({}, action.payload);
|
|
1877
|
-
|
|
1953
|
+
|
|
1954
|
+
if (!draft.allIds.includes(id)) {
|
|
1955
|
+
draft.allIds.push(id);
|
|
1956
|
+
}
|
|
1878
1957
|
},
|
|
1879
1958
|
mapStoreRemoveService: function mapStoreRemoveService(draft, action) {
|
|
1880
1959
|
var foundServiceIndex = draft.allIds.findIndex(function (id) {
|
|
@@ -1888,12 +1967,19 @@
|
|
|
1888
1967
|
});
|
|
1889
1968
|
delete draft.byId[serviceId_1];
|
|
1890
1969
|
}
|
|
1891
|
-
}
|
|
1970
|
+
},
|
|
1971
|
+
fetchInitialServices: function fetchInitialServices( // eslint-disable-next-line no-unused-vars
|
|
1972
|
+
draft, // eslint-disable-next-line no-unused-vars
|
|
1973
|
+
action) {}
|
|
1892
1974
|
},
|
|
1893
1975
|
extraReducers: function extraReducers(builder) {
|
|
1894
1976
|
return builder.addCase(layerActions.onUpdateLayerInformation, function (draft, action) {
|
|
1895
1977
|
var serviceLayers = action.payload.serviceLayers;
|
|
1896
|
-
|
|
1978
|
+
|
|
1979
|
+
if (serviceLayers === null) {
|
|
1980
|
+
return draft;
|
|
1981
|
+
}
|
|
1982
|
+
|
|
1897
1983
|
var mapAction = serviceActions.serviceSetLayers(serviceLayers);
|
|
1898
1984
|
var newState = reducer$7(draft, mapAction);
|
|
1899
1985
|
return newState;
|
|
@@ -2025,7 +2111,10 @@
|
|
|
2025
2111
|
}, function (store, serviceUrl, layerName) {
|
|
2026
2112
|
return layerName;
|
|
2027
2113
|
}, function (layers, serviceUrl, layerName) {
|
|
2028
|
-
if (!layers)
|
|
2114
|
+
if (!layers) {
|
|
2115
|
+
return null;
|
|
2116
|
+
}
|
|
2117
|
+
|
|
2029
2118
|
var index = layers.findIndex(function (serviceLayer) {
|
|
2030
2119
|
return serviceLayer.name === layerName;
|
|
2031
2120
|
});
|
|
@@ -2063,8 +2152,8 @@
|
|
|
2063
2152
|
* See the License for the specific language governing permissions and
|
|
2064
2153
|
* limitations under the License.
|
|
2065
2154
|
*
|
|
2066
|
-
* Copyright
|
|
2067
|
-
* Copyright
|
|
2155
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2156
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
2068
2157
|
* */
|
|
2069
2158
|
var moveToTop = function moveToTop(list, element) {
|
|
2070
2159
|
var filteredList = list.filter(function (item) {
|
|
@@ -2087,7 +2176,8 @@
|
|
|
2087
2176
|
type: type,
|
|
2088
2177
|
source: source,
|
|
2089
2178
|
isLoading: false,
|
|
2090
|
-
error: undefined
|
|
2179
|
+
error: undefined,
|
|
2180
|
+
focused: false
|
|
2091
2181
|
};
|
|
2092
2182
|
};
|
|
2093
2183
|
var initialState$6 = {
|
|
@@ -2162,6 +2252,10 @@
|
|
|
2162
2252
|
if (setOpen) {
|
|
2163
2253
|
draft.order = moveToTop(draft.order, type);
|
|
2164
2254
|
}
|
|
2255
|
+
|
|
2256
|
+
if (!setOpen) {
|
|
2257
|
+
draft.dialogs[type].focused = false;
|
|
2258
|
+
}
|
|
2165
2259
|
},
|
|
2166
2260
|
orderDialog: function orderDialog(draft, action) {
|
|
2167
2261
|
var type = action.payload.type;
|
|
@@ -2182,6 +2276,17 @@
|
|
|
2182
2276
|
error = _a.error,
|
|
2183
2277
|
type = _a.type;
|
|
2184
2278
|
draft.dialogs[type].error = error;
|
|
2279
|
+
},
|
|
2280
|
+
setDialogFocused: function setDialogFocused(draft, action) {
|
|
2281
|
+
var _a = action.payload,
|
|
2282
|
+
focused = _a.focused,
|
|
2283
|
+
type = _a.type;
|
|
2284
|
+
|
|
2285
|
+
if (!draft.dialogs[type]) {
|
|
2286
|
+
return;
|
|
2287
|
+
}
|
|
2288
|
+
|
|
2289
|
+
draft.dialogs[type].focused = focused;
|
|
2185
2290
|
}
|
|
2186
2291
|
}
|
|
2187
2292
|
});
|
|
@@ -2238,7 +2343,10 @@
|
|
|
2238
2343
|
*/
|
|
2239
2344
|
|
|
2240
2345
|
var createLayersWithIds = function createLayersWithIds(state, layers) {
|
|
2241
|
-
if (!layers)
|
|
2346
|
+
if (!layers) {
|
|
2347
|
+
return layers;
|
|
2348
|
+
}
|
|
2349
|
+
|
|
2242
2350
|
return produce.produce(layers, function (draft) {
|
|
2243
2351
|
for (var j = 0; j < draft.length; j += 1) {
|
|
2244
2352
|
var layer = draft[j];
|
|
@@ -2291,7 +2399,10 @@
|
|
|
2291
2399
|
|
|
2292
2400
|
var srs = action.payload.srs || null;
|
|
2293
2401
|
draft.byId[mapId].bbox = bbox;
|
|
2294
|
-
|
|
2402
|
+
|
|
2403
|
+
if (srs) {
|
|
2404
|
+
draft.byId[mapId].srs = srs;
|
|
2405
|
+
}
|
|
2295
2406
|
},
|
|
2296
2407
|
mapUpdateAllMapDimensions: function mapUpdateAllMapDimensions(draft, action) {
|
|
2297
2408
|
var _a = action.payload,
|
|
@@ -2302,7 +2413,6 @@
|
|
|
2302
2413
|
return;
|
|
2303
2414
|
}
|
|
2304
2415
|
|
|
2305
|
-
draft.byId[mapId].dimensions.length = 0;
|
|
2306
2416
|
dimensions.forEach(function (dimension) {
|
|
2307
2417
|
return produceDraftStateSetWebMapDimension(draft, mapId, dimension, true);
|
|
2308
2418
|
});
|
|
@@ -2407,16 +2517,28 @@
|
|
|
2407
2517
|
|
|
2408
2518
|
draft.byId[mapId].mapLayers = moveArrayElements(draft.byId[mapId].mapLayers, oldIndex, newIndex);
|
|
2409
2519
|
},
|
|
2410
|
-
|
|
2520
|
+
setAutoLayerId: function setAutoLayerId(draft, action) {
|
|
2411
2521
|
var _a = action.payload,
|
|
2412
2522
|
mapId = _a.mapId,
|
|
2413
|
-
layerId = _a.layerId
|
|
2523
|
+
layerId = _a.layerId,
|
|
2524
|
+
autoTimeStepLayerId = _a.autoTimeStepLayerId,
|
|
2525
|
+
autoUpdateLayerId = _a.autoUpdateLayerId;
|
|
2526
|
+
var map = draft.byId[mapId];
|
|
2414
2527
|
|
|
2415
|
-
if (!
|
|
2528
|
+
if (!map) {
|
|
2416
2529
|
return;
|
|
2417
2530
|
}
|
|
2418
2531
|
|
|
2419
|
-
|
|
2532
|
+
if (autoUpdateLayerId || autoTimeStepLayerId) {
|
|
2533
|
+
map.autoUpdateLayerId = autoUpdateLayerId;
|
|
2534
|
+
map.autoTimeStepLayerId = autoTimeStepLayerId;
|
|
2535
|
+
} else if (layerId) {
|
|
2536
|
+
map.autoUpdateLayerId = layerId;
|
|
2537
|
+
map.autoTimeStepLayerId = layerId;
|
|
2538
|
+
} else {
|
|
2539
|
+
map.autoTimeStepLayerId = undefined;
|
|
2540
|
+
map.autoUpdateLayerId = undefined;
|
|
2541
|
+
}
|
|
2420
2542
|
},
|
|
2421
2543
|
setTimeSliderCenterTime: function setTimeSliderCenterTime(draft, action) {
|
|
2422
2544
|
var _a = action.payload,
|
|
@@ -2592,7 +2714,8 @@
|
|
|
2592
2714
|
}
|
|
2593
2715
|
|
|
2594
2716
|
if (!draft.byId[mapId].mapLayers.length) {
|
|
2595
|
-
draft.byId[mapId].
|
|
2717
|
+
draft.byId[mapId].autoUpdateLayerId = layerId;
|
|
2718
|
+
draft.byId[mapId].autoTimeStepLayerId = layerId;
|
|
2596
2719
|
}
|
|
2597
2720
|
|
|
2598
2721
|
draft.byId[mapId].mapLayers.unshift(layerId);
|
|
@@ -2632,19 +2755,36 @@
|
|
|
2632
2755
|
|
|
2633
2756
|
if (draft.byId[mapId]) {
|
|
2634
2757
|
draft.byId[mapId].mapLayers = layerIds;
|
|
2635
|
-
draft.byId[mapId].
|
|
2758
|
+
draft.byId[mapId].autoUpdateLayerId = activeLayerId;
|
|
2759
|
+
draft.byId[mapId].autoTimeStepLayerId = activeLayerId;
|
|
2636
2760
|
var webmapInstance = getWMJSMapById(mapId);
|
|
2637
2761
|
|
|
2638
2762
|
if (webmapInstance) {
|
|
2639
2763
|
var mapDims = webmapInstance.getDimensionList();
|
|
2640
2764
|
|
|
2641
|
-
if (
|
|
2642
|
-
draft.byId[mapId].dimensions =
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2765
|
+
if (!draft.byId[mapId].dimensions) {
|
|
2766
|
+
draft.byId[mapId].dimensions = [];
|
|
2767
|
+
}
|
|
2768
|
+
|
|
2769
|
+
var draftDims_1 = draft.byId[mapId].dimensions;
|
|
2770
|
+
|
|
2771
|
+
if (mapDims && draftDims_1) {
|
|
2772
|
+
mapDims.forEach(function (dim) {
|
|
2773
|
+
var draftMapDimIndex = draftDims_1.findIndex(function (draftDim) {
|
|
2774
|
+
return draftDim.name === dim.name;
|
|
2775
|
+
});
|
|
2776
|
+
|
|
2777
|
+
if (draftMapDimIndex !== -1) {
|
|
2778
|
+
draftDims_1[draftMapDimIndex].name = dim.name;
|
|
2779
|
+
draftDims_1[draftMapDimIndex].units = dim.units;
|
|
2780
|
+
draftDims_1[draftMapDimIndex].currentValue = dim.currentValue;
|
|
2781
|
+
} else {
|
|
2782
|
+
draftDims_1.push({
|
|
2783
|
+
name: dim.name,
|
|
2784
|
+
units: dim.units,
|
|
2785
|
+
currentValue: dim.currentValue
|
|
2786
|
+
});
|
|
2787
|
+
}
|
|
2648
2788
|
});
|
|
2649
2789
|
}
|
|
2650
2790
|
}
|
|
@@ -2675,31 +2815,43 @@
|
|
|
2675
2815
|
});
|
|
2676
2816
|
|
|
2677
2817
|
if (draft.byId[mapId]) {
|
|
2678
|
-
if (baseLayerIds.length !== 0)
|
|
2679
|
-
|
|
2818
|
+
if (baseLayerIds.length !== 0) {
|
|
2819
|
+
draft.byId[mapId].baseLayers = baseLayerIds;
|
|
2820
|
+
}
|
|
2821
|
+
|
|
2822
|
+
if (overLayerIds.length !== 0) {
|
|
2823
|
+
draft.byId[mapId].overLayers = overLayerIds;
|
|
2824
|
+
}
|
|
2680
2825
|
}
|
|
2681
2826
|
}).addCase(layerDelete$1, function (draft, action) {
|
|
2682
2827
|
var _a = action.payload,
|
|
2683
2828
|
mapId = _a.mapId,
|
|
2684
2829
|
layerId = _a.layerId;
|
|
2830
|
+
var map = draft.byId[mapId];
|
|
2685
2831
|
|
|
2686
|
-
if (!
|
|
2832
|
+
if (!map) {
|
|
2687
2833
|
return;
|
|
2688
2834
|
}
|
|
2689
2835
|
|
|
2690
|
-
|
|
2836
|
+
map.mapLayers = map.mapLayers.filter(function (id) {
|
|
2691
2837
|
return id !== layerId;
|
|
2692
|
-
}); // if
|
|
2838
|
+
}); // if auto layer is deleted, change auto layer ids
|
|
2839
|
+
|
|
2840
|
+
if (!map.mapLayers.length) {
|
|
2841
|
+
map.autoUpdateLayerId = undefined;
|
|
2842
|
+
map.autoTimeStepLayerId = undefined;
|
|
2843
|
+
return;
|
|
2844
|
+
}
|
|
2693
2845
|
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
activeLayerId = _b[0];
|
|
2846
|
+
var _b = __read(map.mapLayers, 1),
|
|
2847
|
+
activeLayerId = _b[0];
|
|
2697
2848
|
|
|
2698
|
-
|
|
2849
|
+
if (map.autoUpdateLayerId === layerId) {
|
|
2850
|
+
map.autoUpdateLayerId = activeLayerId;
|
|
2699
2851
|
}
|
|
2700
2852
|
|
|
2701
|
-
if (
|
|
2702
|
-
|
|
2853
|
+
if (map.autoTimeStepLayerId === layerId) {
|
|
2854
|
+
map.autoTimeStepLayerId = activeLayerId;
|
|
2703
2855
|
}
|
|
2704
2856
|
}).addCase(baseLayerDelete, function (draft, action) {
|
|
2705
2857
|
var _a = action.payload,
|
|
@@ -2771,7 +2923,9 @@
|
|
|
2771
2923
|
draft.byId[targetId].bbox = bbox;
|
|
2772
2924
|
}
|
|
2773
2925
|
|
|
2774
|
-
if (srs)
|
|
2926
|
+
if (srs) {
|
|
2927
|
+
draft.byId[targetId].srs = srs;
|
|
2928
|
+
}
|
|
2775
2929
|
}
|
|
2776
2930
|
});
|
|
2777
2931
|
}).addCase(setLayerActionSync, function (draft, action) {
|
|
@@ -2795,7 +2949,11 @@
|
|
|
2795
2949
|
}, draft);
|
|
2796
2950
|
}).addCase(onUpdateLayerInformation, function (draft, action) {
|
|
2797
2951
|
var mapDimensions = action.payload.mapDimensions;
|
|
2798
|
-
|
|
2952
|
+
|
|
2953
|
+
if (mapDimensions === null) {
|
|
2954
|
+
return draft;
|
|
2955
|
+
}
|
|
2956
|
+
|
|
2799
2957
|
var mapAction = mapActions$1.mapUpdateAllMapDimensions(mapDimensions);
|
|
2800
2958
|
return reducer$5(draft, mapAction);
|
|
2801
2959
|
}).addCase(mapChangeDimension, function (draft, action) {
|
|
@@ -2859,7 +3017,7 @@
|
|
|
2859
3017
|
* */
|
|
2860
3018
|
|
|
2861
3019
|
var layerStore = function layerStore(store) {
|
|
2862
|
-
return store
|
|
3020
|
+
return store === null || store === void 0 ? void 0 : store.layers;
|
|
2863
3021
|
};
|
|
2864
3022
|
/**
|
|
2865
3023
|
* Gets a layer from the layers part of the store by its Id
|
|
@@ -2887,7 +3045,9 @@
|
|
|
2887
3045
|
*/
|
|
2888
3046
|
|
|
2889
3047
|
var getLayersById = toolkit.createSelector(layerStore, function (store) {
|
|
2890
|
-
|
|
3048
|
+
var _a;
|
|
3049
|
+
|
|
3050
|
+
return (_a = store === null || store === void 0 ? void 0 : store.byId) !== null && _a !== void 0 ? _a : null;
|
|
2891
3051
|
}, selectorMemoizationOptions);
|
|
2892
3052
|
/**
|
|
2893
3053
|
* Retrieves all layerIds
|
|
@@ -3158,7 +3318,7 @@
|
|
|
3158
3318
|
}, []);
|
|
3159
3319
|
}, selectorMemoizationOptions);
|
|
3160
3320
|
|
|
3161
|
-
var selectors$
|
|
3321
|
+
var selectors$3 = /*#__PURE__*/Object.freeze({
|
|
3162
3322
|
__proto__: null,
|
|
3163
3323
|
getLayerById: getLayerById,
|
|
3164
3324
|
getLayersById: getLayersById,
|
|
@@ -3196,8 +3356,8 @@
|
|
|
3196
3356
|
* See the License for the specific language governing permissions and
|
|
3197
3357
|
* limitations under the License.
|
|
3198
3358
|
*
|
|
3199
|
-
* Copyright
|
|
3200
|
-
* Copyright
|
|
3359
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
3360
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
3201
3361
|
* */
|
|
3202
3362
|
var getUiStore = function getUiStore(store) {
|
|
3203
3363
|
if (store && store.ui) {
|
|
@@ -3322,8 +3482,11 @@
|
|
|
3322
3482
|
var getDialogError = toolkit.createSelector(getDialogDetailsByType, function (details) {
|
|
3323
3483
|
return details && details.error || '';
|
|
3324
3484
|
});
|
|
3485
|
+
var getDialogFocused = toolkit.createSelector(getDialogDetailsByType, function (details) {
|
|
3486
|
+
return details && details.focused || false;
|
|
3487
|
+
});
|
|
3325
3488
|
|
|
3326
|
-
var selectors$
|
|
3489
|
+
var selectors$2 = /*#__PURE__*/Object.freeze({
|
|
3327
3490
|
__proto__: null,
|
|
3328
3491
|
getUiStore: getUiStore,
|
|
3329
3492
|
getDialogDetailsByType: getDialogDetailsByType,
|
|
@@ -3334,7 +3497,8 @@
|
|
|
3334
3497
|
getDialogSource: getDialogSource,
|
|
3335
3498
|
getActiveWindowId: getActiveWindowId,
|
|
3336
3499
|
getDialogIsLoading: getDialogIsLoading,
|
|
3337
|
-
getDialogError: getDialogError
|
|
3500
|
+
getDialogError: getDialogError,
|
|
3501
|
+
getDialogFocused: getDialogFocused
|
|
3338
3502
|
});
|
|
3339
3503
|
|
|
3340
3504
|
/* *
|
|
@@ -3397,8 +3561,11 @@
|
|
|
3397
3561
|
var j = 0;
|
|
3398
3562
|
inDraftArray.forEach(function (e, i) {
|
|
3399
3563
|
if (!condition(e)) {
|
|
3400
|
-
|
|
3401
|
-
|
|
3564
|
+
if (i !== j) {
|
|
3565
|
+
// eslint-disable-next-line no-param-reassign
|
|
3566
|
+
inDraftArray[j] = e;
|
|
3567
|
+
}
|
|
3568
|
+
|
|
3402
3569
|
j += 1;
|
|
3403
3570
|
}
|
|
3404
3571
|
}); // eslint-disable-next-line no-param-reassign
|
|
@@ -3536,8 +3703,15 @@
|
|
|
3536
3703
|
var _a = action.payload,
|
|
3537
3704
|
groupId = _a.groupId,
|
|
3538
3705
|
targetId = _a.targetId;
|
|
3539
|
-
|
|
3540
|
-
if (!draft.groups.byId[groupId]
|
|
3706
|
+
|
|
3707
|
+
if (!draft.groups.byId[groupId]) {
|
|
3708
|
+
return;
|
|
3709
|
+
}
|
|
3710
|
+
|
|
3711
|
+
if (!draft.groups.byId[groupId].targets.allIds.includes(targetId)) {
|
|
3712
|
+
return;
|
|
3713
|
+
}
|
|
3714
|
+
|
|
3541
3715
|
delete draft.groups.byId[groupId].targets.byId[targetId];
|
|
3542
3716
|
removeInPlace(draft.groups.byId[groupId].targets.allIds, function (_id) {
|
|
3543
3717
|
return _id === targetId;
|
|
@@ -3776,10 +3950,16 @@
|
|
|
3776
3950
|
return null;
|
|
3777
3951
|
};
|
|
3778
3952
|
|
|
3779
|
-
toolkit.createSelector(getSyncSourceBySourceId, function (store) {
|
|
3953
|
+
var getTime = toolkit.createSelector(getSyncSourceBySourceId, function (store) {
|
|
3780
3954
|
return store && store.payloadByType && store.payloadByType[SYNCGROUPS_TYPE_SETTIME] ? store.payloadByType[SYNCGROUPS_TYPE_SETTIME].value : null;
|
|
3781
3955
|
});
|
|
3782
3956
|
|
|
3957
|
+
var selectors$1 = /*#__PURE__*/Object.freeze({
|
|
3958
|
+
__proto__: null,
|
|
3959
|
+
getSynchronizationGroupStore: getSynchronizationGroupStore,
|
|
3960
|
+
getTime: getTime
|
|
3961
|
+
});
|
|
3962
|
+
|
|
3783
3963
|
/* *
|
|
3784
3964
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3785
3965
|
* you may not use this file except in compliance with the License.
|
|
@@ -3827,11 +4007,9 @@
|
|
|
3827
4007
|
*/
|
|
3828
4008
|
|
|
3829
4009
|
var getMapById = function getMapById(store, mapId) {
|
|
3830
|
-
|
|
3831
|
-
return store.webmap.byId[mapId];
|
|
3832
|
-
}
|
|
4010
|
+
var _a;
|
|
3833
4011
|
|
|
3834
|
-
return null;
|
|
4012
|
+
return (_a = store === null || store === void 0 ? void 0 : store.webmap) === null || _a === void 0 ? void 0 : _a.byId[mapId];
|
|
3835
4013
|
};
|
|
3836
4014
|
/**
|
|
3837
4015
|
* Gets all mapIds
|
|
@@ -3898,8 +4076,10 @@
|
|
|
3898
4076
|
* @returns {array} returnType: array - array containing all layerIds
|
|
3899
4077
|
*/
|
|
3900
4078
|
|
|
3901
|
-
var getLayerIds = toolkit.createSelector(getMapById, function (
|
|
3902
|
-
|
|
4079
|
+
var getLayerIds = toolkit.createSelector(getMapById, function (map) {
|
|
4080
|
+
var _a;
|
|
4081
|
+
|
|
4082
|
+
return (_a = map === null || map === void 0 ? void 0 : map.mapLayers) !== null && _a !== void 0 ? _a : [];
|
|
3903
4083
|
}, selectorMemoizationOptions);
|
|
3904
4084
|
/**
|
|
3905
4085
|
* Gets all layer states for a map
|
|
@@ -3910,10 +4090,12 @@
|
|
|
3910
4090
|
* @returns {array} returnType: array - array containing all layer states for the map
|
|
3911
4091
|
*/
|
|
3912
4092
|
|
|
3913
|
-
var getMapLayers = toolkit.createSelector(getLayerIds, getLayersById, function (
|
|
3914
|
-
|
|
3915
|
-
return
|
|
4093
|
+
var getMapLayers = toolkit.createSelector(getLayerIds, getLayersById, function (layerIdsInMap, allLayers) {
|
|
4094
|
+
var layersWithUndefined = layerIdsInMap.map(function (layerId) {
|
|
4095
|
+
return allLayers === null || allLayers === void 0 ? void 0 : allLayers[layerId];
|
|
3916
4096
|
});
|
|
4097
|
+
var layersWithoutUndefined = _.compact(layersWithUndefined);
|
|
4098
|
+
return layersWithoutUndefined;
|
|
3917
4099
|
}, selectorMemoizationOptions);
|
|
3918
4100
|
/**
|
|
3919
4101
|
* Gets an array of baselayers ids for a map
|
|
@@ -4121,7 +4303,33 @@
|
|
|
4121
4303
|
*/
|
|
4122
4304
|
|
|
4123
4305
|
var getActiveLayerId = toolkit.createSelector(getMapById, function (store) {
|
|
4124
|
-
|
|
4306
|
+
if ((store === null || store === void 0 ? void 0 : store.autoUpdateLayerId) && store.autoUpdateLayerId === store.autoTimeStepLayerId) {
|
|
4307
|
+
return store.autoUpdateLayerId;
|
|
4308
|
+
}
|
|
4309
|
+
|
|
4310
|
+
return undefined;
|
|
4311
|
+
});
|
|
4312
|
+
/**
|
|
4313
|
+
* Gets autoUpdateLayerId for map
|
|
4314
|
+
*
|
|
4315
|
+
* example: autoUpdateLayerId = getAutoUpdateLayerId(store, 'mapid_1')
|
|
4316
|
+
* @param {object} store store: object - store object
|
|
4317
|
+
* @param {string} mapId mapId: string - Id of the map
|
|
4318
|
+
*/
|
|
4319
|
+
|
|
4320
|
+
var getAutoUpdateLayerId = toolkit.createSelector(getMapById, function (store) {
|
|
4321
|
+
return store === null || store === void 0 ? void 0 : store.autoUpdateLayerId;
|
|
4322
|
+
});
|
|
4323
|
+
/**
|
|
4324
|
+
* Gets autoUpdateLayerId for map
|
|
4325
|
+
*
|
|
4326
|
+
* example: autoUpdateLayerId = getAutoUpdateLayerId(store, 'mapid_1')
|
|
4327
|
+
* @param {object} store store: object - store object
|
|
4328
|
+
* @param {string} mapId mapId: string - Id of the map
|
|
4329
|
+
*/
|
|
4330
|
+
|
|
4331
|
+
var getAutoTimeStepLayerId = toolkit.createSelector(getMapById, function (store) {
|
|
4332
|
+
return store === null || store === void 0 ? void 0 : store.autoTimeStepLayerId;
|
|
4125
4333
|
});
|
|
4126
4334
|
/**
|
|
4127
4335
|
* Gets scale of a time slider of a map
|
|
@@ -4285,8 +4493,8 @@
|
|
|
4285
4493
|
* @returns {string} returnType: string - the mapId, or null if not found
|
|
4286
4494
|
*/
|
|
4287
4495
|
|
|
4288
|
-
var getMapIdFromLayerId
|
|
4289
|
-
return store
|
|
4496
|
+
var getMapIdFromLayerId = toolkit.createSelector(function (store) {
|
|
4497
|
+
return store === null || store === void 0 ? void 0 : store.webmap;
|
|
4290
4498
|
}, function (_store, layerId) {
|
|
4291
4499
|
return layerId;
|
|
4292
4500
|
}, findMapIdFromLayerId, selectorMemoizationOptions);
|
|
@@ -4323,7 +4531,7 @@
|
|
|
4323
4531
|
* @returns {number} returnType: index number or -1 if not found
|
|
4324
4532
|
*/
|
|
4325
4533
|
|
|
4326
|
-
var getLayerIndexByLayerId
|
|
4534
|
+
var getLayerIndexByLayerId = toolkit.createSelector(getMapLayers, function (_store, _mapId, layerId) {
|
|
4327
4535
|
return layerId;
|
|
4328
4536
|
}, function (layers, layerId) {
|
|
4329
4537
|
return layers.findIndex(function (layer) {
|
|
@@ -4340,7 +4548,7 @@
|
|
|
4340
4548
|
* @returns {object} returnType: layer, or null if not found
|
|
4341
4549
|
*/
|
|
4342
4550
|
|
|
4343
|
-
var getLayerByLayerIndex
|
|
4551
|
+
var getLayerByLayerIndex = toolkit.createSelector(getMapLayers, function (_store, _mapId, layerIndex) {
|
|
4344
4552
|
return layerIndex;
|
|
4345
4553
|
}, function (layers, layerIndex) {
|
|
4346
4554
|
if (layerIndex >= 0 && layerIndex < layers.length) {
|
|
@@ -4429,7 +4637,7 @@
|
|
|
4429
4637
|
* @returns {MapPreset} returnType: MapPreset
|
|
4430
4638
|
*/
|
|
4431
4639
|
|
|
4432
|
-
var getMapPreset = toolkit.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) {
|
|
4640
|
+
var getMapPreset = toolkit.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) {
|
|
4433
4641
|
var _a;
|
|
4434
4642
|
|
|
4435
4643
|
var allLayers = __spreadArray(__spreadArray(__spreadArray([], __read(baseLayers)), __read(overLayers)), __read(mapLayers)).map(function (_a) {
|
|
@@ -4457,6 +4665,8 @@
|
|
|
4457
4665
|
return __assign({
|
|
4458
4666
|
layers: allLayers,
|
|
4459
4667
|
activeLayerId: activeLayerId,
|
|
4668
|
+
autoTimeStepLayerId: autoTimeStepLayerId,
|
|
4669
|
+
autoUpdateLayerId: autoUpdateLayerId,
|
|
4460
4670
|
proj: {
|
|
4461
4671
|
bbox: bbox,
|
|
4462
4672
|
srs: srs
|
|
@@ -4544,6 +4754,8 @@
|
|
|
4544
4754
|
isAutoUpdating: isAutoUpdating,
|
|
4545
4755
|
isEndTimeOverriding: isEndTimeOverriding,
|
|
4546
4756
|
getActiveLayerId: getActiveLayerId,
|
|
4757
|
+
getAutoUpdateLayerId: getAutoUpdateLayerId,
|
|
4758
|
+
getAutoTimeStepLayerId: getAutoTimeStepLayerId,
|
|
4547
4759
|
getMapTimeSliderScale: getMapTimeSliderScale,
|
|
4548
4760
|
getMapTimeStep: getMapTimeStep,
|
|
4549
4761
|
getMapTimeStepWithoutDefault: getMapTimeStepWithoutDefault,
|
|
@@ -4557,10 +4769,10 @@
|
|
|
4557
4769
|
isZoomControlsVisible: isZoomControlsVisible,
|
|
4558
4770
|
isTimeSliderVisible: isTimeSliderVisible,
|
|
4559
4771
|
getIsLayerActiveLayer: getIsLayerActiveLayer,
|
|
4560
|
-
getMapIdFromLayerId: getMapIdFromLayerId
|
|
4772
|
+
getMapIdFromLayerId: getMapIdFromLayerId,
|
|
4561
4773
|
getLayerIdByLayerName: getLayerIdByLayerName,
|
|
4562
|
-
getLayerIndexByLayerId: getLayerIndexByLayerId
|
|
4563
|
-
getLayerByLayerIndex: getLayerByLayerIndex
|
|
4774
|
+
getLayerIndexByLayerId: getLayerIndexByLayerId,
|
|
4775
|
+
getLayerByLayerIndex: getLayerByLayerIndex,
|
|
4564
4776
|
getAllUniqueDimensions: getAllUniqueDimensions,
|
|
4565
4777
|
getPinLocation: getPinLocation,
|
|
4566
4778
|
getDisableMapPin: getDisableMapPin,
|
|
@@ -4669,8 +4881,8 @@
|
|
|
4669
4881
|
* See the License for the specific language governing permissions and
|
|
4670
4882
|
* limitations under the License.
|
|
4671
4883
|
*
|
|
4672
|
-
* Copyright
|
|
4673
|
-
* Copyright
|
|
4884
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
4885
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
4674
4886
|
* */
|
|
4675
4887
|
var layerSelectFilterAdapter = toolkit.createEntityAdapter();
|
|
4676
4888
|
var layerSelectActiveServicesAdapter = toolkit.createEntityAdapter();
|
|
@@ -4720,62 +4932,6 @@
|
|
|
4720
4932
|
draft.servicePopup.variant = variant;
|
|
4721
4933
|
draft.servicePopup.serviceId = action.payload.serviceId ? action.payload.serviceId : '';
|
|
4722
4934
|
},
|
|
4723
|
-
addFiltersAndActiveServices: function addFiltersAndActiveServices(draft, action) {
|
|
4724
|
-
var _a, _b;
|
|
4725
|
-
|
|
4726
|
-
var _c = action.payload,
|
|
4727
|
-
serviceId = _c.serviceId,
|
|
4728
|
-
serviceName = _c.serviceName,
|
|
4729
|
-
serviceUrl = _c.serviceUrl,
|
|
4730
|
-
_abstract = _c["abstract"],
|
|
4731
|
-
keywords = _c.keywords,
|
|
4732
|
-
scope = _c.scope,
|
|
4733
|
-
groups = _c.groups,
|
|
4734
|
-
isLoading = _c.isLoading;
|
|
4735
|
-
|
|
4736
|
-
if (isLoading) {
|
|
4737
|
-
// If service is still loading, add without filters
|
|
4738
|
-
draft.filters.activeServices.entities[serviceId] = {
|
|
4739
|
-
serviceId: serviceId,
|
|
4740
|
-
enabled: draft.allServicesEnabled,
|
|
4741
|
-
filterIds: [],
|
|
4742
|
-
scope: scope,
|
|
4743
|
-
serviceName: serviceName,
|
|
4744
|
-
serviceUrl: serviceUrl,
|
|
4745
|
-
"abstract": _abstract,
|
|
4746
|
-
isLoading: isLoading
|
|
4747
|
-
};
|
|
4748
|
-
}
|
|
4749
|
-
|
|
4750
|
-
if (!isLoading) {
|
|
4751
|
-
// If service is done loading, add with filters
|
|
4752
|
-
if (!((_b = (_a = draft.filters.activeServices.entities[serviceId]) === null || _a === void 0 ? void 0 : _a.filterIds) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
4753
|
-
// If the service has no filters yet, add them
|
|
4754
|
-
produceFilters(groups, FilterType.Group, draft, layerSelectFilterAdapter);
|
|
4755
|
-
produceFilters(keywords, FilterType.Keyword, draft, layerSelectFilterAdapter);
|
|
4756
|
-
}
|
|
4757
|
-
|
|
4758
|
-
var filterIds = groups.map(function (group) {
|
|
4759
|
-
return getFilterId(FilterType.Group, group);
|
|
4760
|
-
}).concat(keywords.map(function (keyword) {
|
|
4761
|
-
return getFilterId(FilterType.Keyword, keyword);
|
|
4762
|
-
}));
|
|
4763
|
-
draft.filters.activeServices.entities[serviceId] = {
|
|
4764
|
-
serviceId: serviceId,
|
|
4765
|
-
enabled: draft.allServicesEnabled,
|
|
4766
|
-
filterIds: filterIds,
|
|
4767
|
-
scope: scope,
|
|
4768
|
-
serviceName: serviceName,
|
|
4769
|
-
serviceUrl: serviceUrl,
|
|
4770
|
-
"abstract": _abstract,
|
|
4771
|
-
isLoading: isLoading
|
|
4772
|
-
};
|
|
4773
|
-
}
|
|
4774
|
-
|
|
4775
|
-
if (!draft.filters.activeServices.ids.includes(serviceId)) {
|
|
4776
|
-
draft.filters.activeServices.ids.push(serviceId);
|
|
4777
|
-
}
|
|
4778
|
-
},
|
|
4779
4935
|
layerSelectRemoveService: function layerSelectRemoveService(draft, action) {
|
|
4780
4936
|
var serviceId = action.payload.serviceId; // 1. Find a service that is to be removed
|
|
4781
4937
|
|
|
@@ -4866,6 +5022,92 @@
|
|
|
4866
5022
|
var layer = action.payload.layer;
|
|
4867
5023
|
draft.activeLayerInfo = layer;
|
|
4868
5024
|
}
|
|
5025
|
+
},
|
|
5026
|
+
extraReducers: function extraReducers(builder) {
|
|
5027
|
+
builder.addCase(serviceActions.serviceSetLayers, function (draft, action) {
|
|
5028
|
+
var _a, _b;
|
|
5029
|
+
|
|
5030
|
+
var _c = action.payload,
|
|
5031
|
+
serviceId = _c.id,
|
|
5032
|
+
serviceUrl = _c.serviceUrl,
|
|
5033
|
+
serviceName = _c.name,
|
|
5034
|
+
scope = _c.scope,
|
|
5035
|
+
_abstract = _c["abstract"],
|
|
5036
|
+
layers = _c.layers,
|
|
5037
|
+
isUpdating = _c.isUpdating;
|
|
5038
|
+
|
|
5039
|
+
if (isUpdating) {
|
|
5040
|
+
return;
|
|
5041
|
+
}
|
|
5042
|
+
|
|
5043
|
+
var keywords = layers.reduce(function (keywords, layer) {
|
|
5044
|
+
var _a;
|
|
5045
|
+
|
|
5046
|
+
if (layer.leaf) {
|
|
5047
|
+
return keywords.concat((_a = layer.keywords) !== null && _a !== void 0 ? _a : []);
|
|
5048
|
+
}
|
|
5049
|
+
|
|
5050
|
+
return keywords;
|
|
5051
|
+
}, []);
|
|
5052
|
+
var groups = layers.reduce(function (groups, layer) {
|
|
5053
|
+
var _a;
|
|
5054
|
+
|
|
5055
|
+
if (layer.leaf) {
|
|
5056
|
+
return groups.concat((_a = layer.path) !== null && _a !== void 0 ? _a : []);
|
|
5057
|
+
}
|
|
5058
|
+
|
|
5059
|
+
return groups;
|
|
5060
|
+
}, []);
|
|
5061
|
+
|
|
5062
|
+
if (!((_b = (_a = draft.filters.activeServices.entities[serviceId]) === null || _a === void 0 ? void 0 : _a.filterIds) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
5063
|
+
// If the service has no filters yet, add them
|
|
5064
|
+
produceFilters(groups, FilterType.Group, draft, layerSelectFilterAdapter);
|
|
5065
|
+
produceFilters(keywords, FilterType.Keyword, draft, layerSelectFilterAdapter);
|
|
5066
|
+
}
|
|
5067
|
+
|
|
5068
|
+
var filterIds = groups.map(function (group) {
|
|
5069
|
+
return getFilterId(FilterType.Group, group);
|
|
5070
|
+
}).concat(keywords.map(function (keyword) {
|
|
5071
|
+
return getFilterId(FilterType.Keyword, keyword);
|
|
5072
|
+
}));
|
|
5073
|
+
draft.filters.activeServices.entities[serviceId] = {
|
|
5074
|
+
serviceId: serviceId,
|
|
5075
|
+
enabled: draft.allServicesEnabled,
|
|
5076
|
+
filterIds: filterIds,
|
|
5077
|
+
scope: scope,
|
|
5078
|
+
serviceName: serviceName,
|
|
5079
|
+
serviceUrl: serviceUrl,
|
|
5080
|
+
"abstract": _abstract,
|
|
5081
|
+
isLoading: false
|
|
5082
|
+
};
|
|
5083
|
+
|
|
5084
|
+
if (!draft.filters.activeServices.ids.includes(serviceId)) {
|
|
5085
|
+
draft.filters.activeServices.ids.push(serviceId);
|
|
5086
|
+
}
|
|
5087
|
+
}).addCase(serviceActions.fetchInitialServices, function (draft, action) {
|
|
5088
|
+
var services = action.payload.services;
|
|
5089
|
+
services.forEach(function (service) {
|
|
5090
|
+
var serviceId = service.id,
|
|
5091
|
+
serviceName = service.name,
|
|
5092
|
+
serviceUrl = service.serviceUrl,
|
|
5093
|
+
_abstract2 = service["abstract"],
|
|
5094
|
+
scope = service.scope;
|
|
5095
|
+
draft.filters.activeServices.entities[serviceId] = {
|
|
5096
|
+
serviceId: serviceId,
|
|
5097
|
+
enabled: draft.allServicesEnabled,
|
|
5098
|
+
filterIds: [],
|
|
5099
|
+
scope: scope,
|
|
5100
|
+
serviceName: serviceName,
|
|
5101
|
+
serviceUrl: serviceUrl,
|
|
5102
|
+
"abstract": _abstract2,
|
|
5103
|
+
isLoading: true
|
|
5104
|
+
};
|
|
5105
|
+
|
|
5106
|
+
if (!draft.filters.activeServices.ids.includes(serviceId)) {
|
|
5107
|
+
draft.filters.activeServices.ids.push(serviceId);
|
|
5108
|
+
}
|
|
5109
|
+
});
|
|
5110
|
+
});
|
|
4869
5111
|
}
|
|
4870
5112
|
});
|
|
4871
5113
|
var reducer$3 = slice$3.reducer;
|
|
@@ -4889,7 +5131,10 @@
|
|
|
4889
5131
|
* */
|
|
4890
5132
|
var filterLayersFromService = function filterLayersFromService(serviceId, services, filterIds, allFiltersActive, searchString) {
|
|
4891
5133
|
var mapStoreService = services[serviceId];
|
|
4892
|
-
|
|
5134
|
+
|
|
5135
|
+
if (!mapStoreService) {
|
|
5136
|
+
return [];
|
|
5137
|
+
}
|
|
4893
5138
|
|
|
4894
5139
|
if (searchString === '' && allFiltersActive) {
|
|
4895
5140
|
return mapStoreService.layers.filter(function (layer) {
|
|
@@ -5411,9 +5656,6 @@
|
|
|
5411
5656
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
5412
5657
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
5413
5658
|
* */
|
|
5414
|
-
var getLayerByLayerIndex = getLayerByLayerIndex$1,
|
|
5415
|
-
getMapIdFromLayerId = getMapIdFromLayerId$1,
|
|
5416
|
-
getLayerIndexByLayerId = getLayerIndexByLayerId$1;
|
|
5417
5659
|
/**
|
|
5418
5660
|
* Tries to find the layerId's in the other map based on the payload of the action. It works for all layer actions.
|
|
5419
5661
|
* @param state
|
|
@@ -5424,9 +5666,12 @@
|
|
|
5424
5666
|
*/
|
|
5425
5667
|
|
|
5426
5668
|
var getTargetLayerIdFromPayload = function getTargetLayerIdFromPayload(state, mapId, targetMapId, payload) {
|
|
5427
|
-
if (!payload)
|
|
5669
|
+
if (!payload) {
|
|
5670
|
+
return null;
|
|
5671
|
+
}
|
|
5428
5672
|
/* Try to find the layer for the DeleteLayerPayload, it uses layerIndex to reference the layer */
|
|
5429
5673
|
|
|
5674
|
+
|
|
5430
5675
|
if ('layerIndex' in payload) {
|
|
5431
5676
|
var targetLayer = getLayerByLayerIndex(state, targetMapId, payload.layerIndex);
|
|
5432
5677
|
return !targetLayer ? null : targetLayer.id;
|
|
@@ -5719,9 +5964,12 @@
|
|
|
5719
5964
|
switch (_b.label) {
|
|
5720
5965
|
case 0:
|
|
5721
5966
|
/* Should not listen to actions from itself */
|
|
5722
|
-
if (payload && payload.origin === LayerActionOrigin.ReactMapViewParseLayer)
|
|
5723
|
-
|
|
5724
|
-
|
|
5967
|
+
if (payload && payload.origin === LayerActionOrigin.ReactMapViewParseLayer) {
|
|
5968
|
+
return [2
|
|
5969
|
+
/*return*/
|
|
5970
|
+
];
|
|
5971
|
+
}
|
|
5972
|
+
|
|
5725
5973
|
return [4
|
|
5726
5974
|
/*yield*/
|
|
5727
5975
|
, effects.select(getLayerActionsTargets, payload, SYNCGROUPS_TYPE_SETLAYERACTIONS)];
|
|
@@ -5755,9 +6003,12 @@
|
|
|
5755
6003
|
switch (_b.label) {
|
|
5756
6004
|
case 0:
|
|
5757
6005
|
/* Should not listen to actions from itself */
|
|
5758
|
-
if (payload && payload.origin === LayerActionOrigin.ReactMapViewParseLayer)
|
|
5759
|
-
|
|
5760
|
-
|
|
6006
|
+
if (payload && payload.origin === LayerActionOrigin.ReactMapViewParseLayer) {
|
|
6007
|
+
return [2
|
|
6008
|
+
/*return*/
|
|
6009
|
+
];
|
|
6010
|
+
}
|
|
6011
|
+
|
|
5761
6012
|
return [4
|
|
5762
6013
|
/*yield*/
|
|
5763
6014
|
, effects.select(getAddLayerActionsTargets, payload, SYNCGROUPS_TYPE_SETLAYERACTIONS)];
|
|
@@ -5791,9 +6042,12 @@
|
|
|
5791
6042
|
switch (_b.label) {
|
|
5792
6043
|
case 0:
|
|
5793
6044
|
/* Should not listen to actions from itself */
|
|
5794
|
-
if (payload && payload.origin === LayerActionOrigin.ReactMapViewParseLayer)
|
|
5795
|
-
|
|
5796
|
-
|
|
6045
|
+
if (payload && payload.origin === LayerActionOrigin.ReactMapViewParseLayer) {
|
|
6046
|
+
return [2
|
|
6047
|
+
/*return*/
|
|
6048
|
+
];
|
|
6049
|
+
}
|
|
6050
|
+
|
|
5797
6051
|
return [4
|
|
5798
6052
|
/*yield*/
|
|
5799
6053
|
, effects.select(getLayerDeleteActionsTargets, payload, SYNCGROUPS_TYPE_SETLAYERACTIONS)];
|
|
@@ -5827,9 +6081,12 @@
|
|
|
5827
6081
|
switch (_b.label) {
|
|
5828
6082
|
case 0:
|
|
5829
6083
|
/* Should not listen to actions from itself */
|
|
5830
|
-
if (payload && payload.origin === LayerActionOrigin.ReactMapViewParseLayer)
|
|
5831
|
-
|
|
5832
|
-
|
|
6084
|
+
if (payload && payload.origin === LayerActionOrigin.ReactMapViewParseLayer) {
|
|
6085
|
+
return [2
|
|
6086
|
+
/*return*/
|
|
6087
|
+
];
|
|
6088
|
+
}
|
|
6089
|
+
|
|
5833
6090
|
return [4
|
|
5834
6091
|
/*yield*/
|
|
5835
6092
|
, effects.select(getLayerMoveActionsTargets, payload, SYNCGROUPS_TYPE_SETLAYERACTIONS)];
|
|
@@ -5855,7 +6112,7 @@
|
|
|
5855
6112
|
}
|
|
5856
6113
|
});
|
|
5857
6114
|
}
|
|
5858
|
-
function
|
|
6115
|
+
function setAutoLayerIdActionsSaga(_a) {
|
|
5859
6116
|
var targets;
|
|
5860
6117
|
var payload = _a.payload,
|
|
5861
6118
|
type = _a.type;
|
|
@@ -5895,9 +6152,12 @@
|
|
|
5895
6152
|
switch (_b.label) {
|
|
5896
6153
|
case 0:
|
|
5897
6154
|
/* Should not listen to actions from itself */
|
|
5898
|
-
if (payload && payload.origin === LayerActionOrigin.ReactMapViewParseLayer)
|
|
5899
|
-
|
|
5900
|
-
|
|
6155
|
+
if (payload && payload.origin === LayerActionOrigin.ReactMapViewParseLayer) {
|
|
6156
|
+
return [2
|
|
6157
|
+
/*return*/
|
|
6158
|
+
];
|
|
6159
|
+
}
|
|
6160
|
+
|
|
5901
6161
|
return [4
|
|
5902
6162
|
/*yield*/
|
|
5903
6163
|
, effects.select(getMapBaseLayerActionsTargets, payload, SYNCGROUPS_TYPE_SETLAYERACTIONS)];
|
|
@@ -5923,7 +6183,7 @@
|
|
|
5923
6183
|
}
|
|
5924
6184
|
});
|
|
5925
6185
|
}
|
|
5926
|
-
function rootSaga$
|
|
6186
|
+
function rootSaga$7() {
|
|
5927
6187
|
return __generator(this, function (_a) {
|
|
5928
6188
|
switch (_a.label) {
|
|
5929
6189
|
case 0:
|
|
@@ -5999,7 +6259,7 @@
|
|
|
5999
6259
|
|
|
6000
6260
|
return [4
|
|
6001
6261
|
/*yield*/
|
|
6002
|
-
, effects.takeLatest(mapActions$1.
|
|
6262
|
+
, effects.takeLatest(mapActions$1.setAutoLayerId.type, setAutoLayerIdActionsSaga)];
|
|
6003
6263
|
|
|
6004
6264
|
case 11:
|
|
6005
6265
|
_a.sent();
|
|
@@ -6171,9 +6431,12 @@
|
|
|
6171
6431
|
, 6];
|
|
6172
6432
|
|
|
6173
6433
|
case 2:
|
|
6174
|
-
if (!group.payloadByType[SYNCGROUPS_TYPE_SETTIME])
|
|
6175
|
-
|
|
6176
|
-
|
|
6434
|
+
if (!group.payloadByType[SYNCGROUPS_TYPE_SETTIME]) {
|
|
6435
|
+
return [2
|
|
6436
|
+
/*return*/
|
|
6437
|
+
];
|
|
6438
|
+
}
|
|
6439
|
+
|
|
6177
6440
|
return [4
|
|
6178
6441
|
/*yield*/
|
|
6179
6442
|
, effects.put(setTimeSync(group.payloadByType[SYNCGROUPS_TYPE_SETTIME], [{
|
|
@@ -6189,9 +6452,12 @@
|
|
|
6189
6452
|
, 6];
|
|
6190
6453
|
|
|
6191
6454
|
case 4:
|
|
6192
|
-
if (!group.payloadByType[SYNCGROUPS_TYPE_SETBBOX])
|
|
6193
|
-
|
|
6194
|
-
|
|
6455
|
+
if (!group.payloadByType[SYNCGROUPS_TYPE_SETBBOX]) {
|
|
6456
|
+
return [2
|
|
6457
|
+
/*return*/
|
|
6458
|
+
];
|
|
6459
|
+
}
|
|
6460
|
+
|
|
6195
6461
|
return [4
|
|
6196
6462
|
/*yield*/
|
|
6197
6463
|
, effects.put(setBboxSync(group.payloadByType[SYNCGROUPS_TYPE_SETBBOX], [{
|
|
@@ -6293,7 +6559,7 @@
|
|
|
6293
6559
|
});
|
|
6294
6560
|
}
|
|
6295
6561
|
|
|
6296
|
-
function rootSaga$
|
|
6562
|
+
function rootSaga$6() {
|
|
6297
6563
|
return __generator(this, function (_a) {
|
|
6298
6564
|
switch (_a.label) {
|
|
6299
6565
|
case 0:
|
|
@@ -6372,7 +6638,7 @@
|
|
|
6372
6638
|
reducersMap: {
|
|
6373
6639
|
syncronizationGroupStore: reducer$4
|
|
6374
6640
|
},
|
|
6375
|
-
sagas: [rootSaga$
|
|
6641
|
+
sagas: [rootSaga$7, rootSaga$6]
|
|
6376
6642
|
};
|
|
6377
6643
|
|
|
6378
6644
|
/* *
|
|
@@ -6494,7 +6760,7 @@
|
|
|
6494
6760
|
}
|
|
6495
6761
|
});
|
|
6496
6762
|
}
|
|
6497
|
-
function rootSaga$
|
|
6763
|
+
function rootSaga$5() {
|
|
6498
6764
|
return __generator(this, function (_a) {
|
|
6499
6765
|
switch (_a.label) {
|
|
6500
6766
|
case 0:
|
|
@@ -6540,7 +6806,7 @@
|
|
|
6540
6806
|
reducersMap: {
|
|
6541
6807
|
ui: reducer$6
|
|
6542
6808
|
},
|
|
6543
|
-
sagas: [rootSaga$
|
|
6809
|
+
sagas: [rootSaga$5]
|
|
6544
6810
|
};
|
|
6545
6811
|
|
|
6546
6812
|
/* *
|
|
@@ -6559,30 +6825,100 @@
|
|
|
6559
6825
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6560
6826
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
6561
6827
|
* */
|
|
6562
|
-
var
|
|
6563
|
-
|
|
6564
|
-
|
|
6828
|
+
var replaceLayerIdsToEnsureUniqueLayerIdsInStore = function replaceLayerIdsToEnsureUniqueLayerIdsInStore(layerIds) {
|
|
6829
|
+
var layers = layerIds.layers,
|
|
6830
|
+
autoTimeStepLayerId = layerIds.autoTimeStepLayerId,
|
|
6831
|
+
autoUpdateLayerId = layerIds.autoUpdateLayerId;
|
|
6832
|
+
var layerIdIsSameForTimestepAndUpdate = autoTimeStepLayerId && autoTimeStepLayerId === autoUpdateLayerId;
|
|
6833
|
+
|
|
6834
|
+
if (layerIdIsSameForTimestepAndUpdate) {
|
|
6835
|
+
var newAutoLayerId = generateLayerId();
|
|
6836
|
+
return {
|
|
6837
|
+
layers: replaceLayerIds(layers, autoTimeStepLayerId, newAutoLayerId),
|
|
6838
|
+
autoTimeStepLayerId: newAutoLayerId,
|
|
6839
|
+
autoUpdateLayerId: newAutoLayerId
|
|
6840
|
+
};
|
|
6841
|
+
}
|
|
6842
|
+
|
|
6843
|
+
var autoTimeStepLayerIdNew = autoTimeStepLayerId && generateLayerId();
|
|
6844
|
+
var autoUpdateLayerIdNew = autoUpdateLayerId && generateLayerId();
|
|
6845
|
+
var timestepAndUpdateLayerIdsAreProvided = autoTimeStepLayerId && autoUpdateLayerId;
|
|
6846
|
+
|
|
6847
|
+
if (timestepAndUpdateLayerIdsAreProvided) {
|
|
6848
|
+
var autoTimeStepLayerIndex_1 = layers.findIndex(function (layer) {
|
|
6849
|
+
return layer.id === autoTimeStepLayerId;
|
|
6850
|
+
});
|
|
6851
|
+
var autoUpdateLayerIndex_1 = layers.findIndex(function (layer) {
|
|
6852
|
+
return layer.id === autoUpdateLayerId;
|
|
6853
|
+
});
|
|
6854
|
+
var layersWithNewIds_1 = layers.map(function (layer, index) {
|
|
6855
|
+
if (layer.id && index === autoTimeStepLayerIndex_1) {
|
|
6856
|
+
return __assign(__assign({}, layer), {
|
|
6857
|
+
id: autoTimeStepLayerIdNew
|
|
6858
|
+
});
|
|
6859
|
+
}
|
|
6860
|
+
|
|
6861
|
+
if (layer.id && index === autoUpdateLayerIndex_1) {
|
|
6862
|
+
return __assign(__assign({}, layer), {
|
|
6863
|
+
id: autoUpdateLayerIdNew
|
|
6864
|
+
});
|
|
6865
|
+
}
|
|
6565
6866
|
|
|
6566
|
-
var activeLayerIndex = layers.findIndex(function (layer) {
|
|
6567
|
-
return layer.id === activeLayerId;
|
|
6568
|
-
});
|
|
6569
|
-
var layersNewIds = layers.map(function (layer, index) {
|
|
6570
|
-
if (layer.id && index === activeLayerIndex) {
|
|
6571
6867
|
return __assign(__assign({}, layer), {
|
|
6572
|
-
id:
|
|
6868
|
+
id: generateLayerId()
|
|
6573
6869
|
});
|
|
6574
|
-
}
|
|
6870
|
+
});
|
|
6871
|
+
return {
|
|
6872
|
+
layers: layersWithNewIds_1,
|
|
6873
|
+
autoTimeStepLayerId: autoTimeStepLayerIdNew,
|
|
6874
|
+
autoUpdateLayerId: autoUpdateLayerIdNew
|
|
6875
|
+
};
|
|
6876
|
+
}
|
|
6877
|
+
|
|
6878
|
+
if (autoTimeStepLayerIdNew) {
|
|
6879
|
+
return {
|
|
6880
|
+
layers: replaceLayerIds(layers, autoTimeStepLayerId, autoTimeStepLayerIdNew),
|
|
6881
|
+
autoTimeStepLayerId: autoTimeStepLayerIdNew
|
|
6882
|
+
};
|
|
6883
|
+
}
|
|
6575
6884
|
|
|
6885
|
+
if (autoUpdateLayerIdNew) {
|
|
6886
|
+
return {
|
|
6887
|
+
layers: replaceLayerIds(layers, autoUpdateLayerId, autoUpdateLayerIdNew),
|
|
6888
|
+
autoUpdateLayerId: autoUpdateLayerIdNew
|
|
6889
|
+
};
|
|
6890
|
+
} // The code below is executed if neither auto timestep
|
|
6891
|
+
// nor auto update layer id was provided
|
|
6892
|
+
|
|
6893
|
+
|
|
6894
|
+
var layersWithNewIds = layers.map(function (layer) {
|
|
6576
6895
|
return __assign(__assign({}, layer), {
|
|
6577
6896
|
id: generateLayerId()
|
|
6578
6897
|
});
|
|
6579
6898
|
});
|
|
6580
6899
|
return {
|
|
6581
|
-
|
|
6582
|
-
activeLayerNewId: activeLayerNewId
|
|
6900
|
+
layers: layersWithNewIds
|
|
6583
6901
|
};
|
|
6584
6902
|
};
|
|
6585
6903
|
|
|
6904
|
+
function replaceLayerIds(layers, autoLayerIdOld, autoLayerIdNew) {
|
|
6905
|
+
var autoLayerIndex = layers.findIndex(function (layer) {
|
|
6906
|
+
return layer.id === autoLayerIdOld;
|
|
6907
|
+
});
|
|
6908
|
+
var layersWithNewIds = layers.map(function (layer, index) {
|
|
6909
|
+
if (layer.id && index === autoLayerIndex) {
|
|
6910
|
+
return __assign(__assign({}, layer), {
|
|
6911
|
+
id: autoLayerIdNew
|
|
6912
|
+
});
|
|
6913
|
+
}
|
|
6914
|
+
|
|
6915
|
+
return __assign(__assign({}, layer), {
|
|
6916
|
+
id: generateLayerId()
|
|
6917
|
+
});
|
|
6918
|
+
});
|
|
6919
|
+
return layersWithNewIds;
|
|
6920
|
+
}
|
|
6921
|
+
|
|
6586
6922
|
/* *
|
|
6587
6923
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6588
6924
|
* you may not use this file except in compliance with the License.
|
|
@@ -7428,7 +7764,11 @@
|
|
|
7428
7764
|
var _a = this.props,
|
|
7429
7765
|
onKeyUp = _a.onKeyUp,
|
|
7430
7766
|
loopInterval = _a.redrawInterval;
|
|
7431
|
-
|
|
7767
|
+
|
|
7768
|
+
if (onKeyUp) {
|
|
7769
|
+
window.addEventListener('keyup', this.onKeyUp);
|
|
7770
|
+
}
|
|
7771
|
+
|
|
7432
7772
|
window.addEventListener('resize', this._handleWindowResize);
|
|
7433
7773
|
|
|
7434
7774
|
if (this.canvascontaineroutside && this.canvascontaineroutside.current && onKeyUp) {
|
|
@@ -7459,7 +7799,10 @@
|
|
|
7459
7799
|
this.mounted = false;
|
|
7460
7800
|
window.removeEventListener('resize', this._handleWindowResize);
|
|
7461
7801
|
var onKeyUp = this.props.onKeyUp;
|
|
7462
|
-
|
|
7802
|
+
|
|
7803
|
+
if (onKeyUp) {
|
|
7804
|
+
window.removeEventListener('keyup', this.onKeyUp);
|
|
7805
|
+
}
|
|
7463
7806
|
|
|
7464
7807
|
if (this.canvas) {
|
|
7465
7808
|
this.canvas.removeEventListener('mousedown', this.handleMouseDownEvent);
|
|
@@ -7497,7 +7840,10 @@
|
|
|
7497
7840
|
|
|
7498
7841
|
CanvasComponent.prototype.onKeyUp = function (event) {
|
|
7499
7842
|
var onKeyUp = this.props.onKeyUp;
|
|
7500
|
-
|
|
7843
|
+
|
|
7844
|
+
if (onKeyUp) {
|
|
7845
|
+
onKeyUp(event);
|
|
7846
|
+
}
|
|
7501
7847
|
|
|
7502
7848
|
if (this.canvascontaineroutside && this.canvascontaineroutside.current && onKeyUp) {
|
|
7503
7849
|
if (event.code === 'Escape') {
|
|
@@ -7509,7 +7855,10 @@
|
|
|
7509
7855
|
CanvasComponent.prototype._documentKeyDown = function (event) {
|
|
7510
7856
|
if (this._isFocussed) {
|
|
7511
7857
|
var onKeyDown = this.props.onKeyDown;
|
|
7512
|
-
|
|
7858
|
+
|
|
7859
|
+
if (onKeyDown) {
|
|
7860
|
+
onKeyDown(event);
|
|
7861
|
+
}
|
|
7513
7862
|
}
|
|
7514
7863
|
};
|
|
7515
7864
|
|
|
@@ -7519,7 +7868,10 @@
|
|
|
7519
7868
|
|
|
7520
7869
|
CanvasComponent.prototype.startLoop = function () {
|
|
7521
7870
|
var onRenderCanvas = this.props.onRenderCanvas;
|
|
7522
|
-
|
|
7871
|
+
|
|
7872
|
+
if (this.mounted === false || this.loopHasStarted === false) {
|
|
7873
|
+
return;
|
|
7874
|
+
}
|
|
7523
7875
|
|
|
7524
7876
|
if (this.canvas) {
|
|
7525
7877
|
onRenderCanvas(this.ctx, this.currentWidth, this.currentHeight, this.canvas);
|
|
@@ -7888,9 +8240,16 @@
|
|
|
7888
8240
|
}, [layerId]);
|
|
7889
8241
|
/* Should not do anything if no layer is given */
|
|
7890
8242
|
|
|
7891
|
-
if (!layer)
|
|
8243
|
+
if (!layer) {
|
|
8244
|
+
return null;
|
|
8245
|
+
}
|
|
8246
|
+
|
|
7892
8247
|
var isLayerEnabled = layer.enabled;
|
|
7893
|
-
|
|
8248
|
+
|
|
8249
|
+
if (!isLayerEnabled) {
|
|
8250
|
+
return null;
|
|
8251
|
+
}
|
|
8252
|
+
|
|
7894
8253
|
var layerOpacity = layer.opacity ? layer.opacity : 1;
|
|
7895
8254
|
/* Get the wmLayer, it has more detailed info about the WMS service,
|
|
7896
8255
|
like a title and the WMS legendgraphic url */
|
|
@@ -8378,17 +8737,21 @@
|
|
|
8378
8737
|
});
|
|
8379
8738
|
}
|
|
8380
8739
|
function setLayerDimensionsSaga(_a) {
|
|
8381
|
-
var layerDimensions, dimensions, layerId, layer, newTimeDimension_1, mapId,
|
|
8740
|
+
var layerDimensions, dimensions, layerId, layer, newTimeDimension_1, mapId, autoUpdateLayerId, shouldAutoUpdate, shouldEndTimeOverride, prevTimeDimension, isAnimating$1, webmapInstance, isAutoUpdateLayer, syncedMapIds, error_1;
|
|
8382
8741
|
var payload = _a.payload;
|
|
8383
8742
|
return __generator(this, function (_b) {
|
|
8384
8743
|
switch (_b.label) {
|
|
8385
8744
|
case 0:
|
|
8386
|
-
_b.trys.push([0,
|
|
8745
|
+
_b.trys.push([0, 16,, 17]);
|
|
8387
8746
|
|
|
8388
8747
|
layerDimensions = payload.layerDimensions;
|
|
8389
|
-
|
|
8390
|
-
|
|
8391
|
-
|
|
8748
|
+
|
|
8749
|
+
if (!layerDimensions) {
|
|
8750
|
+
return [2
|
|
8751
|
+
/*return*/
|
|
8752
|
+
];
|
|
8753
|
+
}
|
|
8754
|
+
|
|
8392
8755
|
dimensions = layerDimensions.dimensions, layerId = layerDimensions.layerId;
|
|
8393
8756
|
return [4
|
|
8394
8757
|
/*yield*/
|
|
@@ -8396,19 +8759,23 @@
|
|
|
8396
8759
|
|
|
8397
8760
|
case 1:
|
|
8398
8761
|
layer = _b.sent();
|
|
8399
|
-
|
|
8400
|
-
|
|
8401
|
-
|
|
8762
|
+
|
|
8763
|
+
if (!layer) {
|
|
8764
|
+
return [2
|
|
8765
|
+
/*return*/
|
|
8766
|
+
];
|
|
8767
|
+
}
|
|
8768
|
+
|
|
8402
8769
|
newTimeDimension_1 = dimensions.find(function (dimension) {
|
|
8403
8770
|
return dimension.name === 'time';
|
|
8404
8771
|
});
|
|
8405
8772
|
mapId = layer.mapId;
|
|
8406
8773
|
return [4
|
|
8407
8774
|
/*yield*/
|
|
8408
|
-
, effects.select(
|
|
8775
|
+
, effects.select(getAutoUpdateLayerId, mapId)];
|
|
8409
8776
|
|
|
8410
8777
|
case 2:
|
|
8411
|
-
|
|
8778
|
+
autoUpdateLayerId = _b.sent();
|
|
8412
8779
|
return [4
|
|
8413
8780
|
/*yield*/
|
|
8414
8781
|
, effects.select(isAutoUpdating, mapId)];
|
|
@@ -8434,46 +8801,14 @@
|
|
|
8434
8801
|
case 6:
|
|
8435
8802
|
isAnimating$1 = _b.sent();
|
|
8436
8803
|
webmapInstance = getWMJSMapById(mapId);
|
|
8437
|
-
|
|
8438
|
-
|
|
8439
|
-
/*yield*/
|
|
8440
|
-
, effects.select(getMapTimeStepWithoutDefault, mapId)];
|
|
8441
|
-
|
|
8442
|
-
case 7:
|
|
8443
|
-
timeStep = _b.sent();
|
|
8444
|
-
return [4
|
|
8445
|
-
/*yield*/
|
|
8446
|
-
, effects.select(isTimestepAuto, mapId)];
|
|
8447
|
-
|
|
8448
|
-
case 8:
|
|
8449
|
-
isTimestepAuto$1 = _b.sent();
|
|
8450
|
-
if (!(isTimestepAuto$1 && isActiveLayer && timeStep === undefined && newTimeDimension_1)) return [3
|
|
8451
|
-
/*break*/
|
|
8452
|
-
, 10];
|
|
8453
|
-
newTimeStep = getActiveLayerTimeStep(newTimeDimension_1);
|
|
8454
|
-
if (!newTimeStep) return [3
|
|
8455
|
-
/*break*/
|
|
8456
|
-
, 10];
|
|
8457
|
-
return [4
|
|
8458
|
-
/*yield*/
|
|
8459
|
-
, effects.put(mapActions$1.setTimeStep({
|
|
8460
|
-
mapId: mapId,
|
|
8461
|
-
timeStep: newTimeStep
|
|
8462
|
-
}))];
|
|
8463
|
-
|
|
8464
|
-
case 9:
|
|
8465
|
-
_b.sent();
|
|
8466
|
-
|
|
8467
|
-
_b.label = 10;
|
|
8468
|
-
|
|
8469
|
-
case 10:
|
|
8470
|
-
if (!(isActiveLayer && // only update the active layer
|
|
8804
|
+
isAutoUpdateLayer = layerId === autoUpdateLayerId;
|
|
8805
|
+
if (!(isAutoUpdateLayer && // only update the active layer
|
|
8471
8806
|
shouldAutoUpdate && newTimeDimension_1 && newTimeDimension_1.maxValue && prevTimeDimension && prevTimeDimension.currentValue && prevTimeDimension.currentValue !== newTimeDimension_1.maxValue && !shouldEndTimeOverride)) return [3
|
|
8472
8807
|
/*break*/
|
|
8473
|
-
,
|
|
8808
|
+
, 13];
|
|
8474
8809
|
if (!!isAnimating$1) return [3
|
|
8475
8810
|
/*break*/
|
|
8476
|
-
,
|
|
8811
|
+
, 8];
|
|
8477
8812
|
return [4
|
|
8478
8813
|
/*yield*/
|
|
8479
8814
|
, effects.put(layerActions.layerChangeDimension({
|
|
@@ -8485,21 +8820,21 @@
|
|
|
8485
8820
|
}
|
|
8486
8821
|
}))];
|
|
8487
8822
|
|
|
8488
|
-
case
|
|
8823
|
+
case 7:
|
|
8489
8824
|
_b.sent();
|
|
8490
8825
|
|
|
8491
|
-
_b.label =
|
|
8826
|
+
_b.label = 8;
|
|
8492
8827
|
|
|
8493
|
-
case
|
|
8828
|
+
case 8:
|
|
8494
8829
|
return [4
|
|
8495
8830
|
/*yield*/
|
|
8496
8831
|
, effects.select(getSyncedMapIdsForTimeslider)];
|
|
8497
8832
|
|
|
8498
|
-
case
|
|
8833
|
+
case 9:
|
|
8499
8834
|
syncedMapIds = _b.sent();
|
|
8500
8835
|
if (!syncedMapIds) return [3
|
|
8501
8836
|
/*break*/
|
|
8502
|
-
,
|
|
8837
|
+
, 11]; // Change time value for all other timesliders
|
|
8503
8838
|
|
|
8504
8839
|
return [4
|
|
8505
8840
|
/*yield*/
|
|
@@ -8511,51 +8846,51 @@
|
|
|
8511
8846
|
}));
|
|
8512
8847
|
}))];
|
|
8513
8848
|
|
|
8514
|
-
case
|
|
8849
|
+
case 10:
|
|
8515
8850
|
// Change time value for all other timesliders
|
|
8516
8851
|
_b.sent();
|
|
8517
8852
|
|
|
8518
|
-
_b.label =
|
|
8853
|
+
_b.label = 11;
|
|
8519
8854
|
|
|
8520
|
-
case
|
|
8855
|
+
case 11:
|
|
8521
8856
|
return [4
|
|
8522
8857
|
/*yield*/
|
|
8523
8858
|
, effects.call(updateAnimation, mapId, newTimeDimension_1.maxValue)];
|
|
8524
8859
|
|
|
8525
|
-
case
|
|
8860
|
+
case 12:
|
|
8526
8861
|
_b.sent();
|
|
8527
8862
|
|
|
8528
8863
|
return [3
|
|
8529
8864
|
/*break*/
|
|
8530
|
-
,
|
|
8865
|
+
, 15];
|
|
8531
8866
|
|
|
8532
|
-
case
|
|
8867
|
+
case 13:
|
|
8533
8868
|
if (!(isAnimating$1 && !webmapInstance.isAnimating && newTimeDimension_1 && newTimeDimension_1.maxValue && !shouldEndTimeOverride)) return [3
|
|
8534
8869
|
/*break*/
|
|
8535
|
-
,
|
|
8870
|
+
, 15];
|
|
8536
8871
|
return [4
|
|
8537
8872
|
/*yield*/
|
|
8538
8873
|
, effects.call(updateAnimation, mapId, newTimeDimension_1.maxValue)];
|
|
8539
8874
|
|
|
8540
|
-
case
|
|
8875
|
+
case 14:
|
|
8541
8876
|
_b.sent();
|
|
8542
8877
|
|
|
8543
|
-
_b.label =
|
|
8878
|
+
_b.label = 15;
|
|
8544
8879
|
|
|
8545
|
-
case
|
|
8880
|
+
case 15:
|
|
8546
8881
|
return [3
|
|
8547
8882
|
/*break*/
|
|
8548
|
-
,
|
|
8883
|
+
, 17];
|
|
8549
8884
|
|
|
8550
|
-
case
|
|
8885
|
+
case 16:
|
|
8551
8886
|
error_1 = _b.sent(); // eslint-disable-next-line no-console
|
|
8552
8887
|
|
|
8553
8888
|
console.warn(error_1);
|
|
8554
8889
|
return [3
|
|
8555
8890
|
/*break*/
|
|
8556
|
-
,
|
|
8891
|
+
, 17];
|
|
8557
8892
|
|
|
8558
|
-
case
|
|
8893
|
+
case 17:
|
|
8559
8894
|
return [2
|
|
8560
8895
|
/*return*/
|
|
8561
8896
|
];
|
|
@@ -8563,7 +8898,7 @@
|
|
|
8563
8898
|
});
|
|
8564
8899
|
}
|
|
8565
8900
|
function toggleAutoUpdateSaga(_a) {
|
|
8566
|
-
var shouldAutoUpdate, mapId_1,
|
|
8901
|
+
var shouldAutoUpdate, mapId_1, autoUpdateLayerId, timeDimension_1, syncedMapIds, payloads, error_2;
|
|
8567
8902
|
var payload = _a.payload;
|
|
8568
8903
|
return __generator(this, function (_b) {
|
|
8569
8904
|
switch (_b.label) {
|
|
@@ -8576,13 +8911,13 @@
|
|
|
8576
8911
|
, 9];
|
|
8577
8912
|
return [4
|
|
8578
8913
|
/*yield*/
|
|
8579
|
-
, effects.select(
|
|
8914
|
+
, effects.select(getAutoUpdateLayerId, mapId_1)];
|
|
8580
8915
|
|
|
8581
8916
|
case 1:
|
|
8582
|
-
|
|
8917
|
+
autoUpdateLayerId = _b.sent();
|
|
8583
8918
|
return [4
|
|
8584
8919
|
/*yield*/
|
|
8585
|
-
, effects.select(getLayerTimeDimension,
|
|
8920
|
+
, effects.select(getLayerTimeDimension, autoUpdateLayerId)];
|
|
8586
8921
|
|
|
8587
8922
|
case 2:
|
|
8588
8923
|
timeDimension_1 = _b.sent();
|
|
@@ -8592,7 +8927,7 @@
|
|
|
8592
8927
|
return [4
|
|
8593
8928
|
/*yield*/
|
|
8594
8929
|
, effects.put(layerActions.layerChangeDimension({
|
|
8595
|
-
layerId:
|
|
8930
|
+
layerId: autoUpdateLayerId,
|
|
8596
8931
|
origin: LayerActionOrigin.toggleAutoUpdateSaga,
|
|
8597
8932
|
dimension: {
|
|
8598
8933
|
name: 'time',
|
|
@@ -8739,54 +9074,70 @@
|
|
|
8739
9074
|
});
|
|
8740
9075
|
}
|
|
8741
9076
|
function setMapPresetSaga(_a) {
|
|
8742
|
-
var mapId, initialProps, mapPreset, layers, activeLayerId, proj, shouldAutoUpdate, shouldAnimate, animationPayload, toggleTimestepAuto, showTimeSlider, displayMapPin, shouldShowZoomControls, shouldShowLegend, dockedLayerManagerSize, _b, mapLayers, baseLayers, overLayers,
|
|
9077
|
+
var mapId, initialProps, mapPreset, layers, activeLayerId, autoTimeStepLayerId, autoUpdateLayerId, proj, shouldAutoUpdate, shouldAnimate, animationPayload, toggleTimestepAuto, showTimeSlider, displayMapPin, shouldShowZoomControls, shouldShowLegend, dockedLayerManagerSize, _b, mapLayers, baseLayers, overLayers, autoTimeStepLayerIdNew, autoUpdateLayerIdNew, onlyActiveLayerIdIsSet, newLayerIds, firstLayerId, baseLayersWithDefaultLayer, overLayersWithDefaultLayer, allBaseLayers, animationLength, animationEndTime, shouldEndtimeOverride, interval, animationEnd, animationEnd, duration, animationEnd, _c, animationStart, _d, shouldOpenLegend, legendId, fiveMinuteDelayForAnimation, animationEnd, animationStart, error_3;
|
|
9078
|
+
|
|
9079
|
+
var _e, _f, _g;
|
|
8743
9080
|
|
|
8744
9081
|
var payload = _a.payload;
|
|
8745
|
-
return __generator(this, function (
|
|
8746
|
-
switch (
|
|
9082
|
+
return __generator(this, function (_h) {
|
|
9083
|
+
switch (_h.label) {
|
|
8747
9084
|
case 0:
|
|
8748
|
-
|
|
9085
|
+
_h.trys.push([0, 52,, 53]);
|
|
8749
9086
|
|
|
8750
9087
|
mapId = payload.mapId, initialProps = payload.initialProps;
|
|
8751
9088
|
mapPreset = initialProps.mapPreset;
|
|
8752
9089
|
if (!mapPreset) return [3
|
|
8753
9090
|
/*break*/
|
|
8754
9091
|
, 51];
|
|
8755
|
-
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;
|
|
9092
|
+
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;
|
|
8756
9093
|
_b = filterLayers(layers), mapLayers = _b.mapLayers, baseLayers = _b.baseLayers, overLayers = _b.overLayers;
|
|
8757
9094
|
if (!layers) return [3
|
|
8758
9095
|
/*break*/
|
|
8759
9096
|
, 4];
|
|
9097
|
+
autoTimeStepLayerIdNew = autoTimeStepLayerId;
|
|
9098
|
+
autoUpdateLayerIdNew = autoUpdateLayerId;
|
|
9099
|
+
onlyActiveLayerIdIsSet = !autoTimeStepLayerId && !autoUpdateLayerId && activeLayerId;
|
|
9100
|
+
|
|
9101
|
+
if (onlyActiveLayerIdIsSet) {
|
|
9102
|
+
autoTimeStepLayerIdNew = activeLayerId;
|
|
9103
|
+
autoUpdateLayerIdNew = activeLayerId;
|
|
9104
|
+
}
|
|
9105
|
+
|
|
8760
9106
|
return [4
|
|
8761
9107
|
/*yield*/
|
|
8762
|
-
, effects.call(
|
|
9108
|
+
, effects.call(replaceLayerIdsToEnsureUniqueLayerIdsInStore, {
|
|
9109
|
+
layers: mapLayers,
|
|
9110
|
+
autoTimeStepLayerId: autoTimeStepLayerIdNew,
|
|
9111
|
+
autoUpdateLayerId: autoUpdateLayerIdNew
|
|
9112
|
+
})];
|
|
8763
9113
|
|
|
8764
9114
|
case 1:
|
|
8765
|
-
|
|
9115
|
+
newLayerIds = _h.sent(); // set layers
|
|
8766
9116
|
|
|
8767
9117
|
return [4
|
|
8768
9118
|
/*yield*/
|
|
8769
9119
|
, effects.put(layerActions.setLayers({
|
|
8770
9120
|
mapId: mapId,
|
|
8771
|
-
layers:
|
|
9121
|
+
layers: newLayerIds.layers
|
|
8772
9122
|
}))];
|
|
8773
9123
|
|
|
8774
9124
|
case 2:
|
|
8775
9125
|
// set layers
|
|
8776
|
-
|
|
9126
|
+
_h.sent();
|
|
8777
9127
|
|
|
8778
|
-
|
|
9128
|
+
firstLayerId = (_e = newLayerIds.layers[0]) === null || _e === void 0 ? void 0 : _e.id;
|
|
8779
9129
|
return [4
|
|
8780
9130
|
/*yield*/
|
|
8781
|
-
, effects.put(mapActions$1.
|
|
9131
|
+
, effects.put(mapActions$1.setAutoLayerId({
|
|
8782
9132
|
mapId: mapId,
|
|
8783
|
-
|
|
9133
|
+
autoTimeStepLayerId: (_f = newLayerIds.autoTimeStepLayerId) !== null && _f !== void 0 ? _f : firstLayerId,
|
|
9134
|
+
autoUpdateLayerId: (_g = newLayerIds.autoUpdateLayerId) !== null && _g !== void 0 ? _g : firstLayerId
|
|
8784
9135
|
}))];
|
|
8785
9136
|
|
|
8786
9137
|
case 3:
|
|
8787
|
-
|
|
9138
|
+
_h.sent();
|
|
8788
9139
|
|
|
8789
|
-
|
|
9140
|
+
_h.label = 4;
|
|
8790
9141
|
|
|
8791
9142
|
case 4:
|
|
8792
9143
|
baseLayersWithDefaultLayer = baseLayers.length ? baseLayers : [baseLayerGrey$1];
|
|
@@ -8801,7 +9152,7 @@
|
|
|
8801
9152
|
, effects.call(handleBaseLayersSaga, mapId, allBaseLayers)];
|
|
8802
9153
|
|
|
8803
9154
|
case 5:
|
|
8804
|
-
|
|
9155
|
+
_h.sent();
|
|
8805
9156
|
|
|
8806
9157
|
if (!proj) return [3
|
|
8807
9158
|
/*break*/
|
|
@@ -8817,9 +9168,9 @@
|
|
|
8817
9168
|
|
|
8818
9169
|
case 6:
|
|
8819
9170
|
// set bbox
|
|
8820
|
-
|
|
9171
|
+
_h.sent();
|
|
8821
9172
|
|
|
8822
|
-
|
|
9173
|
+
_h.label = 7;
|
|
8823
9174
|
|
|
8824
9175
|
case 7:
|
|
8825
9176
|
animationLength = animationPayload && animationPayload.duration;
|
|
@@ -8838,9 +9189,9 @@
|
|
|
8838
9189
|
|
|
8839
9190
|
case 8:
|
|
8840
9191
|
// auto update
|
|
8841
|
-
|
|
9192
|
+
_h.sent();
|
|
8842
9193
|
|
|
8843
|
-
|
|
9194
|
+
_h.label = 9;
|
|
8844
9195
|
|
|
8845
9196
|
case 9:
|
|
8846
9197
|
if (!(shouldAutoUpdate !== undefined && !animationEndTime)) return [3
|
|
@@ -8856,9 +9207,9 @@
|
|
|
8856
9207
|
|
|
8857
9208
|
case 10:
|
|
8858
9209
|
// auto update
|
|
8859
|
-
|
|
9210
|
+
_h.sent();
|
|
8860
9211
|
|
|
8861
|
-
|
|
9212
|
+
_h.label = 11;
|
|
8862
9213
|
|
|
8863
9214
|
case 11:
|
|
8864
9215
|
if (!(showTimeSlider !== undefined)) return [3
|
|
@@ -8874,9 +9225,9 @@
|
|
|
8874
9225
|
|
|
8875
9226
|
case 12:
|
|
8876
9227
|
// toggle timeslider
|
|
8877
|
-
|
|
9228
|
+
_h.sent();
|
|
8878
9229
|
|
|
8879
|
-
|
|
9230
|
+
_h.label = 13;
|
|
8880
9231
|
|
|
8881
9232
|
case 13:
|
|
8882
9233
|
if (!(shouldShowZoomControls !== undefined)) return [3
|
|
@@ -8892,9 +9243,9 @@
|
|
|
8892
9243
|
|
|
8893
9244
|
case 14:
|
|
8894
9245
|
// toggle zoom controls
|
|
8895
|
-
|
|
9246
|
+
_h.sent();
|
|
8896
9247
|
|
|
8897
|
-
|
|
9248
|
+
_h.label = 15;
|
|
8898
9249
|
|
|
8899
9250
|
case 15:
|
|
8900
9251
|
if (!(displayMapPin !== undefined)) return [3
|
|
@@ -8910,9 +9261,9 @@
|
|
|
8910
9261
|
|
|
8911
9262
|
case 16:
|
|
8912
9263
|
// display map pin
|
|
8913
|
-
|
|
9264
|
+
_h.sent();
|
|
8914
9265
|
|
|
8915
|
-
|
|
9266
|
+
_h.label = 17;
|
|
8916
9267
|
|
|
8917
9268
|
case 17:
|
|
8918
9269
|
interval = animationPayload && animationPayload.interval;
|
|
@@ -8927,9 +9278,9 @@
|
|
|
8927
9278
|
}))];
|
|
8928
9279
|
|
|
8929
9280
|
case 18:
|
|
8930
|
-
|
|
9281
|
+
_h.sent();
|
|
8931
9282
|
|
|
8932
|
-
|
|
9283
|
+
_h.label = 19;
|
|
8933
9284
|
|
|
8934
9285
|
case 19:
|
|
8935
9286
|
if (!animationEndTime) return [3
|
|
@@ -8943,7 +9294,7 @@
|
|
|
8943
9294
|
}))];
|
|
8944
9295
|
|
|
8945
9296
|
case 20:
|
|
8946
|
-
|
|
9297
|
+
_h.sent();
|
|
8947
9298
|
|
|
8948
9299
|
if (!!animationLength) return [3
|
|
8949
9300
|
/*break*/
|
|
@@ -8953,7 +9304,7 @@
|
|
|
8953
9304
|
, effects.select(getAnimationEndTime$1, mapId)];
|
|
8954
9305
|
|
|
8955
9306
|
case 21:
|
|
8956
|
-
animationEnd =
|
|
9307
|
+
animationEnd = _h.sent();
|
|
8957
9308
|
return [4
|
|
8958
9309
|
/*yield*/
|
|
8959
9310
|
, effects.put(mapActions$1.setAnimationStartTime({
|
|
@@ -8963,9 +9314,9 @@
|
|
|
8963
9314
|
}))];
|
|
8964
9315
|
|
|
8965
9316
|
case 22:
|
|
8966
|
-
|
|
9317
|
+
_h.sent();
|
|
8967
9318
|
|
|
8968
|
-
|
|
9319
|
+
_h.label = 23;
|
|
8969
9320
|
|
|
8970
9321
|
case 23:
|
|
8971
9322
|
if (!animationLength) return [3
|
|
@@ -8976,7 +9327,7 @@
|
|
|
8976
9327
|
, effects.select(getAnimationEndTime$1, mapId)];
|
|
8977
9328
|
|
|
8978
9329
|
case 24:
|
|
8979
|
-
animationEnd =
|
|
9330
|
+
animationEnd = _h.sent();
|
|
8980
9331
|
return [4
|
|
8981
9332
|
/*yield*/
|
|
8982
9333
|
, effects.put(mapActions$1.setAnimationStartTime({
|
|
@@ -8985,9 +9336,9 @@
|
|
|
8985
9336
|
}))];
|
|
8986
9337
|
|
|
8987
9338
|
case 25:
|
|
8988
|
-
|
|
9339
|
+
_h.sent();
|
|
8989
9340
|
|
|
8990
|
-
|
|
9341
|
+
_h.label = 26;
|
|
8991
9342
|
|
|
8992
9343
|
case 26:
|
|
8993
9344
|
if (!(animationPayload && animationPayload.speed)) return [3
|
|
@@ -9001,9 +9352,9 @@
|
|
|
9001
9352
|
}))];
|
|
9002
9353
|
|
|
9003
9354
|
case 27:
|
|
9004
|
-
|
|
9355
|
+
_h.sent();
|
|
9005
9356
|
|
|
9006
|
-
|
|
9357
|
+
_h.label = 28;
|
|
9007
9358
|
|
|
9008
9359
|
case 28:
|
|
9009
9360
|
if (!(shouldAnimate === true)) return [3
|
|
@@ -9018,17 +9369,17 @@
|
|
|
9018
9369
|
, effects.select(getAnimationEndTime$1, mapId)];
|
|
9019
9370
|
|
|
9020
9371
|
case 29:
|
|
9021
|
-
|
|
9372
|
+
_c = _h.sent();
|
|
9022
9373
|
return [3
|
|
9023
9374
|
/*break*/
|
|
9024
9375
|
, 31];
|
|
9025
9376
|
|
|
9026
9377
|
case 30:
|
|
9027
|
-
|
|
9028
|
-
|
|
9378
|
+
_c = moment__default["default"].utc().format(dateFormat);
|
|
9379
|
+
_h.label = 31;
|
|
9029
9380
|
|
|
9030
9381
|
case 31:
|
|
9031
|
-
animationEnd =
|
|
9382
|
+
animationEnd = _c;
|
|
9032
9383
|
if (!(shouldEndtimeOverride && animationLength)) return [3
|
|
9033
9384
|
/*break*/
|
|
9034
9385
|
, 33];
|
|
@@ -9037,17 +9388,17 @@
|
|
|
9037
9388
|
, effects.select(getAnimationStartTime, mapId)];
|
|
9038
9389
|
|
|
9039
9390
|
case 32:
|
|
9040
|
-
|
|
9391
|
+
_d = _h.sent();
|
|
9041
9392
|
return [3
|
|
9042
9393
|
/*break*/
|
|
9043
9394
|
, 34];
|
|
9044
9395
|
|
|
9045
9396
|
case 33:
|
|
9046
|
-
|
|
9047
|
-
|
|
9397
|
+
_d = moment__default["default"].utc().subtract(duration, 'minutes').format(dateFormat);
|
|
9398
|
+
_h.label = 34;
|
|
9048
9399
|
|
|
9049
9400
|
case 34:
|
|
9050
|
-
animationStart =
|
|
9401
|
+
animationStart = _d;
|
|
9051
9402
|
return [4
|
|
9052
9403
|
/*yield*/
|
|
9053
9404
|
, effects.put(mapActions$1.mapStartAnimation({
|
|
@@ -9058,7 +9409,7 @@
|
|
|
9058
9409
|
}))];
|
|
9059
9410
|
|
|
9060
9411
|
case 35:
|
|
9061
|
-
|
|
9412
|
+
_h.sent();
|
|
9062
9413
|
|
|
9063
9414
|
if (!interval) return [3
|
|
9064
9415
|
/*break*/
|
|
@@ -9071,9 +9422,9 @@
|
|
|
9071
9422
|
}))];
|
|
9072
9423
|
|
|
9073
9424
|
case 36:
|
|
9074
|
-
|
|
9425
|
+
_h.sent();
|
|
9075
9426
|
|
|
9076
|
-
|
|
9427
|
+
_h.label = 37;
|
|
9077
9428
|
|
|
9078
9429
|
case 37:
|
|
9079
9430
|
return [3
|
|
@@ -9083,7 +9434,8 @@
|
|
|
9083
9434
|
case 38:
|
|
9084
9435
|
if (!(toggleTimestepAuto !== undefined)) return [3
|
|
9085
9436
|
/*break*/
|
|
9086
|
-
, 40];
|
|
9437
|
+
, 40]; // Set timestep auto based on preset if animation is off
|
|
9438
|
+
|
|
9087
9439
|
return [4
|
|
9088
9440
|
/*yield*/
|
|
9089
9441
|
, effects.put(mapActions$1.toggleTimestepAuto({
|
|
@@ -9092,9 +9444,10 @@
|
|
|
9092
9444
|
}))];
|
|
9093
9445
|
|
|
9094
9446
|
case 39:
|
|
9095
|
-
|
|
9447
|
+
// Set timestep auto based on preset if animation is off
|
|
9448
|
+
_h.sent();
|
|
9096
9449
|
|
|
9097
|
-
|
|
9450
|
+
_h.label = 40;
|
|
9098
9451
|
|
|
9099
9452
|
case 40:
|
|
9100
9453
|
shouldOpenLegend = shouldShowLegend !== undefined ? shouldShowLegend : IS_LEGEND_OPEN_BY_DEFAULT;
|
|
@@ -9103,7 +9456,7 @@
|
|
|
9103
9456
|
, effects.select(getLegendId, mapId)];
|
|
9104
9457
|
|
|
9105
9458
|
case 41:
|
|
9106
|
-
legendId =
|
|
9459
|
+
legendId = _h.sent();
|
|
9107
9460
|
if (!legendId) return [3
|
|
9108
9461
|
/*break*/
|
|
9109
9462
|
, 43];
|
|
@@ -9115,9 +9468,9 @@
|
|
|
9115
9468
|
}))];
|
|
9116
9469
|
|
|
9117
9470
|
case 42:
|
|
9118
|
-
|
|
9471
|
+
_h.sent();
|
|
9119
9472
|
|
|
9120
|
-
|
|
9473
|
+
_h.label = 43;
|
|
9121
9474
|
|
|
9122
9475
|
case 43:
|
|
9123
9476
|
if (!dockedLayerManagerSize) return [3
|
|
@@ -9131,9 +9484,9 @@
|
|
|
9131
9484
|
}))];
|
|
9132
9485
|
|
|
9133
9486
|
case 44:
|
|
9134
|
-
|
|
9487
|
+
_h.sent();
|
|
9135
9488
|
|
|
9136
|
-
|
|
9489
|
+
_h.label = 45;
|
|
9137
9490
|
|
|
9138
9491
|
case 45:
|
|
9139
9492
|
if (!(animationEndTime && (shouldEndtimeOverride || !(shouldAutoUpdate || shouldAnimate)))) return [3
|
|
@@ -9145,14 +9498,14 @@
|
|
|
9145
9498
|
, effects.delay(fiveMinuteDelayForAnimation)];
|
|
9146
9499
|
|
|
9147
9500
|
case 46:
|
|
9148
|
-
|
|
9501
|
+
_h.sent();
|
|
9149
9502
|
|
|
9150
9503
|
return [4
|
|
9151
9504
|
/*yield*/
|
|
9152
9505
|
, effects.select(getAnimationEndTime$1, mapId)];
|
|
9153
9506
|
|
|
9154
9507
|
case 47:
|
|
9155
|
-
animationEnd =
|
|
9508
|
+
animationEnd = _h.sent();
|
|
9156
9509
|
return [4
|
|
9157
9510
|
/*yield*/
|
|
9158
9511
|
, effects.put(mapActions$1.setAnimationEndTime({
|
|
@@ -9161,14 +9514,14 @@
|
|
|
9161
9514
|
}))];
|
|
9162
9515
|
|
|
9163
9516
|
case 48:
|
|
9164
|
-
|
|
9517
|
+
_h.sent();
|
|
9165
9518
|
|
|
9166
9519
|
return [4
|
|
9167
9520
|
/*yield*/
|
|
9168
9521
|
, effects.select(getAnimationStartTime, mapId)];
|
|
9169
9522
|
|
|
9170
9523
|
case 49:
|
|
9171
|
-
animationStart =
|
|
9524
|
+
animationStart = _h.sent();
|
|
9172
9525
|
return [4
|
|
9173
9526
|
/*yield*/
|
|
9174
9527
|
, effects.put(mapActions$1.setAnimationStartTime({
|
|
@@ -9177,7 +9530,7 @@
|
|
|
9177
9530
|
}))];
|
|
9178
9531
|
|
|
9179
9532
|
case 50:
|
|
9180
|
-
|
|
9533
|
+
_h.sent();
|
|
9181
9534
|
|
|
9182
9535
|
return [3
|
|
9183
9536
|
/*break*/
|
|
@@ -9189,7 +9542,7 @@
|
|
|
9189
9542
|
, 53];
|
|
9190
9543
|
|
|
9191
9544
|
case 52:
|
|
9192
|
-
error_3 =
|
|
9545
|
+
error_3 = _h.sent();
|
|
9193
9546
|
console.error(error_3);
|
|
9194
9547
|
return [3
|
|
9195
9548
|
/*break*/
|
|
@@ -9235,7 +9588,7 @@
|
|
|
9235
9588
|
}
|
|
9236
9589
|
});
|
|
9237
9590
|
}
|
|
9238
|
-
function rootSaga$
|
|
9591
|
+
function rootSaga$4() {
|
|
9239
9592
|
return __generator(this, function (_a) {
|
|
9240
9593
|
switch (_a.label) {
|
|
9241
9594
|
case 0:
|
|
@@ -9297,6 +9650,187 @@
|
|
|
9297
9650
|
});
|
|
9298
9651
|
}
|
|
9299
9652
|
|
|
9653
|
+
/* *
|
|
9654
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9655
|
+
* you may not use this file except in compliance with the License.
|
|
9656
|
+
* You may obtain a copy of the License at
|
|
9657
|
+
*
|
|
9658
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9659
|
+
*
|
|
9660
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9661
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9662
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9663
|
+
* See the License for the specific language governing permissions and
|
|
9664
|
+
* limitations under the License.
|
|
9665
|
+
*
|
|
9666
|
+
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9667
|
+
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
9668
|
+
* */
|
|
9669
|
+
/**
|
|
9670
|
+
* Converts webmapjs node structure to LayerTree
|
|
9671
|
+
* @param nodesToRecur THe WebMapJS node structure from service.getNodes();
|
|
9672
|
+
*/
|
|
9673
|
+
|
|
9674
|
+
var recurseNodes = function recurseNodes(nodesToRecur) {
|
|
9675
|
+
var newLayerTreeObj = {
|
|
9676
|
+
leaf: nodesToRecur.leaf,
|
|
9677
|
+
name: nodesToRecur.name,
|
|
9678
|
+
title: nodesToRecur.title,
|
|
9679
|
+
path: nodesToRecur.path || [],
|
|
9680
|
+
children: [],
|
|
9681
|
+
keywords: nodesToRecur.keywords || [],
|
|
9682
|
+
"abstract": nodesToRecur["abstract"] || '',
|
|
9683
|
+
styles: nodesToRecur.styles || [],
|
|
9684
|
+
dimensions: nodesToRecur.dimensions || [],
|
|
9685
|
+
geographicBoundingBox: nodesToRecur.geographicBoundingBox || null
|
|
9686
|
+
};
|
|
9687
|
+
|
|
9688
|
+
if (nodesToRecur.children) {
|
|
9689
|
+
for (var j = 0; j < nodesToRecur.children.length; j += 1) {
|
|
9690
|
+
newLayerTreeObj.children.push(recurseNodes(nodesToRecur.children[j]));
|
|
9691
|
+
}
|
|
9692
|
+
}
|
|
9693
|
+
|
|
9694
|
+
return newLayerTreeObj;
|
|
9695
|
+
};
|
|
9696
|
+
/**
|
|
9697
|
+
* Returns a promise with a hierarchical tree of layers from the WMS GetCapabilities document.
|
|
9698
|
+
* @param serviceUrl The URL of the WMS service
|
|
9699
|
+
* @param {boolean} forceReload **optional** forceReload: boolean, true will force the layers to be reloaded from the service, defaults to false
|
|
9700
|
+
*/
|
|
9701
|
+
|
|
9702
|
+
var getLayersFromService = function getLayersFromService(serviceUrl, forceReload) {
|
|
9703
|
+
if (forceReload === void 0) {
|
|
9704
|
+
forceReload = false;
|
|
9705
|
+
}
|
|
9706
|
+
|
|
9707
|
+
return new Promise(function (resolve, reject) {
|
|
9708
|
+
var serviceObject = webmap.WMGetServiceFromStore(serviceUrl);
|
|
9709
|
+
serviceObject.getNodes(function (nodes) {
|
|
9710
|
+
// TODO: Maarten Plieger, 2022-11-02: Harmonize types and use correct types: https://gitlab.com/opengeoweb/opengeoweb/-/issues/2817
|
|
9711
|
+
var layerTree = recurseNodes(nodes);
|
|
9712
|
+
resolve(layerTree);
|
|
9713
|
+
}, function (error) {
|
|
9714
|
+
reject(new Error(error));
|
|
9715
|
+
}, forceReload);
|
|
9716
|
+
});
|
|
9717
|
+
};
|
|
9718
|
+
/**
|
|
9719
|
+
* Returns a promise with an array of flattened layerobjects from the WMS GetCapabilities document.
|
|
9720
|
+
* @param serviceUrl The URL of the WMS service
|
|
9721
|
+
* @param {boolean} forceReload **optional** forceReload: boolean, true will force the layers to be reloaded from the service, defaults to false
|
|
9722
|
+
*/
|
|
9723
|
+
|
|
9724
|
+
var getLayersFlattenedFromService = function getLayersFlattenedFromService(serviceUrl, forceReload) {
|
|
9725
|
+
if (forceReload === void 0) {
|
|
9726
|
+
forceReload = false;
|
|
9727
|
+
}
|
|
9728
|
+
|
|
9729
|
+
return new Promise(function (resolve, reject) {
|
|
9730
|
+
var serviceObject = webmap.WMGetServiceFromStore(serviceUrl);
|
|
9731
|
+
serviceObject.getLayerObjectsFlat(function (layers) {
|
|
9732
|
+
resolve(layers);
|
|
9733
|
+
}, function (error) {
|
|
9734
|
+
reject(new Error(error));
|
|
9735
|
+
}, forceReload);
|
|
9736
|
+
});
|
|
9737
|
+
};
|
|
9738
|
+
|
|
9739
|
+
/* *
|
|
9740
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9741
|
+
* you may not use this file except in compliance with the License.
|
|
9742
|
+
* You may obtain a copy of the License at
|
|
9743
|
+
*
|
|
9744
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9745
|
+
*
|
|
9746
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9747
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9748
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9749
|
+
* See the License for the specific language governing permissions and
|
|
9750
|
+
* limitations under the License.
|
|
9751
|
+
*
|
|
9752
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9753
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
9754
|
+
* */
|
|
9755
|
+
function fetchServiceSaga(service) {
|
|
9756
|
+
var layers;
|
|
9757
|
+
return __generator(this, function (_a) {
|
|
9758
|
+
switch (_a.label) {
|
|
9759
|
+
case 0:
|
|
9760
|
+
_a.trys.push([0, 3,, 4]);
|
|
9761
|
+
|
|
9762
|
+
return [4
|
|
9763
|
+
/*yield*/
|
|
9764
|
+
, effects.call(getLayersFlattenedFromService, service.serviceUrl)];
|
|
9765
|
+
|
|
9766
|
+
case 1:
|
|
9767
|
+
layers = _a.sent();
|
|
9768
|
+
return [4
|
|
9769
|
+
/*yield*/
|
|
9770
|
+
, effects.put(serviceActions.serviceSetLayers(__assign(__assign({}, service), {
|
|
9771
|
+
layers: layers
|
|
9772
|
+
})))];
|
|
9773
|
+
|
|
9774
|
+
case 2:
|
|
9775
|
+
_a.sent();
|
|
9776
|
+
|
|
9777
|
+
return [3
|
|
9778
|
+
/*break*/
|
|
9779
|
+
, 4];
|
|
9780
|
+
|
|
9781
|
+
case 3:
|
|
9782
|
+
_a.sent();
|
|
9783
|
+
return [3
|
|
9784
|
+
/*break*/
|
|
9785
|
+
, 4];
|
|
9786
|
+
|
|
9787
|
+
case 4:
|
|
9788
|
+
return [2
|
|
9789
|
+
/*return*/
|
|
9790
|
+
];
|
|
9791
|
+
}
|
|
9792
|
+
});
|
|
9793
|
+
}
|
|
9794
|
+
function fetchInitialServicesSaga(_a) {
|
|
9795
|
+
var services;
|
|
9796
|
+
var payload = _a.payload;
|
|
9797
|
+
return __generator(this, function (_b) {
|
|
9798
|
+
switch (_b.label) {
|
|
9799
|
+
case 0:
|
|
9800
|
+
services = payload.services;
|
|
9801
|
+
return [4
|
|
9802
|
+
/*yield*/
|
|
9803
|
+
, effects.all(services.map(function (service) {
|
|
9804
|
+
return effects.call(fetchServiceSaga, service);
|
|
9805
|
+
}))];
|
|
9806
|
+
|
|
9807
|
+
case 1:
|
|
9808
|
+
_b.sent();
|
|
9809
|
+
|
|
9810
|
+
return [2
|
|
9811
|
+
/*return*/
|
|
9812
|
+
];
|
|
9813
|
+
}
|
|
9814
|
+
});
|
|
9815
|
+
}
|
|
9816
|
+
function rootSaga$3() {
|
|
9817
|
+
return __generator(this, function (_a) {
|
|
9818
|
+
switch (_a.label) {
|
|
9819
|
+
case 0:
|
|
9820
|
+
return [4
|
|
9821
|
+
/*yield*/
|
|
9822
|
+
, effects.takeEvery(serviceActions.fetchInitialServices, fetchInitialServicesSaga)];
|
|
9823
|
+
|
|
9824
|
+
case 1:
|
|
9825
|
+
_a.sent();
|
|
9826
|
+
|
|
9827
|
+
return [2
|
|
9828
|
+
/*return*/
|
|
9829
|
+
];
|
|
9830
|
+
}
|
|
9831
|
+
});
|
|
9832
|
+
}
|
|
9833
|
+
|
|
9300
9834
|
var moduleConfig = {
|
|
9301
9835
|
id: 'webmap-module',
|
|
9302
9836
|
reducersMap: {
|
|
@@ -9304,7 +9838,7 @@
|
|
|
9304
9838
|
services: reducer$7,
|
|
9305
9839
|
layers: reducer$8
|
|
9306
9840
|
},
|
|
9307
|
-
sagas: [rootSaga$3]
|
|
9841
|
+
sagas: [rootSaga$4, rootSaga$3]
|
|
9308
9842
|
};
|
|
9309
9843
|
|
|
9310
9844
|
function _typeof(obj) {
|
|
@@ -9376,57 +9910,6 @@
|
|
|
9376
9910
|
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9377
9911
|
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
9378
9912
|
* */
|
|
9379
|
-
function newServiceAddedSaga(capturedAction) {
|
|
9380
|
-
var addedService, id, serviceUrl, name, scope, _abstract, isUpdating, keywords, groups;
|
|
9381
|
-
|
|
9382
|
-
return __generator(this, function (_a) {
|
|
9383
|
-
switch (_a.label) {
|
|
9384
|
-
case 0:
|
|
9385
|
-
addedService = capturedAction.payload;
|
|
9386
|
-
id = addedService.id, serviceUrl = addedService.serviceUrl, name = addedService.name, scope = addedService.scope, _abstract = addedService["abstract"], isUpdating = addedService.isUpdating;
|
|
9387
|
-
if (isUpdating) return [2
|
|
9388
|
-
/*return*/
|
|
9389
|
-
];
|
|
9390
|
-
keywords = addedService.layers.reduce(function (keywords, layer) {
|
|
9391
|
-
var _a;
|
|
9392
|
-
|
|
9393
|
-
if (layer.leaf) {
|
|
9394
|
-
return keywords.concat((_a = layer.keywords) !== null && _a !== void 0 ? _a : []);
|
|
9395
|
-
}
|
|
9396
|
-
|
|
9397
|
-
return keywords;
|
|
9398
|
-
}, []);
|
|
9399
|
-
groups = addedService.layers.reduce(function (groups, layer) {
|
|
9400
|
-
var _a;
|
|
9401
|
-
|
|
9402
|
-
if (layer.leaf) {
|
|
9403
|
-
return groups.concat((_a = layer.path) !== null && _a !== void 0 ? _a : []);
|
|
9404
|
-
}
|
|
9405
|
-
|
|
9406
|
-
return groups;
|
|
9407
|
-
}, []);
|
|
9408
|
-
return [4
|
|
9409
|
-
/*yield*/
|
|
9410
|
-
, effects.put(layerSelectActions.addFiltersAndActiveServices({
|
|
9411
|
-
serviceId: id,
|
|
9412
|
-
serviceName: name,
|
|
9413
|
-
serviceUrl: serviceUrl,
|
|
9414
|
-
keywords: keywords,
|
|
9415
|
-
scope: scope,
|
|
9416
|
-
groups: groups,
|
|
9417
|
-
"abstract": _abstract,
|
|
9418
|
-
isLoading: false
|
|
9419
|
-
}))];
|
|
9420
|
-
|
|
9421
|
-
case 1:
|
|
9422
|
-
_a.sent();
|
|
9423
|
-
|
|
9424
|
-
return [2
|
|
9425
|
-
/*return*/
|
|
9426
|
-
];
|
|
9427
|
-
}
|
|
9428
|
-
});
|
|
9429
|
-
}
|
|
9430
9913
|
function layerSelectCloseInfoDialogSaga(_a) {
|
|
9431
9914
|
var _b, togglePayload, activeMapIdPayload, isLayerInfoDialogOpen, isLayerInfoDialogOpen, filteredLayers, dialogInfo;
|
|
9432
9915
|
|
|
@@ -9614,20 +10097,27 @@
|
|
|
9614
10097
|
var scope = payload.scope,
|
|
9615
10098
|
name = payload.name,
|
|
9616
10099
|
serviceUrl = payload.serviceUrl,
|
|
9617
|
-
|
|
9618
|
-
|
|
10100
|
+
_abstract = payload["abstract"];
|
|
10101
|
+
|
|
10102
|
+
if (!isUserAddedService(scope)) {
|
|
10103
|
+
return;
|
|
10104
|
+
}
|
|
10105
|
+
|
|
9619
10106
|
var localStorageServices = getUserAddedServices();
|
|
9620
10107
|
setUserAddedServices(__assign(__assign({}, localStorageServices), (_b = {}, _b[serviceUrl] = {
|
|
9621
10108
|
name: name,
|
|
9622
10109
|
url: serviceUrl,
|
|
9623
|
-
"abstract":
|
|
10110
|
+
"abstract": _abstract
|
|
9624
10111
|
}, _b)));
|
|
9625
10112
|
}
|
|
9626
10113
|
function removeServiceFromLocalStorageSaga(_a) {
|
|
9627
10114
|
var payload = _a.payload;
|
|
9628
10115
|
var serviceUrl = payload.serviceUrl;
|
|
9629
10116
|
var localStorageServices = getUserAddedServices();
|
|
9630
|
-
|
|
10117
|
+
|
|
10118
|
+
if (!localStorageServices[serviceUrl]) {
|
|
10119
|
+
return;
|
|
10120
|
+
}
|
|
9631
10121
|
|
|
9632
10122
|
var updatedServices = __assign({}, localStorageServices);
|
|
9633
10123
|
|
|
@@ -9638,39 +10128,32 @@
|
|
|
9638
10128
|
return __generator(this, function (_a) {
|
|
9639
10129
|
switch (_a.label) {
|
|
9640
10130
|
case 0:
|
|
9641
|
-
return [4
|
|
9642
|
-
/*yield*/
|
|
9643
|
-
, effects.takeEvery(serviceActions.serviceSetLayers.type, newServiceAddedSaga)];
|
|
9644
|
-
|
|
9645
|
-
case 1:
|
|
9646
|
-
_a.sent();
|
|
9647
|
-
|
|
9648
10131
|
return [4
|
|
9649
10132
|
/*yield*/
|
|
9650
10133
|
, effects.takeEvery(layerSelectActions.layerSelectRemoveService.type, layerSelectRemoveServiceSaga)];
|
|
9651
10134
|
|
|
9652
|
-
case
|
|
10135
|
+
case 1:
|
|
9653
10136
|
_a.sent();
|
|
9654
10137
|
|
|
9655
10138
|
return [4
|
|
9656
10139
|
/*yield*/
|
|
9657
10140
|
, effects.takeEvery(serviceActions.serviceSetLayers.type, addServiceToLocalStorageSaga)];
|
|
9658
10141
|
|
|
9659
|
-
case
|
|
10142
|
+
case 2:
|
|
9660
10143
|
_a.sent();
|
|
9661
10144
|
|
|
9662
10145
|
return [4
|
|
9663
10146
|
/*yield*/
|
|
9664
10147
|
, effects.takeEvery(serviceActions.mapStoreRemoveService.type, removeServiceFromLocalStorageSaga)];
|
|
9665
10148
|
|
|
9666
|
-
case
|
|
10149
|
+
case 3:
|
|
9667
10150
|
_a.sent();
|
|
9668
10151
|
|
|
9669
10152
|
return [4
|
|
9670
10153
|
/*yield*/
|
|
9671
10154
|
, effects.takeEvery([uiActions.setToggleOpenDialog.type, uiActions.setActiveMapIdForDialog.type, layerSelectActions.disableActiveService.type, layerSelectActions.toggleFilter.type, layerSelectActions.setSearchFilter.type], layerSelectCloseInfoDialogSaga)];
|
|
9672
10155
|
|
|
9673
|
-
case
|
|
10156
|
+
case 4:
|
|
9674
10157
|
_a.sent();
|
|
9675
10158
|
|
|
9676
10159
|
return [2
|
|
@@ -9850,8 +10333,8 @@
|
|
|
9850
10333
|
* See the License for the specific language governing permissions and
|
|
9851
10334
|
* limitations under the License.
|
|
9852
10335
|
*
|
|
9853
|
-
* Copyright
|
|
9854
|
-
* Copyright
|
|
10336
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10337
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
9855
10338
|
* */
|
|
9856
10339
|
var iconStyle = {
|
|
9857
10340
|
height: 24,
|
|
@@ -9872,16 +10355,19 @@
|
|
|
9872
10355
|
|
|
9873
10356
|
var HeaderOptions = function HeaderOptions(_a) {
|
|
9874
10357
|
var isDockedLayerManager = _a.isDockedLayerManager,
|
|
10358
|
+
shortcutsEnabled = _a.shortcutsEnabled,
|
|
9875
10359
|
onClickDockButton = _a.onClickDockButton,
|
|
9876
10360
|
onChangeSize = _a.onChangeSize;
|
|
9877
10361
|
React__namespace.useEffect(function () {
|
|
9878
10362
|
var handleKeyDown = function handleKeyDown(event) {
|
|
9879
|
-
if (
|
|
9880
|
-
|
|
9881
|
-
|
|
9882
|
-
|
|
9883
|
-
|
|
9884
|
-
|
|
10363
|
+
if (shortcutsEnabled) {
|
|
10364
|
+
if (event.ctrlKey && event.altKey && event.code === 'KeyS') {
|
|
10365
|
+
onChangeSize(sizeSmall);
|
|
10366
|
+
} else if (event.ctrlKey && event.altKey && event.code === 'KeyM') {
|
|
10367
|
+
onChangeSize(sizeMedium);
|
|
10368
|
+
} else if (event.ctrlKey && event.altKey && event.code === 'KeyL') {
|
|
10369
|
+
onChangeSize(sizeLarge);
|
|
10370
|
+
}
|
|
9885
10371
|
}
|
|
9886
10372
|
};
|
|
9887
10373
|
|
|
@@ -9889,7 +10375,7 @@
|
|
|
9889
10375
|
return function () {
|
|
9890
10376
|
document.removeEventListener('keydown', handleKeyDown);
|
|
9891
10377
|
};
|
|
9892
|
-
}, [onChangeSize]);
|
|
10378
|
+
}, [onChangeSize, shortcutsEnabled]);
|
|
9893
10379
|
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
|
|
9894
10380
|
title: "small"
|
|
9895
10381
|
}, /*#__PURE__*/React__namespace.createElement(material.IconButton, {
|
|
@@ -10113,9 +10599,18 @@
|
|
|
10113
10599
|
}
|
|
10114
10600
|
};
|
|
10115
10601
|
var returnCorrectSize = function returnCorrectSize(sizeResult) {
|
|
10116
|
-
if (sizeResult === 'sizeSmall')
|
|
10117
|
-
|
|
10118
|
-
|
|
10602
|
+
if (sizeResult === 'sizeSmall') {
|
|
10603
|
+
return sizeSmall;
|
|
10604
|
+
}
|
|
10605
|
+
|
|
10606
|
+
if (sizeResult === 'sizeMedium') {
|
|
10607
|
+
return sizeMedium;
|
|
10608
|
+
}
|
|
10609
|
+
|
|
10610
|
+
if (sizeResult === 'sizeLarge') {
|
|
10611
|
+
return sizeLarge;
|
|
10612
|
+
}
|
|
10613
|
+
|
|
10119
10614
|
return sizeLarge;
|
|
10120
10615
|
};
|
|
10121
10616
|
|
|
@@ -10301,11 +10796,18 @@
|
|
|
10301
10796
|
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
10302
10797
|
|
|
10303
10798
|
}, []);
|
|
10304
|
-
|
|
10799
|
+
|
|
10800
|
+
if (!layerDimensions.length || !layerId) {
|
|
10801
|
+
return null;
|
|
10802
|
+
}
|
|
10305
10803
|
|
|
10306
10804
|
var getValuesToDisplay = function getValuesToDisplay() {
|
|
10307
10805
|
var activeWMJSDim = getWMJSDimensionForLayerAndDimension(layerId, activeDimName) || getWMJSDimensionForLayerAndDimension(layerId, layerDimensions[0].name);
|
|
10308
|
-
|
|
10806
|
+
|
|
10807
|
+
if (!activeWMJSDim) {
|
|
10808
|
+
return null;
|
|
10809
|
+
}
|
|
10810
|
+
|
|
10309
10811
|
var availableDimValues = [];
|
|
10310
10812
|
|
|
10311
10813
|
for (var j = 0; j < activeWMJSDim.size(); j += 1) {
|
|
@@ -10319,11 +10821,18 @@
|
|
|
10319
10821
|
};
|
|
10320
10822
|
|
|
10321
10823
|
var valuesToDisplay = getValuesToDisplay();
|
|
10322
|
-
|
|
10824
|
+
|
|
10825
|
+
if (valuesToDisplay === null) {
|
|
10826
|
+
return null;
|
|
10827
|
+
}
|
|
10828
|
+
|
|
10323
10829
|
var activeDim = layerDimensions.find(function (dim) {
|
|
10324
10830
|
return dim.name === activeDimName;
|
|
10325
10831
|
});
|
|
10326
|
-
|
|
10832
|
+
|
|
10833
|
+
if (!activeDim) {
|
|
10834
|
+
return null;
|
|
10835
|
+
}
|
|
10327
10836
|
|
|
10328
10837
|
var selectDimensionValue = function selectDimensionValue(event) {
|
|
10329
10838
|
event.stopPropagation();
|
|
@@ -10354,7 +10863,11 @@
|
|
|
10354
10863
|
var dimValueCurrentIndex = valuesToDisplay.findIndex(function (value) {
|
|
10355
10864
|
return value === activeDim.currentValue;
|
|
10356
10865
|
});
|
|
10357
|
-
|
|
10866
|
+
|
|
10867
|
+
if (dimValueCurrentIndex === -1) {
|
|
10868
|
+
return null;
|
|
10869
|
+
}
|
|
10870
|
+
|
|
10358
10871
|
return /*#__PURE__*/React__namespace.createElement(material.Grid, {
|
|
10359
10872
|
container: true,
|
|
10360
10873
|
direction: "row",
|
|
@@ -10635,7 +11148,9 @@
|
|
|
10635
11148
|
}
|
|
10636
11149
|
}, [anchorEl]);
|
|
10637
11150
|
var onMouseEnter = React__namespace.useCallback(function () {
|
|
10638
|
-
if (!isOpen)
|
|
11151
|
+
if (!isOpen) {
|
|
11152
|
+
setTooltipOpen(true);
|
|
11153
|
+
}
|
|
10639
11154
|
}, [isOpen, setTooltipOpen]);
|
|
10640
11155
|
var onMouseLeave = React__namespace.useCallback(function () {
|
|
10641
11156
|
setTooltipOpen(false);
|
|
@@ -10866,15 +11381,15 @@
|
|
|
10866
11381
|
inputProps: {
|
|
10867
11382
|
IconComponent: function IconComponent() {
|
|
10868
11383
|
return null;
|
|
10869
|
-
}
|
|
11384
|
+
},
|
|
11385
|
+
tabIndex: -1
|
|
10870
11386
|
},
|
|
10871
11387
|
value: isActive ? 'Both' : 'None',
|
|
10872
11388
|
sx: {
|
|
10873
|
-
'&& .
|
|
10874
|
-
|
|
10875
|
-
|
|
10876
|
-
|
|
10877
|
-
paddingRight: 0
|
|
11389
|
+
'&& .MuiInput-input': {
|
|
11390
|
+
paddingRight: '2px',
|
|
11391
|
+
paddingLeft: '2px',
|
|
11392
|
+
backgroundColor: 'inherit'
|
|
10878
11393
|
}
|
|
10879
11394
|
},
|
|
10880
11395
|
renderValue: function renderValue(optionSelected) {
|
|
@@ -10912,8 +11427,6 @@
|
|
|
10912
11427
|
isActive = _a.isActive,
|
|
10913
11428
|
isEnabled = _a.isEnabled;
|
|
10914
11429
|
var style = {
|
|
10915
|
-
backgroundColor: isActive ? 'geowebColors.buttons.primary.active.fill' : 'transparent!important',
|
|
10916
|
-
borderRadius: '5px',
|
|
10917
11430
|
color: getIconColor(isActive, isEnabled)
|
|
10918
11431
|
};
|
|
10919
11432
|
var Icon = isActive ? /*#__PURE__*/React__namespace.createElement(theme.Both, {
|
|
@@ -10926,9 +11439,10 @@
|
|
|
10926
11439
|
"aria-label": "Auto update " + optionSelected,
|
|
10927
11440
|
sx: {
|
|
10928
11441
|
'&.MuiButtonBase-root': {
|
|
10929
|
-
backgroundColor: '
|
|
11442
|
+
backgroundColor: 'inherit'
|
|
10930
11443
|
}
|
|
10931
|
-
}
|
|
11444
|
+
},
|
|
11445
|
+
active: isActive
|
|
10932
11446
|
}, Icon);
|
|
10933
11447
|
};
|
|
10934
11448
|
|
|
@@ -11032,16 +11546,18 @@
|
|
|
11032
11546
|
padding: 0
|
|
11033
11547
|
}
|
|
11034
11548
|
},
|
|
11035
|
-
title: /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, dragHandle, layerEnableLayout || /*#__PURE__*/React__default["default"].createElement(shared.
|
|
11549
|
+
title: /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, dragHandle, layerEnableLayout || /*#__PURE__*/React__default["default"].createElement(shared.ManagerButton, {
|
|
11036
11550
|
isEnabled: layer.enabled,
|
|
11037
|
-
|
|
11038
|
-
|
|
11551
|
+
tooltipTitle: layer.name,
|
|
11552
|
+
onClick: function onClick(event) {
|
|
11553
|
+
event.stopPropagation();
|
|
11039
11554
|
onLayerEnable({
|
|
11040
11555
|
layerId: layerId,
|
|
11041
11556
|
enabled: !layer.enabled
|
|
11042
11557
|
});
|
|
11043
11558
|
},
|
|
11044
|
-
|
|
11559
|
+
"data-testid": "enableButton-medium",
|
|
11560
|
+
icon: isEnabled ? /*#__PURE__*/React__default["default"].createElement(theme.Visibility, null) : /*#__PURE__*/React__default["default"].createElement(theme.VisibilityOff, null)
|
|
11045
11561
|
}), layerActiveLayout || /*#__PURE__*/React__default["default"].createElement(ActivateLayer, {
|
|
11046
11562
|
onChange: onClickRow,
|
|
11047
11563
|
isActive: false,
|
|
@@ -11103,26 +11619,31 @@
|
|
|
11103
11619
|
}, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
11104
11620
|
item: true,
|
|
11105
11621
|
sx: {}
|
|
11106
|
-
}, layerDeleteLayout || /*#__PURE__*/React__default["default"].createElement(shared.
|
|
11622
|
+
}, layerDeleteLayout || /*#__PURE__*/React__default["default"].createElement(shared.ManagerButton, {
|
|
11107
11623
|
tooltipTitle: "Delete",
|
|
11108
|
-
|
|
11624
|
+
onClick: function onClick() {
|
|
11109
11625
|
onLayerDelete({
|
|
11110
11626
|
mapId: mapId,
|
|
11111
11627
|
layerId: layerId
|
|
11112
11628
|
});
|
|
11113
|
-
}
|
|
11629
|
+
},
|
|
11630
|
+
icon: /*#__PURE__*/React__default["default"].createElement(theme.Delete, null),
|
|
11631
|
+
"data-testid": "deleteButton"
|
|
11114
11632
|
}))))), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
11115
11633
|
item: true,
|
|
11116
11634
|
className: columnClasses.column1
|
|
11117
|
-
}, dragHandle, layerEnableLayout || /*#__PURE__*/React__default["default"].createElement(shared.
|
|
11635
|
+
}, dragHandle, layerEnableLayout || /*#__PURE__*/React__default["default"].createElement(shared.ManagerButton, {
|
|
11118
11636
|
isEnabled: layer.enabled,
|
|
11119
|
-
|
|
11120
|
-
|
|
11637
|
+
tooltipTitle: layer.name,
|
|
11638
|
+
onClick: function onClick(event) {
|
|
11639
|
+
event.stopPropagation();
|
|
11121
11640
|
onLayerEnable({
|
|
11122
11641
|
layerId: layerId,
|
|
11123
11642
|
enabled: !layer.enabled
|
|
11124
11643
|
});
|
|
11125
|
-
}
|
|
11644
|
+
},
|
|
11645
|
+
icon: layer.enabled ? /*#__PURE__*/React__default["default"].createElement(theme.Visibility, null) : /*#__PURE__*/React__default["default"].createElement(theme.VisibilityOff, null),
|
|
11646
|
+
"data-testid": "enableButton"
|
|
11126
11647
|
}), layerActiveLayout || /*#__PURE__*/React__default["default"].createElement(ActivateLayer, {
|
|
11127
11648
|
onChange: onClickRow,
|
|
11128
11649
|
isActive: false,
|
|
@@ -11189,14 +11710,16 @@
|
|
|
11189
11710
|
}))), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
11190
11711
|
item: true,
|
|
11191
11712
|
className: columnClasses.column6
|
|
11192
|
-
}, layerDeleteLayout || /*#__PURE__*/React__default["default"].createElement(shared.
|
|
11713
|
+
}, layerDeleteLayout || /*#__PURE__*/React__default["default"].createElement(shared.ManagerButton, {
|
|
11193
11714
|
tooltipTitle: "Delete",
|
|
11194
|
-
|
|
11715
|
+
onClick: function onClick() {
|
|
11195
11716
|
onLayerDelete({
|
|
11196
11717
|
mapId: mapId,
|
|
11197
11718
|
layerId: layerId
|
|
11198
11719
|
});
|
|
11199
|
-
}
|
|
11720
|
+
},
|
|
11721
|
+
icon: /*#__PURE__*/React__default["default"].createElement(theme.Delete, null),
|
|
11722
|
+
"data-testid": "deleteButton"
|
|
11200
11723
|
}), layerMenuLayout || /*#__PURE__*/React__default["default"].createElement(LayerManagerMenuButton, {
|
|
11201
11724
|
mapId: mapId,
|
|
11202
11725
|
layerId: layerId,
|
|
@@ -11240,16 +11763,18 @@
|
|
|
11240
11763
|
var isLayerEnabled = reactRedux.useSelector(function (store) {
|
|
11241
11764
|
return getLayerEnabled(store, layerId);
|
|
11242
11765
|
});
|
|
11243
|
-
return /*#__PURE__*/React__namespace.createElement(shared.
|
|
11766
|
+
return /*#__PURE__*/React__namespace.createElement(shared.ManagerButton, {
|
|
11244
11767
|
tooltipTitle: "Delete",
|
|
11245
|
-
|
|
11768
|
+
onClick: function onClick() {
|
|
11246
11769
|
layerDelete({
|
|
11247
11770
|
mapId: mapId,
|
|
11248
11771
|
layerId: layerId,
|
|
11249
11772
|
layerIndex: layerIndex
|
|
11250
11773
|
});
|
|
11251
11774
|
},
|
|
11252
|
-
isEnabled: isLayerEnabled
|
|
11775
|
+
isEnabled: isLayerEnabled,
|
|
11776
|
+
icon: /*#__PURE__*/React__namespace.createElement(theme.Delete, null),
|
|
11777
|
+
"data-testid": "deleteButton"
|
|
11253
11778
|
});
|
|
11254
11779
|
};
|
|
11255
11780
|
|
|
@@ -11288,26 +11813,32 @@
|
|
|
11288
11813
|
origin: LayerActionOrigin.layerManager
|
|
11289
11814
|
}));
|
|
11290
11815
|
}, [dispatch, mapId]);
|
|
11291
|
-
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(shared.
|
|
11816
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(shared.ManagerButton, {
|
|
11292
11817
|
isEnabled: isEnabled,
|
|
11293
|
-
|
|
11294
|
-
|
|
11818
|
+
tooltipTitle: "Toggle visibility",
|
|
11819
|
+
onClick: function onClick(event) {
|
|
11820
|
+
event.stopPropagation();
|
|
11295
11821
|
layerChangeEnabled({
|
|
11296
11822
|
layerId: layerId,
|
|
11297
|
-
enabled:
|
|
11823
|
+
enabled: !isEnabled
|
|
11298
11824
|
});
|
|
11299
11825
|
},
|
|
11300
|
-
className: "enable-btn"
|
|
11301
|
-
|
|
11826
|
+
className: "enable-btn",
|
|
11827
|
+
icon: isEnabled ? /*#__PURE__*/React__namespace.createElement(theme.Visibility, null) : /*#__PURE__*/React__namespace.createElement(theme.VisibilityOff, null),
|
|
11828
|
+
"data-testid": "enableButton"
|
|
11829
|
+
}), /*#__PURE__*/React__namespace.createElement(shared.ManagerButton, {
|
|
11302
11830
|
isEnabled: isEnabled,
|
|
11303
|
-
|
|
11304
|
-
|
|
11831
|
+
tooltipTitle: layerName,
|
|
11832
|
+
onClick: function onClick(event) {
|
|
11833
|
+
event.stopPropagation();
|
|
11305
11834
|
layerChangeEnabled({
|
|
11306
11835
|
layerId: layerId,
|
|
11307
|
-
enabled:
|
|
11836
|
+
enabled: !isEnabled
|
|
11308
11837
|
});
|
|
11309
11838
|
},
|
|
11310
|
-
className: "enable-btn-mini"
|
|
11839
|
+
className: "enable-btn-mini",
|
|
11840
|
+
icon: isEnabled ? /*#__PURE__*/React__namespace.createElement(theme.Visibility, null) : /*#__PURE__*/React__namespace.createElement(theme.VisibilityOff, null),
|
|
11841
|
+
"data-testid": "enableButton"
|
|
11311
11842
|
}));
|
|
11312
11843
|
};
|
|
11313
11844
|
|
|
@@ -11458,92 +11989,6 @@
|
|
|
11458
11989
|
});
|
|
11459
11990
|
};
|
|
11460
11991
|
|
|
11461
|
-
/* *
|
|
11462
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11463
|
-
* you may not use this file except in compliance with the License.
|
|
11464
|
-
* You may obtain a copy of the License at
|
|
11465
|
-
*
|
|
11466
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11467
|
-
*
|
|
11468
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11469
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11470
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11471
|
-
* See the License for the specific language governing permissions and
|
|
11472
|
-
* limitations under the License.
|
|
11473
|
-
*
|
|
11474
|
-
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11475
|
-
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
11476
|
-
* */
|
|
11477
|
-
/**
|
|
11478
|
-
* Converts webmapjs node structure to LayerTree
|
|
11479
|
-
* @param nodesToRecur THe WebMapJS node structure from service.getNodes();
|
|
11480
|
-
*/
|
|
11481
|
-
|
|
11482
|
-
var recurseNodes = function recurseNodes(nodesToRecur) {
|
|
11483
|
-
var newLayerTreeObj = {
|
|
11484
|
-
leaf: nodesToRecur.leaf,
|
|
11485
|
-
name: nodesToRecur.name,
|
|
11486
|
-
title: nodesToRecur.title,
|
|
11487
|
-
path: nodesToRecur.path || [],
|
|
11488
|
-
children: [],
|
|
11489
|
-
keywords: nodesToRecur.keywords || [],
|
|
11490
|
-
"abstract": nodesToRecur["abstract"] || '',
|
|
11491
|
-
styles: nodesToRecur.styles || [],
|
|
11492
|
-
dimensions: nodesToRecur.dimensions || [],
|
|
11493
|
-
geographicBoundingBox: nodesToRecur.geographicBoundingBox || null
|
|
11494
|
-
};
|
|
11495
|
-
|
|
11496
|
-
if (nodesToRecur.children) {
|
|
11497
|
-
for (var j = 0; j < nodesToRecur.children.length; j += 1) {
|
|
11498
|
-
newLayerTreeObj.children.push(recurseNodes(nodesToRecur.children[j]));
|
|
11499
|
-
}
|
|
11500
|
-
}
|
|
11501
|
-
|
|
11502
|
-
return newLayerTreeObj;
|
|
11503
|
-
};
|
|
11504
|
-
/**
|
|
11505
|
-
* Returns a promise with a hierarchical tree of layers from the WMS GetCapabilities document.
|
|
11506
|
-
* @param serviceUrl The URL of the WMS service
|
|
11507
|
-
* @param {boolean} forceReload **optional** forceReload: boolean, true will force the layers to be reloaded from the service, defaults to false
|
|
11508
|
-
*/
|
|
11509
|
-
|
|
11510
|
-
var getLayersFromService = function getLayersFromService(serviceUrl, forceReload) {
|
|
11511
|
-
if (forceReload === void 0) {
|
|
11512
|
-
forceReload = false;
|
|
11513
|
-
}
|
|
11514
|
-
|
|
11515
|
-
return new Promise(function (resolve, reject) {
|
|
11516
|
-
var serviceObject = webmap.WMGetServiceFromStore(serviceUrl);
|
|
11517
|
-
serviceObject.getNodes(function (nodes) {
|
|
11518
|
-
// TODO: Maarten Plieger, 2022-11-02: Harmonize types and use correct types: https://gitlab.com/opengeoweb/opengeoweb/-/issues/2817
|
|
11519
|
-
var layerTree = recurseNodes(nodes);
|
|
11520
|
-
resolve(layerTree);
|
|
11521
|
-
}, function (error) {
|
|
11522
|
-
reject(new Error(error));
|
|
11523
|
-
}, forceReload);
|
|
11524
|
-
});
|
|
11525
|
-
};
|
|
11526
|
-
/**
|
|
11527
|
-
* Returns a promise with an array of flattened layerobjects from the WMS GetCapabilities document.
|
|
11528
|
-
* @param serviceUrl The URL of the WMS service
|
|
11529
|
-
* @param {boolean} forceReload **optional** forceReload: boolean, true will force the layers to be reloaded from the service, defaults to false
|
|
11530
|
-
*/
|
|
11531
|
-
|
|
11532
|
-
var getLayersFlattenedFromService = function getLayersFlattenedFromService(serviceUrl, forceReload) {
|
|
11533
|
-
if (forceReload === void 0) {
|
|
11534
|
-
forceReload = false;
|
|
11535
|
-
}
|
|
11536
|
-
|
|
11537
|
-
return new Promise(function (resolve, reject) {
|
|
11538
|
-
var serviceObject = webmap.WMGetServiceFromStore(serviceUrl);
|
|
11539
|
-
serviceObject.getLayerObjectsFlat(function (layers) {
|
|
11540
|
-
resolve(layers);
|
|
11541
|
-
}, function (error) {
|
|
11542
|
-
reject(new Error(error));
|
|
11543
|
-
}, forceReload);
|
|
11544
|
-
});
|
|
11545
|
-
};
|
|
11546
|
-
|
|
11547
11992
|
/* *
|
|
11548
11993
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11549
11994
|
* you may not use this file except in compliance with the License.
|
|
@@ -11732,8 +12177,9 @@
|
|
|
11732
12177
|
var setActiveLayerId = React__namespace.useCallback(function (_a) {
|
|
11733
12178
|
var layerId = _a.layerId,
|
|
11734
12179
|
mapId = _a.mapId;
|
|
11735
|
-
return dispatch(mapActions$1.
|
|
11736
|
-
|
|
12180
|
+
return dispatch(mapActions$1.setAutoLayerId({
|
|
12181
|
+
autoTimeStepLayerId: layerId,
|
|
12182
|
+
autoUpdateLayerId: layerId,
|
|
11737
12183
|
mapId: mapId,
|
|
11738
12184
|
origin: LayerActionOrigin.layerManager
|
|
11739
12185
|
}));
|
|
@@ -11883,11 +12329,10 @@
|
|
|
11883
12329
|
return /*#__PURE__*/React__default["default"].createElement(shared.ManagerButton, {
|
|
11884
12330
|
tooltipTitle: tooltipTitle,
|
|
11885
12331
|
icon: /*#__PURE__*/React__default["default"].createElement(theme.DragHandle, null),
|
|
11886
|
-
|
|
12332
|
+
"data-testid": "dragHandle" + (index !== undefined ? "-" + index : ''),
|
|
11887
12333
|
className: "handle",
|
|
11888
12334
|
tabIndex: -1,
|
|
11889
12335
|
isEnabled: !isDisabled,
|
|
11890
|
-
disableFocusRipple: true,
|
|
11891
12336
|
disableTouchRipple: true,
|
|
11892
12337
|
disabled: isDisabled,
|
|
11893
12338
|
isAccessible: true,
|
|
@@ -11954,7 +12399,10 @@
|
|
|
11954
12399
|
var onStart = React__namespace.useCallback(function (_a) {
|
|
11955
12400
|
var oldIndex = _a.oldIndex;
|
|
11956
12401
|
setActiveDragIndex(oldIndex);
|
|
11957
|
-
|
|
12402
|
+
|
|
12403
|
+
if (Sortable__default["default"].ghost) {
|
|
12404
|
+
Sortable__default["default"].ghost.style.opacity = '1';
|
|
12405
|
+
}
|
|
11958
12406
|
}, []);
|
|
11959
12407
|
var onEnd = React__namespace.useCallback(function () {
|
|
11960
12408
|
if (activeDragIndex !== null) {
|
|
@@ -12574,7 +13022,9 @@
|
|
|
12574
13022
|
onClickLayer: function onClickLayer(serviceURL, layerName) {
|
|
12575
13023
|
if (layerType === LayerType.baseLayer) {
|
|
12576
13024
|
addBaseLayer(serviceURL, layerName);
|
|
12577
|
-
} else
|
|
13025
|
+
} else {
|
|
13026
|
+
addMapLayer(serviceURL, layerName);
|
|
13027
|
+
}
|
|
12578
13028
|
},
|
|
12579
13029
|
highlightedLayers: loadedLayers
|
|
12580
13030
|
});
|
|
@@ -12725,9 +13175,16 @@
|
|
|
12725
13175
|
* */
|
|
12726
13176
|
|
|
12727
13177
|
var validateServiceUrl$1 = function validateServiceUrl(url) {
|
|
12728
|
-
if (url === '' || url === null || typeof url === 'undefined')
|
|
13178
|
+
if (url === '' || url === null || typeof url === 'undefined') {
|
|
13179
|
+
return false;
|
|
13180
|
+
}
|
|
13181
|
+
|
|
12729
13182
|
var matcher = /^(?:\w+:)?\/\/([^\s.]+\.\S{2}|[0-9a-zA-Z]+[:?\d]*)\S*$/;
|
|
12730
|
-
|
|
13183
|
+
|
|
13184
|
+
if (!matcher.test(url)) {
|
|
13185
|
+
return false;
|
|
13186
|
+
}
|
|
13187
|
+
|
|
12731
13188
|
return true;
|
|
12732
13189
|
};
|
|
12733
13190
|
|
|
@@ -13062,8 +13519,56 @@
|
|
|
13062
13519
|
* See the License for the specific language governing permissions and
|
|
13063
13520
|
* limitations under the License.
|
|
13064
13521
|
*
|
|
13065
|
-
* Copyright
|
|
13066
|
-
* Copyright
|
|
13522
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
13523
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
13524
|
+
* */
|
|
13525
|
+
var areShortcutsEnabled = function areShortcutsEnabled(activeMapId, mapId, floatingLmFocused, isDockedLayerManager) {
|
|
13526
|
+
if (floatingLmFocused && !isDockedLayerManager) {
|
|
13527
|
+
return true;
|
|
13528
|
+
}
|
|
13529
|
+
|
|
13530
|
+
if (activeMapId === mapId && isDockedLayerManager && !floatingLmFocused) {
|
|
13531
|
+
return true;
|
|
13532
|
+
}
|
|
13533
|
+
|
|
13534
|
+
return false;
|
|
13535
|
+
};
|
|
13536
|
+
|
|
13537
|
+
var HeaderOptionsConnect = function HeaderOptionsConnect(_a) {
|
|
13538
|
+
var isDockedLayerManager = _a.isDockedLayerManager,
|
|
13539
|
+
mapId = _a.mapId,
|
|
13540
|
+
onClickDockButton = _a.onClickDockButton,
|
|
13541
|
+
onChangeSize = _a.onChangeSize;
|
|
13542
|
+
var activeMapId = reactRedux.useSelector(function (store) {
|
|
13543
|
+
return getActiveWindowId(store);
|
|
13544
|
+
});
|
|
13545
|
+
var floatingLmFocused = reactRedux.useSelector(function (store) {
|
|
13546
|
+
return getDialogFocused(store, DialogTypes.LayerManager);
|
|
13547
|
+
});
|
|
13548
|
+
var shortcutsEnabled = areShortcutsEnabled(activeMapId, mapId, floatingLmFocused, isDockedLayerManager);
|
|
13549
|
+
return /*#__PURE__*/React__namespace.createElement(HeaderOptions, {
|
|
13550
|
+
isDockedLayerManager: isDockedLayerManager,
|
|
13551
|
+
shortcutsEnabled: shortcutsEnabled,
|
|
13552
|
+
onClickDockButton: onClickDockButton,
|
|
13553
|
+
onChangeSize: onChangeSize
|
|
13554
|
+
});
|
|
13555
|
+
};
|
|
13556
|
+
|
|
13557
|
+
/* *
|
|
13558
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
13559
|
+
* you may not use this file except in compliance with the License.
|
|
13560
|
+
* You may obtain a copy of the License at
|
|
13561
|
+
*
|
|
13562
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13563
|
+
*
|
|
13564
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13565
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13566
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13567
|
+
* See the License for the specific language governing permissions and
|
|
13568
|
+
* limitations under the License.
|
|
13569
|
+
*
|
|
13570
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
13571
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
13067
13572
|
* */
|
|
13068
13573
|
var styles$2 = {
|
|
13069
13574
|
layerRowContainer: {
|
|
@@ -13120,16 +13625,18 @@
|
|
|
13120
13625
|
startPosition = _k === void 0 ? {
|
|
13121
13626
|
top: 85,
|
|
13122
13627
|
left: 50
|
|
13123
|
-
} : _k
|
|
13628
|
+
} : _k,
|
|
13629
|
+
_l = _a.setFocused,
|
|
13630
|
+
setFocused = _l === void 0 ? function () {} : _l;
|
|
13124
13631
|
var minSize = {
|
|
13125
13632
|
width: 100,
|
|
13126
13633
|
height: 126
|
|
13127
13634
|
};
|
|
13128
13635
|
var startSizeCalc = calculateStartSize(minSize, size, startPosition);
|
|
13129
13636
|
|
|
13130
|
-
var
|
|
13131
|
-
sizeInState =
|
|
13132
|
-
setSizeInState =
|
|
13637
|
+
var _m = __read(React__namespace.useState(startSizeCalc), 2),
|
|
13638
|
+
sizeInState = _m[0],
|
|
13639
|
+
setSizeInState = _m[1];
|
|
13133
13640
|
|
|
13134
13641
|
React__namespace.useEffect(function () {
|
|
13135
13642
|
if (size !== sizeInState && isDockedLayerManager && isOpen) {
|
|
@@ -13149,11 +13656,18 @@
|
|
|
13149
13656
|
bounds: bounds,
|
|
13150
13657
|
"data-testid": "layerManagerWindow",
|
|
13151
13658
|
onMouseDown: onMouseDown,
|
|
13659
|
+
onFocus: function onFocus() {
|
|
13660
|
+
return setFocused(true);
|
|
13661
|
+
},
|
|
13662
|
+
onBlur: function onBlur() {
|
|
13663
|
+
return setFocused(false);
|
|
13664
|
+
},
|
|
13152
13665
|
order: order,
|
|
13153
13666
|
source: source,
|
|
13154
13667
|
leftHeaderComponent: leftHeaderComponent,
|
|
13155
|
-
rightHeaderComponent: /*#__PURE__*/React__namespace.createElement(
|
|
13668
|
+
rightHeaderComponent: /*#__PURE__*/React__namespace.createElement(HeaderOptionsConnect, {
|
|
13156
13669
|
isDockedLayerManager: isDockedLayerManager,
|
|
13670
|
+
mapId: mapId,
|
|
13157
13671
|
onClickDockButton: onToggleDock,
|
|
13158
13672
|
onChangeSize: function onChangeSize(_a) {
|
|
13159
13673
|
var width = _a.width;
|
|
@@ -13228,8 +13742,8 @@
|
|
|
13228
13742
|
* See the License for the specific language governing permissions and
|
|
13229
13743
|
* limitations under the License.
|
|
13230
13744
|
*
|
|
13231
|
-
* Copyright
|
|
13232
|
-
* Copyright
|
|
13745
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
13746
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
13233
13747
|
* */
|
|
13234
13748
|
var useSetupDialog = function useSetupDialog(dialogType, source) {
|
|
13235
13749
|
if (source === void 0) {
|
|
@@ -13299,6 +13813,14 @@
|
|
|
13299
13813
|
var uiError = reactRedux.useSelector(function (store) {
|
|
13300
13814
|
return getDialogError(store, dialogType);
|
|
13301
13815
|
});
|
|
13816
|
+
|
|
13817
|
+
var setFocused = function setFocused(focused) {
|
|
13818
|
+
dispatch(uiActions.setDialogFocused({
|
|
13819
|
+
type: dialogType,
|
|
13820
|
+
focused: focused
|
|
13821
|
+
}));
|
|
13822
|
+
};
|
|
13823
|
+
|
|
13302
13824
|
return {
|
|
13303
13825
|
setDialogOrder: setDialogOrder,
|
|
13304
13826
|
dialogOrder: dialogOrder,
|
|
@@ -13306,7 +13828,8 @@
|
|
|
13306
13828
|
uiSource: uiSource,
|
|
13307
13829
|
isDialogOpen: isDialogOpen,
|
|
13308
13830
|
uiIsLoading: uiIsLoading,
|
|
13309
|
-
uiError: uiError
|
|
13831
|
+
uiError: uiError,
|
|
13832
|
+
setFocused: setFocused
|
|
13310
13833
|
};
|
|
13311
13834
|
};
|
|
13312
13835
|
|
|
@@ -13323,62 +13846,42 @@
|
|
|
13323
13846
|
* See the License for the specific language governing permissions and
|
|
13324
13847
|
* limitations under the License.
|
|
13325
13848
|
*
|
|
13326
|
-
* Copyright
|
|
13327
|
-
* Copyright
|
|
13849
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
13850
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
13328
13851
|
* */
|
|
13852
|
+
var getServicesToLoad = function getServicesToLoad(services) {
|
|
13853
|
+
return services.map(function (service) {
|
|
13854
|
+
var wmService = webmap.WMGetServiceFromStore(service.url);
|
|
13855
|
+
var scope = service.scope ? service.scope : 'system';
|
|
13856
|
+
return {
|
|
13857
|
+
id: wmService.id,
|
|
13858
|
+
name: service.name,
|
|
13859
|
+
serviceUrl: service.url,
|
|
13860
|
+
scope: scope,
|
|
13861
|
+
"abstract": service["abstract"] || wmService["abstract"]
|
|
13862
|
+
};
|
|
13863
|
+
});
|
|
13864
|
+
};
|
|
13329
13865
|
var useFetchServices = function useFetchServices(dialogType, preloadedServices) {
|
|
13330
13866
|
if (preloadedServices === void 0) {
|
|
13331
13867
|
preloadedServices = preloadedDefaultMapServices;
|
|
13332
13868
|
}
|
|
13333
13869
|
|
|
13334
13870
|
var dispatch = reactRedux.useDispatch();
|
|
13335
|
-
var isMounted = shared.useIsMounted().isMounted;
|
|
13336
13871
|
var isOpenInStore = reactRedux.useSelector(function (store) {
|
|
13337
13872
|
return getisDialogOpen(store, dialogType);
|
|
13338
13873
|
});
|
|
13339
|
-
var
|
|
13340
|
-
dispatch(serviceActions.
|
|
13341
|
-
|
|
13342
|
-
|
|
13343
|
-
dispatch(layerSelectActions.addFiltersAndActiveServices(payload));
|
|
13874
|
+
var fetchInitialServices = React__namespace.useCallback(function (services) {
|
|
13875
|
+
dispatch(serviceActions.fetchInitialServices({
|
|
13876
|
+
services: services
|
|
13877
|
+
}));
|
|
13344
13878
|
}, [dispatch]);
|
|
13345
13879
|
React__namespace.useEffect(function () {
|
|
13346
13880
|
if (isOpenInStore && preloadedServices && preloadedServices.length > 0) {
|
|
13347
|
-
mergePresetsAndUserAddedServices(preloadedServices, getUserAddedServices())
|
|
13348
|
-
|
|
13349
|
-
var scope = service.scope ? service.scope : 'system';
|
|
13350
|
-
|
|
13351
|
-
if (isMounted.current) {
|
|
13352
|
-
addFiltersAndActiveServices({
|
|
13353
|
-
serviceId: wmService.id,
|
|
13354
|
-
serviceName: service.name,
|
|
13355
|
-
serviceUrl: service.url,
|
|
13356
|
-
keywords: [],
|
|
13357
|
-
scope: scope,
|
|
13358
|
-
groups: [],
|
|
13359
|
-
"abstract": service["abstract"] || wmService["abstract"],
|
|
13360
|
-
isLoading: true
|
|
13361
|
-
});
|
|
13362
|
-
}
|
|
13363
|
-
|
|
13364
|
-
getLayersFlattenedFromService(service.url).then(function (layers) {
|
|
13365
|
-
if (isMounted.current) {
|
|
13366
|
-
serviceSetLayers({
|
|
13367
|
-
id: wmService.id,
|
|
13368
|
-
name: service.name,
|
|
13369
|
-
serviceUrl: service.url,
|
|
13370
|
-
layers: layers,
|
|
13371
|
-
scope: scope,
|
|
13372
|
-
// first try to load the user abstract, otherwise the service abstract
|
|
13373
|
-
"abstract": service["abstract"] || wmService["abstract"]
|
|
13374
|
-
});
|
|
13375
|
-
}
|
|
13376
|
-
})["catch"](function () {
|
|
13377
|
-
return null;
|
|
13378
|
-
});
|
|
13379
|
-
});
|
|
13881
|
+
var allServicesToLoad = mergePresetsAndUserAddedServices(preloadedServices, getUserAddedServices());
|
|
13882
|
+
fetchInitialServices(getServicesToLoad(allServicesToLoad));
|
|
13380
13883
|
}
|
|
13381
|
-
}, [
|
|
13884
|
+
}, [isOpenInStore, preloadedServices, fetchInitialServices]);
|
|
13382
13885
|
};
|
|
13383
13886
|
var mergePresetsAndUserAddedServices = function mergePresetsAndUserAddedServices(presets, userAddedServices) {
|
|
13384
13887
|
return Object.values(__assign(__assign({}, presets.reduce(function (byUrl, preset) {
|
|
@@ -13401,8 +13904,8 @@
|
|
|
13401
13904
|
* See the License for the specific language governing permissions and
|
|
13402
13905
|
* limitations under the License.
|
|
13403
13906
|
*
|
|
13404
|
-
* Copyright
|
|
13405
|
-
* Copyright
|
|
13907
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
13908
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
13406
13909
|
* */
|
|
13407
13910
|
var dialogType = DialogTypes.LayerManager;
|
|
13408
13911
|
/**
|
|
@@ -13438,7 +13941,8 @@
|
|
|
13438
13941
|
isDialogOpen = _d.isDialogOpen,
|
|
13439
13942
|
uiSource = _d.uiSource,
|
|
13440
13943
|
uiIsLoading = _d.uiIsLoading,
|
|
13441
|
-
uiError = _d.uiError
|
|
13944
|
+
uiError = _d.uiError,
|
|
13945
|
+
setFocused = _d.setFocused;
|
|
13442
13946
|
|
|
13443
13947
|
useFetchServices(dialogType, preloadedMapServices);
|
|
13444
13948
|
|
|
@@ -13466,7 +13970,8 @@
|
|
|
13466
13970
|
leftHeaderComponent: leftHeaderComponent,
|
|
13467
13971
|
isLoading: uiIsLoading,
|
|
13468
13972
|
error: uiError,
|
|
13469
|
-
onToggleDock: onToggleDock
|
|
13973
|
+
onToggleDock: onToggleDock,
|
|
13974
|
+
setFocused: setFocused
|
|
13470
13975
|
});
|
|
13471
13976
|
};
|
|
13472
13977
|
|
|
@@ -13643,17 +14148,23 @@
|
|
|
13643
14148
|
}, /*#__PURE__*/React__default["default"].createElement(theme.Clear, null)));
|
|
13644
14149
|
};
|
|
13645
14150
|
|
|
13646
|
-
if (isURL(localSearchString))
|
|
13647
|
-
|
|
13648
|
-
|
|
13649
|
-
|
|
13650
|
-
|
|
13651
|
-
|
|
13652
|
-
|
|
13653
|
-
|
|
13654
|
-
|
|
13655
|
-
|
|
13656
|
-
|
|
14151
|
+
if (isURL(localSearchString)) {
|
|
14152
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
14153
|
+
style: {
|
|
14154
|
+
marginRight: '15px'
|
|
14155
|
+
}
|
|
14156
|
+
}, /*#__PURE__*/React__default["default"].createElement(ClearButton, null)), /*#__PURE__*/React__default["default"].createElement(material.Button, {
|
|
14157
|
+
variant: "tertiary",
|
|
14158
|
+
onClick: function onClick() {
|
|
14159
|
+
return setPopupIsOpen(true);
|
|
14160
|
+
}
|
|
14161
|
+
}, "Save"));
|
|
14162
|
+
}
|
|
14163
|
+
|
|
14164
|
+
if (localSearchString) {
|
|
14165
|
+
return /*#__PURE__*/React__default["default"].createElement(ClearButton, null);
|
|
14166
|
+
}
|
|
14167
|
+
|
|
13657
14168
|
return /*#__PURE__*/React__default["default"].createElement(shared.CustomTooltip, {
|
|
13658
14169
|
title: "Search",
|
|
13659
14170
|
placement: "top"
|
|
@@ -13698,7 +14209,12 @@
|
|
|
13698
14209
|
|
|
13699
14210
|
var handleChange = function handleChange(text) {
|
|
13700
14211
|
setLocalSearchString(text);
|
|
13701
|
-
|
|
14212
|
+
|
|
14213
|
+
if (!isURL(text)) {
|
|
14214
|
+
setSearchFilterDebounced(text);
|
|
14215
|
+
} else if (searchFilter) {
|
|
14216
|
+
setSearchFilterDebounced('');
|
|
14217
|
+
}
|
|
13702
14218
|
};
|
|
13703
14219
|
|
|
13704
14220
|
React__namespace.useEffect(function () {
|
|
@@ -13725,7 +14241,10 @@
|
|
|
13725
14241
|
}, [urlIsValid, localSearchString, onOpenServicePopup]); // mirror store unless typing a URL
|
|
13726
14242
|
|
|
13727
14243
|
React__namespace.useEffect(function () {
|
|
13728
|
-
if (isURL(localSearchString))
|
|
14244
|
+
if (isURL(localSearchString)) {
|
|
14245
|
+
return;
|
|
14246
|
+
}
|
|
14247
|
+
|
|
13729
14248
|
setLocalSearchString(searchFilter); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13730
14249
|
}, [searchFilter]);
|
|
13731
14250
|
return /*#__PURE__*/React__namespace.createElement(material.TextField, {
|
|
@@ -14389,13 +14908,19 @@
|
|
|
14389
14908
|
};
|
|
14390
14909
|
var breakpoint = 500;
|
|
14391
14910
|
var widthToColumns = function widthToColumns(width) {
|
|
14392
|
-
if (width <= breakpoint)
|
|
14911
|
+
if (width <= breakpoint) {
|
|
14912
|
+
return layerSelectColumnsSmall;
|
|
14913
|
+
}
|
|
14914
|
+
|
|
14393
14915
|
return layerSelectColumnsLarge;
|
|
14394
14916
|
};
|
|
14395
14917
|
var rowHeightLarge = 68;
|
|
14396
14918
|
var rowHeightSmall = 136;
|
|
14397
14919
|
var widthToRowHeight = function widthToRowHeight(width) {
|
|
14398
|
-
if (width <= breakpoint)
|
|
14920
|
+
if (width <= breakpoint) {
|
|
14921
|
+
return rowHeightSmall;
|
|
14922
|
+
}
|
|
14923
|
+
|
|
14399
14924
|
return rowHeightLarge;
|
|
14400
14925
|
};
|
|
14401
14926
|
var sortByService = function sortByService(serviceObj) {
|
|
@@ -15120,7 +15645,9 @@
|
|
|
15120
15645
|
sx: styles$1.servicesContainer,
|
|
15121
15646
|
"data-testid": "ServiceDialog",
|
|
15122
15647
|
onKeyDown: function onKeyDown(event) {
|
|
15123
|
-
if (event.key !== 'Escape')
|
|
15648
|
+
if (event.key !== 'Escape') {
|
|
15649
|
+
event.stopPropagation();
|
|
15650
|
+
}
|
|
15124
15651
|
},
|
|
15125
15652
|
tabIndex: -1,
|
|
15126
15653
|
ref: dialogRef
|
|
@@ -15181,7 +15708,11 @@
|
|
|
15181
15708
|
var foundService = selectedLayers.find(function (object) {
|
|
15182
15709
|
return object.service === serviceUrl;
|
|
15183
15710
|
});
|
|
15184
|
-
|
|
15711
|
+
|
|
15712
|
+
if (foundService) {
|
|
15713
|
+
return true;
|
|
15714
|
+
}
|
|
15715
|
+
|
|
15185
15716
|
return false;
|
|
15186
15717
|
};
|
|
15187
15718
|
|
|
@@ -15414,7 +15945,11 @@
|
|
|
15414
15945
|
|
|
15415
15946
|
return ((_a = services[serviceId]) === null || _a === void 0 ? void 0 : _a.serviceUrl) === serviceUrl;
|
|
15416
15947
|
});
|
|
15417
|
-
|
|
15948
|
+
|
|
15949
|
+
if (serviceIndex < 0) {
|
|
15950
|
+
return null;
|
|
15951
|
+
}
|
|
15952
|
+
|
|
15418
15953
|
return services[serviceIds[serviceIndex]];
|
|
15419
15954
|
};
|
|
15420
15955
|
|
|
@@ -16092,7 +16627,10 @@
|
|
|
16092
16627
|
uiSource = _a.uiSource,
|
|
16093
16628
|
isDialogOpen = _a.isDialogOpen;
|
|
16094
16629
|
|
|
16095
|
-
if (!layer)
|
|
16630
|
+
if (!layer) {
|
|
16631
|
+
return null;
|
|
16632
|
+
}
|
|
16633
|
+
|
|
16096
16634
|
return /*#__PURE__*/React__default["default"].createElement(LayerInfoDialog, {
|
|
16097
16635
|
isOpen: isDialogOpen,
|
|
16098
16636
|
onClose: onCloseDialog,
|
|
@@ -16970,8 +17508,8 @@
|
|
|
16970
17508
|
* See the License for the specific language governing permissions and
|
|
16971
17509
|
* limitations under the License.
|
|
16972
17510
|
*
|
|
16973
|
-
* Copyright
|
|
16974
|
-
* Copyright
|
|
17511
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
17512
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
16975
17513
|
* */
|
|
16976
17514
|
var SmallFontSlider = material.styled(material.Slider)(function () {
|
|
16977
17515
|
return {
|
|
@@ -17022,6 +17560,13 @@
|
|
|
17022
17560
|
var sliderValue = managedValue !== null ? values.findIndex(function (v) {
|
|
17023
17561
|
return v === managedValue;
|
|
17024
17562
|
}) : currentIndex;
|
|
17563
|
+
|
|
17564
|
+
var upDownNavigation = function upDownNavigation(event) {
|
|
17565
|
+
if (event.key === 'ArrowLeft' || event.key === 'ArrowRight' || event.metaKey || event.ctrlKey) {
|
|
17566
|
+
event.preventDefault();
|
|
17567
|
+
}
|
|
17568
|
+
};
|
|
17569
|
+
|
|
17025
17570
|
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(material.Box, {
|
|
17026
17571
|
"data-testid": "slider-dimensionSelect",
|
|
17027
17572
|
sx: {
|
|
@@ -17047,9 +17592,13 @@
|
|
|
17047
17592
|
} : {},
|
|
17048
17593
|
disabled: isDisabled,
|
|
17049
17594
|
value: sliderValue,
|
|
17595
|
+
onKeyDown: upDownNavigation,
|
|
17050
17596
|
onChange: function onChange(e, val) {
|
|
17051
17597
|
onChangeDimensionValue(values[val].toString());
|
|
17052
|
-
|
|
17598
|
+
|
|
17599
|
+
if (!managedValue) {
|
|
17600
|
+
setCurrentIndex(val);
|
|
17601
|
+
}
|
|
17053
17602
|
}
|
|
17054
17603
|
}))), /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
|
|
17055
17604
|
title: layerTitle
|
|
@@ -17081,7 +17630,10 @@
|
|
|
17081
17630
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
17082
17631
|
* */
|
|
17083
17632
|
var marksByDimension = function marksByDimension(dim) {
|
|
17084
|
-
if (!dim || !dim.name)
|
|
17633
|
+
if (!dim || !dim.name) {
|
|
17634
|
+
return [];
|
|
17635
|
+
}
|
|
17636
|
+
|
|
17085
17637
|
var dimCnf = dimensionConfig.find(function (cnf) {
|
|
17086
17638
|
return cnf.name === dim.name;
|
|
17087
17639
|
});
|
|
@@ -17107,7 +17659,9 @@
|
|
|
17107
17659
|
|
|
17108
17660
|
var handleMomentISOString = function handleMomentISOString(dateIn) {
|
|
17109
17661
|
/* Try to fix the timestrings generated by moment js made with moment.toISOString() */
|
|
17110
|
-
if (!dateIn)
|
|
17662
|
+
if (!dateIn) {
|
|
17663
|
+
return null;
|
|
17664
|
+
}
|
|
17111
17665
|
|
|
17112
17666
|
if (dateIn.length > 20) {
|
|
17113
17667
|
var fixedDate = dateIn.substring(0, 19);
|
|
@@ -17841,7 +18395,10 @@
|
|
|
17841
18395
|
};
|
|
17842
18396
|
|
|
17843
18397
|
var handleToggleTimeStep = function handleToggleTimeStep() {
|
|
17844
|
-
if (isTimestepAuto)
|
|
18398
|
+
if (isTimestepAuto) {
|
|
18399
|
+
return;
|
|
18400
|
+
}
|
|
18401
|
+
|
|
17845
18402
|
onToggleTimestepAuto();
|
|
17846
18403
|
timeStepFromLayer && onChangeTimeStep(timeStepFromLayer, MapActionOrigin.map);
|
|
17847
18404
|
};
|
|
@@ -18341,32 +18898,53 @@
|
|
|
18341
18898
|
switch (scale) {
|
|
18342
18899
|
case Scale.Hour:
|
|
18343
18900
|
{
|
|
18344
|
-
if (rem === 0)
|
|
18901
|
+
if (rem === 0) {
|
|
18902
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18903
|
+
} // 15 min subdivisions
|
|
18904
|
+
|
|
18905
|
+
|
|
18906
|
+
if (rem % (15 * 60) === 0) {
|
|
18907
|
+
return TICK_MARK_HEIGHT_SECONDARY;
|
|
18908
|
+
}
|
|
18345
18909
|
|
|
18346
|
-
if (rem % (15 * 60) === 0) return TICK_MARK_HEIGHT_SECONDARY;
|
|
18347
18910
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
18348
18911
|
}
|
|
18349
18912
|
|
|
18350
18913
|
case Scale.Hours3:
|
|
18351
18914
|
{
|
|
18352
|
-
if (rem === 0)
|
|
18915
|
+
if (rem === 0) {
|
|
18916
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18917
|
+
}
|
|
18918
|
+
|
|
18353
18919
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
18354
18920
|
}
|
|
18355
18921
|
|
|
18356
18922
|
case Scale.Hours6:
|
|
18357
18923
|
{
|
|
18358
|
-
if (rem === 0)
|
|
18924
|
+
if (rem === 0) {
|
|
18925
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18926
|
+
} // 3 hour subdivisions
|
|
18927
|
+
|
|
18928
|
+
|
|
18929
|
+
if (rem % (3 * 60 * 60) === 0) {
|
|
18930
|
+
return TICK_MARK_HEIGHT_SECONDARY;
|
|
18931
|
+
}
|
|
18359
18932
|
|
|
18360
|
-
if (rem % (3 * 60 * 60) === 0) return TICK_MARK_HEIGHT_SECONDARY;
|
|
18361
18933
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
18362
18934
|
}
|
|
18363
18935
|
|
|
18364
18936
|
default:
|
|
18365
18937
|
{
|
|
18366
18938
|
// Scale.Day
|
|
18367
|
-
if (rem === 0)
|
|
18939
|
+
if (rem === 0) {
|
|
18940
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18941
|
+
} // 6 hour subdivisions
|
|
18942
|
+
|
|
18943
|
+
|
|
18944
|
+
if (rem % (6 * 60 * 60) === 0) {
|
|
18945
|
+
return TICK_MARK_HEIGHT_SECONDARY;
|
|
18946
|
+
}
|
|
18368
18947
|
|
|
18369
|
-
if (rem % (6 * 60 * 60) === 0) return TICK_MARK_HEIGHT_SECONDARY;
|
|
18370
18948
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
18371
18949
|
}
|
|
18372
18950
|
}
|
|
@@ -18376,7 +18954,10 @@
|
|
|
18376
18954
|
{
|
|
18377
18955
|
var weekday = moment__default["default"].unix(timestep).utc().isoWeekday(); // momentjs isoWeekdays range from 1(Monday) to 7(Sunday)
|
|
18378
18956
|
|
|
18379
|
-
if (weekday === 1)
|
|
18957
|
+
if (weekday === 1) {
|
|
18958
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18959
|
+
}
|
|
18960
|
+
|
|
18380
18961
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
18381
18962
|
}
|
|
18382
18963
|
|
|
@@ -18384,15 +18965,24 @@
|
|
|
18384
18965
|
{
|
|
18385
18966
|
var month = moment__default["default"].unix(timestep).utc().month(); // momentjs months are zero indexed
|
|
18386
18967
|
|
|
18387
|
-
if (month === 0)
|
|
18388
|
-
|
|
18968
|
+
if (month === 0) {
|
|
18969
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18970
|
+
}
|
|
18971
|
+
|
|
18972
|
+
if (month % 3 === 0) {
|
|
18973
|
+
return TICK_MARK_HEIGHT_SECONDARY;
|
|
18974
|
+
}
|
|
18975
|
+
|
|
18389
18976
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
18390
18977
|
}
|
|
18391
18978
|
|
|
18392
18979
|
case Scale.Minutes5:
|
|
18393
18980
|
{
|
|
18394
18981
|
// add primary line on day change
|
|
18395
|
-
if (timestep % (60 * 60 * 24) === 0)
|
|
18982
|
+
if (timestep % (60 * 60 * 24) === 0) {
|
|
18983
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18984
|
+
}
|
|
18985
|
+
|
|
18396
18986
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
18397
18987
|
}
|
|
18398
18988
|
|
|
@@ -18410,31 +19000,52 @@
|
|
|
18410
19000
|
switch (scale) {
|
|
18411
19001
|
case Scale.Hour:
|
|
18412
19002
|
{
|
|
18413
|
-
if (rem === 0)
|
|
19003
|
+
if (rem === 0) {
|
|
19004
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
19005
|
+
} // 15 min subdivisions
|
|
19006
|
+
|
|
19007
|
+
|
|
19008
|
+
if (rem % (15 * 60) === 0) {
|
|
19009
|
+
return TICK_MARK_HEIGHT_SECONDARY;
|
|
19010
|
+
}
|
|
18414
19011
|
|
|
18415
|
-
if (rem % (15 * 60) === 0) return TICK_MARK_HEIGHT_SECONDARY;
|
|
18416
19012
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
18417
19013
|
}
|
|
18418
19014
|
|
|
18419
19015
|
case Scale.Hours3:
|
|
18420
19016
|
{
|
|
18421
|
-
if (rem === 0)
|
|
19017
|
+
if (rem === 0) {
|
|
19018
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
19019
|
+
}
|
|
19020
|
+
|
|
18422
19021
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
18423
19022
|
}
|
|
18424
19023
|
|
|
18425
19024
|
case Scale.Hours6:
|
|
18426
19025
|
{
|
|
18427
|
-
if (rem === 0)
|
|
19026
|
+
if (rem === 0) {
|
|
19027
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
19028
|
+
} // 3 hour subdivisions
|
|
19029
|
+
|
|
19030
|
+
|
|
19031
|
+
if (rem % (3 * 60 * 60) === 0) {
|
|
19032
|
+
return TICK_MARK_HEIGHT_SECONDARY;
|
|
19033
|
+
}
|
|
18428
19034
|
|
|
18429
|
-
if (rem % (3 * 60 * 60) === 0) return TICK_MARK_HEIGHT_SECONDARY;
|
|
18430
19035
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
18431
19036
|
}
|
|
18432
19037
|
|
|
18433
19038
|
case Scale.Day:
|
|
18434
19039
|
{
|
|
18435
|
-
if (rem === 0)
|
|
19040
|
+
if (rem === 0) {
|
|
19041
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
19042
|
+
} // 6 hour subdivisions
|
|
19043
|
+
|
|
19044
|
+
|
|
19045
|
+
if (rem % (6 * 60 * 60) === 0) {
|
|
19046
|
+
return TICK_MARK_HEIGHT_SECONDARY;
|
|
19047
|
+
}
|
|
18436
19048
|
|
|
18437
|
-
if (rem % (6 * 60 * 60) === 0) return TICK_MARK_HEIGHT_SECONDARY;
|
|
18438
19049
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
18439
19050
|
}
|
|
18440
19051
|
|
|
@@ -18442,7 +19053,10 @@
|
|
|
18442
19053
|
{
|
|
18443
19054
|
var weekday = moment__default["default"].unix(timestep).utc().isoWeekday(); // momentjs isoWeekdays range from 1(Monday) to 7(Sunday)
|
|
18444
19055
|
|
|
18445
|
-
if (weekday === 1)
|
|
19056
|
+
if (weekday === 1) {
|
|
19057
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
19058
|
+
}
|
|
19059
|
+
|
|
18446
19060
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
18447
19061
|
}
|
|
18448
19062
|
|
|
@@ -18450,14 +19064,20 @@
|
|
|
18450
19064
|
{
|
|
18451
19065
|
var month = moment__default["default"].unix(timestep).utc().month(); // momentjs months are zero indexed
|
|
18452
19066
|
|
|
18453
|
-
if (month === 0)
|
|
19067
|
+
if (month === 0) {
|
|
19068
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
19069
|
+
}
|
|
19070
|
+
|
|
18454
19071
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
18455
19072
|
}
|
|
18456
19073
|
|
|
18457
19074
|
case Scale.Minutes5:
|
|
18458
19075
|
{
|
|
18459
19076
|
// add primary line on day change
|
|
18460
|
-
if (timestep % (60 * 60 * 24) === 0)
|
|
19077
|
+
if (timestep % (60 * 60 * 24) === 0) {
|
|
19078
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
19079
|
+
}
|
|
19080
|
+
|
|
18461
19081
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
18462
19082
|
}
|
|
18463
19083
|
|
|
@@ -18497,7 +19117,10 @@
|
|
|
18497
19117
|
};
|
|
18498
19118
|
|
|
18499
19119
|
var drawUpperText = function drawUpperText(ctx, theme, newDate, stepPx, height, minOffset) {
|
|
18500
|
-
if (stepPx <= 0)
|
|
19120
|
+
if (stepPx <= 0) {
|
|
19121
|
+
return;
|
|
19122
|
+
}
|
|
19123
|
+
|
|
18501
19124
|
var ctx2 = ctx;
|
|
18502
19125
|
var _a = theme.palette.geowebColors.timeSlider.timelineText,
|
|
18503
19126
|
fontSize = _a.fontSize,
|
|
@@ -18881,7 +19504,10 @@
|
|
|
18881
19504
|
} // draw date change texts
|
|
18882
19505
|
|
|
18883
19506
|
|
|
18884
|
-
if (scale === Scale.Year && fundamentalScale === Scale.Year)
|
|
19507
|
+
if (scale === Scale.Year && fundamentalScale === Scale.Year) {
|
|
19508
|
+
return;
|
|
19509
|
+
}
|
|
19510
|
+
|
|
18885
19511
|
var timestepUnit = getDateChangeTimestepUnit(fundamentalScale);
|
|
18886
19512
|
|
|
18887
19513
|
var _c = __read(getCustomRoundedStartAndEnd(visibleTimeStart, visibleTimeEnd, timestepUnit), 2),
|
|
@@ -18919,7 +19545,10 @@
|
|
|
18919
19545
|
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
18920
19546
|
* */
|
|
18921
19547
|
var drawNeedle = function drawNeedle(context, theme, width, height, startTime, endTime, selectedTime) {
|
|
18922
|
-
if (!selectedTime)
|
|
19548
|
+
if (!selectedTime) {
|
|
19549
|
+
return;
|
|
19550
|
+
}
|
|
19551
|
+
|
|
18923
19552
|
var ctx = context;
|
|
18924
19553
|
var _a = theme.palette.geowebColors.timeSlider,
|
|
18925
19554
|
playerNeedlePlayer = _a.playerNeedlePlayer,
|
|
@@ -19060,7 +19689,9 @@
|
|
|
19060
19689
|
function drawNightOrAlternateTime() {
|
|
19061
19690
|
var colorChangeTimesteps = getColorChangeTimesteps(scale, visibleTimeStart, visibleTimeEnd);
|
|
19062
19691
|
colorChangeTimesteps.forEach(function (timestep, i, arr) {
|
|
19063
|
-
if (i === 0)
|
|
19692
|
+
if (i === 0) {
|
|
19693
|
+
return;
|
|
19694
|
+
}
|
|
19064
19695
|
|
|
19065
19696
|
var _a = __read([arr[i - 1], timestep].map(function (timestep) {
|
|
19066
19697
|
return timestampToPixelEdges(timestep, visibleTimeStart, visibleTimeEnd, canvasWidth);
|
|
@@ -19278,7 +19909,9 @@
|
|
|
19278
19909
|
|
|
19279
19910
|
}, [leftMarkerDragging, rightMarkerDragging, animationAreaDragging]);
|
|
19280
19911
|
var handleAnimationDragging = React.useCallback(function (x) {
|
|
19281
|
-
if (!localAnimationStartTime || !localAnimationEndTime)
|
|
19912
|
+
if (!localAnimationStartTime || !localAnimationEndTime) {
|
|
19913
|
+
return;
|
|
19914
|
+
}
|
|
19282
19915
|
|
|
19283
19916
|
var _a = __read([localAnimationStartTime, localAnimationEndTime].map(function (timestamp) {
|
|
19284
19917
|
return timestampToPixel(timestamp, centerTime, canvasWidth, secondsPerPx);
|
|
@@ -19289,7 +19922,11 @@
|
|
|
19289
19922
|
if (leftMarkerDragging) {
|
|
19290
19923
|
var mousePosition = leftMarkerPx + x;
|
|
19291
19924
|
var rightAnimationPosition = rightMarkerPx - DRAG_AREA_WIDTH * 2;
|
|
19292
|
-
|
|
19925
|
+
|
|
19926
|
+
if (mousePosition >= rightAnimationPosition || mousePosition <= 0) {
|
|
19927
|
+
return;
|
|
19928
|
+
} // eslint-disable-next-line no-param-reassign
|
|
19929
|
+
|
|
19293
19930
|
|
|
19294
19931
|
dragTooltipPosition.current = pixelsToLeft ? mousePosition + pixelsToLeft : mousePosition;
|
|
19295
19932
|
var mouseTimeUnix = pixelToTimestamp(mousePosition, centerTime, canvasWidth, secondsPerPx);
|
|
@@ -19301,7 +19938,11 @@
|
|
|
19301
19938
|
if (rightMarkerDragging) {
|
|
19302
19939
|
var mousePosition = rightMarkerPx + x;
|
|
19303
19940
|
var leftAnimationPosition = leftMarkerPx + DRAG_AREA_WIDTH * 2;
|
|
19304
|
-
|
|
19941
|
+
|
|
19942
|
+
if (leftAnimationPosition >= mousePosition || mousePosition >= canvasWidth) {
|
|
19943
|
+
return;
|
|
19944
|
+
} // eslint-disable-next-line no-param-reassign
|
|
19945
|
+
|
|
19305
19946
|
|
|
19306
19947
|
dragTooltipPosition.current = pixelsToLeft ? mousePosition + pixelsToLeft : mousePosition;
|
|
19307
19948
|
var mouseTimeUnix = pixelToTimestamp(mousePosition, centerTime, canvasWidth, secondsPerPx);
|
|
@@ -19450,7 +20091,9 @@
|
|
|
19450
20091
|
}, [canvasWidth, centerTime, dataEndTime, dataStartTime, onSetNewDate, secondsPerPx, setUnfilteredSelectedTime, timeStep, unfilteredSelectedTime]);
|
|
19451
20092
|
React__namespace.useEffect(function () {
|
|
19452
20093
|
var handleMouseMove = function handleMouseMove(event) {
|
|
19453
|
-
if (event.movementX === 0)
|
|
20094
|
+
if (event.movementX === 0) {
|
|
20095
|
+
return;
|
|
20096
|
+
}
|
|
19454
20097
|
|
|
19455
20098
|
if (mouseDownInLegend) {
|
|
19456
20099
|
var dragDistanceTime = event.movementX * secondsPerPx;
|
|
@@ -19534,7 +20177,9 @@
|
|
|
19534
20177
|
isClickOrDrag.current = 'drag';
|
|
19535
20178
|
}
|
|
19536
20179
|
|
|
19537
|
-
if (selectedTimeDragging || leftMarkerDragging || rightMarkerDragging)
|
|
20180
|
+
if (selectedTimeDragging || leftMarkerDragging || rightMarkerDragging) {
|
|
20181
|
+
return;
|
|
20182
|
+
}
|
|
19538
20183
|
|
|
19539
20184
|
var _a = __read([localAnimationStartTime, localAnimationEndTime, selectedTime].map(function (timestamp) {
|
|
19540
20185
|
return timestampToPixel(timestamp, centerTime, width, secondsPerPx);
|
|
@@ -19654,7 +20299,10 @@
|
|
|
19654
20299
|
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
19655
20300
|
* */
|
|
19656
20301
|
var onMouseMove = function onMouseMove(x, width, selectedTime, centerTime, secondsPerPx, mouseDownInTimeBox, isTimeBoxArea, setCursorStyle) {
|
|
19657
|
-
if (!selectedTime || mouseDownInTimeBox)
|
|
20302
|
+
if (!selectedTime || mouseDownInTimeBox) {
|
|
20303
|
+
return;
|
|
20304
|
+
}
|
|
20305
|
+
|
|
19658
20306
|
var selectedTimePx = timestampToPixel(selectedTime, centerTime, width, secondsPerPx);
|
|
19659
20307
|
|
|
19660
20308
|
if (isTimeBoxArea(x, selectedTimePx)) {
|
|
@@ -19664,7 +20312,10 @@
|
|
|
19664
20312
|
}
|
|
19665
20313
|
};
|
|
19666
20314
|
var onMouseDown = function onMouseDown(x, width, selectedTime, centerTime, secondsPerPx, isTimeBoxArea, setCursorStyle, setMouseDownInTimeBox) {
|
|
19667
|
-
if (!selectedTime)
|
|
20315
|
+
if (!selectedTime) {
|
|
20316
|
+
return;
|
|
20317
|
+
}
|
|
20318
|
+
|
|
19668
20319
|
var selectedTimePx = timestampToPixel(selectedTime, centerTime, width, secondsPerPx);
|
|
19669
20320
|
|
|
19670
20321
|
if (isTimeBoxArea(x, selectedTimePx)) {
|
|
@@ -19867,12 +20518,16 @@
|
|
|
19867
20518
|
}, /*#__PURE__*/React__default["default"].createElement(CanvasComponent, {
|
|
19868
20519
|
ref: node,
|
|
19869
20520
|
onMouseMove: function onMouseMove$1(x, y, event, width) {
|
|
19870
|
-
if (!selectedTime)
|
|
20521
|
+
if (!selectedTime) {
|
|
20522
|
+
return;
|
|
20523
|
+
}
|
|
19871
20524
|
|
|
19872
20525
|
onMouseMove(x, width, selectedTime, centerTime, secondsPerPx, mouseDownInTimeBox, isTimeBoxArea, setCursorStyle);
|
|
19873
20526
|
},
|
|
19874
20527
|
onMouseDown: function onMouseDown$1(x, y, width) {
|
|
19875
|
-
if (!selectedTime)
|
|
20528
|
+
if (!selectedTime) {
|
|
20529
|
+
return;
|
|
20530
|
+
}
|
|
19876
20531
|
|
|
19877
20532
|
onMouseDown(x, width, selectedTime, centerTime, secondsPerPx, isTimeBoxArea, setCursorStyle, setMouseDownInTimeBox);
|
|
19878
20533
|
},
|
|
@@ -20152,11 +20807,11 @@
|
|
|
20152
20807
|
var isTimestepAuto$1 = reactRedux.useSelector(function (store) {
|
|
20153
20808
|
return isTimestepAuto(store, mapId);
|
|
20154
20809
|
});
|
|
20155
|
-
var
|
|
20156
|
-
return
|
|
20810
|
+
var autoTimeStepLayerId = reactRedux.useSelector(function (store) {
|
|
20811
|
+
return getAutoTimeStepLayerId(store, mapId);
|
|
20157
20812
|
});
|
|
20158
20813
|
var activeLayerTimeDimension = reactRedux.useSelector(function (store) {
|
|
20159
|
-
return getLayerTimeDimension(store,
|
|
20814
|
+
return getLayerTimeDimension(store, autoTimeStepLayerId);
|
|
20160
20815
|
});
|
|
20161
20816
|
var timeStepFromLayer = getActiveLayerTimeStep(activeLayerTimeDimension);
|
|
20162
20817
|
var onToggleTimestepAuto = React__namespace.useCallback(function () {
|
|
@@ -20727,10 +21382,12 @@
|
|
|
20727
21382
|
isAutoUpdating: isAutoUpdating,
|
|
20728
21383
|
unfilteredSelectedTime: unfilteredSelectedTime || selectedTime,
|
|
20729
21384
|
setUnfilteredSelectedTime: function setUnfilteredSelectedTime(timeSliderUnfilteredSelectedTime) {
|
|
20730
|
-
if (setTimeSliderUnfilteredSelectedTime)
|
|
20731
|
-
|
|
20732
|
-
|
|
20733
|
-
|
|
21385
|
+
if (setTimeSliderUnfilteredSelectedTime) {
|
|
21386
|
+
setTimeSliderUnfilteredSelectedTime({
|
|
21387
|
+
timeSliderUnfilteredSelectedTime: timeSliderUnfilteredSelectedTime,
|
|
21388
|
+
mapId: mapId
|
|
21389
|
+
});
|
|
21390
|
+
}
|
|
20734
21391
|
},
|
|
20735
21392
|
onSetNewDate: function onSetNewDate(newDate) {
|
|
20736
21393
|
if (isAnimating) {
|
|
@@ -20767,14 +21424,14 @@
|
|
|
20767
21424
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
20768
21425
|
* */
|
|
20769
21426
|
var useUpdateTimestep = function useUpdateTimestep(mapId) {
|
|
20770
|
-
var
|
|
20771
|
-
return
|
|
21427
|
+
var autoTimeStepLayerId = reactRedux.useSelector(function (store) {
|
|
21428
|
+
return getAutoTimeStepLayerId(store, mapId);
|
|
20772
21429
|
});
|
|
20773
21430
|
var isTimeStepAuto = reactRedux.useSelector(function (store) {
|
|
20774
21431
|
return isTimestepAuto(store, mapId);
|
|
20775
21432
|
});
|
|
20776
21433
|
var timeDimension = reactRedux.useSelector(function (store) {
|
|
20777
|
-
return getLayerTimeDimension(store,
|
|
21434
|
+
return getLayerTimeDimension(store, autoTimeStepLayerId);
|
|
20778
21435
|
});
|
|
20779
21436
|
var dispatch = reactRedux.useDispatch();
|
|
20780
21437
|
React__namespace.useEffect(function () {
|
|
@@ -20785,7 +21442,7 @@
|
|
|
20785
21442
|
timeStep: timeStep
|
|
20786
21443
|
}));
|
|
20787
21444
|
}
|
|
20788
|
-
}, [
|
|
21445
|
+
}, [autoTimeStepLayerId, dispatch, isTimeStepAuto, mapId, timeDimension]);
|
|
20789
21446
|
};
|
|
20790
21447
|
|
|
20791
21448
|
var TimeSliderConnect = function TimeSliderConnect(_a) {
|
|
@@ -21931,8 +22588,11 @@
|
|
|
21931
22588
|
var to = getProj4(proj.crs);
|
|
21932
22589
|
|
|
21933
22590
|
for (var j = 0; j < featureCoords.length; j += 1) {
|
|
21934
|
-
|
|
21935
|
-
|
|
22591
|
+
if (featureCoords[j].length < 2) {
|
|
22592
|
+
// eslint-disable-next-line no-continue
|
|
22593
|
+
continue;
|
|
22594
|
+
}
|
|
22595
|
+
|
|
21936
22596
|
var coordinates = {
|
|
21937
22597
|
x: featureCoords[j][0],
|
|
21938
22598
|
y: featureCoords[j][1]
|
|
@@ -22244,12 +22904,16 @@
|
|
|
22244
22904
|
isInEditMode = _a.isInEditMode,
|
|
22245
22905
|
featureNrToEdit = _a.featureNrToEdit,
|
|
22246
22906
|
onHoverFeature = _a.onHoverFeature;
|
|
22247
|
-
|
|
22907
|
+
|
|
22908
|
+
if (event && event.rightButton === true) {
|
|
22909
|
+
return undefined;
|
|
22910
|
+
}
|
|
22248
22911
|
/* adagucMouseMove is an event callback function which is triggered when the mouse moves over the map
|
|
22249
22912
|
This event is only triggered if the map is in hover state.
|
|
22250
22913
|
E.g. when the map is dragging/panning, this event is not triggerd
|
|
22251
22914
|
*/
|
|
22252
22915
|
|
|
22916
|
+
|
|
22253
22917
|
var mouseX = event.mouseX,
|
|
22254
22918
|
mouseY = event.mouseY,
|
|
22255
22919
|
mouseDown = event.mouseDown;
|
|
@@ -22289,7 +22953,11 @@
|
|
|
22289
22953
|
}
|
|
22290
22954
|
|
|
22291
22955
|
var feature = this.geojson.features[featureNrToEdit];
|
|
22292
|
-
|
|
22956
|
+
|
|
22957
|
+
if (!feature) {
|
|
22958
|
+
return undefined;
|
|
22959
|
+
}
|
|
22960
|
+
|
|
22293
22961
|
var webmapjs = this.props.webmapjs;
|
|
22294
22962
|
this.mouseGeoCoord = webmapjs.getLatLongFromPixelCoord({
|
|
22295
22963
|
x: mouseX,
|
|
@@ -22364,7 +23032,10 @@
|
|
|
22364
23032
|
AdagucMapDraw.prototype.triggerMouseDownTimer = function (event) {
|
|
22365
23033
|
var _this = this;
|
|
22366
23034
|
|
|
22367
|
-
if (!this.doubleClickTimer)
|
|
23035
|
+
if (!this.doubleClickTimer) {
|
|
23036
|
+
this.doubleClickTimer = {};
|
|
23037
|
+
}
|
|
23038
|
+
|
|
22368
23039
|
var mouseX = event.mouseX,
|
|
22369
23040
|
mouseY = event.mouseY;
|
|
22370
23041
|
|
|
@@ -22490,12 +23161,19 @@
|
|
|
22490
23161
|
if (this.myDrawMode === DRAWMODE.POINT || this.myDrawMode === DRAWMODE.MULTIPOINT) {
|
|
22491
23162
|
/* Create points */
|
|
22492
23163
|
var pointGeometry = feature.geometry;
|
|
22493
|
-
|
|
22494
|
-
|
|
23164
|
+
|
|
23165
|
+
if (pointGeometry) {
|
|
23166
|
+
if (pointGeometry.coordinates === undefined) {
|
|
23167
|
+
pointGeometry.coordinates = [];
|
|
23168
|
+
}
|
|
22495
23169
|
}
|
|
23170
|
+
|
|
22496
23171
|
var multiPointGeometry = feature.geometry;
|
|
22497
|
-
|
|
22498
|
-
|
|
23172
|
+
|
|
23173
|
+
if (multiPointGeometry) {
|
|
23174
|
+
if (multiPointGeometry.coordinates === undefined) {
|
|
23175
|
+
multiPointGeometry.coordinates = [[]];
|
|
23176
|
+
}
|
|
22499
23177
|
}
|
|
22500
23178
|
|
|
22501
23179
|
if (this.myDrawMode === DRAWMODE.POINT) {
|
|
@@ -22535,8 +23213,11 @@
|
|
|
22535
23213
|
if (this.myDrawMode === DRAWMODE.POLYGON || this.myDrawMode === DRAWMODE.BOX) {
|
|
22536
23214
|
/* Create poly's and boxes */
|
|
22537
23215
|
this.myEditMode = EDITMODE.ADD_FEATURE;
|
|
22538
|
-
|
|
22539
|
-
|
|
23216
|
+
|
|
23217
|
+
if (feature.geometry) {
|
|
23218
|
+
if (feature.geometry.coordinates === undefined) {
|
|
23219
|
+
feature.geometry.coordinates = [[]];
|
|
23220
|
+
}
|
|
22540
23221
|
}
|
|
22541
23222
|
|
|
22542
23223
|
if (feature.geometry.coordinates[0] === undefined || feature.geometry.coordinates[0].length === 0) {
|
|
@@ -22682,7 +23363,10 @@
|
|
|
22682
23363
|
|
|
22683
23364
|
AdagucMapDraw.prototype.adagucMouseDown = function (event) {
|
|
22684
23365
|
var isInEditMode = this.props.isInEditMode;
|
|
22685
|
-
|
|
23366
|
+
|
|
23367
|
+
if (event && event.rightButton === true) {
|
|
23368
|
+
return;
|
|
23369
|
+
}
|
|
22686
23370
|
|
|
22687
23371
|
if (isInEditMode === false) {
|
|
22688
23372
|
return;
|
|
@@ -22708,11 +23392,14 @@
|
|
|
22708
23392
|
// eslint-disable-next-line consistent-return
|
|
22709
23393
|
|
|
22710
23394
|
|
|
22711
|
-
if (this.insertVertexInEdge(event) === false)
|
|
23395
|
+
if (this.insertVertexInEdge(event) === false) {
|
|
23396
|
+
return false;
|
|
23397
|
+
}
|
|
22712
23398
|
/* This is trigged when a new feature is created. */
|
|
22713
23399
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
22714
23400
|
// @ts-ignore
|
|
22715
23401
|
|
|
23402
|
+
|
|
22716
23403
|
if (this.createNewFeature(event) === false) {
|
|
22717
23404
|
/* Start with mouse move from this mouse down location, enables sizing the box while moving the mouse */
|
|
22718
23405
|
this.adagucMouseMove(event);
|
|
@@ -22721,13 +23408,22 @@
|
|
|
22721
23408
|
/* This is triggered when new points are added during the addmultipoint mode. One point is added per time */
|
|
22722
23409
|
|
|
22723
23410
|
|
|
22724
|
-
if (this.addPointToMultiPointFeature(event) === false)
|
|
23411
|
+
if (this.addPointToMultiPointFeature(event) === false) {
|
|
23412
|
+
return false;
|
|
23413
|
+
}
|
|
22725
23414
|
/* This is triggered when new points are added during the addpolygon mode. One point is added per time */
|
|
22726
23415
|
|
|
22727
|
-
|
|
23416
|
+
|
|
23417
|
+
if (this.addVerticesToPolygonFeature(event) === false) {
|
|
23418
|
+
return false;
|
|
23419
|
+
}
|
|
22728
23420
|
/* This is triggered when new points are added to a linestring */
|
|
22729
23421
|
|
|
22730
|
-
|
|
23422
|
+
|
|
23423
|
+
if (this.addPointToLineStringFeature(event) === false) {
|
|
23424
|
+
return false;
|
|
23425
|
+
}
|
|
23426
|
+
|
|
22731
23427
|
return false;
|
|
22732
23428
|
/* False means that this component will take over entire controll.
|
|
22733
23429
|
True means that it is still possible to pan and drag the map while editing */
|
|
@@ -22793,7 +23489,10 @@
|
|
|
22793
23489
|
var _a = this.props,
|
|
22794
23490
|
isInEditMode = _a.isInEditMode,
|
|
22795
23491
|
onClickFeature = _a.onClickFeature;
|
|
22796
|
-
|
|
23492
|
+
|
|
23493
|
+
if (event && event.rightButton === true) {
|
|
23494
|
+
return;
|
|
23495
|
+
}
|
|
22797
23496
|
|
|
22798
23497
|
if (onClickFeature) {
|
|
22799
23498
|
var mouseX = event.mouseX,
|
|
@@ -22933,17 +23632,33 @@
|
|
|
22933
23632
|
|
|
22934
23633
|
|
|
22935
23634
|
AdagucMapDraw.prototype.validateFeature = function (feature) {
|
|
22936
|
-
if (!feature.properties)
|
|
22937
|
-
|
|
22938
|
-
|
|
22939
|
-
|
|
23635
|
+
if (!feature.properties) {
|
|
23636
|
+
feature.properties = {};
|
|
23637
|
+
}
|
|
23638
|
+
|
|
23639
|
+
if (!feature.geometry) {
|
|
23640
|
+
feature.geometry = {};
|
|
23641
|
+
}
|
|
23642
|
+
|
|
23643
|
+
if (!feature.type) {
|
|
23644
|
+
feature.type = 'Feature';
|
|
23645
|
+
}
|
|
23646
|
+
|
|
23647
|
+
if (!feature.geometry.coordinates) {
|
|
23648
|
+
feature.geometry.coordinates = [];
|
|
23649
|
+
}
|
|
22940
23650
|
};
|
|
22941
23651
|
|
|
22942
23652
|
AdagucMapDraw.prototype.validatePolys = function (fixPolys) {
|
|
22943
|
-
if (!this.geojson || !this.geojson.features || !this.geojson.features.length)
|
|
23653
|
+
if (!this.geojson || !this.geojson.features || !this.geojson.features.length) {
|
|
23654
|
+
return;
|
|
23655
|
+
}
|
|
22944
23656
|
|
|
22945
23657
|
for (var featureIndex = 0; featureIndex < this.geojson.features.length; featureIndex += 1) {
|
|
22946
|
-
if (!this.geojson.features)
|
|
23658
|
+
if (!this.geojson.features) {
|
|
23659
|
+
this.geojson.features = [];
|
|
23660
|
+
}
|
|
23661
|
+
|
|
22947
23662
|
var feature = this.geojson.features[featureIndex];
|
|
22948
23663
|
this.validateFeature(feature);
|
|
22949
23664
|
var featureType = feature.geometry.type;
|
|
@@ -23024,7 +23739,11 @@
|
|
|
23024
23739
|
var _a = this.props,
|
|
23025
23740
|
featureNrToEdit = _a.featureNrToEdit,
|
|
23026
23741
|
isInEditMode = _a.isInEditMode;
|
|
23027
|
-
|
|
23742
|
+
|
|
23743
|
+
if (!this.geojson || !this.geojson.features || !this.geojson.features.length) {
|
|
23744
|
+
return;
|
|
23745
|
+
}
|
|
23746
|
+
|
|
23028
23747
|
this.textPositions = [];
|
|
23029
23748
|
this.mouseOverPolygonCoordinates = [];
|
|
23030
23749
|
this.mouseOverPolygonFeatureIndex = -1;
|
|
@@ -23494,12 +24213,23 @@
|
|
|
23494
24213
|
isInEditMode = _a.isInEditMode,
|
|
23495
24214
|
featureNrToEdit = _a.featureNrToEdit;
|
|
23496
24215
|
var feature = this.geojson.features[featureIndex];
|
|
23497
|
-
|
|
23498
|
-
if (feature.geometry
|
|
24216
|
+
|
|
24217
|
+
if (!feature || !feature.geometry) {
|
|
24218
|
+
return;
|
|
24219
|
+
}
|
|
24220
|
+
|
|
24221
|
+
if (feature.geometry.type !== 'LineString') {
|
|
24222
|
+
return;
|
|
24223
|
+
}
|
|
24224
|
+
|
|
23499
24225
|
var lineProps = feature.properties;
|
|
23500
|
-
|
|
24226
|
+
|
|
24227
|
+
if (!lineProps) {
|
|
24228
|
+
lineProps = this.defaultLineStringProps;
|
|
24229
|
+
}
|
|
23501
24230
|
/* Draw polygons and calculate center of poly */
|
|
23502
24231
|
|
|
24232
|
+
|
|
23503
24233
|
var middle = {
|
|
23504
24234
|
x: 0,
|
|
23505
24235
|
y: 0,
|
|
@@ -23569,12 +24299,23 @@
|
|
|
23569
24299
|
isInEditMode = _a.isInEditMode,
|
|
23570
24300
|
featureNrToEdit = _a.featureNrToEdit;
|
|
23571
24301
|
var feature = this.geojson.features[featureIndex];
|
|
23572
|
-
|
|
23573
|
-
if (feature
|
|
24302
|
+
|
|
24303
|
+
if (!feature || !feature.geometry) {
|
|
24304
|
+
return;
|
|
24305
|
+
}
|
|
24306
|
+
|
|
24307
|
+
if (feature.geometry.type !== 'Polygon' && feature.geometry.type !== 'MultiPolygon') {
|
|
24308
|
+
return;
|
|
24309
|
+
}
|
|
24310
|
+
|
|
23574
24311
|
var polyProps = feature.properties;
|
|
23575
|
-
|
|
24312
|
+
|
|
24313
|
+
if (!polyProps) {
|
|
24314
|
+
polyProps = this.defaultPolyProps;
|
|
24315
|
+
}
|
|
23576
24316
|
/* Draw polygons and calculate center of poly */
|
|
23577
24317
|
|
|
24318
|
+
|
|
23578
24319
|
var middle = {
|
|
23579
24320
|
x: 0,
|
|
23580
24321
|
y: 0,
|
|
@@ -23647,8 +24388,11 @@
|
|
|
23647
24388
|
var XYCoords = [];
|
|
23648
24389
|
|
|
23649
24390
|
for (var j = 0; j < featureCoords.length; j += 1) {
|
|
23650
|
-
|
|
23651
|
-
|
|
24391
|
+
if (featureCoords[j].length < 2) {
|
|
24392
|
+
// eslint-disable-next-line no-continue
|
|
24393
|
+
continue;
|
|
24394
|
+
}
|
|
24395
|
+
|
|
23652
24396
|
var coord = webmapjs.getPixelCoordFromLatLong({
|
|
23653
24397
|
x: featureCoords[j][0],
|
|
23654
24398
|
y: featureCoords[j][1]
|
|
@@ -23680,7 +24424,10 @@
|
|
|
23680
24424
|
} else {
|
|
23681
24425
|
this.validateFeature(feature); // eslint-disable-next-line no-underscore-dangle
|
|
23682
24426
|
|
|
23683
|
-
if (feature.properties._adaguctype)
|
|
24427
|
+
if (feature.properties._adaguctype) {
|
|
24428
|
+
delete feature.properties._adaguctype;
|
|
24429
|
+
} // eslint-disable-next-line default-case
|
|
24430
|
+
|
|
23684
24431
|
|
|
23685
24432
|
switch (type) {
|
|
23686
24433
|
case DRAWMODE.POINT:
|
|
@@ -23689,8 +24436,12 @@
|
|
|
23689
24436
|
|
|
23690
24437
|
case DRAWMODE.MULTIPOINT:
|
|
23691
24438
|
feature.geometry.type = 'MultiPoint';
|
|
23692
|
-
|
|
24439
|
+
|
|
24440
|
+
if (feature.geometry.coordinates.length === 0) {
|
|
24441
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23693
24442
|
feature.geometry.coordinates.push([]);
|
|
24443
|
+
}
|
|
24444
|
+
|
|
23694
24445
|
break;
|
|
23695
24446
|
|
|
23696
24447
|
case DRAWMODE.BOX:
|
|
@@ -23701,14 +24452,22 @@
|
|
|
23701
24452
|
|
|
23702
24453
|
case DRAWMODE.POLYGON:
|
|
23703
24454
|
feature.geometry.type = 'Polygon';
|
|
23704
|
-
|
|
24455
|
+
|
|
24456
|
+
if (feature.geometry.coordinates.length === 0) {
|
|
24457
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23705
24458
|
feature.geometry.coordinates.push([]);
|
|
24459
|
+
}
|
|
24460
|
+
|
|
23706
24461
|
break;
|
|
23707
24462
|
|
|
23708
24463
|
case DRAWMODE.LINESTRING:
|
|
23709
24464
|
feature.geometry.type = 'LineString';
|
|
23710
|
-
|
|
24465
|
+
|
|
24466
|
+
if (feature.geometry.coordinates.length === 0) {
|
|
24467
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23711
24468
|
feature.geometry.coordinates.push([]);
|
|
24469
|
+
}
|
|
24470
|
+
|
|
23712
24471
|
break;
|
|
23713
24472
|
}
|
|
23714
24473
|
}
|
|
@@ -23718,7 +24477,10 @@
|
|
|
23718
24477
|
|
|
23719
24478
|
|
|
23720
24479
|
AdagucMapDraw.prototype.checkIfFeatureIsBox = function (feature) {
|
|
23721
|
-
if (!feature || !feature.properties || !feature.properties._adaguctype)
|
|
24480
|
+
if (!feature || !feature.properties || !feature.properties._adaguctype) {
|
|
24481
|
+
return false;
|
|
24482
|
+
}
|
|
24483
|
+
|
|
23722
24484
|
return feature.properties._adaguctype === 'box';
|
|
23723
24485
|
};
|
|
23724
24486
|
|
|
@@ -23846,7 +24608,9 @@
|
|
|
23846
24608
|
}
|
|
23847
24609
|
},
|
|
23848
24610
|
exitDrawModeCallback: function exitDrawModeCallback() {
|
|
23849
|
-
if (layer.exitDrawModeCallback)
|
|
24611
|
+
if (layer.exitDrawModeCallback) {
|
|
24612
|
+
layer.exitDrawModeCallback();
|
|
24613
|
+
}
|
|
23850
24614
|
},
|
|
23851
24615
|
featureNrToEdit: parseInt(layer.featureNrToEdit || '0', 10)
|
|
23852
24616
|
}));
|
|
@@ -23908,24 +24672,31 @@
|
|
|
23908
24672
|
var wmjsMap = getWMJSMapById(mapId);
|
|
23909
24673
|
/* Some safety checks */
|
|
23910
24674
|
|
|
23911
|
-
if (!wmjsMap || !wmLayers || !reactLayerId || !layerName)
|
|
23912
|
-
|
|
23913
|
-
|
|
23914
|
-
|
|
24675
|
+
if (!wmjsMap || !wmLayers || !reactLayerId || !layerName) {
|
|
24676
|
+
return {
|
|
24677
|
+
layer: null,
|
|
24678
|
+
layerArrayMutated: false
|
|
24679
|
+
};
|
|
24680
|
+
}
|
|
23915
24681
|
/* Find the wmlayer by its react layer id */
|
|
23916
24682
|
|
|
24683
|
+
|
|
23917
24684
|
var matchingLayerIndex = wmLayers.findIndex(function (wmLayer) {
|
|
23918
24685
|
return wmLayer.id === reactLayerId;
|
|
23919
24686
|
});
|
|
23920
|
-
|
|
23921
|
-
|
|
23922
|
-
|
|
23923
|
-
|
|
24687
|
+
|
|
24688
|
+
if (matchingLayerIndex === -1) {
|
|
24689
|
+
return {
|
|
24690
|
+
layer: null,
|
|
24691
|
+
layerArrayMutated: false
|
|
24692
|
+
};
|
|
24693
|
+
}
|
|
23924
24694
|
/*
|
|
23925
24695
|
The layer order in the react children array index is
|
|
23926
24696
|
reversed compared to the layer order in the wmLayer array index
|
|
23927
24697
|
*/
|
|
23928
24698
|
|
|
24699
|
+
|
|
23929
24700
|
var reactLayerIndex = wmLayers.length - 1 - wmLayerIndex;
|
|
23930
24701
|
var isMapLayer = isAMapLayer(reactWebMapJSLayer.props);
|
|
23931
24702
|
var mapLayerArrayShouldBeMutated = isMapLayer && matchingLayerIndex !== reactLayerIndex;
|
|
@@ -24120,7 +24891,11 @@
|
|
|
24120
24891
|
mapId = _a.mapId,
|
|
24121
24892
|
onMapZoomEnd = _a.onMapZoomEnd;
|
|
24122
24893
|
var wmjsMap = getWMJSMapById(mapId);
|
|
24123
|
-
|
|
24894
|
+
|
|
24895
|
+
if (!wmjsMap) {
|
|
24896
|
+
return;
|
|
24897
|
+
}
|
|
24898
|
+
|
|
24124
24899
|
var projectionInfo = wmjsMap.getProjection();
|
|
24125
24900
|
/* Trigger onMapZoomEnd callback */
|
|
24126
24901
|
|
|
@@ -25286,7 +26061,7 @@
|
|
|
25286
26061
|
onLayerError: function onLayerError(_, error) {
|
|
25287
26062
|
layerError({
|
|
25288
26063
|
layerId: layer.id,
|
|
25289
|
-
error: error
|
|
26064
|
+
error: "" + error
|
|
25290
26065
|
});
|
|
25291
26066
|
}
|
|
25292
26067
|
}, layer));
|
|
@@ -25297,7 +26072,7 @@
|
|
|
25297
26072
|
onLayerError: function onLayerError(_, error) {
|
|
25298
26073
|
layerError({
|
|
25299
26074
|
layerId: layer.id,
|
|
25300
|
-
error: error
|
|
26075
|
+
error: "" + error
|
|
25301
26076
|
});
|
|
25302
26077
|
},
|
|
25303
26078
|
onClickFeature: layer.geojson ? function (event) {
|
|
@@ -25314,7 +26089,7 @@
|
|
|
25314
26089
|
onLayerError: function onLayerError(_, error) {
|
|
25315
26090
|
layerError({
|
|
25316
26091
|
layerId: layer.id,
|
|
25317
|
-
error: error
|
|
26092
|
+
error: "" + error
|
|
25318
26093
|
});
|
|
25319
26094
|
}
|
|
25320
26095
|
}, layer));
|
|
@@ -25907,7 +26682,11 @@
|
|
|
25907
26682
|
|
|
25908
26683
|
var getLayersToUpdate = function getLayersToUpdate(layers, mapId) {
|
|
25909
26684
|
var wmjsMap = getWMJSMapById(mapId);
|
|
25910
|
-
|
|
26685
|
+
|
|
26686
|
+
if (!wmjsMap || !layers || layers.length === 0) {
|
|
26687
|
+
return [];
|
|
26688
|
+
}
|
|
26689
|
+
|
|
25911
26690
|
return layers.filter(function (layer) {
|
|
25912
26691
|
return layer && layer.enabled && !!getWMLayerById(layer.id);
|
|
25913
26692
|
}).map(function (layer) {
|
|
@@ -26101,7 +26880,11 @@
|
|
|
26101
26880
|
title = layer.title,
|
|
26102
26881
|
url = layer.url;
|
|
26103
26882
|
var result = gfiResultMap.get(layerId);
|
|
26104
|
-
|
|
26883
|
+
|
|
26884
|
+
if (!result) {
|
|
26885
|
+
return null;
|
|
26886
|
+
}
|
|
26887
|
+
|
|
26105
26888
|
return /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
26106
26889
|
key: layerId,
|
|
26107
26890
|
sx: {
|
|
@@ -26318,38 +27101,40 @@
|
|
|
26318
27101
|
title = _a.title,
|
|
26319
27102
|
_b = _a.layers,
|
|
26320
27103
|
layers = _b === void 0 ? [] : _b,
|
|
26321
|
-
_c = _a.
|
|
26322
|
-
|
|
26323
|
-
_d = _a.
|
|
26324
|
-
|
|
26325
|
-
_e = _a.
|
|
26326
|
-
|
|
26327
|
-
_f = _a.
|
|
26328
|
-
|
|
26329
|
-
_g = _a.
|
|
26330
|
-
|
|
26331
|
-
_h = _a.
|
|
26332
|
-
|
|
26333
|
-
_j = _a.
|
|
26334
|
-
|
|
26335
|
-
_k = _a.
|
|
26336
|
-
|
|
26337
|
-
_l = _a.
|
|
26338
|
-
|
|
26339
|
-
_m = _a.
|
|
26340
|
-
|
|
26341
|
-
_o = _a.
|
|
26342
|
-
|
|
26343
|
-
_p = _a.
|
|
26344
|
-
|
|
27104
|
+
_c = _a.dimensions,
|
|
27105
|
+
dimensions = _c === void 0 ? [] : _c,
|
|
27106
|
+
_d = _a.shouldAutoUpdate,
|
|
27107
|
+
shouldAutoUpdate = _d === void 0 ? false : _d,
|
|
27108
|
+
_e = _a.shouldAnimate,
|
|
27109
|
+
shouldAnimate = _e === void 0 ? false : _e,
|
|
27110
|
+
_f = _a.bbox,
|
|
27111
|
+
bbox = _f === void 0 ? defaultBbox.bbox : _f,
|
|
27112
|
+
_g = _a.srs,
|
|
27113
|
+
srs = _g === void 0 ? defaultBbox.srs : _g,
|
|
27114
|
+
_h = _a.shouldShowZoomControls,
|
|
27115
|
+
shouldShowZoomControls = _h === void 0 ? true : _h,
|
|
27116
|
+
_j = _a.displayMapPin,
|
|
27117
|
+
displayMapPin = _j === void 0 ? false : _j,
|
|
27118
|
+
_k = _a.showTimeSlider,
|
|
27119
|
+
showTimeSlider = _k === void 0 ? true : _k,
|
|
27120
|
+
_l = _a.disableTimeSlider,
|
|
27121
|
+
disableTimeSlider = _l === void 0 ? false : _l,
|
|
27122
|
+
_m = _a.displayTimeInMap,
|
|
27123
|
+
displayTimeInMap = _m === void 0 ? false : _m,
|
|
27124
|
+
_o = _a.displayLayerManagerAndLegendButtonInMap,
|
|
27125
|
+
displayLayerManagerAndLegendButtonInMap = _o === void 0 ? true : _o,
|
|
27126
|
+
_p = _a.displayDimensionSelectButtonInMap,
|
|
27127
|
+
displayDimensionSelectButtonInMap = _p === void 0 ? true : _p,
|
|
27128
|
+
_q = _a.multiLegend,
|
|
27129
|
+
multiLegend = _q === void 0 ? true : _q,
|
|
26345
27130
|
shouldShowLayerManager = _a.shouldShowLayerManager,
|
|
26346
27131
|
shouldShowDockedLayerManager = _a.shouldShowDockedLayerManager,
|
|
26347
|
-
|
|
26348
|
-
showClock =
|
|
26349
|
-
|
|
26350
|
-
displayGetFeatureInfoButtonInMap =
|
|
27132
|
+
_r = _a.showClock,
|
|
27133
|
+
showClock = _r === void 0 ? true : _r,
|
|
27134
|
+
_s = _a.displayGetFeatureInfoButtonInMap,
|
|
27135
|
+
displayGetFeatureInfoButtonInMap = _s === void 0 ? false : _s,
|
|
26351
27136
|
children = _a.children,
|
|
26352
|
-
props = __rest(_a, ["id", "dockedLayerManagerSize", "title", "layers", "shouldAutoUpdate", "shouldAnimate", "bbox", "srs", "shouldShowZoomControls", "displayMapPin", "showTimeSlider", "disableTimeSlider", "displayTimeInMap", "displayLayerManagerAndLegendButtonInMap", "displayDimensionSelectButtonInMap", "multiLegend", "shouldShowLayerManager", "shouldShowDockedLayerManager", "showClock", "displayGetFeatureInfoButtonInMap", "children"]);
|
|
27137
|
+
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"]);
|
|
26353
27138
|
|
|
26354
27139
|
var dispatch = reactRedux.useDispatch();
|
|
26355
27140
|
var mapId = React__default["default"].useRef(id || generateMapId()).current;
|
|
@@ -26367,6 +27152,7 @@
|
|
|
26367
27152
|
bbox: bbox,
|
|
26368
27153
|
srs: srs
|
|
26369
27154
|
},
|
|
27155
|
+
dimensions: dimensions,
|
|
26370
27156
|
shouldAutoUpdate: shouldAutoUpdate,
|
|
26371
27157
|
shouldAnimate: shouldAnimate,
|
|
26372
27158
|
shouldShowZoomControls: shouldShowZoomControls,
|
|
@@ -26406,6 +27192,7 @@
|
|
|
26406
27192
|
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
26407
27193
|
|
|
26408
27194
|
}, []);
|
|
27195
|
+
var mapControlsPositionTop = title ? 24 : 8;
|
|
26409
27196
|
return /*#__PURE__*/React__default["default"].createElement(material.Box, {
|
|
26410
27197
|
sx: {
|
|
26411
27198
|
width: '100%',
|
|
@@ -26414,13 +27201,13 @@
|
|
|
26414
27201
|
overflow: 'hidden'
|
|
26415
27202
|
},
|
|
26416
27203
|
"data-testid": "ConfigurableMap"
|
|
26417
|
-
}, /*#__PURE__*/React__default["default"].createElement(material.Typography, {
|
|
27204
|
+
}, title && /*#__PURE__*/React__default["default"].createElement(material.Typography, {
|
|
26418
27205
|
"data-testid": "mapTitle",
|
|
26419
27206
|
sx: titleStyle
|
|
26420
|
-
}, title
|
|
27207
|
+
}, title), /*#__PURE__*/React__default["default"].createElement(MapControls, {
|
|
26421
27208
|
"data-testid": "mapControls",
|
|
26422
27209
|
style: {
|
|
26423
|
-
top:
|
|
27210
|
+
top: mapControlsPositionTop
|
|
26424
27211
|
}
|
|
26425
27212
|
}, /*#__PURE__*/React__default["default"].createElement(ZoomControlConnect, {
|
|
26426
27213
|
mapId: id
|
|
@@ -26513,7 +27300,8 @@
|
|
|
26513
27300
|
syncGroupAddTarget({
|
|
26514
27301
|
groupId: syncGroupsId,
|
|
26515
27302
|
targetId: map.id,
|
|
26516
|
-
linked: true
|
|
27303
|
+
linked: true,
|
|
27304
|
+
origin: 'system'
|
|
26517
27305
|
});
|
|
26518
27306
|
});
|
|
26519
27307
|
});
|
|
@@ -26554,12 +27342,14 @@
|
|
|
26554
27342
|
style: mapStyle,
|
|
26555
27343
|
sx: mapBoxStyle
|
|
26556
27344
|
}, /*#__PURE__*/React__default["default"].createElement(ConfigurableMapConnect, {
|
|
26557
|
-
title: map.title,
|
|
27345
|
+
title: map.title || mapId,
|
|
26558
27346
|
id: mapId,
|
|
26559
27347
|
layers: map.layers || [],
|
|
26560
|
-
|
|
27348
|
+
autoTimeStepLayerId: map.autoTimeStepLayerId,
|
|
27349
|
+
autoUpdateLayerId: map.autoUpdateLayerId,
|
|
26561
27350
|
bbox: map.bbox,
|
|
26562
27351
|
srs: map.srs,
|
|
27352
|
+
dimensions: map.dimensions || [],
|
|
26563
27353
|
displayTimeInMap: map.displayTimeInMap || false,
|
|
26564
27354
|
displayLayerManagerAndLegendButtonInMap: map.displayLayerManagerAndLegendButtonInMap,
|
|
26565
27355
|
displayDimensionSelectButtonInMap: map.displayDimensionSelectButtonInMap,
|
|
@@ -26616,9 +27406,13 @@
|
|
|
26616
27406
|
var syncGroupState = reactRedux.useSelector(function (store) {
|
|
26617
27407
|
return getSynchronizationGroupState(store);
|
|
26618
27408
|
});
|
|
26619
|
-
|
|
27409
|
+
|
|
27410
|
+
if (!syncGroupState) {
|
|
27411
|
+
return false;
|
|
27412
|
+
}
|
|
26620
27413
|
/* Return all syncgroups configured for this component of type SYNCGROUPS_TYPE_SETLAYERACTIONS */
|
|
26621
27414
|
|
|
27415
|
+
|
|
26622
27416
|
var syncGroupsWithLayerActions = syncGroupState.groups.allIds.filter(function (syncGroupId) {
|
|
26623
27417
|
return syncGroupsIds && syncGroupsIds.includes(syncGroupId) && syncGroupState.groups.byId[syncGroupId].type === 'SYNCGROUPS_TYPE_SETLAYERACTIONS';
|
|
26624
27418
|
});
|
|
@@ -26673,9 +27467,13 @@
|
|
|
26673
27467
|
/* Get latest reference time for this layer */
|
|
26674
27468
|
|
|
26675
27469
|
var latestReferenceTime = useGetLatestReferenceTime(layers[0]);
|
|
26676
|
-
|
|
27470
|
+
|
|
27471
|
+
if (latestReferenceTime === '') {
|
|
27472
|
+
return /*#__PURE__*/React__namespace.createElement("div", null, "Loading...");
|
|
27473
|
+
}
|
|
26677
27474
|
/* Calculate the last time increment based on 15 maps */
|
|
26678
27475
|
|
|
27476
|
+
|
|
26679
27477
|
var lastTimeIncrement = startTimeIncrement + 15 * interval;
|
|
26680
27478
|
/* Make the preset */
|
|
26681
27479
|
|
|
@@ -26747,9 +27545,13 @@
|
|
|
26747
27545
|
/* Get all the reference times for this layer */
|
|
26748
27546
|
|
|
26749
27547
|
var referenceTimes = useGetReferenceTimes(layers.topRow);
|
|
26750
|
-
|
|
27548
|
+
|
|
27549
|
+
if (referenceTimes.length === 0) {
|
|
27550
|
+
return /*#__PURE__*/React__namespace.createElement("div", null, "Loading...");
|
|
27551
|
+
}
|
|
26751
27552
|
/* Helper to make a map layer prest */
|
|
26752
27553
|
|
|
27554
|
+
|
|
26753
27555
|
var makeMapPreset = function makeMapPreset(referenceTime, uniqueId, layer, syncGroupsIds, col) {
|
|
26754
27556
|
return {
|
|
26755
27557
|
id: uniqueId,
|
|
@@ -26838,7 +27640,11 @@
|
|
|
26838
27640
|
mapPreset_1 = _b.mapPreset,
|
|
26839
27641
|
shouldShowZoomControls = _b.shouldShowZoomControls,
|
|
26840
27642
|
syncGroupsIds_1 = _b.syncGroupsIds;
|
|
26841
|
-
|
|
27643
|
+
|
|
27644
|
+
if (!mapPreset_1 || mapPreset_1.length === 0) {
|
|
27645
|
+
return null;
|
|
27646
|
+
}
|
|
27647
|
+
|
|
26842
27648
|
return /*#__PURE__*/React__default["default"].createElement(MultiMapViewConnect, {
|
|
26843
27649
|
rows: 2,
|
|
26844
27650
|
cols: 2,
|
|
@@ -26846,11 +27652,15 @@
|
|
|
26846
27652
|
maps: mapPreset_1.map(function (preset, index) {
|
|
26847
27653
|
var _a, _b, _c, _d;
|
|
26848
27654
|
|
|
27655
|
+
var layers = preset.layers,
|
|
27656
|
+
autoUpdateLayerId = preset.autoUpdateLayerId,
|
|
27657
|
+
autoTimeStepLayerId = preset.autoTimeStepLayerId;
|
|
26849
27658
|
return {
|
|
26850
27659
|
id: id + "_" + index,
|
|
26851
27660
|
syncGroupsIds: syncGroupsIds_1,
|
|
26852
|
-
layers:
|
|
26853
|
-
|
|
27661
|
+
layers: layers,
|
|
27662
|
+
autoUpdateLayerId: autoUpdateLayerId,
|
|
27663
|
+
autoTimeStepLayerId: autoTimeStepLayerId,
|
|
26854
27664
|
bbox: (_b = (_a = mapPreset_1[0]) === null || _a === void 0 ? void 0 : _a.proj) === null || _b === void 0 ? void 0 : _b.bbox,
|
|
26855
27665
|
srs: (_d = (_c = mapPreset_1[0]) === null || _c === void 0 ? void 0 : _c.proj) === null || _d === void 0 ? void 0 : _d.srs
|
|
26856
27666
|
};
|
|
@@ -27845,6 +28655,7 @@
|
|
|
27845
28655
|
exports.generateLayerId = generateLayerId;
|
|
27846
28656
|
exports.generateMapId = generateMapId;
|
|
27847
28657
|
exports.generateTimesliderId = generateTimesliderId;
|
|
28658
|
+
exports.genericSelectors = selectors$1;
|
|
27848
28659
|
exports.getDrawFunctionFromStore = getDrawFunctionFromStore;
|
|
27849
28660
|
exports.getFirstTimeStepForLayerId = getFirstTimeStepForLayerId;
|
|
27850
28661
|
exports.getInitialAppPresets = getInitialAppPresets;
|
|
@@ -27857,7 +28668,7 @@
|
|
|
27857
28668
|
exports.getWMLayerById = getWMLayerById;
|
|
27858
28669
|
exports.layerActions = layerActions;
|
|
27859
28670
|
exports.layerReducer = reducer$8;
|
|
27860
|
-
exports.layerSelectors = selectors$
|
|
28671
|
+
exports.layerSelectors = selectors$3;
|
|
27861
28672
|
exports.layerTypes = types$3;
|
|
27862
28673
|
exports.mapActions = mapActions;
|
|
27863
28674
|
exports.mapModuleConfig = moduleConfig;
|
|
@@ -27881,7 +28692,7 @@
|
|
|
27881
28692
|
exports.timeSliderUtils = timeSliderUtils;
|
|
27882
28693
|
exports.uiActions = uiActions;
|
|
27883
28694
|
exports.uiModuleConfig = uiModuleConfig;
|
|
27884
|
-
exports.uiSelectors = selectors$
|
|
28695
|
+
exports.uiSelectors = selectors$2;
|
|
27885
28696
|
exports.uiTypes = types;
|
|
27886
28697
|
exports.unRegisterWMJSLayer = unRegisterWMJSLayer;
|
|
27887
28698
|
exports.unRegisterWMJSMap = unRegisterWMJSMap;
|