@opengeoweb/core 4.17.0 → 4.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.esm.js +1425 -778
- package/index.umd.js +1410 -722
- package/lib/components/ConfigurableMap/ConfigurableMapConnect.d.ts +4 -2
- package/lib/components/LayerManager/LayerManager.custom.stories.d.ts +6 -0
- package/lib/components/LayerManager/LayerManager.d.ts +1 -0
- package/lib/components/LayerManager/LayerManagerHeaderOptions.d.ts +1 -0
- package/lib/components/LayerManager/LayerManagerHeaderOptionsConnect.d.ts +11 -0
- package/lib/components/LayerManager/LayerManagerHeaderOptionsConnect.spec.d.ts +1 -0
- package/lib/components/LayerManager/useFetchServices.d.ts +2 -0
- package/lib/components/MultiMapView/MultiMapViewConnect.d.ts +4 -2
- package/lib/components/SyncGroups/utils.d.ts +6 -4
- package/lib/hooks/useSetupDialog/useSetupDialog.d.ts +1 -0
- package/lib/index.d.ts +4 -3
- package/lib/store/generic/sagas.d.ts +1 -1
- package/lib/store/generic/synchronizationGroups/types.d.ts +1 -0
- package/lib/store/generic/types.d.ts +2 -2
- package/lib/store/layerSelect/reducer.d.ts +2 -3
- package/lib/store/layerSelect/sagas.d.ts +1 -2
- package/lib/store/layerSelect/types.d.ts +0 -10
- package/lib/store/mapStore/layers/selectors.d.ts +3 -3
- package/lib/store/mapStore/layers/types.d.ts +2 -1
- package/lib/store/mapStore/map/reducer.d.ts +3 -3
- package/lib/store/mapStore/map/selectors.d.ts +73 -35
- package/lib/store/mapStore/map/types.d.ts +9 -3
- package/lib/store/mapStore/map/utils.d.ts +4 -3
- package/lib/store/mapStore/service/reducer.d.ts +2 -1
- package/lib/store/mapStore/service/sagas.d.ts +7 -0
- package/lib/store/mapStore/service/sagas.spec.d.ts +1 -0
- package/lib/store/mapStore/service/types.d.ts +10 -0
- package/lib/store/ui/reducer.d.ts +3 -1
- package/lib/store/ui/selectors.d.ts +12 -0
- package/lib/store/ui/types.d.ts +5 -0
- package/lib/storybookUtils/defaultStorySettings.d.ts +0 -1
- package/package.json +6 -6
package/index.umd.js
CHANGED
|
@@ -429,7 +429,11 @@
|
|
|
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
|
|
|
435
439
|
if (currentIndex < 0 || currentIndex - 1 < 0) {
|
|
@@ -465,7 +469,11 @@
|
|
|
465
469
|
|
|
466
470
|
var getFirstTimeStepForLayerId = function getFirstTimeStepForLayerId(layerId) {
|
|
467
471
|
var wmjsTimeDim = getWMJSTimeDimensionForLayerId(layerId);
|
|
468
|
-
|
|
472
|
+
|
|
473
|
+
if (!wmjsTimeDim) {
|
|
474
|
+
return null;
|
|
475
|
+
}
|
|
476
|
+
|
|
469
477
|
return wmjsTimeDim.getFirstValue();
|
|
470
478
|
};
|
|
471
479
|
/**
|
|
@@ -475,7 +483,11 @@
|
|
|
475
483
|
|
|
476
484
|
var getLastTimeStepForLayerId = function getLastTimeStepForLayerId(layerId) {
|
|
477
485
|
var wmjsTimeDim = getWMJSTimeDimensionForLayerId(layerId);
|
|
478
|
-
|
|
486
|
+
|
|
487
|
+
if (!wmjsTimeDim) {
|
|
488
|
+
return null;
|
|
489
|
+
}
|
|
490
|
+
|
|
479
491
|
return wmjsTimeDim.getLastValue();
|
|
480
492
|
};
|
|
481
493
|
|
|
@@ -979,32 +991,32 @@
|
|
|
979
991
|
featureLayers = _m === void 0 ? [] : _m,
|
|
980
992
|
_o = _a.dimensions,
|
|
981
993
|
dimensions = _o === void 0 ? [] : _o,
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
timeSliderScale =
|
|
986
|
-
|
|
987
|
-
timeStep =
|
|
988
|
-
|
|
989
|
-
animationDelay =
|
|
990
|
-
|
|
991
|
-
timeSliderCenterTime =
|
|
992
|
-
|
|
993
|
-
timeSliderSecondsPerPx =
|
|
994
|
-
|
|
995
|
-
timeSliderDataScaleToSecondsPerPx =
|
|
996
|
-
|
|
997
|
-
isTimestepAuto =
|
|
998
|
-
|
|
999
|
-
isTimeSliderHoverOn =
|
|
1000
|
-
|
|
1001
|
-
isTimeSliderVisible =
|
|
1002
|
-
|
|
1003
|
-
displayMapPin =
|
|
1004
|
-
|
|
1005
|
-
disableMapPin =
|
|
1006
|
-
|
|
1007
|
-
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;
|
|
1008
1020
|
return {
|
|
1009
1021
|
id: id,
|
|
1010
1022
|
isAnimating: isAnimating,
|
|
@@ -1019,7 +1031,8 @@
|
|
|
1019
1031
|
mapLayers: mapLayers,
|
|
1020
1032
|
featureLayers: featureLayers,
|
|
1021
1033
|
dimensions: dimensions,
|
|
1022
|
-
|
|
1034
|
+
autoUpdateLayerId: autoUpdateLayerId,
|
|
1035
|
+
autoTimeStepLayerId: autoTimeStepLayerId,
|
|
1023
1036
|
timeSliderScale: timeSliderScale,
|
|
1024
1037
|
timeStep: timeStep,
|
|
1025
1038
|
animationDelay: animationDelay,
|
|
@@ -1066,7 +1079,10 @@
|
|
|
1066
1079
|
|
|
1067
1080
|
var getDraftMapById = function getDraftMapById(mapId, draft) {
|
|
1068
1081
|
var map = draft.byId[mapId];
|
|
1069
|
-
|
|
1082
|
+
|
|
1083
|
+
if (map) {
|
|
1084
|
+
return map;
|
|
1085
|
+
}
|
|
1070
1086
|
|
|
1071
1087
|
if (!draft.allIds.includes(mapId)) {
|
|
1072
1088
|
draft.byId[mapId] = createMap({
|
|
@@ -1091,7 +1107,10 @@
|
|
|
1091
1107
|
var map = getDraftMapById(mapId, draft);
|
|
1092
1108
|
|
|
1093
1109
|
if (dimensionFromAction) {
|
|
1094
|
-
if (!map.dimensions)
|
|
1110
|
+
if (!map.dimensions) {
|
|
1111
|
+
map.dimensions = [];
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1095
1114
|
var dimensions = map.dimensions;
|
|
1096
1115
|
var mapDim = dimensions.find(function (dim) {
|
|
1097
1116
|
return dim.name === dimensionFromAction.name;
|
|
@@ -1116,6 +1135,10 @@
|
|
|
1116
1135
|
*/
|
|
1117
1136
|
|
|
1118
1137
|
var findMapIdFromLayerId = function findMapIdFromLayerId(draft, layerId) {
|
|
1138
|
+
if (!draft || !layerId) {
|
|
1139
|
+
return null;
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1119
1142
|
for (var i = 0; i < draft.allIds.length; i += 1) {
|
|
1120
1143
|
var mapId = draft.allIds[i];
|
|
1121
1144
|
var layerIds = draft.byId[mapId].mapLayers;
|
|
@@ -1247,7 +1270,10 @@
|
|
|
1247
1270
|
*/
|
|
1248
1271
|
|
|
1249
1272
|
var produceLayerDimensionDraftState = function produceLayerDimensionDraftState(draft, layerId, dimensionValueToUpdate) {
|
|
1250
|
-
if (!draft.byId[layerId].dimensions)
|
|
1273
|
+
if (!draft.byId[layerId].dimensions) {
|
|
1274
|
+
draft.byId[layerId].dimensions = [];
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1251
1277
|
var existingLayerDimIndex = draft.byId[layerId].dimensions.findIndex(function (layerDim) {
|
|
1252
1278
|
return layerDim.name === dimensionValueToUpdate.name;
|
|
1253
1279
|
});
|
|
@@ -1270,13 +1296,24 @@
|
|
|
1270
1296
|
};
|
|
1271
1297
|
|
|
1272
1298
|
var isActionLayerSynced = function isActionLayerSynced(state, layerIdFromAction, dimension) {
|
|
1273
|
-
if (dimension.synced !== undefined)
|
|
1299
|
+
if (dimension.synced !== undefined) {
|
|
1300
|
+
return dimension.synced;
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1274
1303
|
var actionLayer = state.byId[layerIdFromAction];
|
|
1275
|
-
|
|
1304
|
+
|
|
1305
|
+
if (!actionLayer) {
|
|
1306
|
+
return false;
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1276
1309
|
var layerDimensionIndex = actionLayer.dimensions.findIndex(function (layerDim) {
|
|
1277
1310
|
return layerDim.name === dimension.name;
|
|
1278
1311
|
});
|
|
1279
|
-
|
|
1312
|
+
|
|
1313
|
+
if (layerDimensionIndex < 0) {
|
|
1314
|
+
return false;
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1280
1317
|
return actionLayer.dimensions[layerDimensionIndex].synced === true;
|
|
1281
1318
|
};
|
|
1282
1319
|
var produceDimensionActionForMapLayer = function produceDimensionActionForMapLayer(layerDim, wmjsDimension, newDimension) {
|
|
@@ -1308,7 +1345,10 @@
|
|
|
1308
1345
|
var produceDraftStateForAllLayersForDimensionWithinMap = function produceDraftStateForAllLayersForDimensionWithinMap(draft, dimension, mapId, layerIdFromAction
|
|
1309
1346
|
/* Layer ID or null if not known */
|
|
1310
1347
|
) {
|
|
1311
|
-
if (!mapId)
|
|
1348
|
+
if (!mapId) {
|
|
1349
|
+
return;
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1312
1352
|
var actionLayerSynced = isActionLayerSynced(draft, layerIdFromAction, dimension);
|
|
1313
1353
|
|
|
1314
1354
|
for (var li = 0; li < draft.allIds.length; li += 1) {
|
|
@@ -1561,7 +1601,11 @@
|
|
|
1561
1601
|
layerIdFromAction = _a.layerId,
|
|
1562
1602
|
dimension = _a.dimension;
|
|
1563
1603
|
var layerFromAction = draft.byId[layerIdFromAction];
|
|
1564
|
-
|
|
1604
|
+
|
|
1605
|
+
if (!layerFromAction) {
|
|
1606
|
+
return;
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1565
1609
|
var mapId = layerFromAction.mapId;
|
|
1566
1610
|
produceDraftStateForAllLayersForDimensionWithinMap(draft, dimension, mapId, layerIdFromAction);
|
|
1567
1611
|
},
|
|
@@ -1784,7 +1828,10 @@
|
|
|
1784
1828
|
}); // add new available baselayers
|
|
1785
1829
|
|
|
1786
1830
|
layers.forEach(function (layer) {
|
|
1787
|
-
if (layer.layerType !== LayerType.baseLayer || !layer.mapId)
|
|
1831
|
+
if (layer.layerType !== LayerType.baseLayer || !layer.mapId) {
|
|
1832
|
+
return;
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1788
1835
|
draft.availableBaseLayers.byId[layer.id] = createLayer(__assign({}, layer));
|
|
1789
1836
|
draft.availableBaseLayers.allIds.push(layer.id);
|
|
1790
1837
|
});
|
|
@@ -1903,7 +1950,10 @@
|
|
|
1903
1950
|
serviceSetLayers: function serviceSetLayers(draft, action) {
|
|
1904
1951
|
var id = action.payload.id;
|
|
1905
1952
|
draft.byId[id] = __assign({}, action.payload);
|
|
1906
|
-
|
|
1953
|
+
|
|
1954
|
+
if (!draft.allIds.includes(id)) {
|
|
1955
|
+
draft.allIds.push(id);
|
|
1956
|
+
}
|
|
1907
1957
|
},
|
|
1908
1958
|
mapStoreRemoveService: function mapStoreRemoveService(draft, action) {
|
|
1909
1959
|
var foundServiceIndex = draft.allIds.findIndex(function (id) {
|
|
@@ -1917,12 +1967,19 @@
|
|
|
1917
1967
|
});
|
|
1918
1968
|
delete draft.byId[serviceId_1];
|
|
1919
1969
|
}
|
|
1920
|
-
}
|
|
1970
|
+
},
|
|
1971
|
+
fetchInitialServices: function fetchInitialServices( // eslint-disable-next-line no-unused-vars
|
|
1972
|
+
draft, // eslint-disable-next-line no-unused-vars
|
|
1973
|
+
action) {}
|
|
1921
1974
|
},
|
|
1922
1975
|
extraReducers: function extraReducers(builder) {
|
|
1923
1976
|
return builder.addCase(layerActions.onUpdateLayerInformation, function (draft, action) {
|
|
1924
1977
|
var serviceLayers = action.payload.serviceLayers;
|
|
1925
|
-
|
|
1978
|
+
|
|
1979
|
+
if (serviceLayers === null) {
|
|
1980
|
+
return draft;
|
|
1981
|
+
}
|
|
1982
|
+
|
|
1926
1983
|
var mapAction = serviceActions.serviceSetLayers(serviceLayers);
|
|
1927
1984
|
var newState = reducer$7(draft, mapAction);
|
|
1928
1985
|
return newState;
|
|
@@ -2054,7 +2111,10 @@
|
|
|
2054
2111
|
}, function (store, serviceUrl, layerName) {
|
|
2055
2112
|
return layerName;
|
|
2056
2113
|
}, function (layers, serviceUrl, layerName) {
|
|
2057
|
-
if (!layers)
|
|
2114
|
+
if (!layers) {
|
|
2115
|
+
return null;
|
|
2116
|
+
}
|
|
2117
|
+
|
|
2058
2118
|
var index = layers.findIndex(function (serviceLayer) {
|
|
2059
2119
|
return serviceLayer.name === layerName;
|
|
2060
2120
|
});
|
|
@@ -2092,8 +2152,8 @@
|
|
|
2092
2152
|
* See the License for the specific language governing permissions and
|
|
2093
2153
|
* limitations under the License.
|
|
2094
2154
|
*
|
|
2095
|
-
* Copyright
|
|
2096
|
-
* Copyright
|
|
2155
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2156
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
2097
2157
|
* */
|
|
2098
2158
|
var moveToTop = function moveToTop(list, element) {
|
|
2099
2159
|
var filteredList = list.filter(function (item) {
|
|
@@ -2116,7 +2176,8 @@
|
|
|
2116
2176
|
type: type,
|
|
2117
2177
|
source: source,
|
|
2118
2178
|
isLoading: false,
|
|
2119
|
-
error: undefined
|
|
2179
|
+
error: undefined,
|
|
2180
|
+
focused: false
|
|
2120
2181
|
};
|
|
2121
2182
|
};
|
|
2122
2183
|
var initialState$6 = {
|
|
@@ -2191,6 +2252,10 @@
|
|
|
2191
2252
|
if (setOpen) {
|
|
2192
2253
|
draft.order = moveToTop(draft.order, type);
|
|
2193
2254
|
}
|
|
2255
|
+
|
|
2256
|
+
if (!setOpen) {
|
|
2257
|
+
draft.dialogs[type].focused = false;
|
|
2258
|
+
}
|
|
2194
2259
|
},
|
|
2195
2260
|
orderDialog: function orderDialog(draft, action) {
|
|
2196
2261
|
var type = action.payload.type;
|
|
@@ -2211,6 +2276,17 @@
|
|
|
2211
2276
|
error = _a.error,
|
|
2212
2277
|
type = _a.type;
|
|
2213
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;
|
|
2214
2290
|
}
|
|
2215
2291
|
}
|
|
2216
2292
|
});
|
|
@@ -2267,7 +2343,10 @@
|
|
|
2267
2343
|
*/
|
|
2268
2344
|
|
|
2269
2345
|
var createLayersWithIds = function createLayersWithIds(state, layers) {
|
|
2270
|
-
if (!layers)
|
|
2346
|
+
if (!layers) {
|
|
2347
|
+
return layers;
|
|
2348
|
+
}
|
|
2349
|
+
|
|
2271
2350
|
return produce.produce(layers, function (draft) {
|
|
2272
2351
|
for (var j = 0; j < draft.length; j += 1) {
|
|
2273
2352
|
var layer = draft[j];
|
|
@@ -2320,7 +2399,10 @@
|
|
|
2320
2399
|
|
|
2321
2400
|
var srs = action.payload.srs || null;
|
|
2322
2401
|
draft.byId[mapId].bbox = bbox;
|
|
2323
|
-
|
|
2402
|
+
|
|
2403
|
+
if (srs) {
|
|
2404
|
+
draft.byId[mapId].srs = srs;
|
|
2405
|
+
}
|
|
2324
2406
|
},
|
|
2325
2407
|
mapUpdateAllMapDimensions: function mapUpdateAllMapDimensions(draft, action) {
|
|
2326
2408
|
var _a = action.payload,
|
|
@@ -2331,7 +2413,6 @@
|
|
|
2331
2413
|
return;
|
|
2332
2414
|
}
|
|
2333
2415
|
|
|
2334
|
-
draft.byId[mapId].dimensions.length = 0;
|
|
2335
2416
|
dimensions.forEach(function (dimension) {
|
|
2336
2417
|
return produceDraftStateSetWebMapDimension(draft, mapId, dimension, true);
|
|
2337
2418
|
});
|
|
@@ -2436,16 +2517,28 @@
|
|
|
2436
2517
|
|
|
2437
2518
|
draft.byId[mapId].mapLayers = moveArrayElements(draft.byId[mapId].mapLayers, oldIndex, newIndex);
|
|
2438
2519
|
},
|
|
2439
|
-
|
|
2520
|
+
setAutoLayerId: function setAutoLayerId(draft, action) {
|
|
2440
2521
|
var _a = action.payload,
|
|
2441
2522
|
mapId = _a.mapId,
|
|
2442
|
-
layerId = _a.layerId
|
|
2523
|
+
layerId = _a.layerId,
|
|
2524
|
+
autoTimeStepLayerId = _a.autoTimeStepLayerId,
|
|
2525
|
+
autoUpdateLayerId = _a.autoUpdateLayerId;
|
|
2526
|
+
var map = draft.byId[mapId];
|
|
2443
2527
|
|
|
2444
|
-
if (!
|
|
2528
|
+
if (!map) {
|
|
2445
2529
|
return;
|
|
2446
2530
|
}
|
|
2447
2531
|
|
|
2448
|
-
|
|
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
|
+
}
|
|
2449
2542
|
},
|
|
2450
2543
|
setTimeSliderCenterTime: function setTimeSliderCenterTime(draft, action) {
|
|
2451
2544
|
var _a = action.payload,
|
|
@@ -2621,7 +2714,8 @@
|
|
|
2621
2714
|
}
|
|
2622
2715
|
|
|
2623
2716
|
if (!draft.byId[mapId].mapLayers.length) {
|
|
2624
|
-
draft.byId[mapId].
|
|
2717
|
+
draft.byId[mapId].autoUpdateLayerId = layerId;
|
|
2718
|
+
draft.byId[mapId].autoTimeStepLayerId = layerId;
|
|
2625
2719
|
}
|
|
2626
2720
|
|
|
2627
2721
|
draft.byId[mapId].mapLayers.unshift(layerId);
|
|
@@ -2661,19 +2755,36 @@
|
|
|
2661
2755
|
|
|
2662
2756
|
if (draft.byId[mapId]) {
|
|
2663
2757
|
draft.byId[mapId].mapLayers = layerIds;
|
|
2664
|
-
draft.byId[mapId].
|
|
2758
|
+
draft.byId[mapId].autoUpdateLayerId = activeLayerId;
|
|
2759
|
+
draft.byId[mapId].autoTimeStepLayerId = activeLayerId;
|
|
2665
2760
|
var webmapInstance = getWMJSMapById(mapId);
|
|
2666
2761
|
|
|
2667
2762
|
if (webmapInstance) {
|
|
2668
2763
|
var mapDims = webmapInstance.getDimensionList();
|
|
2669
2764
|
|
|
2670
|
-
if (
|
|
2671
|
-
draft.byId[mapId].dimensions =
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
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
|
+
}
|
|
2677
2788
|
});
|
|
2678
2789
|
}
|
|
2679
2790
|
}
|
|
@@ -2716,24 +2827,31 @@
|
|
|
2716
2827
|
var _a = action.payload,
|
|
2717
2828
|
mapId = _a.mapId,
|
|
2718
2829
|
layerId = _a.layerId;
|
|
2830
|
+
var map = draft.byId[mapId];
|
|
2719
2831
|
|
|
2720
|
-
if (!
|
|
2832
|
+
if (!map) {
|
|
2721
2833
|
return;
|
|
2722
2834
|
}
|
|
2723
2835
|
|
|
2724
|
-
|
|
2836
|
+
map.mapLayers = map.mapLayers.filter(function (id) {
|
|
2725
2837
|
return id !== layerId;
|
|
2726
|
-
}); // 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
|
+
}
|
|
2727
2845
|
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
activeLayerId = _b[0];
|
|
2846
|
+
var _b = __read(map.mapLayers, 1),
|
|
2847
|
+
activeLayerId = _b[0];
|
|
2731
2848
|
|
|
2732
|
-
|
|
2849
|
+
if (map.autoUpdateLayerId === layerId) {
|
|
2850
|
+
map.autoUpdateLayerId = activeLayerId;
|
|
2733
2851
|
}
|
|
2734
2852
|
|
|
2735
|
-
if (
|
|
2736
|
-
|
|
2853
|
+
if (map.autoTimeStepLayerId === layerId) {
|
|
2854
|
+
map.autoTimeStepLayerId = activeLayerId;
|
|
2737
2855
|
}
|
|
2738
2856
|
}).addCase(baseLayerDelete, function (draft, action) {
|
|
2739
2857
|
var _a = action.payload,
|
|
@@ -2805,7 +2923,9 @@
|
|
|
2805
2923
|
draft.byId[targetId].bbox = bbox;
|
|
2806
2924
|
}
|
|
2807
2925
|
|
|
2808
|
-
if (srs)
|
|
2926
|
+
if (srs) {
|
|
2927
|
+
draft.byId[targetId].srs = srs;
|
|
2928
|
+
}
|
|
2809
2929
|
}
|
|
2810
2930
|
});
|
|
2811
2931
|
}).addCase(setLayerActionSync, function (draft, action) {
|
|
@@ -2829,7 +2949,11 @@
|
|
|
2829
2949
|
}, draft);
|
|
2830
2950
|
}).addCase(onUpdateLayerInformation, function (draft, action) {
|
|
2831
2951
|
var mapDimensions = action.payload.mapDimensions;
|
|
2832
|
-
|
|
2952
|
+
|
|
2953
|
+
if (mapDimensions === null) {
|
|
2954
|
+
return draft;
|
|
2955
|
+
}
|
|
2956
|
+
|
|
2833
2957
|
var mapAction = mapActions$1.mapUpdateAllMapDimensions(mapDimensions);
|
|
2834
2958
|
return reducer$5(draft, mapAction);
|
|
2835
2959
|
}).addCase(mapChangeDimension, function (draft, action) {
|
|
@@ -2893,7 +3017,7 @@
|
|
|
2893
3017
|
* */
|
|
2894
3018
|
|
|
2895
3019
|
var layerStore = function layerStore(store) {
|
|
2896
|
-
return store
|
|
3020
|
+
return store === null || store === void 0 ? void 0 : store.layers;
|
|
2897
3021
|
};
|
|
2898
3022
|
/**
|
|
2899
3023
|
* Gets a layer from the layers part of the store by its Id
|
|
@@ -2921,7 +3045,9 @@
|
|
|
2921
3045
|
*/
|
|
2922
3046
|
|
|
2923
3047
|
var getLayersById = toolkit.createSelector(layerStore, function (store) {
|
|
2924
|
-
|
|
3048
|
+
var _a;
|
|
3049
|
+
|
|
3050
|
+
return (_a = store === null || store === void 0 ? void 0 : store.byId) !== null && _a !== void 0 ? _a : null;
|
|
2925
3051
|
}, selectorMemoizationOptions);
|
|
2926
3052
|
/**
|
|
2927
3053
|
* Retrieves all layerIds
|
|
@@ -3192,7 +3318,7 @@
|
|
|
3192
3318
|
}, []);
|
|
3193
3319
|
}, selectorMemoizationOptions);
|
|
3194
3320
|
|
|
3195
|
-
var selectors$
|
|
3321
|
+
var selectors$3 = /*#__PURE__*/Object.freeze({
|
|
3196
3322
|
__proto__: null,
|
|
3197
3323
|
getLayerById: getLayerById,
|
|
3198
3324
|
getLayersById: getLayersById,
|
|
@@ -3230,8 +3356,8 @@
|
|
|
3230
3356
|
* See the License for the specific language governing permissions and
|
|
3231
3357
|
* limitations under the License.
|
|
3232
3358
|
*
|
|
3233
|
-
* Copyright
|
|
3234
|
-
* Copyright
|
|
3359
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
3360
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
3235
3361
|
* */
|
|
3236
3362
|
var getUiStore = function getUiStore(store) {
|
|
3237
3363
|
if (store && store.ui) {
|
|
@@ -3356,8 +3482,11 @@
|
|
|
3356
3482
|
var getDialogError = toolkit.createSelector(getDialogDetailsByType, function (details) {
|
|
3357
3483
|
return details && details.error || '';
|
|
3358
3484
|
});
|
|
3485
|
+
var getDialogFocused = toolkit.createSelector(getDialogDetailsByType, function (details) {
|
|
3486
|
+
return details && details.focused || false;
|
|
3487
|
+
});
|
|
3359
3488
|
|
|
3360
|
-
var selectors$
|
|
3489
|
+
var selectors$2 = /*#__PURE__*/Object.freeze({
|
|
3361
3490
|
__proto__: null,
|
|
3362
3491
|
getUiStore: getUiStore,
|
|
3363
3492
|
getDialogDetailsByType: getDialogDetailsByType,
|
|
@@ -3368,7 +3497,8 @@
|
|
|
3368
3497
|
getDialogSource: getDialogSource,
|
|
3369
3498
|
getActiveWindowId: getActiveWindowId,
|
|
3370
3499
|
getDialogIsLoading: getDialogIsLoading,
|
|
3371
|
-
getDialogError: getDialogError
|
|
3500
|
+
getDialogError: getDialogError,
|
|
3501
|
+
getDialogFocused: getDialogFocused
|
|
3372
3502
|
});
|
|
3373
3503
|
|
|
3374
3504
|
/* *
|
|
@@ -3431,8 +3561,11 @@
|
|
|
3431
3561
|
var j = 0;
|
|
3432
3562
|
inDraftArray.forEach(function (e, i) {
|
|
3433
3563
|
if (!condition(e)) {
|
|
3434
|
-
|
|
3435
|
-
|
|
3564
|
+
if (i !== j) {
|
|
3565
|
+
// eslint-disable-next-line no-param-reassign
|
|
3566
|
+
inDraftArray[j] = e;
|
|
3567
|
+
}
|
|
3568
|
+
|
|
3436
3569
|
j += 1;
|
|
3437
3570
|
}
|
|
3438
3571
|
}); // eslint-disable-next-line no-param-reassign
|
|
@@ -3570,8 +3703,15 @@
|
|
|
3570
3703
|
var _a = action.payload,
|
|
3571
3704
|
groupId = _a.groupId,
|
|
3572
3705
|
targetId = _a.targetId;
|
|
3573
|
-
|
|
3574
|
-
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
|
+
|
|
3575
3715
|
delete draft.groups.byId[groupId].targets.byId[targetId];
|
|
3576
3716
|
removeInPlace(draft.groups.byId[groupId].targets.allIds, function (_id) {
|
|
3577
3717
|
return _id === targetId;
|
|
@@ -3810,10 +3950,16 @@
|
|
|
3810
3950
|
return null;
|
|
3811
3951
|
};
|
|
3812
3952
|
|
|
3813
|
-
toolkit.createSelector(getSyncSourceBySourceId, function (store) {
|
|
3953
|
+
var getTime = toolkit.createSelector(getSyncSourceBySourceId, function (store) {
|
|
3814
3954
|
return store && store.payloadByType && store.payloadByType[SYNCGROUPS_TYPE_SETTIME] ? store.payloadByType[SYNCGROUPS_TYPE_SETTIME].value : null;
|
|
3815
3955
|
});
|
|
3816
3956
|
|
|
3957
|
+
var selectors$1 = /*#__PURE__*/Object.freeze({
|
|
3958
|
+
__proto__: null,
|
|
3959
|
+
getSynchronizationGroupStore: getSynchronizationGroupStore,
|
|
3960
|
+
getTime: getTime
|
|
3961
|
+
});
|
|
3962
|
+
|
|
3817
3963
|
/* *
|
|
3818
3964
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3819
3965
|
* you may not use this file except in compliance with the License.
|
|
@@ -3861,11 +4007,9 @@
|
|
|
3861
4007
|
*/
|
|
3862
4008
|
|
|
3863
4009
|
var getMapById = function getMapById(store, mapId) {
|
|
3864
|
-
|
|
3865
|
-
return store.webmap.byId[mapId];
|
|
3866
|
-
}
|
|
4010
|
+
var _a;
|
|
3867
4011
|
|
|
3868
|
-
return null;
|
|
4012
|
+
return (_a = store === null || store === void 0 ? void 0 : store.webmap) === null || _a === void 0 ? void 0 : _a.byId[mapId];
|
|
3869
4013
|
};
|
|
3870
4014
|
/**
|
|
3871
4015
|
* Gets all mapIds
|
|
@@ -3932,8 +4076,10 @@
|
|
|
3932
4076
|
* @returns {array} returnType: array - array containing all layerIds
|
|
3933
4077
|
*/
|
|
3934
4078
|
|
|
3935
|
-
var getLayerIds = toolkit.createSelector(getMapById, function (
|
|
3936
|
-
|
|
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 : [];
|
|
3937
4083
|
}, selectorMemoizationOptions);
|
|
3938
4084
|
/**
|
|
3939
4085
|
* Gets all layer states for a map
|
|
@@ -3944,10 +4090,12 @@
|
|
|
3944
4090
|
* @returns {array} returnType: array - array containing all layer states for the map
|
|
3945
4091
|
*/
|
|
3946
4092
|
|
|
3947
|
-
var getMapLayers = toolkit.createSelector(getLayerIds, getLayersById, function (
|
|
3948
|
-
|
|
3949
|
-
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];
|
|
3950
4096
|
});
|
|
4097
|
+
var layersWithoutUndefined = _.compact(layersWithUndefined);
|
|
4098
|
+
return layersWithoutUndefined;
|
|
3951
4099
|
}, selectorMemoizationOptions);
|
|
3952
4100
|
/**
|
|
3953
4101
|
* Gets an array of baselayers ids for a map
|
|
@@ -4155,7 +4303,33 @@
|
|
|
4155
4303
|
*/
|
|
4156
4304
|
|
|
4157
4305
|
var getActiveLayerId = toolkit.createSelector(getMapById, function (store) {
|
|
4158
|
-
|
|
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;
|
|
4159
4333
|
});
|
|
4160
4334
|
/**
|
|
4161
4335
|
* Gets scale of a time slider of a map
|
|
@@ -4319,8 +4493,8 @@
|
|
|
4319
4493
|
* @returns {string} returnType: string - the mapId, or null if not found
|
|
4320
4494
|
*/
|
|
4321
4495
|
|
|
4322
|
-
var getMapIdFromLayerId
|
|
4323
|
-
return store
|
|
4496
|
+
var getMapIdFromLayerId = toolkit.createSelector(function (store) {
|
|
4497
|
+
return store === null || store === void 0 ? void 0 : store.webmap;
|
|
4324
4498
|
}, function (_store, layerId) {
|
|
4325
4499
|
return layerId;
|
|
4326
4500
|
}, findMapIdFromLayerId, selectorMemoizationOptions);
|
|
@@ -4357,7 +4531,7 @@
|
|
|
4357
4531
|
* @returns {number} returnType: index number or -1 if not found
|
|
4358
4532
|
*/
|
|
4359
4533
|
|
|
4360
|
-
var getLayerIndexByLayerId
|
|
4534
|
+
var getLayerIndexByLayerId = toolkit.createSelector(getMapLayers, function (_store, _mapId, layerId) {
|
|
4361
4535
|
return layerId;
|
|
4362
4536
|
}, function (layers, layerId) {
|
|
4363
4537
|
return layers.findIndex(function (layer) {
|
|
@@ -4374,7 +4548,7 @@
|
|
|
4374
4548
|
* @returns {object} returnType: layer, or null if not found
|
|
4375
4549
|
*/
|
|
4376
4550
|
|
|
4377
|
-
var getLayerByLayerIndex
|
|
4551
|
+
var getLayerByLayerIndex = toolkit.createSelector(getMapLayers, function (_store, _mapId, layerIndex) {
|
|
4378
4552
|
return layerIndex;
|
|
4379
4553
|
}, function (layers, layerIndex) {
|
|
4380
4554
|
if (layerIndex >= 0 && layerIndex < layers.length) {
|
|
@@ -4463,7 +4637,7 @@
|
|
|
4463
4637
|
* @returns {MapPreset} returnType: MapPreset
|
|
4464
4638
|
*/
|
|
4465
4639
|
|
|
4466
|
-
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) {
|
|
4467
4641
|
var _a;
|
|
4468
4642
|
|
|
4469
4643
|
var allLayers = __spreadArray(__spreadArray(__spreadArray([], __read(baseLayers)), __read(overLayers)), __read(mapLayers)).map(function (_a) {
|
|
@@ -4491,6 +4665,8 @@
|
|
|
4491
4665
|
return __assign({
|
|
4492
4666
|
layers: allLayers,
|
|
4493
4667
|
activeLayerId: activeLayerId,
|
|
4668
|
+
autoTimeStepLayerId: autoTimeStepLayerId,
|
|
4669
|
+
autoUpdateLayerId: autoUpdateLayerId,
|
|
4494
4670
|
proj: {
|
|
4495
4671
|
bbox: bbox,
|
|
4496
4672
|
srs: srs
|
|
@@ -4578,6 +4754,8 @@
|
|
|
4578
4754
|
isAutoUpdating: isAutoUpdating,
|
|
4579
4755
|
isEndTimeOverriding: isEndTimeOverriding,
|
|
4580
4756
|
getActiveLayerId: getActiveLayerId,
|
|
4757
|
+
getAutoUpdateLayerId: getAutoUpdateLayerId,
|
|
4758
|
+
getAutoTimeStepLayerId: getAutoTimeStepLayerId,
|
|
4581
4759
|
getMapTimeSliderScale: getMapTimeSliderScale,
|
|
4582
4760
|
getMapTimeStep: getMapTimeStep,
|
|
4583
4761
|
getMapTimeStepWithoutDefault: getMapTimeStepWithoutDefault,
|
|
@@ -4591,10 +4769,10 @@
|
|
|
4591
4769
|
isZoomControlsVisible: isZoomControlsVisible,
|
|
4592
4770
|
isTimeSliderVisible: isTimeSliderVisible,
|
|
4593
4771
|
getIsLayerActiveLayer: getIsLayerActiveLayer,
|
|
4594
|
-
getMapIdFromLayerId: getMapIdFromLayerId
|
|
4772
|
+
getMapIdFromLayerId: getMapIdFromLayerId,
|
|
4595
4773
|
getLayerIdByLayerName: getLayerIdByLayerName,
|
|
4596
|
-
getLayerIndexByLayerId: getLayerIndexByLayerId
|
|
4597
|
-
getLayerByLayerIndex: getLayerByLayerIndex
|
|
4774
|
+
getLayerIndexByLayerId: getLayerIndexByLayerId,
|
|
4775
|
+
getLayerByLayerIndex: getLayerByLayerIndex,
|
|
4598
4776
|
getAllUniqueDimensions: getAllUniqueDimensions,
|
|
4599
4777
|
getPinLocation: getPinLocation,
|
|
4600
4778
|
getDisableMapPin: getDisableMapPin,
|
|
@@ -4703,8 +4881,8 @@
|
|
|
4703
4881
|
* See the License for the specific language governing permissions and
|
|
4704
4882
|
* limitations under the License.
|
|
4705
4883
|
*
|
|
4706
|
-
* Copyright
|
|
4707
|
-
* Copyright
|
|
4884
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
4885
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
4708
4886
|
* */
|
|
4709
4887
|
var layerSelectFilterAdapter = toolkit.createEntityAdapter();
|
|
4710
4888
|
var layerSelectActiveServicesAdapter = toolkit.createEntityAdapter();
|
|
@@ -4754,62 +4932,6 @@
|
|
|
4754
4932
|
draft.servicePopup.variant = variant;
|
|
4755
4933
|
draft.servicePopup.serviceId = action.payload.serviceId ? action.payload.serviceId : '';
|
|
4756
4934
|
},
|
|
4757
|
-
addFiltersAndActiveServices: function addFiltersAndActiveServices(draft, action) {
|
|
4758
|
-
var _a, _b;
|
|
4759
|
-
|
|
4760
|
-
var _c = action.payload,
|
|
4761
|
-
serviceId = _c.serviceId,
|
|
4762
|
-
serviceName = _c.serviceName,
|
|
4763
|
-
serviceUrl = _c.serviceUrl,
|
|
4764
|
-
_abstract = _c["abstract"],
|
|
4765
|
-
keywords = _c.keywords,
|
|
4766
|
-
scope = _c.scope,
|
|
4767
|
-
groups = _c.groups,
|
|
4768
|
-
isLoading = _c.isLoading;
|
|
4769
|
-
|
|
4770
|
-
if (isLoading) {
|
|
4771
|
-
// If service is still loading, add without filters
|
|
4772
|
-
draft.filters.activeServices.entities[serviceId] = {
|
|
4773
|
-
serviceId: serviceId,
|
|
4774
|
-
enabled: draft.allServicesEnabled,
|
|
4775
|
-
filterIds: [],
|
|
4776
|
-
scope: scope,
|
|
4777
|
-
serviceName: serviceName,
|
|
4778
|
-
serviceUrl: serviceUrl,
|
|
4779
|
-
"abstract": _abstract,
|
|
4780
|
-
isLoading: isLoading
|
|
4781
|
-
};
|
|
4782
|
-
}
|
|
4783
|
-
|
|
4784
|
-
if (!isLoading) {
|
|
4785
|
-
// If service is done loading, add with filters
|
|
4786
|
-
if (!((_b = (_a = draft.filters.activeServices.entities[serviceId]) === null || _a === void 0 ? void 0 : _a.filterIds) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
4787
|
-
// If the service has no filters yet, add them
|
|
4788
|
-
produceFilters(groups, FilterType.Group, draft, layerSelectFilterAdapter);
|
|
4789
|
-
produceFilters(keywords, FilterType.Keyword, draft, layerSelectFilterAdapter);
|
|
4790
|
-
}
|
|
4791
|
-
|
|
4792
|
-
var filterIds = groups.map(function (group) {
|
|
4793
|
-
return getFilterId(FilterType.Group, group);
|
|
4794
|
-
}).concat(keywords.map(function (keyword) {
|
|
4795
|
-
return getFilterId(FilterType.Keyword, keyword);
|
|
4796
|
-
}));
|
|
4797
|
-
draft.filters.activeServices.entities[serviceId] = {
|
|
4798
|
-
serviceId: serviceId,
|
|
4799
|
-
enabled: draft.allServicesEnabled,
|
|
4800
|
-
filterIds: filterIds,
|
|
4801
|
-
scope: scope,
|
|
4802
|
-
serviceName: serviceName,
|
|
4803
|
-
serviceUrl: serviceUrl,
|
|
4804
|
-
"abstract": _abstract,
|
|
4805
|
-
isLoading: isLoading
|
|
4806
|
-
};
|
|
4807
|
-
}
|
|
4808
|
-
|
|
4809
|
-
if (!draft.filters.activeServices.ids.includes(serviceId)) {
|
|
4810
|
-
draft.filters.activeServices.ids.push(serviceId);
|
|
4811
|
-
}
|
|
4812
|
-
},
|
|
4813
4935
|
layerSelectRemoveService: function layerSelectRemoveService(draft, action) {
|
|
4814
4936
|
var serviceId = action.payload.serviceId; // 1. Find a service that is to be removed
|
|
4815
4937
|
|
|
@@ -4900,6 +5022,92 @@
|
|
|
4900
5022
|
var layer = action.payload.layer;
|
|
4901
5023
|
draft.activeLayerInfo = layer;
|
|
4902
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
|
+
});
|
|
4903
5111
|
}
|
|
4904
5112
|
});
|
|
4905
5113
|
var reducer$3 = slice$3.reducer;
|
|
@@ -4923,7 +5131,10 @@
|
|
|
4923
5131
|
* */
|
|
4924
5132
|
var filterLayersFromService = function filterLayersFromService(serviceId, services, filterIds, allFiltersActive, searchString) {
|
|
4925
5133
|
var mapStoreService = services[serviceId];
|
|
4926
|
-
|
|
5134
|
+
|
|
5135
|
+
if (!mapStoreService) {
|
|
5136
|
+
return [];
|
|
5137
|
+
}
|
|
4927
5138
|
|
|
4928
5139
|
if (searchString === '' && allFiltersActive) {
|
|
4929
5140
|
return mapStoreService.layers.filter(function (layer) {
|
|
@@ -5445,9 +5656,6 @@
|
|
|
5445
5656
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
5446
5657
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
5447
5658
|
* */
|
|
5448
|
-
var getLayerByLayerIndex = getLayerByLayerIndex$1,
|
|
5449
|
-
getMapIdFromLayerId = getMapIdFromLayerId$1,
|
|
5450
|
-
getLayerIndexByLayerId = getLayerIndexByLayerId$1;
|
|
5451
5659
|
/**
|
|
5452
5660
|
* Tries to find the layerId's in the other map based on the payload of the action. It works for all layer actions.
|
|
5453
5661
|
* @param state
|
|
@@ -5458,9 +5666,12 @@
|
|
|
5458
5666
|
*/
|
|
5459
5667
|
|
|
5460
5668
|
var getTargetLayerIdFromPayload = function getTargetLayerIdFromPayload(state, mapId, targetMapId, payload) {
|
|
5461
|
-
if (!payload)
|
|
5669
|
+
if (!payload) {
|
|
5670
|
+
return null;
|
|
5671
|
+
}
|
|
5462
5672
|
/* Try to find the layer for the DeleteLayerPayload, it uses layerIndex to reference the layer */
|
|
5463
5673
|
|
|
5674
|
+
|
|
5464
5675
|
if ('layerIndex' in payload) {
|
|
5465
5676
|
var targetLayer = getLayerByLayerIndex(state, targetMapId, payload.layerIndex);
|
|
5466
5677
|
return !targetLayer ? null : targetLayer.id;
|
|
@@ -5901,7 +6112,7 @@
|
|
|
5901
6112
|
}
|
|
5902
6113
|
});
|
|
5903
6114
|
}
|
|
5904
|
-
function
|
|
6115
|
+
function setAutoLayerIdActionsSaga(_a) {
|
|
5905
6116
|
var targets;
|
|
5906
6117
|
var payload = _a.payload,
|
|
5907
6118
|
type = _a.type;
|
|
@@ -5972,7 +6183,7 @@
|
|
|
5972
6183
|
}
|
|
5973
6184
|
});
|
|
5974
6185
|
}
|
|
5975
|
-
function rootSaga$
|
|
6186
|
+
function rootSaga$7() {
|
|
5976
6187
|
return __generator(this, function (_a) {
|
|
5977
6188
|
switch (_a.label) {
|
|
5978
6189
|
case 0:
|
|
@@ -6048,7 +6259,7 @@
|
|
|
6048
6259
|
|
|
6049
6260
|
return [4
|
|
6050
6261
|
/*yield*/
|
|
6051
|
-
, effects.takeLatest(mapActions$1.
|
|
6262
|
+
, effects.takeLatest(mapActions$1.setAutoLayerId.type, setAutoLayerIdActionsSaga)];
|
|
6052
6263
|
|
|
6053
6264
|
case 11:
|
|
6054
6265
|
_a.sent();
|
|
@@ -6220,9 +6431,12 @@
|
|
|
6220
6431
|
, 6];
|
|
6221
6432
|
|
|
6222
6433
|
case 2:
|
|
6223
|
-
if (!group.payloadByType[SYNCGROUPS_TYPE_SETTIME])
|
|
6224
|
-
|
|
6225
|
-
|
|
6434
|
+
if (!group.payloadByType[SYNCGROUPS_TYPE_SETTIME]) {
|
|
6435
|
+
return [2
|
|
6436
|
+
/*return*/
|
|
6437
|
+
];
|
|
6438
|
+
}
|
|
6439
|
+
|
|
6226
6440
|
return [4
|
|
6227
6441
|
/*yield*/
|
|
6228
6442
|
, effects.put(setTimeSync(group.payloadByType[SYNCGROUPS_TYPE_SETTIME], [{
|
|
@@ -6238,9 +6452,12 @@
|
|
|
6238
6452
|
, 6];
|
|
6239
6453
|
|
|
6240
6454
|
case 4:
|
|
6241
|
-
if (!group.payloadByType[SYNCGROUPS_TYPE_SETBBOX])
|
|
6242
|
-
|
|
6243
|
-
|
|
6455
|
+
if (!group.payloadByType[SYNCGROUPS_TYPE_SETBBOX]) {
|
|
6456
|
+
return [2
|
|
6457
|
+
/*return*/
|
|
6458
|
+
];
|
|
6459
|
+
}
|
|
6460
|
+
|
|
6244
6461
|
return [4
|
|
6245
6462
|
/*yield*/
|
|
6246
6463
|
, effects.put(setBboxSync(group.payloadByType[SYNCGROUPS_TYPE_SETBBOX], [{
|
|
@@ -6342,7 +6559,7 @@
|
|
|
6342
6559
|
});
|
|
6343
6560
|
}
|
|
6344
6561
|
|
|
6345
|
-
function rootSaga$
|
|
6562
|
+
function rootSaga$6() {
|
|
6346
6563
|
return __generator(this, function (_a) {
|
|
6347
6564
|
switch (_a.label) {
|
|
6348
6565
|
case 0:
|
|
@@ -6421,7 +6638,7 @@
|
|
|
6421
6638
|
reducersMap: {
|
|
6422
6639
|
syncronizationGroupStore: reducer$4
|
|
6423
6640
|
},
|
|
6424
|
-
sagas: [rootSaga$
|
|
6641
|
+
sagas: [rootSaga$7, rootSaga$6]
|
|
6425
6642
|
};
|
|
6426
6643
|
|
|
6427
6644
|
/* *
|
|
@@ -6543,7 +6760,7 @@
|
|
|
6543
6760
|
}
|
|
6544
6761
|
});
|
|
6545
6762
|
}
|
|
6546
|
-
function rootSaga$
|
|
6763
|
+
function rootSaga$5() {
|
|
6547
6764
|
return __generator(this, function (_a) {
|
|
6548
6765
|
switch (_a.label) {
|
|
6549
6766
|
case 0:
|
|
@@ -6589,7 +6806,7 @@
|
|
|
6589
6806
|
reducersMap: {
|
|
6590
6807
|
ui: reducer$6
|
|
6591
6808
|
},
|
|
6592
|
-
sagas: [rootSaga$
|
|
6809
|
+
sagas: [rootSaga$5]
|
|
6593
6810
|
};
|
|
6594
6811
|
|
|
6595
6812
|
/* *
|
|
@@ -6608,30 +6825,100 @@
|
|
|
6608
6825
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6609
6826
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
6610
6827
|
* */
|
|
6611
|
-
var
|
|
6612
|
-
|
|
6613
|
-
|
|
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
|
+
}
|
|
6614
6866
|
|
|
6615
|
-
var activeLayerIndex = layers.findIndex(function (layer) {
|
|
6616
|
-
return layer.id === activeLayerId;
|
|
6617
|
-
});
|
|
6618
|
-
var layersNewIds = layers.map(function (layer, index) {
|
|
6619
|
-
if (layer.id && index === activeLayerIndex) {
|
|
6620
6867
|
return __assign(__assign({}, layer), {
|
|
6621
|
-
id:
|
|
6868
|
+
id: generateLayerId()
|
|
6622
6869
|
});
|
|
6623
|
-
}
|
|
6870
|
+
});
|
|
6871
|
+
return {
|
|
6872
|
+
layers: layersWithNewIds_1,
|
|
6873
|
+
autoTimeStepLayerId: autoTimeStepLayerIdNew,
|
|
6874
|
+
autoUpdateLayerId: autoUpdateLayerIdNew
|
|
6875
|
+
};
|
|
6876
|
+
}
|
|
6624
6877
|
|
|
6878
|
+
if (autoTimeStepLayerIdNew) {
|
|
6879
|
+
return {
|
|
6880
|
+
layers: replaceLayerIds(layers, autoTimeStepLayerId, autoTimeStepLayerIdNew),
|
|
6881
|
+
autoTimeStepLayerId: autoTimeStepLayerIdNew
|
|
6882
|
+
};
|
|
6883
|
+
}
|
|
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) {
|
|
6625
6895
|
return __assign(__assign({}, layer), {
|
|
6626
6896
|
id: generateLayerId()
|
|
6627
6897
|
});
|
|
6628
6898
|
});
|
|
6629
6899
|
return {
|
|
6630
|
-
|
|
6631
|
-
activeLayerNewId: activeLayerNewId
|
|
6900
|
+
layers: layersWithNewIds
|
|
6632
6901
|
};
|
|
6633
6902
|
};
|
|
6634
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
|
+
|
|
6635
6922
|
/* *
|
|
6636
6923
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6637
6924
|
* you may not use this file except in compliance with the License.
|
|
@@ -7477,7 +7764,11 @@
|
|
|
7477
7764
|
var _a = this.props,
|
|
7478
7765
|
onKeyUp = _a.onKeyUp,
|
|
7479
7766
|
loopInterval = _a.redrawInterval;
|
|
7480
|
-
|
|
7767
|
+
|
|
7768
|
+
if (onKeyUp) {
|
|
7769
|
+
window.addEventListener('keyup', this.onKeyUp);
|
|
7770
|
+
}
|
|
7771
|
+
|
|
7481
7772
|
window.addEventListener('resize', this._handleWindowResize);
|
|
7482
7773
|
|
|
7483
7774
|
if (this.canvascontaineroutside && this.canvascontaineroutside.current && onKeyUp) {
|
|
@@ -7508,7 +7799,10 @@
|
|
|
7508
7799
|
this.mounted = false;
|
|
7509
7800
|
window.removeEventListener('resize', this._handleWindowResize);
|
|
7510
7801
|
var onKeyUp = this.props.onKeyUp;
|
|
7511
|
-
|
|
7802
|
+
|
|
7803
|
+
if (onKeyUp) {
|
|
7804
|
+
window.removeEventListener('keyup', this.onKeyUp);
|
|
7805
|
+
}
|
|
7512
7806
|
|
|
7513
7807
|
if (this.canvas) {
|
|
7514
7808
|
this.canvas.removeEventListener('mousedown', this.handleMouseDownEvent);
|
|
@@ -7546,7 +7840,10 @@
|
|
|
7546
7840
|
|
|
7547
7841
|
CanvasComponent.prototype.onKeyUp = function (event) {
|
|
7548
7842
|
var onKeyUp = this.props.onKeyUp;
|
|
7549
|
-
|
|
7843
|
+
|
|
7844
|
+
if (onKeyUp) {
|
|
7845
|
+
onKeyUp(event);
|
|
7846
|
+
}
|
|
7550
7847
|
|
|
7551
7848
|
if (this.canvascontaineroutside && this.canvascontaineroutside.current && onKeyUp) {
|
|
7552
7849
|
if (event.code === 'Escape') {
|
|
@@ -7558,7 +7855,10 @@
|
|
|
7558
7855
|
CanvasComponent.prototype._documentKeyDown = function (event) {
|
|
7559
7856
|
if (this._isFocussed) {
|
|
7560
7857
|
var onKeyDown = this.props.onKeyDown;
|
|
7561
|
-
|
|
7858
|
+
|
|
7859
|
+
if (onKeyDown) {
|
|
7860
|
+
onKeyDown(event);
|
|
7861
|
+
}
|
|
7562
7862
|
}
|
|
7563
7863
|
};
|
|
7564
7864
|
|
|
@@ -7568,7 +7868,10 @@
|
|
|
7568
7868
|
|
|
7569
7869
|
CanvasComponent.prototype.startLoop = function () {
|
|
7570
7870
|
var onRenderCanvas = this.props.onRenderCanvas;
|
|
7571
|
-
|
|
7871
|
+
|
|
7872
|
+
if (this.mounted === false || this.loopHasStarted === false) {
|
|
7873
|
+
return;
|
|
7874
|
+
}
|
|
7572
7875
|
|
|
7573
7876
|
if (this.canvas) {
|
|
7574
7877
|
onRenderCanvas(this.ctx, this.currentWidth, this.currentHeight, this.canvas);
|
|
@@ -7937,9 +8240,16 @@
|
|
|
7937
8240
|
}, [layerId]);
|
|
7938
8241
|
/* Should not do anything if no layer is given */
|
|
7939
8242
|
|
|
7940
|
-
if (!layer)
|
|
8243
|
+
if (!layer) {
|
|
8244
|
+
return null;
|
|
8245
|
+
}
|
|
8246
|
+
|
|
7941
8247
|
var isLayerEnabled = layer.enabled;
|
|
7942
|
-
|
|
8248
|
+
|
|
8249
|
+
if (!isLayerEnabled) {
|
|
8250
|
+
return null;
|
|
8251
|
+
}
|
|
8252
|
+
|
|
7943
8253
|
var layerOpacity = layer.opacity ? layer.opacity : 1;
|
|
7944
8254
|
/* Get the wmLayer, it has more detailed info about the WMS service,
|
|
7945
8255
|
like a title and the WMS legendgraphic url */
|
|
@@ -8427,17 +8737,21 @@
|
|
|
8427
8737
|
});
|
|
8428
8738
|
}
|
|
8429
8739
|
function setLayerDimensionsSaga(_a) {
|
|
8430
|
-
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;
|
|
8431
8741
|
var payload = _a.payload;
|
|
8432
8742
|
return __generator(this, function (_b) {
|
|
8433
8743
|
switch (_b.label) {
|
|
8434
8744
|
case 0:
|
|
8435
|
-
_b.trys.push([0,
|
|
8745
|
+
_b.trys.push([0, 16,, 17]);
|
|
8436
8746
|
|
|
8437
8747
|
layerDimensions = payload.layerDimensions;
|
|
8438
|
-
|
|
8439
|
-
|
|
8440
|
-
|
|
8748
|
+
|
|
8749
|
+
if (!layerDimensions) {
|
|
8750
|
+
return [2
|
|
8751
|
+
/*return*/
|
|
8752
|
+
];
|
|
8753
|
+
}
|
|
8754
|
+
|
|
8441
8755
|
dimensions = layerDimensions.dimensions, layerId = layerDimensions.layerId;
|
|
8442
8756
|
return [4
|
|
8443
8757
|
/*yield*/
|
|
@@ -8445,19 +8759,23 @@
|
|
|
8445
8759
|
|
|
8446
8760
|
case 1:
|
|
8447
8761
|
layer = _b.sent();
|
|
8448
|
-
|
|
8449
|
-
|
|
8450
|
-
|
|
8762
|
+
|
|
8763
|
+
if (!layer) {
|
|
8764
|
+
return [2
|
|
8765
|
+
/*return*/
|
|
8766
|
+
];
|
|
8767
|
+
}
|
|
8768
|
+
|
|
8451
8769
|
newTimeDimension_1 = dimensions.find(function (dimension) {
|
|
8452
8770
|
return dimension.name === 'time';
|
|
8453
8771
|
});
|
|
8454
8772
|
mapId = layer.mapId;
|
|
8455
8773
|
return [4
|
|
8456
8774
|
/*yield*/
|
|
8457
|
-
, effects.select(
|
|
8775
|
+
, effects.select(getAutoUpdateLayerId, mapId)];
|
|
8458
8776
|
|
|
8459
8777
|
case 2:
|
|
8460
|
-
|
|
8778
|
+
autoUpdateLayerId = _b.sent();
|
|
8461
8779
|
return [4
|
|
8462
8780
|
/*yield*/
|
|
8463
8781
|
, effects.select(isAutoUpdating, mapId)];
|
|
@@ -8483,46 +8801,14 @@
|
|
|
8483
8801
|
case 6:
|
|
8484
8802
|
isAnimating$1 = _b.sent();
|
|
8485
8803
|
webmapInstance = getWMJSMapById(mapId);
|
|
8486
|
-
|
|
8487
|
-
|
|
8488
|
-
/*yield*/
|
|
8489
|
-
, effects.select(getMapTimeStepWithoutDefault, mapId)];
|
|
8490
|
-
|
|
8491
|
-
case 7:
|
|
8492
|
-
timeStep = _b.sent();
|
|
8493
|
-
return [4
|
|
8494
|
-
/*yield*/
|
|
8495
|
-
, effects.select(isTimestepAuto, mapId)];
|
|
8496
|
-
|
|
8497
|
-
case 8:
|
|
8498
|
-
isTimestepAuto$1 = _b.sent();
|
|
8499
|
-
if (!(isTimestepAuto$1 && isActiveLayer && timeStep === undefined && newTimeDimension_1)) return [3
|
|
8500
|
-
/*break*/
|
|
8501
|
-
, 10];
|
|
8502
|
-
newTimeStep = getActiveLayerTimeStep(newTimeDimension_1);
|
|
8503
|
-
if (!newTimeStep) return [3
|
|
8504
|
-
/*break*/
|
|
8505
|
-
, 10];
|
|
8506
|
-
return [4
|
|
8507
|
-
/*yield*/
|
|
8508
|
-
, effects.put(mapActions$1.setTimeStep({
|
|
8509
|
-
mapId: mapId,
|
|
8510
|
-
timeStep: newTimeStep
|
|
8511
|
-
}))];
|
|
8512
|
-
|
|
8513
|
-
case 9:
|
|
8514
|
-
_b.sent();
|
|
8515
|
-
|
|
8516
|
-
_b.label = 10;
|
|
8517
|
-
|
|
8518
|
-
case 10:
|
|
8519
|
-
if (!(isActiveLayer && // only update the active layer
|
|
8804
|
+
isAutoUpdateLayer = layerId === autoUpdateLayerId;
|
|
8805
|
+
if (!(isAutoUpdateLayer && // only update the active layer
|
|
8520
8806
|
shouldAutoUpdate && newTimeDimension_1 && newTimeDimension_1.maxValue && prevTimeDimension && prevTimeDimension.currentValue && prevTimeDimension.currentValue !== newTimeDimension_1.maxValue && !shouldEndTimeOverride)) return [3
|
|
8521
8807
|
/*break*/
|
|
8522
|
-
,
|
|
8808
|
+
, 13];
|
|
8523
8809
|
if (!!isAnimating$1) return [3
|
|
8524
8810
|
/*break*/
|
|
8525
|
-
,
|
|
8811
|
+
, 8];
|
|
8526
8812
|
return [4
|
|
8527
8813
|
/*yield*/
|
|
8528
8814
|
, effects.put(layerActions.layerChangeDimension({
|
|
@@ -8534,21 +8820,21 @@
|
|
|
8534
8820
|
}
|
|
8535
8821
|
}))];
|
|
8536
8822
|
|
|
8537
|
-
case
|
|
8823
|
+
case 7:
|
|
8538
8824
|
_b.sent();
|
|
8539
8825
|
|
|
8540
|
-
_b.label =
|
|
8826
|
+
_b.label = 8;
|
|
8541
8827
|
|
|
8542
|
-
case
|
|
8828
|
+
case 8:
|
|
8543
8829
|
return [4
|
|
8544
8830
|
/*yield*/
|
|
8545
8831
|
, effects.select(getSyncedMapIdsForTimeslider)];
|
|
8546
8832
|
|
|
8547
|
-
case
|
|
8833
|
+
case 9:
|
|
8548
8834
|
syncedMapIds = _b.sent();
|
|
8549
8835
|
if (!syncedMapIds) return [3
|
|
8550
8836
|
/*break*/
|
|
8551
|
-
,
|
|
8837
|
+
, 11]; // Change time value for all other timesliders
|
|
8552
8838
|
|
|
8553
8839
|
return [4
|
|
8554
8840
|
/*yield*/
|
|
@@ -8560,51 +8846,51 @@
|
|
|
8560
8846
|
}));
|
|
8561
8847
|
}))];
|
|
8562
8848
|
|
|
8563
|
-
case
|
|
8849
|
+
case 10:
|
|
8564
8850
|
// Change time value for all other timesliders
|
|
8565
8851
|
_b.sent();
|
|
8566
8852
|
|
|
8567
|
-
_b.label =
|
|
8853
|
+
_b.label = 11;
|
|
8568
8854
|
|
|
8569
|
-
case
|
|
8855
|
+
case 11:
|
|
8570
8856
|
return [4
|
|
8571
8857
|
/*yield*/
|
|
8572
8858
|
, effects.call(updateAnimation, mapId, newTimeDimension_1.maxValue)];
|
|
8573
8859
|
|
|
8574
|
-
case
|
|
8860
|
+
case 12:
|
|
8575
8861
|
_b.sent();
|
|
8576
8862
|
|
|
8577
8863
|
return [3
|
|
8578
8864
|
/*break*/
|
|
8579
|
-
,
|
|
8865
|
+
, 15];
|
|
8580
8866
|
|
|
8581
|
-
case
|
|
8867
|
+
case 13:
|
|
8582
8868
|
if (!(isAnimating$1 && !webmapInstance.isAnimating && newTimeDimension_1 && newTimeDimension_1.maxValue && !shouldEndTimeOverride)) return [3
|
|
8583
8869
|
/*break*/
|
|
8584
|
-
,
|
|
8870
|
+
, 15];
|
|
8585
8871
|
return [4
|
|
8586
8872
|
/*yield*/
|
|
8587
8873
|
, effects.call(updateAnimation, mapId, newTimeDimension_1.maxValue)];
|
|
8588
8874
|
|
|
8589
|
-
case
|
|
8875
|
+
case 14:
|
|
8590
8876
|
_b.sent();
|
|
8591
8877
|
|
|
8592
|
-
_b.label =
|
|
8878
|
+
_b.label = 15;
|
|
8593
8879
|
|
|
8594
|
-
case
|
|
8880
|
+
case 15:
|
|
8595
8881
|
return [3
|
|
8596
8882
|
/*break*/
|
|
8597
|
-
,
|
|
8883
|
+
, 17];
|
|
8598
8884
|
|
|
8599
|
-
case
|
|
8885
|
+
case 16:
|
|
8600
8886
|
error_1 = _b.sent(); // eslint-disable-next-line no-console
|
|
8601
8887
|
|
|
8602
8888
|
console.warn(error_1);
|
|
8603
8889
|
return [3
|
|
8604
8890
|
/*break*/
|
|
8605
|
-
,
|
|
8891
|
+
, 17];
|
|
8606
8892
|
|
|
8607
|
-
case
|
|
8893
|
+
case 17:
|
|
8608
8894
|
return [2
|
|
8609
8895
|
/*return*/
|
|
8610
8896
|
];
|
|
@@ -8612,7 +8898,7 @@
|
|
|
8612
8898
|
});
|
|
8613
8899
|
}
|
|
8614
8900
|
function toggleAutoUpdateSaga(_a) {
|
|
8615
|
-
var shouldAutoUpdate, mapId_1,
|
|
8901
|
+
var shouldAutoUpdate, mapId_1, autoUpdateLayerId, timeDimension_1, syncedMapIds, payloads, error_2;
|
|
8616
8902
|
var payload = _a.payload;
|
|
8617
8903
|
return __generator(this, function (_b) {
|
|
8618
8904
|
switch (_b.label) {
|
|
@@ -8625,13 +8911,13 @@
|
|
|
8625
8911
|
, 9];
|
|
8626
8912
|
return [4
|
|
8627
8913
|
/*yield*/
|
|
8628
|
-
, effects.select(
|
|
8914
|
+
, effects.select(getAutoUpdateLayerId, mapId_1)];
|
|
8629
8915
|
|
|
8630
8916
|
case 1:
|
|
8631
|
-
|
|
8917
|
+
autoUpdateLayerId = _b.sent();
|
|
8632
8918
|
return [4
|
|
8633
8919
|
/*yield*/
|
|
8634
|
-
, effects.select(getLayerTimeDimension,
|
|
8920
|
+
, effects.select(getLayerTimeDimension, autoUpdateLayerId)];
|
|
8635
8921
|
|
|
8636
8922
|
case 2:
|
|
8637
8923
|
timeDimension_1 = _b.sent();
|
|
@@ -8641,7 +8927,7 @@
|
|
|
8641
8927
|
return [4
|
|
8642
8928
|
/*yield*/
|
|
8643
8929
|
, effects.put(layerActions.layerChangeDimension({
|
|
8644
|
-
layerId:
|
|
8930
|
+
layerId: autoUpdateLayerId,
|
|
8645
8931
|
origin: LayerActionOrigin.toggleAutoUpdateSaga,
|
|
8646
8932
|
dimension: {
|
|
8647
8933
|
name: 'time',
|
|
@@ -8788,54 +9074,70 @@
|
|
|
8788
9074
|
});
|
|
8789
9075
|
}
|
|
8790
9076
|
function setMapPresetSaga(_a) {
|
|
8791
|
-
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;
|
|
8792
9080
|
|
|
8793
9081
|
var payload = _a.payload;
|
|
8794
|
-
return __generator(this, function (
|
|
8795
|
-
switch (
|
|
9082
|
+
return __generator(this, function (_h) {
|
|
9083
|
+
switch (_h.label) {
|
|
8796
9084
|
case 0:
|
|
8797
|
-
|
|
9085
|
+
_h.trys.push([0, 52,, 53]);
|
|
8798
9086
|
|
|
8799
9087
|
mapId = payload.mapId, initialProps = payload.initialProps;
|
|
8800
9088
|
mapPreset = initialProps.mapPreset;
|
|
8801
9089
|
if (!mapPreset) return [3
|
|
8802
9090
|
/*break*/
|
|
8803
9091
|
, 51];
|
|
8804
|
-
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;
|
|
8805
9093
|
_b = filterLayers(layers), mapLayers = _b.mapLayers, baseLayers = _b.baseLayers, overLayers = _b.overLayers;
|
|
8806
9094
|
if (!layers) return [3
|
|
8807
9095
|
/*break*/
|
|
8808
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
|
+
|
|
8809
9106
|
return [4
|
|
8810
9107
|
/*yield*/
|
|
8811
|
-
, effects.call(
|
|
9108
|
+
, effects.call(replaceLayerIdsToEnsureUniqueLayerIdsInStore, {
|
|
9109
|
+
layers: mapLayers,
|
|
9110
|
+
autoTimeStepLayerId: autoTimeStepLayerIdNew,
|
|
9111
|
+
autoUpdateLayerId: autoUpdateLayerIdNew
|
|
9112
|
+
})];
|
|
8812
9113
|
|
|
8813
9114
|
case 1:
|
|
8814
|
-
|
|
9115
|
+
newLayerIds = _h.sent(); // set layers
|
|
8815
9116
|
|
|
8816
9117
|
return [4
|
|
8817
9118
|
/*yield*/
|
|
8818
9119
|
, effects.put(layerActions.setLayers({
|
|
8819
9120
|
mapId: mapId,
|
|
8820
|
-
layers:
|
|
9121
|
+
layers: newLayerIds.layers
|
|
8821
9122
|
}))];
|
|
8822
9123
|
|
|
8823
9124
|
case 2:
|
|
8824
9125
|
// set layers
|
|
8825
|
-
|
|
9126
|
+
_h.sent();
|
|
8826
9127
|
|
|
8827
|
-
|
|
9128
|
+
firstLayerId = (_e = newLayerIds.layers[0]) === null || _e === void 0 ? void 0 : _e.id;
|
|
8828
9129
|
return [4
|
|
8829
9130
|
/*yield*/
|
|
8830
|
-
, effects.put(mapActions$1.
|
|
9131
|
+
, effects.put(mapActions$1.setAutoLayerId({
|
|
8831
9132
|
mapId: mapId,
|
|
8832
|
-
|
|
9133
|
+
autoTimeStepLayerId: (_f = newLayerIds.autoTimeStepLayerId) !== null && _f !== void 0 ? _f : firstLayerId,
|
|
9134
|
+
autoUpdateLayerId: (_g = newLayerIds.autoUpdateLayerId) !== null && _g !== void 0 ? _g : firstLayerId
|
|
8833
9135
|
}))];
|
|
8834
9136
|
|
|
8835
9137
|
case 3:
|
|
8836
|
-
|
|
9138
|
+
_h.sent();
|
|
8837
9139
|
|
|
8838
|
-
|
|
9140
|
+
_h.label = 4;
|
|
8839
9141
|
|
|
8840
9142
|
case 4:
|
|
8841
9143
|
baseLayersWithDefaultLayer = baseLayers.length ? baseLayers : [baseLayerGrey$1];
|
|
@@ -8850,7 +9152,7 @@
|
|
|
8850
9152
|
, effects.call(handleBaseLayersSaga, mapId, allBaseLayers)];
|
|
8851
9153
|
|
|
8852
9154
|
case 5:
|
|
8853
|
-
|
|
9155
|
+
_h.sent();
|
|
8854
9156
|
|
|
8855
9157
|
if (!proj) return [3
|
|
8856
9158
|
/*break*/
|
|
@@ -8866,9 +9168,9 @@
|
|
|
8866
9168
|
|
|
8867
9169
|
case 6:
|
|
8868
9170
|
// set bbox
|
|
8869
|
-
|
|
9171
|
+
_h.sent();
|
|
8870
9172
|
|
|
8871
|
-
|
|
9173
|
+
_h.label = 7;
|
|
8872
9174
|
|
|
8873
9175
|
case 7:
|
|
8874
9176
|
animationLength = animationPayload && animationPayload.duration;
|
|
@@ -8887,9 +9189,9 @@
|
|
|
8887
9189
|
|
|
8888
9190
|
case 8:
|
|
8889
9191
|
// auto update
|
|
8890
|
-
|
|
9192
|
+
_h.sent();
|
|
8891
9193
|
|
|
8892
|
-
|
|
9194
|
+
_h.label = 9;
|
|
8893
9195
|
|
|
8894
9196
|
case 9:
|
|
8895
9197
|
if (!(shouldAutoUpdate !== undefined && !animationEndTime)) return [3
|
|
@@ -8905,9 +9207,9 @@
|
|
|
8905
9207
|
|
|
8906
9208
|
case 10:
|
|
8907
9209
|
// auto update
|
|
8908
|
-
|
|
9210
|
+
_h.sent();
|
|
8909
9211
|
|
|
8910
|
-
|
|
9212
|
+
_h.label = 11;
|
|
8911
9213
|
|
|
8912
9214
|
case 11:
|
|
8913
9215
|
if (!(showTimeSlider !== undefined)) return [3
|
|
@@ -8923,9 +9225,9 @@
|
|
|
8923
9225
|
|
|
8924
9226
|
case 12:
|
|
8925
9227
|
// toggle timeslider
|
|
8926
|
-
|
|
9228
|
+
_h.sent();
|
|
8927
9229
|
|
|
8928
|
-
|
|
9230
|
+
_h.label = 13;
|
|
8929
9231
|
|
|
8930
9232
|
case 13:
|
|
8931
9233
|
if (!(shouldShowZoomControls !== undefined)) return [3
|
|
@@ -8941,9 +9243,9 @@
|
|
|
8941
9243
|
|
|
8942
9244
|
case 14:
|
|
8943
9245
|
// toggle zoom controls
|
|
8944
|
-
|
|
9246
|
+
_h.sent();
|
|
8945
9247
|
|
|
8946
|
-
|
|
9248
|
+
_h.label = 15;
|
|
8947
9249
|
|
|
8948
9250
|
case 15:
|
|
8949
9251
|
if (!(displayMapPin !== undefined)) return [3
|
|
@@ -8959,9 +9261,9 @@
|
|
|
8959
9261
|
|
|
8960
9262
|
case 16:
|
|
8961
9263
|
// display map pin
|
|
8962
|
-
|
|
9264
|
+
_h.sent();
|
|
8963
9265
|
|
|
8964
|
-
|
|
9266
|
+
_h.label = 17;
|
|
8965
9267
|
|
|
8966
9268
|
case 17:
|
|
8967
9269
|
interval = animationPayload && animationPayload.interval;
|
|
@@ -8976,9 +9278,9 @@
|
|
|
8976
9278
|
}))];
|
|
8977
9279
|
|
|
8978
9280
|
case 18:
|
|
8979
|
-
|
|
9281
|
+
_h.sent();
|
|
8980
9282
|
|
|
8981
|
-
|
|
9283
|
+
_h.label = 19;
|
|
8982
9284
|
|
|
8983
9285
|
case 19:
|
|
8984
9286
|
if (!animationEndTime) return [3
|
|
@@ -8992,7 +9294,7 @@
|
|
|
8992
9294
|
}))];
|
|
8993
9295
|
|
|
8994
9296
|
case 20:
|
|
8995
|
-
|
|
9297
|
+
_h.sent();
|
|
8996
9298
|
|
|
8997
9299
|
if (!!animationLength) return [3
|
|
8998
9300
|
/*break*/
|
|
@@ -9002,7 +9304,7 @@
|
|
|
9002
9304
|
, effects.select(getAnimationEndTime$1, mapId)];
|
|
9003
9305
|
|
|
9004
9306
|
case 21:
|
|
9005
|
-
animationEnd =
|
|
9307
|
+
animationEnd = _h.sent();
|
|
9006
9308
|
return [4
|
|
9007
9309
|
/*yield*/
|
|
9008
9310
|
, effects.put(mapActions$1.setAnimationStartTime({
|
|
@@ -9012,9 +9314,9 @@
|
|
|
9012
9314
|
}))];
|
|
9013
9315
|
|
|
9014
9316
|
case 22:
|
|
9015
|
-
|
|
9317
|
+
_h.sent();
|
|
9016
9318
|
|
|
9017
|
-
|
|
9319
|
+
_h.label = 23;
|
|
9018
9320
|
|
|
9019
9321
|
case 23:
|
|
9020
9322
|
if (!animationLength) return [3
|
|
@@ -9025,7 +9327,7 @@
|
|
|
9025
9327
|
, effects.select(getAnimationEndTime$1, mapId)];
|
|
9026
9328
|
|
|
9027
9329
|
case 24:
|
|
9028
|
-
animationEnd =
|
|
9330
|
+
animationEnd = _h.sent();
|
|
9029
9331
|
return [4
|
|
9030
9332
|
/*yield*/
|
|
9031
9333
|
, effects.put(mapActions$1.setAnimationStartTime({
|
|
@@ -9034,9 +9336,9 @@
|
|
|
9034
9336
|
}))];
|
|
9035
9337
|
|
|
9036
9338
|
case 25:
|
|
9037
|
-
|
|
9339
|
+
_h.sent();
|
|
9038
9340
|
|
|
9039
|
-
|
|
9341
|
+
_h.label = 26;
|
|
9040
9342
|
|
|
9041
9343
|
case 26:
|
|
9042
9344
|
if (!(animationPayload && animationPayload.speed)) return [3
|
|
@@ -9050,9 +9352,9 @@
|
|
|
9050
9352
|
}))];
|
|
9051
9353
|
|
|
9052
9354
|
case 27:
|
|
9053
|
-
|
|
9355
|
+
_h.sent();
|
|
9054
9356
|
|
|
9055
|
-
|
|
9357
|
+
_h.label = 28;
|
|
9056
9358
|
|
|
9057
9359
|
case 28:
|
|
9058
9360
|
if (!(shouldAnimate === true)) return [3
|
|
@@ -9067,17 +9369,17 @@
|
|
|
9067
9369
|
, effects.select(getAnimationEndTime$1, mapId)];
|
|
9068
9370
|
|
|
9069
9371
|
case 29:
|
|
9070
|
-
|
|
9372
|
+
_c = _h.sent();
|
|
9071
9373
|
return [3
|
|
9072
9374
|
/*break*/
|
|
9073
9375
|
, 31];
|
|
9074
9376
|
|
|
9075
9377
|
case 30:
|
|
9076
|
-
|
|
9077
|
-
|
|
9378
|
+
_c = moment__default["default"].utc().format(dateFormat);
|
|
9379
|
+
_h.label = 31;
|
|
9078
9380
|
|
|
9079
9381
|
case 31:
|
|
9080
|
-
animationEnd =
|
|
9382
|
+
animationEnd = _c;
|
|
9081
9383
|
if (!(shouldEndtimeOverride && animationLength)) return [3
|
|
9082
9384
|
/*break*/
|
|
9083
9385
|
, 33];
|
|
@@ -9086,17 +9388,17 @@
|
|
|
9086
9388
|
, effects.select(getAnimationStartTime, mapId)];
|
|
9087
9389
|
|
|
9088
9390
|
case 32:
|
|
9089
|
-
|
|
9391
|
+
_d = _h.sent();
|
|
9090
9392
|
return [3
|
|
9091
9393
|
/*break*/
|
|
9092
9394
|
, 34];
|
|
9093
9395
|
|
|
9094
9396
|
case 33:
|
|
9095
|
-
|
|
9096
|
-
|
|
9397
|
+
_d = moment__default["default"].utc().subtract(duration, 'minutes').format(dateFormat);
|
|
9398
|
+
_h.label = 34;
|
|
9097
9399
|
|
|
9098
9400
|
case 34:
|
|
9099
|
-
animationStart =
|
|
9401
|
+
animationStart = _d;
|
|
9100
9402
|
return [4
|
|
9101
9403
|
/*yield*/
|
|
9102
9404
|
, effects.put(mapActions$1.mapStartAnimation({
|
|
@@ -9107,7 +9409,7 @@
|
|
|
9107
9409
|
}))];
|
|
9108
9410
|
|
|
9109
9411
|
case 35:
|
|
9110
|
-
|
|
9412
|
+
_h.sent();
|
|
9111
9413
|
|
|
9112
9414
|
if (!interval) return [3
|
|
9113
9415
|
/*break*/
|
|
@@ -9120,9 +9422,9 @@
|
|
|
9120
9422
|
}))];
|
|
9121
9423
|
|
|
9122
9424
|
case 36:
|
|
9123
|
-
|
|
9425
|
+
_h.sent();
|
|
9124
9426
|
|
|
9125
|
-
|
|
9427
|
+
_h.label = 37;
|
|
9126
9428
|
|
|
9127
9429
|
case 37:
|
|
9128
9430
|
return [3
|
|
@@ -9143,9 +9445,9 @@
|
|
|
9143
9445
|
|
|
9144
9446
|
case 39:
|
|
9145
9447
|
// Set timestep auto based on preset if animation is off
|
|
9146
|
-
|
|
9448
|
+
_h.sent();
|
|
9147
9449
|
|
|
9148
|
-
|
|
9450
|
+
_h.label = 40;
|
|
9149
9451
|
|
|
9150
9452
|
case 40:
|
|
9151
9453
|
shouldOpenLegend = shouldShowLegend !== undefined ? shouldShowLegend : IS_LEGEND_OPEN_BY_DEFAULT;
|
|
@@ -9154,7 +9456,7 @@
|
|
|
9154
9456
|
, effects.select(getLegendId, mapId)];
|
|
9155
9457
|
|
|
9156
9458
|
case 41:
|
|
9157
|
-
legendId =
|
|
9459
|
+
legendId = _h.sent();
|
|
9158
9460
|
if (!legendId) return [3
|
|
9159
9461
|
/*break*/
|
|
9160
9462
|
, 43];
|
|
@@ -9166,9 +9468,9 @@
|
|
|
9166
9468
|
}))];
|
|
9167
9469
|
|
|
9168
9470
|
case 42:
|
|
9169
|
-
|
|
9471
|
+
_h.sent();
|
|
9170
9472
|
|
|
9171
|
-
|
|
9473
|
+
_h.label = 43;
|
|
9172
9474
|
|
|
9173
9475
|
case 43:
|
|
9174
9476
|
if (!dockedLayerManagerSize) return [3
|
|
@@ -9182,9 +9484,9 @@
|
|
|
9182
9484
|
}))];
|
|
9183
9485
|
|
|
9184
9486
|
case 44:
|
|
9185
|
-
|
|
9487
|
+
_h.sent();
|
|
9186
9488
|
|
|
9187
|
-
|
|
9489
|
+
_h.label = 45;
|
|
9188
9490
|
|
|
9189
9491
|
case 45:
|
|
9190
9492
|
if (!(animationEndTime && (shouldEndtimeOverride || !(shouldAutoUpdate || shouldAnimate)))) return [3
|
|
@@ -9196,14 +9498,14 @@
|
|
|
9196
9498
|
, effects.delay(fiveMinuteDelayForAnimation)];
|
|
9197
9499
|
|
|
9198
9500
|
case 46:
|
|
9199
|
-
|
|
9501
|
+
_h.sent();
|
|
9200
9502
|
|
|
9201
9503
|
return [4
|
|
9202
9504
|
/*yield*/
|
|
9203
9505
|
, effects.select(getAnimationEndTime$1, mapId)];
|
|
9204
9506
|
|
|
9205
9507
|
case 47:
|
|
9206
|
-
animationEnd =
|
|
9508
|
+
animationEnd = _h.sent();
|
|
9207
9509
|
return [4
|
|
9208
9510
|
/*yield*/
|
|
9209
9511
|
, effects.put(mapActions$1.setAnimationEndTime({
|
|
@@ -9212,14 +9514,14 @@
|
|
|
9212
9514
|
}))];
|
|
9213
9515
|
|
|
9214
9516
|
case 48:
|
|
9215
|
-
|
|
9517
|
+
_h.sent();
|
|
9216
9518
|
|
|
9217
9519
|
return [4
|
|
9218
9520
|
/*yield*/
|
|
9219
9521
|
, effects.select(getAnimationStartTime, mapId)];
|
|
9220
9522
|
|
|
9221
9523
|
case 49:
|
|
9222
|
-
animationStart =
|
|
9524
|
+
animationStart = _h.sent();
|
|
9223
9525
|
return [4
|
|
9224
9526
|
/*yield*/
|
|
9225
9527
|
, effects.put(mapActions$1.setAnimationStartTime({
|
|
@@ -9228,7 +9530,7 @@
|
|
|
9228
9530
|
}))];
|
|
9229
9531
|
|
|
9230
9532
|
case 50:
|
|
9231
|
-
|
|
9533
|
+
_h.sent();
|
|
9232
9534
|
|
|
9233
9535
|
return [3
|
|
9234
9536
|
/*break*/
|
|
@@ -9240,7 +9542,7 @@
|
|
|
9240
9542
|
, 53];
|
|
9241
9543
|
|
|
9242
9544
|
case 52:
|
|
9243
|
-
error_3 =
|
|
9545
|
+
error_3 = _h.sent();
|
|
9244
9546
|
console.error(error_3);
|
|
9245
9547
|
return [3
|
|
9246
9548
|
/*break*/
|
|
@@ -9286,7 +9588,7 @@
|
|
|
9286
9588
|
}
|
|
9287
9589
|
});
|
|
9288
9590
|
}
|
|
9289
|
-
function rootSaga$
|
|
9591
|
+
function rootSaga$4() {
|
|
9290
9592
|
return __generator(this, function (_a) {
|
|
9291
9593
|
switch (_a.label) {
|
|
9292
9594
|
case 0:
|
|
@@ -9348,6 +9650,187 @@
|
|
|
9348
9650
|
});
|
|
9349
9651
|
}
|
|
9350
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
|
+
|
|
9351
9834
|
var moduleConfig = {
|
|
9352
9835
|
id: 'webmap-module',
|
|
9353
9836
|
reducersMap: {
|
|
@@ -9355,7 +9838,7 @@
|
|
|
9355
9838
|
services: reducer$7,
|
|
9356
9839
|
layers: reducer$8
|
|
9357
9840
|
},
|
|
9358
|
-
sagas: [rootSaga$3]
|
|
9841
|
+
sagas: [rootSaga$4, rootSaga$3]
|
|
9359
9842
|
};
|
|
9360
9843
|
|
|
9361
9844
|
function _typeof(obj) {
|
|
@@ -9427,57 +9910,6 @@
|
|
|
9427
9910
|
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9428
9911
|
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
9429
9912
|
* */
|
|
9430
|
-
function newServiceAddedSaga(capturedAction) {
|
|
9431
|
-
var addedService, id, serviceUrl, name, scope, _abstract, isUpdating, keywords, groups;
|
|
9432
|
-
|
|
9433
|
-
return __generator(this, function (_a) {
|
|
9434
|
-
switch (_a.label) {
|
|
9435
|
-
case 0:
|
|
9436
|
-
addedService = capturedAction.payload;
|
|
9437
|
-
id = addedService.id, serviceUrl = addedService.serviceUrl, name = addedService.name, scope = addedService.scope, _abstract = addedService["abstract"], isUpdating = addedService.isUpdating;
|
|
9438
|
-
if (isUpdating) return [2
|
|
9439
|
-
/*return*/
|
|
9440
|
-
];
|
|
9441
|
-
keywords = addedService.layers.reduce(function (keywords, layer) {
|
|
9442
|
-
var _a;
|
|
9443
|
-
|
|
9444
|
-
if (layer.leaf) {
|
|
9445
|
-
return keywords.concat((_a = layer.keywords) !== null && _a !== void 0 ? _a : []);
|
|
9446
|
-
}
|
|
9447
|
-
|
|
9448
|
-
return keywords;
|
|
9449
|
-
}, []);
|
|
9450
|
-
groups = addedService.layers.reduce(function (groups, layer) {
|
|
9451
|
-
var _a;
|
|
9452
|
-
|
|
9453
|
-
if (layer.leaf) {
|
|
9454
|
-
return groups.concat((_a = layer.path) !== null && _a !== void 0 ? _a : []);
|
|
9455
|
-
}
|
|
9456
|
-
|
|
9457
|
-
return groups;
|
|
9458
|
-
}, []);
|
|
9459
|
-
return [4
|
|
9460
|
-
/*yield*/
|
|
9461
|
-
, effects.put(layerSelectActions.addFiltersAndActiveServices({
|
|
9462
|
-
serviceId: id,
|
|
9463
|
-
serviceName: name,
|
|
9464
|
-
serviceUrl: serviceUrl,
|
|
9465
|
-
keywords: keywords,
|
|
9466
|
-
scope: scope,
|
|
9467
|
-
groups: groups,
|
|
9468
|
-
"abstract": _abstract,
|
|
9469
|
-
isLoading: false
|
|
9470
|
-
}))];
|
|
9471
|
-
|
|
9472
|
-
case 1:
|
|
9473
|
-
_a.sent();
|
|
9474
|
-
|
|
9475
|
-
return [2
|
|
9476
|
-
/*return*/
|
|
9477
|
-
];
|
|
9478
|
-
}
|
|
9479
|
-
});
|
|
9480
|
-
}
|
|
9481
9913
|
function layerSelectCloseInfoDialogSaga(_a) {
|
|
9482
9914
|
var _b, togglePayload, activeMapIdPayload, isLayerInfoDialogOpen, isLayerInfoDialogOpen, filteredLayers, dialogInfo;
|
|
9483
9915
|
|
|
@@ -9665,20 +10097,27 @@
|
|
|
9665
10097
|
var scope = payload.scope,
|
|
9666
10098
|
name = payload.name,
|
|
9667
10099
|
serviceUrl = payload.serviceUrl,
|
|
9668
|
-
|
|
9669
|
-
|
|
10100
|
+
_abstract = payload["abstract"];
|
|
10101
|
+
|
|
10102
|
+
if (!isUserAddedService(scope)) {
|
|
10103
|
+
return;
|
|
10104
|
+
}
|
|
10105
|
+
|
|
9670
10106
|
var localStorageServices = getUserAddedServices();
|
|
9671
10107
|
setUserAddedServices(__assign(__assign({}, localStorageServices), (_b = {}, _b[serviceUrl] = {
|
|
9672
10108
|
name: name,
|
|
9673
10109
|
url: serviceUrl,
|
|
9674
|
-
"abstract":
|
|
10110
|
+
"abstract": _abstract
|
|
9675
10111
|
}, _b)));
|
|
9676
10112
|
}
|
|
9677
10113
|
function removeServiceFromLocalStorageSaga(_a) {
|
|
9678
10114
|
var payload = _a.payload;
|
|
9679
10115
|
var serviceUrl = payload.serviceUrl;
|
|
9680
10116
|
var localStorageServices = getUserAddedServices();
|
|
9681
|
-
|
|
10117
|
+
|
|
10118
|
+
if (!localStorageServices[serviceUrl]) {
|
|
10119
|
+
return;
|
|
10120
|
+
}
|
|
9682
10121
|
|
|
9683
10122
|
var updatedServices = __assign({}, localStorageServices);
|
|
9684
10123
|
|
|
@@ -9689,39 +10128,32 @@
|
|
|
9689
10128
|
return __generator(this, function (_a) {
|
|
9690
10129
|
switch (_a.label) {
|
|
9691
10130
|
case 0:
|
|
9692
|
-
return [4
|
|
9693
|
-
/*yield*/
|
|
9694
|
-
, effects.takeEvery(serviceActions.serviceSetLayers.type, newServiceAddedSaga)];
|
|
9695
|
-
|
|
9696
|
-
case 1:
|
|
9697
|
-
_a.sent();
|
|
9698
|
-
|
|
9699
10131
|
return [4
|
|
9700
10132
|
/*yield*/
|
|
9701
10133
|
, effects.takeEvery(layerSelectActions.layerSelectRemoveService.type, layerSelectRemoveServiceSaga)];
|
|
9702
10134
|
|
|
9703
|
-
case
|
|
10135
|
+
case 1:
|
|
9704
10136
|
_a.sent();
|
|
9705
10137
|
|
|
9706
10138
|
return [4
|
|
9707
10139
|
/*yield*/
|
|
9708
10140
|
, effects.takeEvery(serviceActions.serviceSetLayers.type, addServiceToLocalStorageSaga)];
|
|
9709
10141
|
|
|
9710
|
-
case
|
|
10142
|
+
case 2:
|
|
9711
10143
|
_a.sent();
|
|
9712
10144
|
|
|
9713
10145
|
return [4
|
|
9714
10146
|
/*yield*/
|
|
9715
10147
|
, effects.takeEvery(serviceActions.mapStoreRemoveService.type, removeServiceFromLocalStorageSaga)];
|
|
9716
10148
|
|
|
9717
|
-
case
|
|
10149
|
+
case 3:
|
|
9718
10150
|
_a.sent();
|
|
9719
10151
|
|
|
9720
10152
|
return [4
|
|
9721
10153
|
/*yield*/
|
|
9722
10154
|
, effects.takeEvery([uiActions.setToggleOpenDialog.type, uiActions.setActiveMapIdForDialog.type, layerSelectActions.disableActiveService.type, layerSelectActions.toggleFilter.type, layerSelectActions.setSearchFilter.type], layerSelectCloseInfoDialogSaga)];
|
|
9723
10155
|
|
|
9724
|
-
case
|
|
10156
|
+
case 4:
|
|
9725
10157
|
_a.sent();
|
|
9726
10158
|
|
|
9727
10159
|
return [2
|
|
@@ -9901,8 +10333,8 @@
|
|
|
9901
10333
|
* See the License for the specific language governing permissions and
|
|
9902
10334
|
* limitations under the License.
|
|
9903
10335
|
*
|
|
9904
|
-
* Copyright
|
|
9905
|
-
* Copyright
|
|
10336
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10337
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
9906
10338
|
* */
|
|
9907
10339
|
var iconStyle = {
|
|
9908
10340
|
height: 24,
|
|
@@ -9923,16 +10355,19 @@
|
|
|
9923
10355
|
|
|
9924
10356
|
var HeaderOptions = function HeaderOptions(_a) {
|
|
9925
10357
|
var isDockedLayerManager = _a.isDockedLayerManager,
|
|
10358
|
+
shortcutsEnabled = _a.shortcutsEnabled,
|
|
9926
10359
|
onClickDockButton = _a.onClickDockButton,
|
|
9927
10360
|
onChangeSize = _a.onChangeSize;
|
|
9928
10361
|
React__namespace.useEffect(function () {
|
|
9929
10362
|
var handleKeyDown = function handleKeyDown(event) {
|
|
9930
|
-
if (
|
|
9931
|
-
|
|
9932
|
-
|
|
9933
|
-
|
|
9934
|
-
|
|
9935
|
-
|
|
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
|
+
}
|
|
9936
10371
|
}
|
|
9937
10372
|
};
|
|
9938
10373
|
|
|
@@ -9940,7 +10375,7 @@
|
|
|
9940
10375
|
return function () {
|
|
9941
10376
|
document.removeEventListener('keydown', handleKeyDown);
|
|
9942
10377
|
};
|
|
9943
|
-
}, [onChangeSize]);
|
|
10378
|
+
}, [onChangeSize, shortcutsEnabled]);
|
|
9944
10379
|
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
|
|
9945
10380
|
title: "small"
|
|
9946
10381
|
}, /*#__PURE__*/React__namespace.createElement(material.IconButton, {
|
|
@@ -10164,9 +10599,18 @@
|
|
|
10164
10599
|
}
|
|
10165
10600
|
};
|
|
10166
10601
|
var returnCorrectSize = function returnCorrectSize(sizeResult) {
|
|
10167
|
-
if (sizeResult === 'sizeSmall')
|
|
10168
|
-
|
|
10169
|
-
|
|
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
|
+
|
|
10170
10614
|
return sizeLarge;
|
|
10171
10615
|
};
|
|
10172
10616
|
|
|
@@ -10352,11 +10796,18 @@
|
|
|
10352
10796
|
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
10353
10797
|
|
|
10354
10798
|
}, []);
|
|
10355
|
-
|
|
10799
|
+
|
|
10800
|
+
if (!layerDimensions.length || !layerId) {
|
|
10801
|
+
return null;
|
|
10802
|
+
}
|
|
10356
10803
|
|
|
10357
10804
|
var getValuesToDisplay = function getValuesToDisplay() {
|
|
10358
10805
|
var activeWMJSDim = getWMJSDimensionForLayerAndDimension(layerId, activeDimName) || getWMJSDimensionForLayerAndDimension(layerId, layerDimensions[0].name);
|
|
10359
|
-
|
|
10806
|
+
|
|
10807
|
+
if (!activeWMJSDim) {
|
|
10808
|
+
return null;
|
|
10809
|
+
}
|
|
10810
|
+
|
|
10360
10811
|
var availableDimValues = [];
|
|
10361
10812
|
|
|
10362
10813
|
for (var j = 0; j < activeWMJSDim.size(); j += 1) {
|
|
@@ -10370,11 +10821,18 @@
|
|
|
10370
10821
|
};
|
|
10371
10822
|
|
|
10372
10823
|
var valuesToDisplay = getValuesToDisplay();
|
|
10373
|
-
|
|
10824
|
+
|
|
10825
|
+
if (valuesToDisplay === null) {
|
|
10826
|
+
return null;
|
|
10827
|
+
}
|
|
10828
|
+
|
|
10374
10829
|
var activeDim = layerDimensions.find(function (dim) {
|
|
10375
10830
|
return dim.name === activeDimName;
|
|
10376
10831
|
});
|
|
10377
|
-
|
|
10832
|
+
|
|
10833
|
+
if (!activeDim) {
|
|
10834
|
+
return null;
|
|
10835
|
+
}
|
|
10378
10836
|
|
|
10379
10837
|
var selectDimensionValue = function selectDimensionValue(event) {
|
|
10380
10838
|
event.stopPropagation();
|
|
@@ -10405,7 +10863,11 @@
|
|
|
10405
10863
|
var dimValueCurrentIndex = valuesToDisplay.findIndex(function (value) {
|
|
10406
10864
|
return value === activeDim.currentValue;
|
|
10407
10865
|
});
|
|
10408
|
-
|
|
10866
|
+
|
|
10867
|
+
if (dimValueCurrentIndex === -1) {
|
|
10868
|
+
return null;
|
|
10869
|
+
}
|
|
10870
|
+
|
|
10409
10871
|
return /*#__PURE__*/React__namespace.createElement(material.Grid, {
|
|
10410
10872
|
container: true,
|
|
10411
10873
|
direction: "row",
|
|
@@ -10686,7 +11148,9 @@
|
|
|
10686
11148
|
}
|
|
10687
11149
|
}, [anchorEl]);
|
|
10688
11150
|
var onMouseEnter = React__namespace.useCallback(function () {
|
|
10689
|
-
if (!isOpen)
|
|
11151
|
+
if (!isOpen) {
|
|
11152
|
+
setTooltipOpen(true);
|
|
11153
|
+
}
|
|
10690
11154
|
}, [isOpen, setTooltipOpen]);
|
|
10691
11155
|
var onMouseLeave = React__namespace.useCallback(function () {
|
|
10692
11156
|
setTooltipOpen(false);
|
|
@@ -10917,15 +11381,15 @@
|
|
|
10917
11381
|
inputProps: {
|
|
10918
11382
|
IconComponent: function IconComponent() {
|
|
10919
11383
|
return null;
|
|
10920
|
-
}
|
|
11384
|
+
},
|
|
11385
|
+
tabIndex: -1
|
|
10921
11386
|
},
|
|
10922
11387
|
value: isActive ? 'Both' : 'None',
|
|
10923
11388
|
sx: {
|
|
10924
|
-
'&& .
|
|
10925
|
-
|
|
10926
|
-
|
|
10927
|
-
|
|
10928
|
-
paddingRight: 0
|
|
11389
|
+
'&& .MuiInput-input': {
|
|
11390
|
+
paddingRight: '2px',
|
|
11391
|
+
paddingLeft: '2px',
|
|
11392
|
+
backgroundColor: 'inherit'
|
|
10929
11393
|
}
|
|
10930
11394
|
},
|
|
10931
11395
|
renderValue: function renderValue(optionSelected) {
|
|
@@ -10963,8 +11427,6 @@
|
|
|
10963
11427
|
isActive = _a.isActive,
|
|
10964
11428
|
isEnabled = _a.isEnabled;
|
|
10965
11429
|
var style = {
|
|
10966
|
-
backgroundColor: isActive ? 'geowebColors.buttons.primary.active.fill' : 'transparent!important',
|
|
10967
|
-
borderRadius: '5px',
|
|
10968
11430
|
color: getIconColor(isActive, isEnabled)
|
|
10969
11431
|
};
|
|
10970
11432
|
var Icon = isActive ? /*#__PURE__*/React__namespace.createElement(theme.Both, {
|
|
@@ -10977,9 +11439,10 @@
|
|
|
10977
11439
|
"aria-label": "Auto update " + optionSelected,
|
|
10978
11440
|
sx: {
|
|
10979
11441
|
'&.MuiButtonBase-root': {
|
|
10980
|
-
backgroundColor: '
|
|
11442
|
+
backgroundColor: 'inherit'
|
|
10981
11443
|
}
|
|
10982
|
-
}
|
|
11444
|
+
},
|
|
11445
|
+
active: isActive
|
|
10983
11446
|
}, Icon);
|
|
10984
11447
|
};
|
|
10985
11448
|
|
|
@@ -11083,16 +11546,18 @@
|
|
|
11083
11546
|
padding: 0
|
|
11084
11547
|
}
|
|
11085
11548
|
},
|
|
11086
|
-
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, {
|
|
11087
11550
|
isEnabled: layer.enabled,
|
|
11088
|
-
|
|
11089
|
-
|
|
11551
|
+
tooltipTitle: layer.name,
|
|
11552
|
+
onClick: function onClick(event) {
|
|
11553
|
+
event.stopPropagation();
|
|
11090
11554
|
onLayerEnable({
|
|
11091
11555
|
layerId: layerId,
|
|
11092
11556
|
enabled: !layer.enabled
|
|
11093
11557
|
});
|
|
11094
11558
|
},
|
|
11095
|
-
|
|
11559
|
+
"data-testid": "enableButton-medium",
|
|
11560
|
+
icon: isEnabled ? /*#__PURE__*/React__default["default"].createElement(theme.Visibility, null) : /*#__PURE__*/React__default["default"].createElement(theme.VisibilityOff, null)
|
|
11096
11561
|
}), layerActiveLayout || /*#__PURE__*/React__default["default"].createElement(ActivateLayer, {
|
|
11097
11562
|
onChange: onClickRow,
|
|
11098
11563
|
isActive: false,
|
|
@@ -11154,26 +11619,31 @@
|
|
|
11154
11619
|
}, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
11155
11620
|
item: true,
|
|
11156
11621
|
sx: {}
|
|
11157
|
-
}, layerDeleteLayout || /*#__PURE__*/React__default["default"].createElement(shared.
|
|
11622
|
+
}, layerDeleteLayout || /*#__PURE__*/React__default["default"].createElement(shared.ManagerButton, {
|
|
11158
11623
|
tooltipTitle: "Delete",
|
|
11159
|
-
|
|
11624
|
+
onClick: function onClick() {
|
|
11160
11625
|
onLayerDelete({
|
|
11161
11626
|
mapId: mapId,
|
|
11162
11627
|
layerId: layerId
|
|
11163
11628
|
});
|
|
11164
|
-
}
|
|
11629
|
+
},
|
|
11630
|
+
icon: /*#__PURE__*/React__default["default"].createElement(theme.Delete, null),
|
|
11631
|
+
"data-testid": "deleteButton"
|
|
11165
11632
|
}))))), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
11166
11633
|
item: true,
|
|
11167
11634
|
className: columnClasses.column1
|
|
11168
|
-
}, dragHandle, layerEnableLayout || /*#__PURE__*/React__default["default"].createElement(shared.
|
|
11635
|
+
}, dragHandle, layerEnableLayout || /*#__PURE__*/React__default["default"].createElement(shared.ManagerButton, {
|
|
11169
11636
|
isEnabled: layer.enabled,
|
|
11170
|
-
|
|
11171
|
-
|
|
11637
|
+
tooltipTitle: layer.name,
|
|
11638
|
+
onClick: function onClick(event) {
|
|
11639
|
+
event.stopPropagation();
|
|
11172
11640
|
onLayerEnable({
|
|
11173
11641
|
layerId: layerId,
|
|
11174
11642
|
enabled: !layer.enabled
|
|
11175
11643
|
});
|
|
11176
|
-
}
|
|
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"
|
|
11177
11647
|
}), layerActiveLayout || /*#__PURE__*/React__default["default"].createElement(ActivateLayer, {
|
|
11178
11648
|
onChange: onClickRow,
|
|
11179
11649
|
isActive: false,
|
|
@@ -11240,14 +11710,16 @@
|
|
|
11240
11710
|
}))), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
11241
11711
|
item: true,
|
|
11242
11712
|
className: columnClasses.column6
|
|
11243
|
-
}, layerDeleteLayout || /*#__PURE__*/React__default["default"].createElement(shared.
|
|
11713
|
+
}, layerDeleteLayout || /*#__PURE__*/React__default["default"].createElement(shared.ManagerButton, {
|
|
11244
11714
|
tooltipTitle: "Delete",
|
|
11245
|
-
|
|
11715
|
+
onClick: function onClick() {
|
|
11246
11716
|
onLayerDelete({
|
|
11247
11717
|
mapId: mapId,
|
|
11248
11718
|
layerId: layerId
|
|
11249
11719
|
});
|
|
11250
|
-
}
|
|
11720
|
+
},
|
|
11721
|
+
icon: /*#__PURE__*/React__default["default"].createElement(theme.Delete, null),
|
|
11722
|
+
"data-testid": "deleteButton"
|
|
11251
11723
|
}), layerMenuLayout || /*#__PURE__*/React__default["default"].createElement(LayerManagerMenuButton, {
|
|
11252
11724
|
mapId: mapId,
|
|
11253
11725
|
layerId: layerId,
|
|
@@ -11291,16 +11763,18 @@
|
|
|
11291
11763
|
var isLayerEnabled = reactRedux.useSelector(function (store) {
|
|
11292
11764
|
return getLayerEnabled(store, layerId);
|
|
11293
11765
|
});
|
|
11294
|
-
return /*#__PURE__*/React__namespace.createElement(shared.
|
|
11766
|
+
return /*#__PURE__*/React__namespace.createElement(shared.ManagerButton, {
|
|
11295
11767
|
tooltipTitle: "Delete",
|
|
11296
|
-
|
|
11768
|
+
onClick: function onClick() {
|
|
11297
11769
|
layerDelete({
|
|
11298
11770
|
mapId: mapId,
|
|
11299
11771
|
layerId: layerId,
|
|
11300
11772
|
layerIndex: layerIndex
|
|
11301
11773
|
});
|
|
11302
11774
|
},
|
|
11303
|
-
isEnabled: isLayerEnabled
|
|
11775
|
+
isEnabled: isLayerEnabled,
|
|
11776
|
+
icon: /*#__PURE__*/React__namespace.createElement(theme.Delete, null),
|
|
11777
|
+
"data-testid": "deleteButton"
|
|
11304
11778
|
});
|
|
11305
11779
|
};
|
|
11306
11780
|
|
|
@@ -11339,26 +11813,32 @@
|
|
|
11339
11813
|
origin: LayerActionOrigin.layerManager
|
|
11340
11814
|
}));
|
|
11341
11815
|
}, [dispatch, mapId]);
|
|
11342
|
-
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, {
|
|
11343
11817
|
isEnabled: isEnabled,
|
|
11344
|
-
|
|
11345
|
-
|
|
11818
|
+
tooltipTitle: "Toggle visibility",
|
|
11819
|
+
onClick: function onClick(event) {
|
|
11820
|
+
event.stopPropagation();
|
|
11346
11821
|
layerChangeEnabled({
|
|
11347
11822
|
layerId: layerId,
|
|
11348
|
-
enabled:
|
|
11823
|
+
enabled: !isEnabled
|
|
11349
11824
|
});
|
|
11350
11825
|
},
|
|
11351
|
-
className: "enable-btn"
|
|
11352
|
-
|
|
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, {
|
|
11353
11830
|
isEnabled: isEnabled,
|
|
11354
|
-
|
|
11355
|
-
|
|
11831
|
+
tooltipTitle: layerName,
|
|
11832
|
+
onClick: function onClick(event) {
|
|
11833
|
+
event.stopPropagation();
|
|
11356
11834
|
layerChangeEnabled({
|
|
11357
11835
|
layerId: layerId,
|
|
11358
|
-
enabled:
|
|
11836
|
+
enabled: !isEnabled
|
|
11359
11837
|
});
|
|
11360
11838
|
},
|
|
11361
|
-
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"
|
|
11362
11842
|
}));
|
|
11363
11843
|
};
|
|
11364
11844
|
|
|
@@ -11509,92 +11989,6 @@
|
|
|
11509
11989
|
});
|
|
11510
11990
|
};
|
|
11511
11991
|
|
|
11512
|
-
/* *
|
|
11513
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11514
|
-
* you may not use this file except in compliance with the License.
|
|
11515
|
-
* You may obtain a copy of the License at
|
|
11516
|
-
*
|
|
11517
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11518
|
-
*
|
|
11519
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11520
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11521
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11522
|
-
* See the License for the specific language governing permissions and
|
|
11523
|
-
* limitations under the License.
|
|
11524
|
-
*
|
|
11525
|
-
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11526
|
-
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
11527
|
-
* */
|
|
11528
|
-
/**
|
|
11529
|
-
* Converts webmapjs node structure to LayerTree
|
|
11530
|
-
* @param nodesToRecur THe WebMapJS node structure from service.getNodes();
|
|
11531
|
-
*/
|
|
11532
|
-
|
|
11533
|
-
var recurseNodes = function recurseNodes(nodesToRecur) {
|
|
11534
|
-
var newLayerTreeObj = {
|
|
11535
|
-
leaf: nodesToRecur.leaf,
|
|
11536
|
-
name: nodesToRecur.name,
|
|
11537
|
-
title: nodesToRecur.title,
|
|
11538
|
-
path: nodesToRecur.path || [],
|
|
11539
|
-
children: [],
|
|
11540
|
-
keywords: nodesToRecur.keywords || [],
|
|
11541
|
-
"abstract": nodesToRecur["abstract"] || '',
|
|
11542
|
-
styles: nodesToRecur.styles || [],
|
|
11543
|
-
dimensions: nodesToRecur.dimensions || [],
|
|
11544
|
-
geographicBoundingBox: nodesToRecur.geographicBoundingBox || null
|
|
11545
|
-
};
|
|
11546
|
-
|
|
11547
|
-
if (nodesToRecur.children) {
|
|
11548
|
-
for (var j = 0; j < nodesToRecur.children.length; j += 1) {
|
|
11549
|
-
newLayerTreeObj.children.push(recurseNodes(nodesToRecur.children[j]));
|
|
11550
|
-
}
|
|
11551
|
-
}
|
|
11552
|
-
|
|
11553
|
-
return newLayerTreeObj;
|
|
11554
|
-
};
|
|
11555
|
-
/**
|
|
11556
|
-
* Returns a promise with a hierarchical tree of layers from the WMS GetCapabilities document.
|
|
11557
|
-
* @param serviceUrl The URL of the WMS service
|
|
11558
|
-
* @param {boolean} forceReload **optional** forceReload: boolean, true will force the layers to be reloaded from the service, defaults to false
|
|
11559
|
-
*/
|
|
11560
|
-
|
|
11561
|
-
var getLayersFromService = function getLayersFromService(serviceUrl, forceReload) {
|
|
11562
|
-
if (forceReload === void 0) {
|
|
11563
|
-
forceReload = false;
|
|
11564
|
-
}
|
|
11565
|
-
|
|
11566
|
-
return new Promise(function (resolve, reject) {
|
|
11567
|
-
var serviceObject = webmap.WMGetServiceFromStore(serviceUrl);
|
|
11568
|
-
serviceObject.getNodes(function (nodes) {
|
|
11569
|
-
// TODO: Maarten Plieger, 2022-11-02: Harmonize types and use correct types: https://gitlab.com/opengeoweb/opengeoweb/-/issues/2817
|
|
11570
|
-
var layerTree = recurseNodes(nodes);
|
|
11571
|
-
resolve(layerTree);
|
|
11572
|
-
}, function (error) {
|
|
11573
|
-
reject(new Error(error));
|
|
11574
|
-
}, forceReload);
|
|
11575
|
-
});
|
|
11576
|
-
};
|
|
11577
|
-
/**
|
|
11578
|
-
* Returns a promise with an array of flattened layerobjects from the WMS GetCapabilities document.
|
|
11579
|
-
* @param serviceUrl The URL of the WMS service
|
|
11580
|
-
* @param {boolean} forceReload **optional** forceReload: boolean, true will force the layers to be reloaded from the service, defaults to false
|
|
11581
|
-
*/
|
|
11582
|
-
|
|
11583
|
-
var getLayersFlattenedFromService = function getLayersFlattenedFromService(serviceUrl, forceReload) {
|
|
11584
|
-
if (forceReload === void 0) {
|
|
11585
|
-
forceReload = false;
|
|
11586
|
-
}
|
|
11587
|
-
|
|
11588
|
-
return new Promise(function (resolve, reject) {
|
|
11589
|
-
var serviceObject = webmap.WMGetServiceFromStore(serviceUrl);
|
|
11590
|
-
serviceObject.getLayerObjectsFlat(function (layers) {
|
|
11591
|
-
resolve(layers);
|
|
11592
|
-
}, function (error) {
|
|
11593
|
-
reject(new Error(error));
|
|
11594
|
-
}, forceReload);
|
|
11595
|
-
});
|
|
11596
|
-
};
|
|
11597
|
-
|
|
11598
11992
|
/* *
|
|
11599
11993
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11600
11994
|
* you may not use this file except in compliance with the License.
|
|
@@ -11783,8 +12177,9 @@
|
|
|
11783
12177
|
var setActiveLayerId = React__namespace.useCallback(function (_a) {
|
|
11784
12178
|
var layerId = _a.layerId,
|
|
11785
12179
|
mapId = _a.mapId;
|
|
11786
|
-
return dispatch(mapActions$1.
|
|
11787
|
-
|
|
12180
|
+
return dispatch(mapActions$1.setAutoLayerId({
|
|
12181
|
+
autoTimeStepLayerId: layerId,
|
|
12182
|
+
autoUpdateLayerId: layerId,
|
|
11788
12183
|
mapId: mapId,
|
|
11789
12184
|
origin: LayerActionOrigin.layerManager
|
|
11790
12185
|
}));
|
|
@@ -11934,11 +12329,10 @@
|
|
|
11934
12329
|
return /*#__PURE__*/React__default["default"].createElement(shared.ManagerButton, {
|
|
11935
12330
|
tooltipTitle: tooltipTitle,
|
|
11936
12331
|
icon: /*#__PURE__*/React__default["default"].createElement(theme.DragHandle, null),
|
|
11937
|
-
|
|
12332
|
+
"data-testid": "dragHandle" + (index !== undefined ? "-" + index : ''),
|
|
11938
12333
|
className: "handle",
|
|
11939
12334
|
tabIndex: -1,
|
|
11940
12335
|
isEnabled: !isDisabled,
|
|
11941
|
-
disableFocusRipple: true,
|
|
11942
12336
|
disableTouchRipple: true,
|
|
11943
12337
|
disabled: isDisabled,
|
|
11944
12338
|
isAccessible: true,
|
|
@@ -12005,7 +12399,10 @@
|
|
|
12005
12399
|
var onStart = React__namespace.useCallback(function (_a) {
|
|
12006
12400
|
var oldIndex = _a.oldIndex;
|
|
12007
12401
|
setActiveDragIndex(oldIndex);
|
|
12008
|
-
|
|
12402
|
+
|
|
12403
|
+
if (Sortable__default["default"].ghost) {
|
|
12404
|
+
Sortable__default["default"].ghost.style.opacity = '1';
|
|
12405
|
+
}
|
|
12009
12406
|
}, []);
|
|
12010
12407
|
var onEnd = React__namespace.useCallback(function () {
|
|
12011
12408
|
if (activeDragIndex !== null) {
|
|
@@ -12625,7 +13022,9 @@
|
|
|
12625
13022
|
onClickLayer: function onClickLayer(serviceURL, layerName) {
|
|
12626
13023
|
if (layerType === LayerType.baseLayer) {
|
|
12627
13024
|
addBaseLayer(serviceURL, layerName);
|
|
12628
|
-
} else
|
|
13025
|
+
} else {
|
|
13026
|
+
addMapLayer(serviceURL, layerName);
|
|
13027
|
+
}
|
|
12629
13028
|
},
|
|
12630
13029
|
highlightedLayers: loadedLayers
|
|
12631
13030
|
});
|
|
@@ -12776,9 +13175,16 @@
|
|
|
12776
13175
|
* */
|
|
12777
13176
|
|
|
12778
13177
|
var validateServiceUrl$1 = function validateServiceUrl(url) {
|
|
12779
|
-
if (url === '' || url === null || typeof url === 'undefined')
|
|
13178
|
+
if (url === '' || url === null || typeof url === 'undefined') {
|
|
13179
|
+
return false;
|
|
13180
|
+
}
|
|
13181
|
+
|
|
12780
13182
|
var matcher = /^(?:\w+:)?\/\/([^\s.]+\.\S{2}|[0-9a-zA-Z]+[:?\d]*)\S*$/;
|
|
12781
|
-
|
|
13183
|
+
|
|
13184
|
+
if (!matcher.test(url)) {
|
|
13185
|
+
return false;
|
|
13186
|
+
}
|
|
13187
|
+
|
|
12782
13188
|
return true;
|
|
12783
13189
|
};
|
|
12784
13190
|
|
|
@@ -13113,8 +13519,56 @@
|
|
|
13113
13519
|
* See the License for the specific language governing permissions and
|
|
13114
13520
|
* limitations under the License.
|
|
13115
13521
|
*
|
|
13116
|
-
* Copyright
|
|
13117
|
-
* 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)
|
|
13118
13572
|
* */
|
|
13119
13573
|
var styles$2 = {
|
|
13120
13574
|
layerRowContainer: {
|
|
@@ -13171,16 +13625,18 @@
|
|
|
13171
13625
|
startPosition = _k === void 0 ? {
|
|
13172
13626
|
top: 85,
|
|
13173
13627
|
left: 50
|
|
13174
|
-
} : _k
|
|
13628
|
+
} : _k,
|
|
13629
|
+
_l = _a.setFocused,
|
|
13630
|
+
setFocused = _l === void 0 ? function () {} : _l;
|
|
13175
13631
|
var minSize = {
|
|
13176
13632
|
width: 100,
|
|
13177
13633
|
height: 126
|
|
13178
13634
|
};
|
|
13179
13635
|
var startSizeCalc = calculateStartSize(minSize, size, startPosition);
|
|
13180
13636
|
|
|
13181
|
-
var
|
|
13182
|
-
sizeInState =
|
|
13183
|
-
setSizeInState =
|
|
13637
|
+
var _m = __read(React__namespace.useState(startSizeCalc), 2),
|
|
13638
|
+
sizeInState = _m[0],
|
|
13639
|
+
setSizeInState = _m[1];
|
|
13184
13640
|
|
|
13185
13641
|
React__namespace.useEffect(function () {
|
|
13186
13642
|
if (size !== sizeInState && isDockedLayerManager && isOpen) {
|
|
@@ -13200,11 +13656,18 @@
|
|
|
13200
13656
|
bounds: bounds,
|
|
13201
13657
|
"data-testid": "layerManagerWindow",
|
|
13202
13658
|
onMouseDown: onMouseDown,
|
|
13659
|
+
onFocus: function onFocus() {
|
|
13660
|
+
return setFocused(true);
|
|
13661
|
+
},
|
|
13662
|
+
onBlur: function onBlur() {
|
|
13663
|
+
return setFocused(false);
|
|
13664
|
+
},
|
|
13203
13665
|
order: order,
|
|
13204
13666
|
source: source,
|
|
13205
13667
|
leftHeaderComponent: leftHeaderComponent,
|
|
13206
|
-
rightHeaderComponent: /*#__PURE__*/React__namespace.createElement(
|
|
13668
|
+
rightHeaderComponent: /*#__PURE__*/React__namespace.createElement(HeaderOptionsConnect, {
|
|
13207
13669
|
isDockedLayerManager: isDockedLayerManager,
|
|
13670
|
+
mapId: mapId,
|
|
13208
13671
|
onClickDockButton: onToggleDock,
|
|
13209
13672
|
onChangeSize: function onChangeSize(_a) {
|
|
13210
13673
|
var width = _a.width;
|
|
@@ -13279,8 +13742,8 @@
|
|
|
13279
13742
|
* See the License for the specific language governing permissions and
|
|
13280
13743
|
* limitations under the License.
|
|
13281
13744
|
*
|
|
13282
|
-
* Copyright
|
|
13283
|
-
* Copyright
|
|
13745
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
13746
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
13284
13747
|
* */
|
|
13285
13748
|
var useSetupDialog = function useSetupDialog(dialogType, source) {
|
|
13286
13749
|
if (source === void 0) {
|
|
@@ -13350,6 +13813,14 @@
|
|
|
13350
13813
|
var uiError = reactRedux.useSelector(function (store) {
|
|
13351
13814
|
return getDialogError(store, dialogType);
|
|
13352
13815
|
});
|
|
13816
|
+
|
|
13817
|
+
var setFocused = function setFocused(focused) {
|
|
13818
|
+
dispatch(uiActions.setDialogFocused({
|
|
13819
|
+
type: dialogType,
|
|
13820
|
+
focused: focused
|
|
13821
|
+
}));
|
|
13822
|
+
};
|
|
13823
|
+
|
|
13353
13824
|
return {
|
|
13354
13825
|
setDialogOrder: setDialogOrder,
|
|
13355
13826
|
dialogOrder: dialogOrder,
|
|
@@ -13357,7 +13828,8 @@
|
|
|
13357
13828
|
uiSource: uiSource,
|
|
13358
13829
|
isDialogOpen: isDialogOpen,
|
|
13359
13830
|
uiIsLoading: uiIsLoading,
|
|
13360
|
-
uiError: uiError
|
|
13831
|
+
uiError: uiError,
|
|
13832
|
+
setFocused: setFocused
|
|
13361
13833
|
};
|
|
13362
13834
|
};
|
|
13363
13835
|
|
|
@@ -13374,62 +13846,42 @@
|
|
|
13374
13846
|
* See the License for the specific language governing permissions and
|
|
13375
13847
|
* limitations under the License.
|
|
13376
13848
|
*
|
|
13377
|
-
* Copyright
|
|
13378
|
-
* Copyright
|
|
13849
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
13850
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
13379
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
|
+
};
|
|
13380
13865
|
var useFetchServices = function useFetchServices(dialogType, preloadedServices) {
|
|
13381
13866
|
if (preloadedServices === void 0) {
|
|
13382
13867
|
preloadedServices = preloadedDefaultMapServices;
|
|
13383
13868
|
}
|
|
13384
13869
|
|
|
13385
13870
|
var dispatch = reactRedux.useDispatch();
|
|
13386
|
-
var isMounted = shared.useIsMounted().isMounted;
|
|
13387
13871
|
var isOpenInStore = reactRedux.useSelector(function (store) {
|
|
13388
13872
|
return getisDialogOpen(store, dialogType);
|
|
13389
13873
|
});
|
|
13390
|
-
var
|
|
13391
|
-
dispatch(serviceActions.
|
|
13392
|
-
|
|
13393
|
-
|
|
13394
|
-
dispatch(layerSelectActions.addFiltersAndActiveServices(payload));
|
|
13874
|
+
var fetchInitialServices = React__namespace.useCallback(function (services) {
|
|
13875
|
+
dispatch(serviceActions.fetchInitialServices({
|
|
13876
|
+
services: services
|
|
13877
|
+
}));
|
|
13395
13878
|
}, [dispatch]);
|
|
13396
13879
|
React__namespace.useEffect(function () {
|
|
13397
13880
|
if (isOpenInStore && preloadedServices && preloadedServices.length > 0) {
|
|
13398
|
-
mergePresetsAndUserAddedServices(preloadedServices, getUserAddedServices())
|
|
13399
|
-
|
|
13400
|
-
var scope = service.scope ? service.scope : 'system';
|
|
13401
|
-
|
|
13402
|
-
if (isMounted.current) {
|
|
13403
|
-
addFiltersAndActiveServices({
|
|
13404
|
-
serviceId: wmService.id,
|
|
13405
|
-
serviceName: service.name,
|
|
13406
|
-
serviceUrl: service.url,
|
|
13407
|
-
keywords: [],
|
|
13408
|
-
scope: scope,
|
|
13409
|
-
groups: [],
|
|
13410
|
-
"abstract": service["abstract"] || wmService["abstract"],
|
|
13411
|
-
isLoading: true
|
|
13412
|
-
});
|
|
13413
|
-
}
|
|
13414
|
-
|
|
13415
|
-
getLayersFlattenedFromService(service.url).then(function (layers) {
|
|
13416
|
-
if (isMounted.current) {
|
|
13417
|
-
serviceSetLayers({
|
|
13418
|
-
id: wmService.id,
|
|
13419
|
-
name: service.name,
|
|
13420
|
-
serviceUrl: service.url,
|
|
13421
|
-
layers: layers,
|
|
13422
|
-
scope: scope,
|
|
13423
|
-
// first try to load the user abstract, otherwise the service abstract
|
|
13424
|
-
"abstract": service["abstract"] || wmService["abstract"]
|
|
13425
|
-
});
|
|
13426
|
-
}
|
|
13427
|
-
})["catch"](function () {
|
|
13428
|
-
return null;
|
|
13429
|
-
});
|
|
13430
|
-
});
|
|
13881
|
+
var allServicesToLoad = mergePresetsAndUserAddedServices(preloadedServices, getUserAddedServices());
|
|
13882
|
+
fetchInitialServices(getServicesToLoad(allServicesToLoad));
|
|
13431
13883
|
}
|
|
13432
|
-
}, [
|
|
13884
|
+
}, [isOpenInStore, preloadedServices, fetchInitialServices]);
|
|
13433
13885
|
};
|
|
13434
13886
|
var mergePresetsAndUserAddedServices = function mergePresetsAndUserAddedServices(presets, userAddedServices) {
|
|
13435
13887
|
return Object.values(__assign(__assign({}, presets.reduce(function (byUrl, preset) {
|
|
@@ -13452,8 +13904,8 @@
|
|
|
13452
13904
|
* See the License for the specific language governing permissions and
|
|
13453
13905
|
* limitations under the License.
|
|
13454
13906
|
*
|
|
13455
|
-
* Copyright
|
|
13456
|
-
* Copyright
|
|
13907
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
13908
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
13457
13909
|
* */
|
|
13458
13910
|
var dialogType = DialogTypes.LayerManager;
|
|
13459
13911
|
/**
|
|
@@ -13489,7 +13941,8 @@
|
|
|
13489
13941
|
isDialogOpen = _d.isDialogOpen,
|
|
13490
13942
|
uiSource = _d.uiSource,
|
|
13491
13943
|
uiIsLoading = _d.uiIsLoading,
|
|
13492
|
-
uiError = _d.uiError
|
|
13944
|
+
uiError = _d.uiError,
|
|
13945
|
+
setFocused = _d.setFocused;
|
|
13493
13946
|
|
|
13494
13947
|
useFetchServices(dialogType, preloadedMapServices);
|
|
13495
13948
|
|
|
@@ -13517,7 +13970,8 @@
|
|
|
13517
13970
|
leftHeaderComponent: leftHeaderComponent,
|
|
13518
13971
|
isLoading: uiIsLoading,
|
|
13519
13972
|
error: uiError,
|
|
13520
|
-
onToggleDock: onToggleDock
|
|
13973
|
+
onToggleDock: onToggleDock,
|
|
13974
|
+
setFocused: setFocused
|
|
13521
13975
|
});
|
|
13522
13976
|
};
|
|
13523
13977
|
|
|
@@ -13755,7 +14209,12 @@
|
|
|
13755
14209
|
|
|
13756
14210
|
var handleChange = function handleChange(text) {
|
|
13757
14211
|
setLocalSearchString(text);
|
|
13758
|
-
|
|
14212
|
+
|
|
14213
|
+
if (!isURL(text)) {
|
|
14214
|
+
setSearchFilterDebounced(text);
|
|
14215
|
+
} else if (searchFilter) {
|
|
14216
|
+
setSearchFilterDebounced('');
|
|
14217
|
+
}
|
|
13759
14218
|
};
|
|
13760
14219
|
|
|
13761
14220
|
React__namespace.useEffect(function () {
|
|
@@ -13782,7 +14241,10 @@
|
|
|
13782
14241
|
}, [urlIsValid, localSearchString, onOpenServicePopup]); // mirror store unless typing a URL
|
|
13783
14242
|
|
|
13784
14243
|
React__namespace.useEffect(function () {
|
|
13785
|
-
if (isURL(localSearchString))
|
|
14244
|
+
if (isURL(localSearchString)) {
|
|
14245
|
+
return;
|
|
14246
|
+
}
|
|
14247
|
+
|
|
13786
14248
|
setLocalSearchString(searchFilter); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13787
14249
|
}, [searchFilter]);
|
|
13788
14250
|
return /*#__PURE__*/React__namespace.createElement(material.TextField, {
|
|
@@ -14446,13 +14908,19 @@
|
|
|
14446
14908
|
};
|
|
14447
14909
|
var breakpoint = 500;
|
|
14448
14910
|
var widthToColumns = function widthToColumns(width) {
|
|
14449
|
-
if (width <= breakpoint)
|
|
14911
|
+
if (width <= breakpoint) {
|
|
14912
|
+
return layerSelectColumnsSmall;
|
|
14913
|
+
}
|
|
14914
|
+
|
|
14450
14915
|
return layerSelectColumnsLarge;
|
|
14451
14916
|
};
|
|
14452
14917
|
var rowHeightLarge = 68;
|
|
14453
14918
|
var rowHeightSmall = 136;
|
|
14454
14919
|
var widthToRowHeight = function widthToRowHeight(width) {
|
|
14455
|
-
if (width <= breakpoint)
|
|
14920
|
+
if (width <= breakpoint) {
|
|
14921
|
+
return rowHeightSmall;
|
|
14922
|
+
}
|
|
14923
|
+
|
|
14456
14924
|
return rowHeightLarge;
|
|
14457
14925
|
};
|
|
14458
14926
|
var sortByService = function sortByService(serviceObj) {
|
|
@@ -15177,7 +15645,9 @@
|
|
|
15177
15645
|
sx: styles$1.servicesContainer,
|
|
15178
15646
|
"data-testid": "ServiceDialog",
|
|
15179
15647
|
onKeyDown: function onKeyDown(event) {
|
|
15180
|
-
if (event.key !== 'Escape')
|
|
15648
|
+
if (event.key !== 'Escape') {
|
|
15649
|
+
event.stopPropagation();
|
|
15650
|
+
}
|
|
15181
15651
|
},
|
|
15182
15652
|
tabIndex: -1,
|
|
15183
15653
|
ref: dialogRef
|
|
@@ -15238,7 +15708,11 @@
|
|
|
15238
15708
|
var foundService = selectedLayers.find(function (object) {
|
|
15239
15709
|
return object.service === serviceUrl;
|
|
15240
15710
|
});
|
|
15241
|
-
|
|
15711
|
+
|
|
15712
|
+
if (foundService) {
|
|
15713
|
+
return true;
|
|
15714
|
+
}
|
|
15715
|
+
|
|
15242
15716
|
return false;
|
|
15243
15717
|
};
|
|
15244
15718
|
|
|
@@ -15471,7 +15945,11 @@
|
|
|
15471
15945
|
|
|
15472
15946
|
return ((_a = services[serviceId]) === null || _a === void 0 ? void 0 : _a.serviceUrl) === serviceUrl;
|
|
15473
15947
|
});
|
|
15474
|
-
|
|
15948
|
+
|
|
15949
|
+
if (serviceIndex < 0) {
|
|
15950
|
+
return null;
|
|
15951
|
+
}
|
|
15952
|
+
|
|
15475
15953
|
return services[serviceIds[serviceIndex]];
|
|
15476
15954
|
};
|
|
15477
15955
|
|
|
@@ -16149,7 +16627,10 @@
|
|
|
16149
16627
|
uiSource = _a.uiSource,
|
|
16150
16628
|
isDialogOpen = _a.isDialogOpen;
|
|
16151
16629
|
|
|
16152
|
-
if (!layer)
|
|
16630
|
+
if (!layer) {
|
|
16631
|
+
return null;
|
|
16632
|
+
}
|
|
16633
|
+
|
|
16153
16634
|
return /*#__PURE__*/React__default["default"].createElement(LayerInfoDialog, {
|
|
16154
16635
|
isOpen: isDialogOpen,
|
|
16155
16636
|
onClose: onCloseDialog,
|
|
@@ -17114,7 +17595,10 @@
|
|
|
17114
17595
|
onKeyDown: upDownNavigation,
|
|
17115
17596
|
onChange: function onChange(e, val) {
|
|
17116
17597
|
onChangeDimensionValue(values[val].toString());
|
|
17117
|
-
|
|
17598
|
+
|
|
17599
|
+
if (!managedValue) {
|
|
17600
|
+
setCurrentIndex(val);
|
|
17601
|
+
}
|
|
17118
17602
|
}
|
|
17119
17603
|
}))), /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
|
|
17120
17604
|
title: layerTitle
|
|
@@ -17146,7 +17630,10 @@
|
|
|
17146
17630
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
17147
17631
|
* */
|
|
17148
17632
|
var marksByDimension = function marksByDimension(dim) {
|
|
17149
|
-
if (!dim || !dim.name)
|
|
17633
|
+
if (!dim || !dim.name) {
|
|
17634
|
+
return [];
|
|
17635
|
+
}
|
|
17636
|
+
|
|
17150
17637
|
var dimCnf = dimensionConfig.find(function (cnf) {
|
|
17151
17638
|
return cnf.name === dim.name;
|
|
17152
17639
|
});
|
|
@@ -17172,7 +17659,9 @@
|
|
|
17172
17659
|
|
|
17173
17660
|
var handleMomentISOString = function handleMomentISOString(dateIn) {
|
|
17174
17661
|
/* Try to fix the timestrings generated by moment js made with moment.toISOString() */
|
|
17175
|
-
if (!dateIn)
|
|
17662
|
+
if (!dateIn) {
|
|
17663
|
+
return null;
|
|
17664
|
+
}
|
|
17176
17665
|
|
|
17177
17666
|
if (dateIn.length > 20) {
|
|
17178
17667
|
var fixedDate = dateIn.substring(0, 19);
|
|
@@ -17906,7 +18395,10 @@
|
|
|
17906
18395
|
};
|
|
17907
18396
|
|
|
17908
18397
|
var handleToggleTimeStep = function handleToggleTimeStep() {
|
|
17909
|
-
if (isTimestepAuto)
|
|
18398
|
+
if (isTimestepAuto) {
|
|
18399
|
+
return;
|
|
18400
|
+
}
|
|
18401
|
+
|
|
17910
18402
|
onToggleTimestepAuto();
|
|
17911
18403
|
timeStepFromLayer && onChangeTimeStep(timeStepFromLayer, MapActionOrigin.map);
|
|
17912
18404
|
};
|
|
@@ -18406,32 +18898,53 @@
|
|
|
18406
18898
|
switch (scale) {
|
|
18407
18899
|
case Scale.Hour:
|
|
18408
18900
|
{
|
|
18409
|
-
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
|
+
}
|
|
18410
18909
|
|
|
18411
|
-
if (rem % (15 * 60) === 0) return TICK_MARK_HEIGHT_SECONDARY;
|
|
18412
18910
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
18413
18911
|
}
|
|
18414
18912
|
|
|
18415
18913
|
case Scale.Hours3:
|
|
18416
18914
|
{
|
|
18417
|
-
if (rem === 0)
|
|
18915
|
+
if (rem === 0) {
|
|
18916
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18917
|
+
}
|
|
18918
|
+
|
|
18418
18919
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
18419
18920
|
}
|
|
18420
18921
|
|
|
18421
18922
|
case Scale.Hours6:
|
|
18422
18923
|
{
|
|
18423
|
-
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
|
+
}
|
|
18424
18932
|
|
|
18425
|
-
if (rem % (3 * 60 * 60) === 0) return TICK_MARK_HEIGHT_SECONDARY;
|
|
18426
18933
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
18427
18934
|
}
|
|
18428
18935
|
|
|
18429
18936
|
default:
|
|
18430
18937
|
{
|
|
18431
18938
|
// Scale.Day
|
|
18432
|
-
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
|
+
}
|
|
18433
18947
|
|
|
18434
|
-
if (rem % (6 * 60 * 60) === 0) return TICK_MARK_HEIGHT_SECONDARY;
|
|
18435
18948
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
18436
18949
|
}
|
|
18437
18950
|
}
|
|
@@ -18441,7 +18954,10 @@
|
|
|
18441
18954
|
{
|
|
18442
18955
|
var weekday = moment__default["default"].unix(timestep).utc().isoWeekday(); // momentjs isoWeekdays range from 1(Monday) to 7(Sunday)
|
|
18443
18956
|
|
|
18444
|
-
if (weekday === 1)
|
|
18957
|
+
if (weekday === 1) {
|
|
18958
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18959
|
+
}
|
|
18960
|
+
|
|
18445
18961
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
18446
18962
|
}
|
|
18447
18963
|
|
|
@@ -18449,15 +18965,24 @@
|
|
|
18449
18965
|
{
|
|
18450
18966
|
var month = moment__default["default"].unix(timestep).utc().month(); // momentjs months are zero indexed
|
|
18451
18967
|
|
|
18452
|
-
if (month === 0)
|
|
18453
|
-
|
|
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
|
+
|
|
18454
18976
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
18455
18977
|
}
|
|
18456
18978
|
|
|
18457
18979
|
case Scale.Minutes5:
|
|
18458
18980
|
{
|
|
18459
18981
|
// add primary line on day change
|
|
18460
|
-
if (timestep % (60 * 60 * 24) === 0)
|
|
18982
|
+
if (timestep % (60 * 60 * 24) === 0) {
|
|
18983
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
18984
|
+
}
|
|
18985
|
+
|
|
18461
18986
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
18462
18987
|
}
|
|
18463
18988
|
|
|
@@ -18475,31 +19000,52 @@
|
|
|
18475
19000
|
switch (scale) {
|
|
18476
19001
|
case Scale.Hour:
|
|
18477
19002
|
{
|
|
18478
|
-
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
|
+
}
|
|
18479
19011
|
|
|
18480
|
-
if (rem % (15 * 60) === 0) return TICK_MARK_HEIGHT_SECONDARY;
|
|
18481
19012
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
18482
19013
|
}
|
|
18483
19014
|
|
|
18484
19015
|
case Scale.Hours3:
|
|
18485
19016
|
{
|
|
18486
|
-
if (rem === 0)
|
|
19017
|
+
if (rem === 0) {
|
|
19018
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
19019
|
+
}
|
|
19020
|
+
|
|
18487
19021
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
18488
19022
|
}
|
|
18489
19023
|
|
|
18490
19024
|
case Scale.Hours6:
|
|
18491
19025
|
{
|
|
18492
|
-
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
|
+
}
|
|
18493
19034
|
|
|
18494
|
-
if (rem % (3 * 60 * 60) === 0) return TICK_MARK_HEIGHT_SECONDARY;
|
|
18495
19035
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
18496
19036
|
}
|
|
18497
19037
|
|
|
18498
19038
|
case Scale.Day:
|
|
18499
19039
|
{
|
|
18500
|
-
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
|
+
}
|
|
18501
19048
|
|
|
18502
|
-
if (rem % (6 * 60 * 60) === 0) return TICK_MARK_HEIGHT_SECONDARY;
|
|
18503
19049
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
18504
19050
|
}
|
|
18505
19051
|
|
|
@@ -18507,7 +19053,10 @@
|
|
|
18507
19053
|
{
|
|
18508
19054
|
var weekday = moment__default["default"].unix(timestep).utc().isoWeekday(); // momentjs isoWeekdays range from 1(Monday) to 7(Sunday)
|
|
18509
19055
|
|
|
18510
|
-
if (weekday === 1)
|
|
19056
|
+
if (weekday === 1) {
|
|
19057
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
19058
|
+
}
|
|
19059
|
+
|
|
18511
19060
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
18512
19061
|
}
|
|
18513
19062
|
|
|
@@ -18515,14 +19064,20 @@
|
|
|
18515
19064
|
{
|
|
18516
19065
|
var month = moment__default["default"].unix(timestep).utc().month(); // momentjs months are zero indexed
|
|
18517
19066
|
|
|
18518
|
-
if (month === 0)
|
|
19067
|
+
if (month === 0) {
|
|
19068
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
19069
|
+
}
|
|
19070
|
+
|
|
18519
19071
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
18520
19072
|
}
|
|
18521
19073
|
|
|
18522
19074
|
case Scale.Minutes5:
|
|
18523
19075
|
{
|
|
18524
19076
|
// add primary line on day change
|
|
18525
|
-
if (timestep % (60 * 60 * 24) === 0)
|
|
19077
|
+
if (timestep % (60 * 60 * 24) === 0) {
|
|
19078
|
+
return TICK_MARK_HEIGHT_PRIMARY;
|
|
19079
|
+
}
|
|
19080
|
+
|
|
18526
19081
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
18527
19082
|
}
|
|
18528
19083
|
|
|
@@ -18562,7 +19117,10 @@
|
|
|
18562
19117
|
};
|
|
18563
19118
|
|
|
18564
19119
|
var drawUpperText = function drawUpperText(ctx, theme, newDate, stepPx, height, minOffset) {
|
|
18565
|
-
if (stepPx <= 0)
|
|
19120
|
+
if (stepPx <= 0) {
|
|
19121
|
+
return;
|
|
19122
|
+
}
|
|
19123
|
+
|
|
18566
19124
|
var ctx2 = ctx;
|
|
18567
19125
|
var _a = theme.palette.geowebColors.timeSlider.timelineText,
|
|
18568
19126
|
fontSize = _a.fontSize,
|
|
@@ -18946,7 +19504,10 @@
|
|
|
18946
19504
|
} // draw date change texts
|
|
18947
19505
|
|
|
18948
19506
|
|
|
18949
|
-
if (scale === Scale.Year && fundamentalScale === Scale.Year)
|
|
19507
|
+
if (scale === Scale.Year && fundamentalScale === Scale.Year) {
|
|
19508
|
+
return;
|
|
19509
|
+
}
|
|
19510
|
+
|
|
18950
19511
|
var timestepUnit = getDateChangeTimestepUnit(fundamentalScale);
|
|
18951
19512
|
|
|
18952
19513
|
var _c = __read(getCustomRoundedStartAndEnd(visibleTimeStart, visibleTimeEnd, timestepUnit), 2),
|
|
@@ -18984,7 +19545,10 @@
|
|
|
18984
19545
|
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
18985
19546
|
* */
|
|
18986
19547
|
var drawNeedle = function drawNeedle(context, theme, width, height, startTime, endTime, selectedTime) {
|
|
18987
|
-
if (!selectedTime)
|
|
19548
|
+
if (!selectedTime) {
|
|
19549
|
+
return;
|
|
19550
|
+
}
|
|
19551
|
+
|
|
18988
19552
|
var ctx = context;
|
|
18989
19553
|
var _a = theme.palette.geowebColors.timeSlider,
|
|
18990
19554
|
playerNeedlePlayer = _a.playerNeedlePlayer,
|
|
@@ -19125,7 +19689,9 @@
|
|
|
19125
19689
|
function drawNightOrAlternateTime() {
|
|
19126
19690
|
var colorChangeTimesteps = getColorChangeTimesteps(scale, visibleTimeStart, visibleTimeEnd);
|
|
19127
19691
|
colorChangeTimesteps.forEach(function (timestep, i, arr) {
|
|
19128
|
-
if (i === 0)
|
|
19692
|
+
if (i === 0) {
|
|
19693
|
+
return;
|
|
19694
|
+
}
|
|
19129
19695
|
|
|
19130
19696
|
var _a = __read([arr[i - 1], timestep].map(function (timestep) {
|
|
19131
19697
|
return timestampToPixelEdges(timestep, visibleTimeStart, visibleTimeEnd, canvasWidth);
|
|
@@ -19343,7 +19909,9 @@
|
|
|
19343
19909
|
|
|
19344
19910
|
}, [leftMarkerDragging, rightMarkerDragging, animationAreaDragging]);
|
|
19345
19911
|
var handleAnimationDragging = React.useCallback(function (x) {
|
|
19346
|
-
if (!localAnimationStartTime || !localAnimationEndTime)
|
|
19912
|
+
if (!localAnimationStartTime || !localAnimationEndTime) {
|
|
19913
|
+
return;
|
|
19914
|
+
}
|
|
19347
19915
|
|
|
19348
19916
|
var _a = __read([localAnimationStartTime, localAnimationEndTime].map(function (timestamp) {
|
|
19349
19917
|
return timestampToPixel(timestamp, centerTime, canvasWidth, secondsPerPx);
|
|
@@ -19523,7 +20091,9 @@
|
|
|
19523
20091
|
}, [canvasWidth, centerTime, dataEndTime, dataStartTime, onSetNewDate, secondsPerPx, setUnfilteredSelectedTime, timeStep, unfilteredSelectedTime]);
|
|
19524
20092
|
React__namespace.useEffect(function () {
|
|
19525
20093
|
var handleMouseMove = function handleMouseMove(event) {
|
|
19526
|
-
if (event.movementX === 0)
|
|
20094
|
+
if (event.movementX === 0) {
|
|
20095
|
+
return;
|
|
20096
|
+
}
|
|
19527
20097
|
|
|
19528
20098
|
if (mouseDownInLegend) {
|
|
19529
20099
|
var dragDistanceTime = event.movementX * secondsPerPx;
|
|
@@ -19729,7 +20299,10 @@
|
|
|
19729
20299
|
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
19730
20300
|
* */
|
|
19731
20301
|
var onMouseMove = function onMouseMove(x, width, selectedTime, centerTime, secondsPerPx, mouseDownInTimeBox, isTimeBoxArea, setCursorStyle) {
|
|
19732
|
-
if (!selectedTime || mouseDownInTimeBox)
|
|
20302
|
+
if (!selectedTime || mouseDownInTimeBox) {
|
|
20303
|
+
return;
|
|
20304
|
+
}
|
|
20305
|
+
|
|
19733
20306
|
var selectedTimePx = timestampToPixel(selectedTime, centerTime, width, secondsPerPx);
|
|
19734
20307
|
|
|
19735
20308
|
if (isTimeBoxArea(x, selectedTimePx)) {
|
|
@@ -19739,7 +20312,10 @@
|
|
|
19739
20312
|
}
|
|
19740
20313
|
};
|
|
19741
20314
|
var onMouseDown = function onMouseDown(x, width, selectedTime, centerTime, secondsPerPx, isTimeBoxArea, setCursorStyle, setMouseDownInTimeBox) {
|
|
19742
|
-
if (!selectedTime)
|
|
20315
|
+
if (!selectedTime) {
|
|
20316
|
+
return;
|
|
20317
|
+
}
|
|
20318
|
+
|
|
19743
20319
|
var selectedTimePx = timestampToPixel(selectedTime, centerTime, width, secondsPerPx);
|
|
19744
20320
|
|
|
19745
20321
|
if (isTimeBoxArea(x, selectedTimePx)) {
|
|
@@ -19942,12 +20518,16 @@
|
|
|
19942
20518
|
}, /*#__PURE__*/React__default["default"].createElement(CanvasComponent, {
|
|
19943
20519
|
ref: node,
|
|
19944
20520
|
onMouseMove: function onMouseMove$1(x, y, event, width) {
|
|
19945
|
-
if (!selectedTime)
|
|
20521
|
+
if (!selectedTime) {
|
|
20522
|
+
return;
|
|
20523
|
+
}
|
|
19946
20524
|
|
|
19947
20525
|
onMouseMove(x, width, selectedTime, centerTime, secondsPerPx, mouseDownInTimeBox, isTimeBoxArea, setCursorStyle);
|
|
19948
20526
|
},
|
|
19949
20527
|
onMouseDown: function onMouseDown$1(x, y, width) {
|
|
19950
|
-
if (!selectedTime)
|
|
20528
|
+
if (!selectedTime) {
|
|
20529
|
+
return;
|
|
20530
|
+
}
|
|
19951
20531
|
|
|
19952
20532
|
onMouseDown(x, width, selectedTime, centerTime, secondsPerPx, isTimeBoxArea, setCursorStyle, setMouseDownInTimeBox);
|
|
19953
20533
|
},
|
|
@@ -20227,11 +20807,11 @@
|
|
|
20227
20807
|
var isTimestepAuto$1 = reactRedux.useSelector(function (store) {
|
|
20228
20808
|
return isTimestepAuto(store, mapId);
|
|
20229
20809
|
});
|
|
20230
|
-
var
|
|
20231
|
-
return
|
|
20810
|
+
var autoTimeStepLayerId = reactRedux.useSelector(function (store) {
|
|
20811
|
+
return getAutoTimeStepLayerId(store, mapId);
|
|
20232
20812
|
});
|
|
20233
20813
|
var activeLayerTimeDimension = reactRedux.useSelector(function (store) {
|
|
20234
|
-
return getLayerTimeDimension(store,
|
|
20814
|
+
return getLayerTimeDimension(store, autoTimeStepLayerId);
|
|
20235
20815
|
});
|
|
20236
20816
|
var timeStepFromLayer = getActiveLayerTimeStep(activeLayerTimeDimension);
|
|
20237
20817
|
var onToggleTimestepAuto = React__namespace.useCallback(function () {
|
|
@@ -20844,14 +21424,14 @@
|
|
|
20844
21424
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
20845
21425
|
* */
|
|
20846
21426
|
var useUpdateTimestep = function useUpdateTimestep(mapId) {
|
|
20847
|
-
var
|
|
20848
|
-
return
|
|
21427
|
+
var autoTimeStepLayerId = reactRedux.useSelector(function (store) {
|
|
21428
|
+
return getAutoTimeStepLayerId(store, mapId);
|
|
20849
21429
|
});
|
|
20850
21430
|
var isTimeStepAuto = reactRedux.useSelector(function (store) {
|
|
20851
21431
|
return isTimestepAuto(store, mapId);
|
|
20852
21432
|
});
|
|
20853
21433
|
var timeDimension = reactRedux.useSelector(function (store) {
|
|
20854
|
-
return getLayerTimeDimension(store,
|
|
21434
|
+
return getLayerTimeDimension(store, autoTimeStepLayerId);
|
|
20855
21435
|
});
|
|
20856
21436
|
var dispatch = reactRedux.useDispatch();
|
|
20857
21437
|
React__namespace.useEffect(function () {
|
|
@@ -20862,7 +21442,7 @@
|
|
|
20862
21442
|
timeStep: timeStep
|
|
20863
21443
|
}));
|
|
20864
21444
|
}
|
|
20865
|
-
}, [
|
|
21445
|
+
}, [autoTimeStepLayerId, dispatch, isTimeStepAuto, mapId, timeDimension]);
|
|
20866
21446
|
};
|
|
20867
21447
|
|
|
20868
21448
|
var TimeSliderConnect = function TimeSliderConnect(_a) {
|
|
@@ -22008,8 +22588,11 @@
|
|
|
22008
22588
|
var to = getProj4(proj.crs);
|
|
22009
22589
|
|
|
22010
22590
|
for (var j = 0; j < featureCoords.length; j += 1) {
|
|
22011
|
-
|
|
22012
|
-
|
|
22591
|
+
if (featureCoords[j].length < 2) {
|
|
22592
|
+
// eslint-disable-next-line no-continue
|
|
22593
|
+
continue;
|
|
22594
|
+
}
|
|
22595
|
+
|
|
22013
22596
|
var coordinates = {
|
|
22014
22597
|
x: featureCoords[j][0],
|
|
22015
22598
|
y: featureCoords[j][1]
|
|
@@ -22321,12 +22904,16 @@
|
|
|
22321
22904
|
isInEditMode = _a.isInEditMode,
|
|
22322
22905
|
featureNrToEdit = _a.featureNrToEdit,
|
|
22323
22906
|
onHoverFeature = _a.onHoverFeature;
|
|
22324
|
-
|
|
22907
|
+
|
|
22908
|
+
if (event && event.rightButton === true) {
|
|
22909
|
+
return undefined;
|
|
22910
|
+
}
|
|
22325
22911
|
/* adagucMouseMove is an event callback function which is triggered when the mouse moves over the map
|
|
22326
22912
|
This event is only triggered if the map is in hover state.
|
|
22327
22913
|
E.g. when the map is dragging/panning, this event is not triggerd
|
|
22328
22914
|
*/
|
|
22329
22915
|
|
|
22916
|
+
|
|
22330
22917
|
var mouseX = event.mouseX,
|
|
22331
22918
|
mouseY = event.mouseY,
|
|
22332
22919
|
mouseDown = event.mouseDown;
|
|
@@ -22366,7 +22953,11 @@
|
|
|
22366
22953
|
}
|
|
22367
22954
|
|
|
22368
22955
|
var feature = this.geojson.features[featureNrToEdit];
|
|
22369
|
-
|
|
22956
|
+
|
|
22957
|
+
if (!feature) {
|
|
22958
|
+
return undefined;
|
|
22959
|
+
}
|
|
22960
|
+
|
|
22370
22961
|
var webmapjs = this.props.webmapjs;
|
|
22371
22962
|
this.mouseGeoCoord = webmapjs.getLatLongFromPixelCoord({
|
|
22372
22963
|
x: mouseX,
|
|
@@ -22441,7 +23032,10 @@
|
|
|
22441
23032
|
AdagucMapDraw.prototype.triggerMouseDownTimer = function (event) {
|
|
22442
23033
|
var _this = this;
|
|
22443
23034
|
|
|
22444
|
-
if (!this.doubleClickTimer)
|
|
23035
|
+
if (!this.doubleClickTimer) {
|
|
23036
|
+
this.doubleClickTimer = {};
|
|
23037
|
+
}
|
|
23038
|
+
|
|
22445
23039
|
var mouseX = event.mouseX,
|
|
22446
23040
|
mouseY = event.mouseY;
|
|
22447
23041
|
|
|
@@ -22769,7 +23363,10 @@
|
|
|
22769
23363
|
|
|
22770
23364
|
AdagucMapDraw.prototype.adagucMouseDown = function (event) {
|
|
22771
23365
|
var isInEditMode = this.props.isInEditMode;
|
|
22772
|
-
|
|
23366
|
+
|
|
23367
|
+
if (event && event.rightButton === true) {
|
|
23368
|
+
return;
|
|
23369
|
+
}
|
|
22773
23370
|
|
|
22774
23371
|
if (isInEditMode === false) {
|
|
22775
23372
|
return;
|
|
@@ -22795,11 +23392,14 @@
|
|
|
22795
23392
|
// eslint-disable-next-line consistent-return
|
|
22796
23393
|
|
|
22797
23394
|
|
|
22798
|
-
if (this.insertVertexInEdge(event) === false)
|
|
23395
|
+
if (this.insertVertexInEdge(event) === false) {
|
|
23396
|
+
return false;
|
|
23397
|
+
}
|
|
22799
23398
|
/* This is trigged when a new feature is created. */
|
|
22800
23399
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
22801
23400
|
// @ts-ignore
|
|
22802
23401
|
|
|
23402
|
+
|
|
22803
23403
|
if (this.createNewFeature(event) === false) {
|
|
22804
23404
|
/* Start with mouse move from this mouse down location, enables sizing the box while moving the mouse */
|
|
22805
23405
|
this.adagucMouseMove(event);
|
|
@@ -22808,13 +23408,22 @@
|
|
|
22808
23408
|
/* This is triggered when new points are added during the addmultipoint mode. One point is added per time */
|
|
22809
23409
|
|
|
22810
23410
|
|
|
22811
|
-
if (this.addPointToMultiPointFeature(event) === false)
|
|
23411
|
+
if (this.addPointToMultiPointFeature(event) === false) {
|
|
23412
|
+
return false;
|
|
23413
|
+
}
|
|
22812
23414
|
/* This is triggered when new points are added during the addpolygon mode. One point is added per time */
|
|
22813
23415
|
|
|
22814
|
-
|
|
23416
|
+
|
|
23417
|
+
if (this.addVerticesToPolygonFeature(event) === false) {
|
|
23418
|
+
return false;
|
|
23419
|
+
}
|
|
22815
23420
|
/* This is triggered when new points are added to a linestring */
|
|
22816
23421
|
|
|
22817
|
-
|
|
23422
|
+
|
|
23423
|
+
if (this.addPointToLineStringFeature(event) === false) {
|
|
23424
|
+
return false;
|
|
23425
|
+
}
|
|
23426
|
+
|
|
22818
23427
|
return false;
|
|
22819
23428
|
/* False means that this component will take over entire controll.
|
|
22820
23429
|
True means that it is still possible to pan and drag the map while editing */
|
|
@@ -22880,7 +23489,10 @@
|
|
|
22880
23489
|
var _a = this.props,
|
|
22881
23490
|
isInEditMode = _a.isInEditMode,
|
|
22882
23491
|
onClickFeature = _a.onClickFeature;
|
|
22883
|
-
|
|
23492
|
+
|
|
23493
|
+
if (event && event.rightButton === true) {
|
|
23494
|
+
return;
|
|
23495
|
+
}
|
|
22884
23496
|
|
|
22885
23497
|
if (onClickFeature) {
|
|
22886
23498
|
var mouseX = event.mouseX,
|
|
@@ -23020,10 +23632,21 @@
|
|
|
23020
23632
|
|
|
23021
23633
|
|
|
23022
23634
|
AdagucMapDraw.prototype.validateFeature = function (feature) {
|
|
23023
|
-
if (!feature.properties)
|
|
23024
|
-
|
|
23025
|
-
|
|
23026
|
-
|
|
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
|
+
}
|
|
23027
23650
|
};
|
|
23028
23651
|
|
|
23029
23652
|
AdagucMapDraw.prototype.validatePolys = function (fixPolys) {
|
|
@@ -23032,7 +23655,10 @@
|
|
|
23032
23655
|
}
|
|
23033
23656
|
|
|
23034
23657
|
for (var featureIndex = 0; featureIndex < this.geojson.features.length; featureIndex += 1) {
|
|
23035
|
-
if (!this.geojson.features)
|
|
23658
|
+
if (!this.geojson.features) {
|
|
23659
|
+
this.geojson.features = [];
|
|
23660
|
+
}
|
|
23661
|
+
|
|
23036
23662
|
var feature = this.geojson.features[featureIndex];
|
|
23037
23663
|
this.validateFeature(feature);
|
|
23038
23664
|
var featureType = feature.geometry.type;
|
|
@@ -23587,12 +24213,23 @@
|
|
|
23587
24213
|
isInEditMode = _a.isInEditMode,
|
|
23588
24214
|
featureNrToEdit = _a.featureNrToEdit;
|
|
23589
24215
|
var feature = this.geojson.features[featureIndex];
|
|
23590
|
-
|
|
23591
|
-
if (feature.geometry
|
|
24216
|
+
|
|
24217
|
+
if (!feature || !feature.geometry) {
|
|
24218
|
+
return;
|
|
24219
|
+
}
|
|
24220
|
+
|
|
24221
|
+
if (feature.geometry.type !== 'LineString') {
|
|
24222
|
+
return;
|
|
24223
|
+
}
|
|
24224
|
+
|
|
23592
24225
|
var lineProps = feature.properties;
|
|
23593
|
-
|
|
24226
|
+
|
|
24227
|
+
if (!lineProps) {
|
|
24228
|
+
lineProps = this.defaultLineStringProps;
|
|
24229
|
+
}
|
|
23594
24230
|
/* Draw polygons and calculate center of poly */
|
|
23595
24231
|
|
|
24232
|
+
|
|
23596
24233
|
var middle = {
|
|
23597
24234
|
x: 0,
|
|
23598
24235
|
y: 0,
|
|
@@ -23662,16 +24299,23 @@
|
|
|
23662
24299
|
isInEditMode = _a.isInEditMode,
|
|
23663
24300
|
featureNrToEdit = _a.featureNrToEdit;
|
|
23664
24301
|
var feature = this.geojson.features[featureIndex];
|
|
23665
|
-
|
|
24302
|
+
|
|
24303
|
+
if (!feature || !feature.geometry) {
|
|
24304
|
+
return;
|
|
24305
|
+
}
|
|
23666
24306
|
|
|
23667
24307
|
if (feature.geometry.type !== 'Polygon' && feature.geometry.type !== 'MultiPolygon') {
|
|
23668
24308
|
return;
|
|
23669
24309
|
}
|
|
23670
24310
|
|
|
23671
24311
|
var polyProps = feature.properties;
|
|
23672
|
-
|
|
24312
|
+
|
|
24313
|
+
if (!polyProps) {
|
|
24314
|
+
polyProps = this.defaultPolyProps;
|
|
24315
|
+
}
|
|
23673
24316
|
/* Draw polygons and calculate center of poly */
|
|
23674
24317
|
|
|
24318
|
+
|
|
23675
24319
|
var middle = {
|
|
23676
24320
|
x: 0,
|
|
23677
24321
|
y: 0,
|
|
@@ -23744,8 +24388,11 @@
|
|
|
23744
24388
|
var XYCoords = [];
|
|
23745
24389
|
|
|
23746
24390
|
for (var j = 0; j < featureCoords.length; j += 1) {
|
|
23747
|
-
|
|
23748
|
-
|
|
24391
|
+
if (featureCoords[j].length < 2) {
|
|
24392
|
+
// eslint-disable-next-line no-continue
|
|
24393
|
+
continue;
|
|
24394
|
+
}
|
|
24395
|
+
|
|
23749
24396
|
var coord = webmapjs.getPixelCoordFromLatLong({
|
|
23750
24397
|
x: featureCoords[j][0],
|
|
23751
24398
|
y: featureCoords[j][1]
|
|
@@ -23961,7 +24608,9 @@
|
|
|
23961
24608
|
}
|
|
23962
24609
|
},
|
|
23963
24610
|
exitDrawModeCallback: function exitDrawModeCallback() {
|
|
23964
|
-
if (layer.exitDrawModeCallback)
|
|
24611
|
+
if (layer.exitDrawModeCallback) {
|
|
24612
|
+
layer.exitDrawModeCallback();
|
|
24613
|
+
}
|
|
23965
24614
|
},
|
|
23966
24615
|
featureNrToEdit: parseInt(layer.featureNrToEdit || '0', 10)
|
|
23967
24616
|
}));
|
|
@@ -24242,7 +24891,11 @@
|
|
|
24242
24891
|
mapId = _a.mapId,
|
|
24243
24892
|
onMapZoomEnd = _a.onMapZoomEnd;
|
|
24244
24893
|
var wmjsMap = getWMJSMapById(mapId);
|
|
24245
|
-
|
|
24894
|
+
|
|
24895
|
+
if (!wmjsMap) {
|
|
24896
|
+
return;
|
|
24897
|
+
}
|
|
24898
|
+
|
|
24246
24899
|
var projectionInfo = wmjsMap.getProjection();
|
|
24247
24900
|
/* Trigger onMapZoomEnd callback */
|
|
24248
24901
|
|
|
@@ -25408,7 +26061,7 @@
|
|
|
25408
26061
|
onLayerError: function onLayerError(_, error) {
|
|
25409
26062
|
layerError({
|
|
25410
26063
|
layerId: layer.id,
|
|
25411
|
-
error: error
|
|
26064
|
+
error: "" + error
|
|
25412
26065
|
});
|
|
25413
26066
|
}
|
|
25414
26067
|
}, layer));
|
|
@@ -25419,7 +26072,7 @@
|
|
|
25419
26072
|
onLayerError: function onLayerError(_, error) {
|
|
25420
26073
|
layerError({
|
|
25421
26074
|
layerId: layer.id,
|
|
25422
|
-
error: error
|
|
26075
|
+
error: "" + error
|
|
25423
26076
|
});
|
|
25424
26077
|
},
|
|
25425
26078
|
onClickFeature: layer.geojson ? function (event) {
|
|
@@ -25436,7 +26089,7 @@
|
|
|
25436
26089
|
onLayerError: function onLayerError(_, error) {
|
|
25437
26090
|
layerError({
|
|
25438
26091
|
layerId: layer.id,
|
|
25439
|
-
error: error
|
|
26092
|
+
error: "" + error
|
|
25440
26093
|
});
|
|
25441
26094
|
}
|
|
25442
26095
|
}, layer));
|
|
@@ -26029,7 +26682,11 @@
|
|
|
26029
26682
|
|
|
26030
26683
|
var getLayersToUpdate = function getLayersToUpdate(layers, mapId) {
|
|
26031
26684
|
var wmjsMap = getWMJSMapById(mapId);
|
|
26032
|
-
|
|
26685
|
+
|
|
26686
|
+
if (!wmjsMap || !layers || layers.length === 0) {
|
|
26687
|
+
return [];
|
|
26688
|
+
}
|
|
26689
|
+
|
|
26033
26690
|
return layers.filter(function (layer) {
|
|
26034
26691
|
return layer && layer.enabled && !!getWMLayerById(layer.id);
|
|
26035
26692
|
}).map(function (layer) {
|
|
@@ -26223,7 +26880,11 @@
|
|
|
26223
26880
|
title = layer.title,
|
|
26224
26881
|
url = layer.url;
|
|
26225
26882
|
var result = gfiResultMap.get(layerId);
|
|
26226
|
-
|
|
26883
|
+
|
|
26884
|
+
if (!result) {
|
|
26885
|
+
return null;
|
|
26886
|
+
}
|
|
26887
|
+
|
|
26227
26888
|
return /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
26228
26889
|
key: layerId,
|
|
26229
26890
|
sx: {
|
|
@@ -26440,38 +27101,40 @@
|
|
|
26440
27101
|
title = _a.title,
|
|
26441
27102
|
_b = _a.layers,
|
|
26442
27103
|
layers = _b === void 0 ? [] : _b,
|
|
26443
|
-
_c = _a.
|
|
26444
|
-
|
|
26445
|
-
_d = _a.
|
|
26446
|
-
|
|
26447
|
-
_e = _a.
|
|
26448
|
-
|
|
26449
|
-
_f = _a.
|
|
26450
|
-
|
|
26451
|
-
_g = _a.
|
|
26452
|
-
|
|
26453
|
-
_h = _a.
|
|
26454
|
-
|
|
26455
|
-
_j = _a.
|
|
26456
|
-
|
|
26457
|
-
_k = _a.
|
|
26458
|
-
|
|
26459
|
-
_l = _a.
|
|
26460
|
-
|
|
26461
|
-
_m = _a.
|
|
26462
|
-
|
|
26463
|
-
_o = _a.
|
|
26464
|
-
|
|
26465
|
-
_p = _a.
|
|
26466
|
-
|
|
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,
|
|
26467
27130
|
shouldShowLayerManager = _a.shouldShowLayerManager,
|
|
26468
27131
|
shouldShowDockedLayerManager = _a.shouldShowDockedLayerManager,
|
|
26469
|
-
|
|
26470
|
-
showClock =
|
|
26471
|
-
|
|
26472
|
-
displayGetFeatureInfoButtonInMap =
|
|
27132
|
+
_r = _a.showClock,
|
|
27133
|
+
showClock = _r === void 0 ? true : _r,
|
|
27134
|
+
_s = _a.displayGetFeatureInfoButtonInMap,
|
|
27135
|
+
displayGetFeatureInfoButtonInMap = _s === void 0 ? false : _s,
|
|
26473
27136
|
children = _a.children,
|
|
26474
|
-
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"]);
|
|
26475
27138
|
|
|
26476
27139
|
var dispatch = reactRedux.useDispatch();
|
|
26477
27140
|
var mapId = React__default["default"].useRef(id || generateMapId()).current;
|
|
@@ -26489,6 +27152,7 @@
|
|
|
26489
27152
|
bbox: bbox,
|
|
26490
27153
|
srs: srs
|
|
26491
27154
|
},
|
|
27155
|
+
dimensions: dimensions,
|
|
26492
27156
|
shouldAutoUpdate: shouldAutoUpdate,
|
|
26493
27157
|
shouldAnimate: shouldAnimate,
|
|
26494
27158
|
shouldShowZoomControls: shouldShowZoomControls,
|
|
@@ -26636,7 +27300,8 @@
|
|
|
26636
27300
|
syncGroupAddTarget({
|
|
26637
27301
|
groupId: syncGroupsId,
|
|
26638
27302
|
targetId: map.id,
|
|
26639
|
-
linked: true
|
|
27303
|
+
linked: true,
|
|
27304
|
+
origin: 'system'
|
|
26640
27305
|
});
|
|
26641
27306
|
});
|
|
26642
27307
|
});
|
|
@@ -26680,9 +27345,11 @@
|
|
|
26680
27345
|
title: map.title || mapId,
|
|
26681
27346
|
id: mapId,
|
|
26682
27347
|
layers: map.layers || [],
|
|
26683
|
-
|
|
27348
|
+
autoTimeStepLayerId: map.autoTimeStepLayerId,
|
|
27349
|
+
autoUpdateLayerId: map.autoUpdateLayerId,
|
|
26684
27350
|
bbox: map.bbox,
|
|
26685
27351
|
srs: map.srs,
|
|
27352
|
+
dimensions: map.dimensions || [],
|
|
26686
27353
|
displayTimeInMap: map.displayTimeInMap || false,
|
|
26687
27354
|
displayLayerManagerAndLegendButtonInMap: map.displayLayerManagerAndLegendButtonInMap,
|
|
26688
27355
|
displayDimensionSelectButtonInMap: map.displayDimensionSelectButtonInMap,
|
|
@@ -26739,9 +27406,13 @@
|
|
|
26739
27406
|
var syncGroupState = reactRedux.useSelector(function (store) {
|
|
26740
27407
|
return getSynchronizationGroupState(store);
|
|
26741
27408
|
});
|
|
26742
|
-
|
|
27409
|
+
|
|
27410
|
+
if (!syncGroupState) {
|
|
27411
|
+
return false;
|
|
27412
|
+
}
|
|
26743
27413
|
/* Return all syncgroups configured for this component of type SYNCGROUPS_TYPE_SETLAYERACTIONS */
|
|
26744
27414
|
|
|
27415
|
+
|
|
26745
27416
|
var syncGroupsWithLayerActions = syncGroupState.groups.allIds.filter(function (syncGroupId) {
|
|
26746
27417
|
return syncGroupsIds && syncGroupsIds.includes(syncGroupId) && syncGroupState.groups.byId[syncGroupId].type === 'SYNCGROUPS_TYPE_SETLAYERACTIONS';
|
|
26747
27418
|
});
|
|
@@ -26796,9 +27467,13 @@
|
|
|
26796
27467
|
/* Get latest reference time for this layer */
|
|
26797
27468
|
|
|
26798
27469
|
var latestReferenceTime = useGetLatestReferenceTime(layers[0]);
|
|
26799
|
-
|
|
27470
|
+
|
|
27471
|
+
if (latestReferenceTime === '') {
|
|
27472
|
+
return /*#__PURE__*/React__namespace.createElement("div", null, "Loading...");
|
|
27473
|
+
}
|
|
26800
27474
|
/* Calculate the last time increment based on 15 maps */
|
|
26801
27475
|
|
|
27476
|
+
|
|
26802
27477
|
var lastTimeIncrement = startTimeIncrement + 15 * interval;
|
|
26803
27478
|
/* Make the preset */
|
|
26804
27479
|
|
|
@@ -26870,9 +27545,13 @@
|
|
|
26870
27545
|
/* Get all the reference times for this layer */
|
|
26871
27546
|
|
|
26872
27547
|
var referenceTimes = useGetReferenceTimes(layers.topRow);
|
|
26873
|
-
|
|
27548
|
+
|
|
27549
|
+
if (referenceTimes.length === 0) {
|
|
27550
|
+
return /*#__PURE__*/React__namespace.createElement("div", null, "Loading...");
|
|
27551
|
+
}
|
|
26874
27552
|
/* Helper to make a map layer prest */
|
|
26875
27553
|
|
|
27554
|
+
|
|
26876
27555
|
var makeMapPreset = function makeMapPreset(referenceTime, uniqueId, layer, syncGroupsIds, col) {
|
|
26877
27556
|
return {
|
|
26878
27557
|
id: uniqueId,
|
|
@@ -26961,7 +27640,11 @@
|
|
|
26961
27640
|
mapPreset_1 = _b.mapPreset,
|
|
26962
27641
|
shouldShowZoomControls = _b.shouldShowZoomControls,
|
|
26963
27642
|
syncGroupsIds_1 = _b.syncGroupsIds;
|
|
26964
|
-
|
|
27643
|
+
|
|
27644
|
+
if (!mapPreset_1 || mapPreset_1.length === 0) {
|
|
27645
|
+
return null;
|
|
27646
|
+
}
|
|
27647
|
+
|
|
26965
27648
|
return /*#__PURE__*/React__default["default"].createElement(MultiMapViewConnect, {
|
|
26966
27649
|
rows: 2,
|
|
26967
27650
|
cols: 2,
|
|
@@ -26969,11 +27652,15 @@
|
|
|
26969
27652
|
maps: mapPreset_1.map(function (preset, index) {
|
|
26970
27653
|
var _a, _b, _c, _d;
|
|
26971
27654
|
|
|
27655
|
+
var layers = preset.layers,
|
|
27656
|
+
autoUpdateLayerId = preset.autoUpdateLayerId,
|
|
27657
|
+
autoTimeStepLayerId = preset.autoTimeStepLayerId;
|
|
26972
27658
|
return {
|
|
26973
27659
|
id: id + "_" + index,
|
|
26974
27660
|
syncGroupsIds: syncGroupsIds_1,
|
|
26975
|
-
layers:
|
|
26976
|
-
|
|
27661
|
+
layers: layers,
|
|
27662
|
+
autoUpdateLayerId: autoUpdateLayerId,
|
|
27663
|
+
autoTimeStepLayerId: autoTimeStepLayerId,
|
|
26977
27664
|
bbox: (_b = (_a = mapPreset_1[0]) === null || _a === void 0 ? void 0 : _a.proj) === null || _b === void 0 ? void 0 : _b.bbox,
|
|
26978
27665
|
srs: (_d = (_c = mapPreset_1[0]) === null || _c === void 0 ? void 0 : _c.proj) === null || _d === void 0 ? void 0 : _d.srs
|
|
26979
27666
|
};
|
|
@@ -27968,6 +28655,7 @@
|
|
|
27968
28655
|
exports.generateLayerId = generateLayerId;
|
|
27969
28656
|
exports.generateMapId = generateMapId;
|
|
27970
28657
|
exports.generateTimesliderId = generateTimesliderId;
|
|
28658
|
+
exports.genericSelectors = selectors$1;
|
|
27971
28659
|
exports.getDrawFunctionFromStore = getDrawFunctionFromStore;
|
|
27972
28660
|
exports.getFirstTimeStepForLayerId = getFirstTimeStepForLayerId;
|
|
27973
28661
|
exports.getInitialAppPresets = getInitialAppPresets;
|
|
@@ -27980,7 +28668,7 @@
|
|
|
27980
28668
|
exports.getWMLayerById = getWMLayerById;
|
|
27981
28669
|
exports.layerActions = layerActions;
|
|
27982
28670
|
exports.layerReducer = reducer$8;
|
|
27983
|
-
exports.layerSelectors = selectors$
|
|
28671
|
+
exports.layerSelectors = selectors$3;
|
|
27984
28672
|
exports.layerTypes = types$3;
|
|
27985
28673
|
exports.mapActions = mapActions;
|
|
27986
28674
|
exports.mapModuleConfig = moduleConfig;
|
|
@@ -28004,7 +28692,7 @@
|
|
|
28004
28692
|
exports.timeSliderUtils = timeSliderUtils;
|
|
28005
28693
|
exports.uiActions = uiActions;
|
|
28006
28694
|
exports.uiModuleConfig = uiModuleConfig;
|
|
28007
|
-
exports.uiSelectors = selectors$
|
|
28695
|
+
exports.uiSelectors = selectors$2;
|
|
28008
28696
|
exports.uiTypes = types;
|
|
28009
28697
|
exports.unRegisterWMJSLayer = unRegisterWMJSLayer;
|
|
28010
28698
|
exports.unRegisterWMJSMap = unRegisterWMJSMap;
|