@opengeoweb/store 8.4.1 → 9.0.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 +717 -1241
- package/package.json +2 -21
- package/src/hooks/index.d.ts +1 -0
- package/src/hooks/useSetupDialog/index.d.ts +1 -0
- package/src/hooks/useSetupDialog/useSetupDialog.d.ts +12 -0
- package/src/index.d.ts +1 -0
- package/src/store/coreModuleConfig.d.ts +1 -1
- package/src/store/drawingtool/reducer.d.ts +2 -2
- package/src/store/drawingtool/selectors.d.ts +20 -0
- package/src/store/index.d.ts +1 -2
- package/src/store/mapStore/config.d.ts +1 -1
- package/src/store/mapStore/index.d.ts +4 -0
- package/src/store/mapStore/layers/reducer.d.ts +11 -3
- package/src/store/mapStore/layers/selectors.d.ts +5 -0
- package/src/store/mapStore/layers/types.d.ts +3 -0
- package/src/store/mapStore/map/sagas.d.ts +2 -2
- package/src/store/mapStore/storeTestSettings.d.ts +1 -0
- package/src/store/mapStore/storeTestUtils.d.ts +5 -0
- package/src/store/types.d.ts +2 -2
- package/src/store/utils.d.ts +0 -2
- package/src/store/layerSelect/config.d.ts +0 -5
- package/src/store/layerSelect/index.d.ts +0 -4
- package/src/store/layerSelect/localStorage.d.ts +0 -3
- package/src/store/layerSelect/reducer.d.ts +0 -28
- package/src/store/layerSelect/reducer.spec.d.ts +0 -1
- package/src/store/layerSelect/sagas.d.ts +0 -10
- package/src/store/layerSelect/sagas.spec.d.ts +0 -1
- package/src/store/layerSelect/selectors.d.ts +0 -115
- package/src/store/layerSelect/selectors.spec.d.ts +0 -1
- package/src/store/layerSelect/types.d.ts +0 -88
- package/src/store/layerSelect/utils.d.ts +0 -6
- package/src/store/layerSelect/utils.spec.d.ts +0 -1
- package/src/store/snackbar/config.d.ts +0 -4
- package/src/store/snackbar/index.d.ts +0 -6
- package/src/store/snackbar/reducer.d.ts +0 -11
- package/src/store/snackbar/reducer.spec.d.ts +0 -1
- package/src/store/snackbar/sagas.d.ts +0 -5
- package/src/store/snackbar/sagas.spec.d.ts +0 -1
- package/src/store/snackbar/selectors.d.ts +0 -8
- package/src/store/snackbar/selectors.spec.d.ts +0 -1
- package/src/store/snackbar/types.d.ts +0 -15
- /package/src/{store/layerSelect/localStorage.spec.d.ts → hooks/useSetupDialog/useSetupDialog.spec.d.ts} +0 -0
package/index.esm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { webmapUtils, LayerType, webmapTestSettings, WMLayer, getCapabilities } from '@opengeoweb/webmap';
|
|
2
|
-
import { getGeoJson, moveFeature, defaultLayers, getFeatureCollection, emptyGeoJSON } from '@opengeoweb/webmap-react';
|
|
2
|
+
import { getGeoJson, moveFeature, createInterSections, defaultLayers, getFeatureCollection, emptyGeoJSON } from '@opengeoweb/webmap-react';
|
|
3
3
|
export { defaultLayers } from '@opengeoweb/webmap-react';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import React__default from 'react';
|
|
5
|
+
import React__default, { useContext, useRef, useCallback, useDebugValue, useEffect } from 'react';
|
|
6
6
|
import { ThemeWrapper, lightTheme } from '@opengeoweb/theme';
|
|
7
7
|
import { withEggs } from '@opengeoweb/shared';
|
|
8
8
|
|
|
@@ -334,15 +334,6 @@ function _regeneratorRuntime() {
|
|
|
334
334
|
}
|
|
335
335
|
}, e;
|
|
336
336
|
}
|
|
337
|
-
function _typeof$1(o) {
|
|
338
|
-
"@babel/helpers - typeof";
|
|
339
|
-
|
|
340
|
-
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
341
|
-
return typeof o;
|
|
342
|
-
} : function (o) {
|
|
343
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
344
|
-
}, _typeof$1(o);
|
|
345
|
-
}
|
|
346
337
|
function _defineProperty$1(obj, key, value) {
|
|
347
338
|
key = _toPropertyKey$1(key);
|
|
348
339
|
if (key in obj) {
|
|
@@ -391,57 +382,6 @@ function _nonIterableSpread() {
|
|
|
391
382
|
function _nonIterableRest() {
|
|
392
383
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
393
384
|
}
|
|
394
|
-
function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
395
|
-
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
396
|
-
if (!it) {
|
|
397
|
-
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
398
|
-
if (it) o = it;
|
|
399
|
-
var i = 0;
|
|
400
|
-
var F = function () {};
|
|
401
|
-
return {
|
|
402
|
-
s: F,
|
|
403
|
-
n: function () {
|
|
404
|
-
if (i >= o.length) return {
|
|
405
|
-
done: true
|
|
406
|
-
};
|
|
407
|
-
return {
|
|
408
|
-
done: false,
|
|
409
|
-
value: o[i++]
|
|
410
|
-
};
|
|
411
|
-
},
|
|
412
|
-
e: function (e) {
|
|
413
|
-
throw e;
|
|
414
|
-
},
|
|
415
|
-
f: F
|
|
416
|
-
};
|
|
417
|
-
}
|
|
418
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
419
|
-
}
|
|
420
|
-
var normalCompletion = true,
|
|
421
|
-
didErr = false,
|
|
422
|
-
err;
|
|
423
|
-
return {
|
|
424
|
-
s: function () {
|
|
425
|
-
it = it.call(o);
|
|
426
|
-
},
|
|
427
|
-
n: function () {
|
|
428
|
-
var step = it.next();
|
|
429
|
-
normalCompletion = step.done;
|
|
430
|
-
return step;
|
|
431
|
-
},
|
|
432
|
-
e: function (e) {
|
|
433
|
-
didErr = true;
|
|
434
|
-
err = e;
|
|
435
|
-
},
|
|
436
|
-
f: function () {
|
|
437
|
-
try {
|
|
438
|
-
if (!normalCompletion && it.return != null) it.return();
|
|
439
|
-
} finally {
|
|
440
|
-
if (didErr) throw err;
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
};
|
|
444
|
-
}
|
|
445
385
|
function _toPrimitive$1(input, hint) {
|
|
446
386
|
if (typeof input !== "object" || input === null) return input;
|
|
447
387
|
var prim = input[Symbol.toPrimitive];
|
|
@@ -2856,7 +2796,7 @@ var LayerActionOrigin;
|
|
|
2856
2796
|
LayerActionOrigin["unregisterMapSaga"] = "unregisterMapSaga";
|
|
2857
2797
|
})(LayerActionOrigin || (LayerActionOrigin = {}));
|
|
2858
2798
|
|
|
2859
|
-
var types$
|
|
2799
|
+
var types$5 = /*#__PURE__*/Object.freeze({
|
|
2860
2800
|
__proto__: null,
|
|
2861
2801
|
get LayerStatus () { return LayerStatus; },
|
|
2862
2802
|
get LayerActionOrigin () { return LayerActionOrigin; }
|
|
@@ -9747,7 +9687,9 @@ var createLayer = function createLayer(_a) {
|
|
|
9747
9687
|
layerType = _a$layerType === void 0 ? 'mapLayer' : _a$layerType,
|
|
9748
9688
|
_a$status = _a.status,
|
|
9749
9689
|
status = _a$status === void 0 ? 'default' : _a$status,
|
|
9750
|
-
|
|
9690
|
+
_a$useLatestReference = _a.useLatestReferenceTime,
|
|
9691
|
+
useLatestReferenceTime = _a$useLatestReference === void 0 ? true : _a$useLatestReference,
|
|
9692
|
+
props = __rest(_a, ["id", "opacity", "acceptanceTimeInMinutes", "enabled", "layerType", "status", "useLatestReferenceTime"]);
|
|
9751
9693
|
var wmjsLayer = webmapUtils.getWMLayerById(id);
|
|
9752
9694
|
var dimensions = props.dimensions || (wmjsLayer ? wmjsLayer.getDimensions() : []).map(function (dim) {
|
|
9753
9695
|
return {
|
|
@@ -9763,10 +9705,11 @@ var createLayer = function createLayer(_a) {
|
|
|
9763
9705
|
acceptanceTimeInMinutes: acceptanceTimeInMinutes,
|
|
9764
9706
|
enabled: enabled,
|
|
9765
9707
|
layerType: layerType,
|
|
9766
|
-
status: status
|
|
9708
|
+
status: status,
|
|
9709
|
+
useLatestReferenceTime: useLatestReferenceTime
|
|
9767
9710
|
});
|
|
9768
9711
|
};
|
|
9769
|
-
var initialState$
|
|
9712
|
+
var initialState$7 = {
|
|
9770
9713
|
byId: {},
|
|
9771
9714
|
allIds: [],
|
|
9772
9715
|
availableBaseLayers: {
|
|
@@ -9774,8 +9717,8 @@ var initialState$9 = {
|
|
|
9774
9717
|
allIds: []
|
|
9775
9718
|
}
|
|
9776
9719
|
};
|
|
9777
|
-
var slice$
|
|
9778
|
-
initialState: initialState$
|
|
9720
|
+
var slice$7 = createSlice({
|
|
9721
|
+
initialState: initialState$7,
|
|
9779
9722
|
name: 'layerReducer',
|
|
9780
9723
|
reducers: {
|
|
9781
9724
|
addLayer: function addLayer(draft, action) {
|
|
@@ -10034,10 +9977,20 @@ var slice$9 = createSlice({
|
|
|
10034
9977
|
draft.availableBaseLayers.allIds.push(layer.id);
|
|
10035
9978
|
});
|
|
10036
9979
|
},
|
|
10037
|
-
|
|
9980
|
+
setUseLatestReferenceTime: function setUseLatestReferenceTime(draft, action) {
|
|
10038
9981
|
var _action$payload14 = action.payload,
|
|
10039
|
-
|
|
10040
|
-
|
|
9982
|
+
id = _action$payload14.id,
|
|
9983
|
+
useLatestReferenceTime = _action$payload14.useLatestReferenceTime;
|
|
9984
|
+
var layer = draft.byId[id];
|
|
9985
|
+
if (!layer) {
|
|
9986
|
+
return;
|
|
9987
|
+
}
|
|
9988
|
+
layer.useLatestReferenceTime = useLatestReferenceTime;
|
|
9989
|
+
},
|
|
9990
|
+
onUpdateLayerInformation: function onUpdateLayerInformation(draft, action) {
|
|
9991
|
+
var _action$payload15 = action.payload,
|
|
9992
|
+
layerStyle = _action$payload15.layerStyle,
|
|
9993
|
+
layerDimensions = _action$payload15.layerDimensions;
|
|
10041
9994
|
if (layerStyle && draft.byId[layerStyle.layerId]) {
|
|
10042
9995
|
draft.byId[layerStyle.layerId].style = layerStyle === null || layerStyle === void 0 ? void 0 : layerStyle.style;
|
|
10043
9996
|
}
|
|
@@ -10074,6 +10027,9 @@ var slice$9 = createSlice({
|
|
|
10074
10027
|
return d.name === newLayerDimension.name;
|
|
10075
10028
|
});
|
|
10076
10029
|
if (existingDimension) {
|
|
10030
|
+
if (existingDimension.name === 'reference_time' && reduxLayer.useLatestReferenceTime && newLayerDimension.maxValue) {
|
|
10031
|
+
existingDimension.currentValue = newLayerDimension.maxValue;
|
|
10032
|
+
}
|
|
10077
10033
|
/* If found update only minValue, maxValue and values */
|
|
10078
10034
|
existingDimension.maxValue = newLayerDimension.maxValue;
|
|
10079
10035
|
existingDimension.minValue = newLayerDimension.minValue;
|
|
@@ -10090,22 +10046,25 @@ var slice$9 = createSlice({
|
|
|
10090
10046
|
},
|
|
10091
10047
|
// feature layer actions
|
|
10092
10048
|
setSelectedFeature: function setSelectedFeature(draft, action) {
|
|
10093
|
-
var _action$
|
|
10094
|
-
layerId = _action$
|
|
10095
|
-
selectedFeatureIndex = _action$
|
|
10049
|
+
var _action$payload16 = action.payload,
|
|
10050
|
+
layerId = _action$payload16.layerId,
|
|
10051
|
+
selectedFeatureIndex = _action$payload16.selectedFeatureIndex;
|
|
10096
10052
|
if (!draft.byId[layerId]) {
|
|
10097
10053
|
return;
|
|
10098
10054
|
}
|
|
10099
10055
|
draft.byId[layerId].selectedFeatureIndex = selectedFeatureIndex;
|
|
10100
10056
|
},
|
|
10101
10057
|
updateFeature: function updateFeature(draft, action) {
|
|
10102
|
-
var
|
|
10103
|
-
|
|
10104
|
-
|
|
10105
|
-
|
|
10106
|
-
|
|
10107
|
-
_action$
|
|
10108
|
-
|
|
10058
|
+
var _a, _b;
|
|
10059
|
+
var _action$payload17 = action.payload,
|
|
10060
|
+
layerId = _action$payload17.layerId,
|
|
10061
|
+
geojson = _action$payload17.geojson,
|
|
10062
|
+
_action$payload17$sho = _action$payload17.shouldAllowMultipleShapes,
|
|
10063
|
+
shouldAllowMultipleShapes = _action$payload17$sho === void 0 ? false : _action$payload17$sho,
|
|
10064
|
+
_action$payload17$rea = _action$payload17.reason,
|
|
10065
|
+
reason = _action$payload17$rea === void 0 ? '' : _action$payload17$rea,
|
|
10066
|
+
geoJSONIntersectionLayerId = _action$payload17.geoJSONIntersectionLayerId,
|
|
10067
|
+
geoJSONIntersectionBoundsLayerId = _action$payload17.geoJSONIntersectionBoundsLayerId;
|
|
10109
10068
|
var currentLayer = draft.byId[layerId];
|
|
10110
10069
|
if (!currentLayer) {
|
|
10111
10070
|
return;
|
|
@@ -10122,12 +10081,22 @@ var slice$9 = createSlice({
|
|
|
10122
10081
|
}
|
|
10123
10082
|
}
|
|
10124
10083
|
currentLayer.geojson = updatedGeoJSON;
|
|
10084
|
+
if (geoJSONIntersectionBoundsLayerId && geoJSONIntersectionLayerId) {
|
|
10085
|
+
var intersectionLayer = draft.byId[geoJSONIntersectionLayerId];
|
|
10086
|
+
var intersectionBoundsLayer = draft.byId[geoJSONIntersectionBoundsLayerId];
|
|
10087
|
+
if (!intersectionLayer || !intersectionBoundsLayer) {
|
|
10088
|
+
return;
|
|
10089
|
+
}
|
|
10090
|
+
var bounds = R$1(intersectionBoundsLayer).geojson;
|
|
10091
|
+
var properties = (_b = (_a = R$1(currentLayer).geojson) === null || _a === void 0 ? void 0 : _a.features[0]) === null || _b === void 0 ? void 0 : _b.properties;
|
|
10092
|
+
intersectionLayer.geojson = createInterSections(updatedGeoJSON, bounds, properties);
|
|
10093
|
+
}
|
|
10125
10094
|
},
|
|
10126
10095
|
updateFeatureProperties: function updateFeatureProperties(draft, action) {
|
|
10127
|
-
var _action$
|
|
10128
|
-
layerId = _action$
|
|
10129
|
-
properties = _action$
|
|
10130
|
-
selectedFeatureIndex = _action$
|
|
10096
|
+
var _action$payload18 = action.payload,
|
|
10097
|
+
layerId = _action$payload18.layerId,
|
|
10098
|
+
properties = _action$payload18.properties,
|
|
10099
|
+
selectedFeatureIndex = _action$payload18.selectedFeatureIndex;
|
|
10131
10100
|
var currentLayer = draft.byId[layerId];
|
|
10132
10101
|
if (!currentLayer) {
|
|
10133
10102
|
return;
|
|
@@ -10143,10 +10112,10 @@ var slice$9 = createSlice({
|
|
|
10143
10112
|
}
|
|
10144
10113
|
},
|
|
10145
10114
|
toggleFeatureMode: function toggleFeatureMode(draft, action) {
|
|
10146
|
-
var _action$
|
|
10147
|
-
layerId = _action$
|
|
10148
|
-
isInEditMode = _action$
|
|
10149
|
-
drawMode = _action$
|
|
10115
|
+
var _action$payload19 = action.payload,
|
|
10116
|
+
layerId = _action$payload19.layerId,
|
|
10117
|
+
isInEditMode = _action$payload19.isInEditMode,
|
|
10118
|
+
drawMode = _action$payload19.drawMode;
|
|
10150
10119
|
if (!draft.byId[layerId]) {
|
|
10151
10120
|
return;
|
|
10152
10121
|
}
|
|
@@ -10158,10 +10127,10 @@ var slice$9 = createSlice({
|
|
|
10158
10127
|
}
|
|
10159
10128
|
},
|
|
10160
10129
|
exitFeatureDrawMode: function exitFeatureDrawMode(draft, action) {
|
|
10161
|
-
var _action$
|
|
10162
|
-
layerId = _action$
|
|
10163
|
-
shouldAllowMultipleShapes = _action$
|
|
10164
|
-
reason = _action$
|
|
10130
|
+
var _action$payload20 = action.payload,
|
|
10131
|
+
layerId = _action$payload20.layerId,
|
|
10132
|
+
shouldAllowMultipleShapes = _action$payload20.shouldAllowMultipleShapes,
|
|
10133
|
+
reason = _action$payload20.reason;
|
|
10165
10134
|
if (!draft.byId[layerId]) {
|
|
10166
10135
|
return;
|
|
10167
10136
|
}
|
|
@@ -10173,9 +10142,9 @@ var slice$9 = createSlice({
|
|
|
10173
10142
|
},
|
|
10174
10143
|
extraReducers: function extraReducers(builder) {
|
|
10175
10144
|
builder.addCase(setTimeSync, function (draft, action) {
|
|
10176
|
-
var _action$
|
|
10177
|
-
targetsFromAction = _action$
|
|
10178
|
-
source = _action$
|
|
10145
|
+
var _action$payload21 = action.payload,
|
|
10146
|
+
targetsFromAction = _action$payload21.targets,
|
|
10147
|
+
source = _action$payload21.source;
|
|
10179
10148
|
/* Because we want backwards compatibility with the previous code, we also need to listen to the original source action */
|
|
10180
10149
|
var targets = [{
|
|
10181
10150
|
targetId: source.payload.sourceId,
|
|
@@ -10199,9 +10168,9 @@ var slice$9 = createSlice({
|
|
|
10199
10168
|
* These targets can be used as payloads in new Layer actions.
|
|
10200
10169
|
* These actions are here handled via the layer reducer, as it is the same logic
|
|
10201
10170
|
*/
|
|
10202
|
-
var _action$
|
|
10203
|
-
targets = _action$
|
|
10204
|
-
source = _action$
|
|
10171
|
+
var _action$payload22 = action.payload,
|
|
10172
|
+
targets = _action$payload22.targets,
|
|
10173
|
+
source = _action$payload22.source;
|
|
10205
10174
|
var state = R$1(draft);
|
|
10206
10175
|
return targets.reduce(function (prevState, target) {
|
|
10207
10176
|
var action = {
|
|
@@ -10209,7 +10178,7 @@ var slice$9 = createSlice({
|
|
|
10209
10178
|
type: source.type
|
|
10210
10179
|
};
|
|
10211
10180
|
/* Handle the Layer action with the same logic, using the same reducer */
|
|
10212
|
-
return reducer$
|
|
10181
|
+
return reducer$7(prevState, action);
|
|
10213
10182
|
}, state);
|
|
10214
10183
|
}).addCase(setMapPreset, function (draft, action) {
|
|
10215
10184
|
var mapId = action.payload.mapId;
|
|
@@ -10229,8 +10198,8 @@ var slice$9 = createSlice({
|
|
|
10229
10198
|
});
|
|
10230
10199
|
}
|
|
10231
10200
|
});
|
|
10232
|
-
var reducer$
|
|
10233
|
-
var layerActions = slice$
|
|
10201
|
+
var reducer$7 = slice$7.reducer;
|
|
10202
|
+
var layerActions = slice$7.actions;
|
|
10234
10203
|
|
|
10235
10204
|
var lodash = {exports: {}};
|
|
10236
10205
|
|
|
@@ -27455,14 +27424,10 @@ var selectorMemoizationOptions = {
|
|
|
27455
27424
|
resultEqualityCheck: lodash.exports.isEqual
|
|
27456
27425
|
}
|
|
27457
27426
|
};
|
|
27458
|
-
var isUserAddedService = function isUserAddedService(scope) {
|
|
27459
|
-
return scope === 'user';
|
|
27460
|
-
};
|
|
27461
27427
|
|
|
27462
27428
|
var utils$1 = /*#__PURE__*/Object.freeze({
|
|
27463
27429
|
__proto__: null,
|
|
27464
|
-
selectorMemoizationOptions: selectorMemoizationOptions
|
|
27465
|
-
isUserAddedService: isUserAddedService
|
|
27430
|
+
selectorMemoizationOptions: selectorMemoizationOptions
|
|
27466
27431
|
});
|
|
27467
27432
|
|
|
27468
27433
|
/* *
|
|
@@ -27829,8 +27794,11 @@ var getLayerIsInsideAcceptanceTime = createSelector(getAcceptanceTimeInMinutes,
|
|
|
27829
27794
|
}
|
|
27830
27795
|
return 'inside';
|
|
27831
27796
|
});
|
|
27797
|
+
var getUseLatestReferenceTime = createSelector(getLayerById, function (layer) {
|
|
27798
|
+
return Boolean(layer === null || layer === void 0 ? void 0 : layer.useLatestReferenceTime);
|
|
27799
|
+
});
|
|
27832
27800
|
|
|
27833
|
-
var selectors$
|
|
27801
|
+
var selectors$6 = /*#__PURE__*/Object.freeze({
|
|
27834
27802
|
__proto__: null,
|
|
27835
27803
|
getLayerById: getLayerById,
|
|
27836
27804
|
getLayersById: getLayersById,
|
|
@@ -27860,7 +27828,8 @@ var selectors$8 = /*#__PURE__*/Object.freeze({
|
|
|
27860
27828
|
getFeatureLayerGeoJSONProperties: getFeatureLayerGeoJSONProperties,
|
|
27861
27829
|
getDimensionLayerIds: getDimensionLayerIds,
|
|
27862
27830
|
getAcceptanceTimeInMinutes: getAcceptanceTimeInMinutes,
|
|
27863
|
-
getLayerIsInsideAcceptanceTime: getLayerIsInsideAcceptanceTime
|
|
27831
|
+
getLayerIsInsideAcceptanceTime: getLayerIsInsideAcceptanceTime,
|
|
27832
|
+
getUseLatestReferenceTime: getUseLatestReferenceTime
|
|
27864
27833
|
});
|
|
27865
27834
|
|
|
27866
27835
|
/* *
|
|
@@ -27891,7 +27860,7 @@ var AnimationLength;
|
|
|
27891
27860
|
AnimationLength[AnimationLength["Hours24"] = 1440] = "Hours24";
|
|
27892
27861
|
})(AnimationLength || (AnimationLength = {}));
|
|
27893
27862
|
|
|
27894
|
-
var types$
|
|
27863
|
+
var types$4 = /*#__PURE__*/Object.freeze({
|
|
27895
27864
|
__proto__: null,
|
|
27896
27865
|
get AnimationLength () { return AnimationLength; }
|
|
27897
27866
|
});
|
|
@@ -28019,13 +27988,13 @@ var createUIDialogElement = function createUIDialogElement(_ref) {
|
|
|
28019
27988
|
focused: false
|
|
28020
27989
|
};
|
|
28021
27990
|
};
|
|
28022
|
-
var initialState$
|
|
27991
|
+
var initialState$6 = {
|
|
28023
27992
|
order: [],
|
|
28024
27993
|
dialogs: {},
|
|
28025
27994
|
activeWindowId: undefined
|
|
28026
27995
|
};
|
|
28027
|
-
var slice$
|
|
28028
|
-
initialState: initialState$
|
|
27996
|
+
var slice$6 = createSlice({
|
|
27997
|
+
initialState: initialState$6,
|
|
28029
27998
|
name: 'uiReducer',
|
|
28030
27999
|
reducers: {
|
|
28031
28000
|
registerDialog: function registerDialog(draft, action) {
|
|
@@ -28117,18 +28086,9 @@ var slice$8 = createSlice({
|
|
|
28117
28086
|
}
|
|
28118
28087
|
}
|
|
28119
28088
|
});
|
|
28120
|
-
var reducer$
|
|
28121
|
-
var uiActions = slice$
|
|
28122
|
-
|
|
28123
|
-
var addBaseLayer = layerActions.addBaseLayer,
|
|
28124
|
-
addLayer$1 = layerActions.addLayer,
|
|
28125
|
-
duplicateMapLayer$1 = layerActions.duplicateMapLayer,
|
|
28126
|
-
baseLayerDelete = layerActions.baseLayerDelete,
|
|
28127
|
-
layerChangeDimension$1 = layerActions.layerChangeDimension,
|
|
28128
|
-
layerDelete$1 = layerActions.layerDelete,
|
|
28129
|
-
setBaseLayers$1 = layerActions.setBaseLayers,
|
|
28130
|
-
setLayers = layerActions.setLayers,
|
|
28131
|
-
onUpdateLayerInformation = layerActions.onUpdateLayerInformation;
|
|
28089
|
+
var reducer$6 = slice$6.reducer;
|
|
28090
|
+
var uiActions = slice$6.actions;
|
|
28091
|
+
|
|
28132
28092
|
/**
|
|
28133
28093
|
* Checks if the layer id is already taken in one of the maps.
|
|
28134
28094
|
* @param state The WebMapState
|
|
@@ -28166,12 +28126,12 @@ var createLayersWithIds = function createLayersWithIds(state, layers) {
|
|
|
28166
28126
|
}
|
|
28167
28127
|
});
|
|
28168
28128
|
};
|
|
28169
|
-
var initialState$
|
|
28129
|
+
var initialState$5 = {
|
|
28170
28130
|
byId: {},
|
|
28171
28131
|
allIds: []
|
|
28172
28132
|
};
|
|
28173
|
-
var slice$
|
|
28174
|
-
initialState: initialState$
|
|
28133
|
+
var slice$5 = createSlice({
|
|
28134
|
+
initialState: initialState$5,
|
|
28175
28135
|
name: 'mapReducer',
|
|
28176
28136
|
reducers: {
|
|
28177
28137
|
registerMap: function registerMap(draft, action) {
|
|
@@ -28472,7 +28432,7 @@ var slice$7 = createSlice({
|
|
|
28472
28432
|
}
|
|
28473
28433
|
},
|
|
28474
28434
|
extraReducers: function extraReducers(builder) {
|
|
28475
|
-
builder.addCase(addLayer
|
|
28435
|
+
builder.addCase(layerActions.addLayer, function (draft, action) {
|
|
28476
28436
|
var _action$payload27 = action.payload,
|
|
28477
28437
|
layerId = _action$payload27.layerId,
|
|
28478
28438
|
mapId = _action$payload27.mapId,
|
|
@@ -28494,7 +28454,7 @@ var slice$7 = createSlice({
|
|
|
28494
28454
|
} else {
|
|
28495
28455
|
draft.byId[mapId].mapLayers.unshift(layerId);
|
|
28496
28456
|
}
|
|
28497
|
-
}).addCase(duplicateMapLayer
|
|
28457
|
+
}).addCase(layerActions.duplicateMapLayer, function (draft, action) {
|
|
28498
28458
|
var _action$payload28 = action.payload,
|
|
28499
28459
|
newLayerId = _action$payload28.newLayerId,
|
|
28500
28460
|
mapId = _action$payload28.mapId;
|
|
@@ -28506,7 +28466,7 @@ var slice$7 = createSlice({
|
|
|
28506
28466
|
return;
|
|
28507
28467
|
}
|
|
28508
28468
|
draft.byId[mapId].mapLayers.unshift(newLayerId);
|
|
28509
|
-
}).addCase(addBaseLayer, function (draft, action) {
|
|
28469
|
+
}).addCase(layerActions.addBaseLayer, function (draft, action) {
|
|
28510
28470
|
var _action$payload29 = action.payload,
|
|
28511
28471
|
layer = _action$payload29.layer,
|
|
28512
28472
|
layerId = _action$payload29.layerId,
|
|
@@ -28525,7 +28485,7 @@ var slice$7 = createSlice({
|
|
|
28525
28485
|
if (layer.layerType === LayerType.overLayer) {
|
|
28526
28486
|
draft.byId[mapId].overLayers.unshift(layerId);
|
|
28527
28487
|
}
|
|
28528
|
-
}).addCase(setLayers, function (draft, action) {
|
|
28488
|
+
}).addCase(layerActions.setLayers, function (draft, action) {
|
|
28529
28489
|
var mapId = action.payload.mapId;
|
|
28530
28490
|
var layersWithIds = createLayersWithIds(draft, action.payload.layers);
|
|
28531
28491
|
var layerIds = layersWithIds.map(function (_ref) {
|
|
@@ -28565,7 +28525,7 @@ var slice$7 = createSlice({
|
|
|
28565
28525
|
}
|
|
28566
28526
|
}
|
|
28567
28527
|
}
|
|
28568
|
-
}).addCase(setBaseLayers
|
|
28528
|
+
}).addCase(layerActions.setBaseLayers, function (draft, action) {
|
|
28569
28529
|
var _action$payload30 = action.payload,
|
|
28570
28530
|
layers = _action$payload30.layers,
|
|
28571
28531
|
mapId = _action$payload30.mapId;
|
|
@@ -28597,7 +28557,7 @@ var slice$7 = createSlice({
|
|
|
28597
28557
|
draft.byId[mapId].overLayers = overLayerIds;
|
|
28598
28558
|
}
|
|
28599
28559
|
}
|
|
28600
|
-
}).addCase(layerDelete
|
|
28560
|
+
}).addCase(layerActions.layerDelete, function (draft, action) {
|
|
28601
28561
|
var _action$payload31 = action.payload,
|
|
28602
28562
|
mapId = _action$payload31.mapId,
|
|
28603
28563
|
layerId = _action$payload31.layerId;
|
|
@@ -28625,7 +28585,7 @@ var slice$7 = createSlice({
|
|
|
28625
28585
|
map.featureLayers = map.featureLayers.filter(function (id) {
|
|
28626
28586
|
return id !== layerId;
|
|
28627
28587
|
});
|
|
28628
|
-
}).addCase(baseLayerDelete, function (draft, action) {
|
|
28588
|
+
}).addCase(layerActions.baseLayerDelete, function (draft, action) {
|
|
28629
28589
|
var _action$payload32 = action.payload,
|
|
28630
28590
|
mapId = _action$payload32.mapId,
|
|
28631
28591
|
layerId = _action$payload32.layerId;
|
|
@@ -28638,7 +28598,7 @@ var slice$7 = createSlice({
|
|
|
28638
28598
|
draft.byId[mapId].overLayers = draft.byId[mapId].overLayers.filter(function (id) {
|
|
28639
28599
|
return id !== layerId;
|
|
28640
28600
|
});
|
|
28641
|
-
}).addCase(layerChangeDimension
|
|
28601
|
+
}).addCase(layerActions.layerChangeDimension, function (draft, action) {
|
|
28642
28602
|
var _action$payload33 = action.payload,
|
|
28643
28603
|
layerId = _action$payload33.layerId,
|
|
28644
28604
|
dimension = _action$payload33.dimension;
|
|
@@ -28707,9 +28667,9 @@ var slice$7 = createSlice({
|
|
|
28707
28667
|
type: source.type
|
|
28708
28668
|
};
|
|
28709
28669
|
/* Handle the Layer action with the same logic, using the same reducer */
|
|
28710
|
-
return reducer$
|
|
28670
|
+
return reducer$5(prevState, action);
|
|
28711
28671
|
}, draft);
|
|
28712
|
-
}).addCase(onUpdateLayerInformation, function (draft, action) {
|
|
28672
|
+
}).addCase(layerActions.onUpdateLayerInformation, function (draft, action) {
|
|
28713
28673
|
var mapDimensions = action.payload.mapDimensions;
|
|
28714
28674
|
if (!mapDimensions) {
|
|
28715
28675
|
return draft;
|
|
@@ -28753,11 +28713,11 @@ var slice$7 = createSlice({
|
|
|
28753
28713
|
});
|
|
28754
28714
|
}
|
|
28755
28715
|
});
|
|
28756
|
-
var mapActions = Object.assign(Object.assign({}, slice$
|
|
28716
|
+
var mapActions = Object.assign(Object.assign({}, slice$5.actions), {
|
|
28757
28717
|
setMapPreset: setMapPreset,
|
|
28758
28718
|
mapChangeDimension: mapChangeDimension
|
|
28759
28719
|
});
|
|
28760
|
-
var reducer$
|
|
28720
|
+
var reducer$5 = slice$5.reducer;
|
|
28761
28721
|
|
|
28762
28722
|
/* *
|
|
28763
28723
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -28884,7 +28844,7 @@ var getDialogError = createSelector(getDialogDetailsByType, function (details) {
|
|
|
28884
28844
|
return details && details.error || '';
|
|
28885
28845
|
});
|
|
28886
28846
|
|
|
28887
|
-
var selectors$
|
|
28847
|
+
var selectors$5 = /*#__PURE__*/Object.freeze({
|
|
28888
28848
|
__proto__: null,
|
|
28889
28849
|
getUiStore: getUiStore,
|
|
28890
28850
|
getDialogDetailsByType: getDialogDetailsByType,
|
|
@@ -28932,7 +28892,7 @@ var DialogTypes;
|
|
|
28932
28892
|
DialogTypes["Search"] = "search";
|
|
28933
28893
|
})(DialogTypes || (DialogTypes = {}));
|
|
28934
28894
|
|
|
28935
|
-
var types$
|
|
28895
|
+
var types$3 = /*#__PURE__*/Object.freeze({
|
|
28936
28896
|
__proto__: null,
|
|
28937
28897
|
get DialogTypes () { return DialogTypes; }
|
|
28938
28898
|
});
|
|
@@ -29022,7 +28982,7 @@ var removeInPlace = function removeInPlace(inDraftArray, condition) {
|
|
|
29022
28982
|
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
29023
28983
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
29024
28984
|
* */
|
|
29025
|
-
var initialState$
|
|
28985
|
+
var initialState$4 = {
|
|
29026
28986
|
sources: {
|
|
29027
28987
|
byId: {},
|
|
29028
28988
|
allIds: []
|
|
@@ -29046,8 +29006,8 @@ var initialState$6 = {
|
|
|
29046
29006
|
}
|
|
29047
29007
|
}
|
|
29048
29008
|
};
|
|
29049
|
-
var slice$
|
|
29050
|
-
initialState: initialState$
|
|
29009
|
+
var slice$4 = createSlice({
|
|
29010
|
+
initialState: initialState$4,
|
|
29051
29011
|
name: 'synchronizationGroupsReducer',
|
|
29052
29012
|
reducers: {
|
|
29053
29013
|
syncGroupAddSource: function syncGroupAddSource(draft, action) {
|
|
@@ -29176,7 +29136,7 @@ var slice$6 = createSlice({
|
|
|
29176
29136
|
});
|
|
29177
29137
|
},
|
|
29178
29138
|
syncGroupClear: function syncGroupClear() {
|
|
29179
|
-
return initialState$
|
|
29139
|
+
return initialState$4;
|
|
29180
29140
|
},
|
|
29181
29141
|
syncGroupSetViewState: function syncGroupSetViewState(draft, action) {
|
|
29182
29142
|
var viewState = action.payload.viewState;
|
|
@@ -29235,7 +29195,7 @@ var setBboxOrTimeSync = function setBboxOrTimeSync(state, action) {
|
|
|
29235
29195
|
});
|
|
29236
29196
|
});
|
|
29237
29197
|
};
|
|
29238
|
-
var _slice$actions = slice$
|
|
29198
|
+
var _slice$actions = slice$4.actions,
|
|
29239
29199
|
syncGroupAddGroup = _slice$actions.syncGroupAddGroup,
|
|
29240
29200
|
syncGroupAddSource = _slice$actions.syncGroupAddSource,
|
|
29241
29201
|
syncGroupAddTarget = _slice$actions.syncGroupAddTarget;
|
|
@@ -29245,8 +29205,8 @@ var _slice$actions = slice$6.actions,
|
|
|
29245
29205
|
syncGroupRemoveSource = _slice$actions.syncGroupRemoveSource,
|
|
29246
29206
|
syncGroupRemoveTarget = _slice$actions.syncGroupRemoveTarget,
|
|
29247
29207
|
syncGroupSetViewState = _slice$actions.syncGroupSetViewState;
|
|
29248
|
-
var actions = slice$
|
|
29249
|
-
reducer$
|
|
29208
|
+
var actions = slice$4.actions,
|
|
29209
|
+
reducer$4 = slice$4.reducer;
|
|
29250
29210
|
|
|
29251
29211
|
/* *
|
|
29252
29212
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -29274,7 +29234,7 @@ var SyncGroupActionOrigin;
|
|
|
29274
29234
|
SyncGroupActionOrigin["activateLayerId"] = "ORIGIN_GENERIC_SYNCHRONIZATIONGROUP_UTILS_ACTIVELAYERIDACTION";
|
|
29275
29235
|
})(SyncGroupActionOrigin || (SyncGroupActionOrigin = {}));
|
|
29276
29236
|
|
|
29277
|
-
var types$
|
|
29237
|
+
var types$2 = /*#__PURE__*/Object.freeze({
|
|
29278
29238
|
__proto__: null,
|
|
29279
29239
|
SyncGroupTypeList: SyncGroupTypeList,
|
|
29280
29240
|
get SyncGroupActionOrigin () { return SyncGroupActionOrigin; }
|
|
@@ -29416,7 +29376,7 @@ var getSyncGroupTargets = createSelector(syncGroupStore, function (store) {
|
|
|
29416
29376
|
}, []);
|
|
29417
29377
|
});
|
|
29418
29378
|
|
|
29419
|
-
var selectors$
|
|
29379
|
+
var selectors$4 = /*#__PURE__*/Object.freeze({
|
|
29420
29380
|
__proto__: null,
|
|
29421
29381
|
syncGroupStore: syncGroupStore,
|
|
29422
29382
|
getSynchronizationGroupState: getSynchronizationGroupState,
|
|
@@ -29568,7 +29528,7 @@ var getTime = createSelector(getSyncSourceBySourceId, function (store) {
|
|
|
29568
29528
|
return store && store.payloadByType && store.payloadByType[SYNCGROUPS_TYPE_SETTIME] ? store.payloadByType[SYNCGROUPS_TYPE_SETTIME].value : null;
|
|
29569
29529
|
});
|
|
29570
29530
|
|
|
29571
|
-
var selectors$
|
|
29531
|
+
var selectors$3 = /*#__PURE__*/Object.freeze({
|
|
29572
29532
|
__proto__: null,
|
|
29573
29533
|
getSynchronizationGroupStore: getSynchronizationGroupStore,
|
|
29574
29534
|
getTime: getTime
|
|
@@ -29591,7 +29551,7 @@ var selectors$5 = /*#__PURE__*/Object.freeze({
|
|
|
29591
29551
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
29592
29552
|
* */
|
|
29593
29553
|
|
|
29594
|
-
var types$
|
|
29554
|
+
var types$1 = /*#__PURE__*/Object.freeze({
|
|
29595
29555
|
__proto__: null
|
|
29596
29556
|
});
|
|
29597
29557
|
|
|
@@ -30343,7 +30303,7 @@ var getDockedLayerManagerSize = createSelector(getMapById, function (store) {
|
|
|
30343
30303
|
return store ? store.dockedLayerManagerSize : 'sizeSmall';
|
|
30344
30304
|
});
|
|
30345
30305
|
|
|
30346
|
-
var selectors$
|
|
30306
|
+
var selectors$2 = /*#__PURE__*/Object.freeze({
|
|
30347
30307
|
__proto__: null,
|
|
30348
30308
|
getMapById: getMapById,
|
|
30349
30309
|
getAllMapIds: getAllMapIds,
|
|
@@ -30513,12 +30473,12 @@ var mapUtils = Object.assign(Object.assign({}, utils$3), {
|
|
|
30513
30473
|
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
30514
30474
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
30515
30475
|
* */
|
|
30516
|
-
var initialState$
|
|
30476
|
+
var initialState$3 = {
|
|
30517
30477
|
byId: {},
|
|
30518
30478
|
allIds: []
|
|
30519
30479
|
};
|
|
30520
|
-
var slice$
|
|
30521
|
-
initialState: initialState$
|
|
30480
|
+
var slice$3 = createSlice({
|
|
30481
|
+
initialState: initialState$3,
|
|
30522
30482
|
name: 'serviceReducer',
|
|
30523
30483
|
reducers: {
|
|
30524
30484
|
serviceSetLayers: function serviceSetLayers(draft, action) {
|
|
@@ -30547,8 +30507,8 @@ var slice$5 = createSlice({
|
|
|
30547
30507
|
action) {}
|
|
30548
30508
|
}
|
|
30549
30509
|
});
|
|
30550
|
-
var reducer$
|
|
30551
|
-
var serviceActions = slice$
|
|
30510
|
+
var reducer$3 = slice$3.reducer;
|
|
30511
|
+
var serviceActions = slice$3.actions;
|
|
30552
30512
|
|
|
30553
30513
|
/* *
|
|
30554
30514
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -30650,7 +30610,7 @@ var getLayerStyles = createSelector(getLayerFromService, function (layer) {
|
|
|
30650
30610
|
return (_a = layer === null || layer === void 0 ? void 0 : layer.styles) !== null && _a !== void 0 ? _a : [];
|
|
30651
30611
|
}, selectorMemoizationOptions);
|
|
30652
30612
|
|
|
30653
|
-
var selectors$
|
|
30613
|
+
var selectors$1 = /*#__PURE__*/Object.freeze({
|
|
30654
30614
|
__proto__: null,
|
|
30655
30615
|
getServiceIds: getServiceIds,
|
|
30656
30616
|
getServices: getServices,
|
|
@@ -30677,7 +30637,7 @@ var selectors$3 = /*#__PURE__*/Object.freeze({
|
|
|
30677
30637
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
30678
30638
|
* */
|
|
30679
30639
|
|
|
30680
|
-
var types
|
|
30640
|
+
var types = /*#__PURE__*/Object.freeze({
|
|
30681
30641
|
__proto__: null
|
|
30682
30642
|
});
|
|
30683
30643
|
|
|
@@ -30816,6 +30776,33 @@ var WmMultiDimensionLayer2 = new WMLayer({
|
|
|
30816
30776
|
currentValue: '2017-01-01T00:25:00Z'
|
|
30817
30777
|
}]
|
|
30818
30778
|
});
|
|
30779
|
+
var WmMultiDimensionServices = {
|
|
30780
|
+
serviceid_1: {
|
|
30781
|
+
name: 'testservicedimensions',
|
|
30782
|
+
serviceUrl: 'https://testservicedimensions',
|
|
30783
|
+
layers: [{
|
|
30784
|
+
name: 'netcdf_5dims',
|
|
30785
|
+
title: 'netcdf_5dims',
|
|
30786
|
+
leaf: true,
|
|
30787
|
+
path: []
|
|
30788
|
+
}]
|
|
30789
|
+
},
|
|
30790
|
+
serviceid_2: {
|
|
30791
|
+
name: 'testservice',
|
|
30792
|
+
serviceUrl: 'https://testservice',
|
|
30793
|
+
layers: [{
|
|
30794
|
+
name: 'RADNL_OPER_R___25PCPRR_L3_KNMI',
|
|
30795
|
+
title: 'RADNL_OPER_R___25PCPRR_L3_KNMI',
|
|
30796
|
+
leaf: true,
|
|
30797
|
+
path: []
|
|
30798
|
+
}, {
|
|
30799
|
+
name: 'LAYER_WITHOUT_TIME',
|
|
30800
|
+
title: 'LAYER_WITHOUT_TIME',
|
|
30801
|
+
leaf: true,
|
|
30802
|
+
path: []
|
|
30803
|
+
}]
|
|
30804
|
+
}
|
|
30805
|
+
};
|
|
30819
30806
|
|
|
30820
30807
|
var storeTestSettings = /*#__PURE__*/Object.freeze({
|
|
30821
30808
|
__proto__: null,
|
|
@@ -30824,7 +30811,8 @@ var storeTestSettings = /*#__PURE__*/Object.freeze({
|
|
|
30824
30811
|
layerWithoutTimeDimension: layerWithoutTimeDimension,
|
|
30825
30812
|
styleListForRADNLOPERR25PCPRRL3KNMILayer: styleListForRADNLOPERR25PCPRRL3KNMILayer,
|
|
30826
30813
|
defaultReduxServices: defaultReduxServices,
|
|
30827
|
-
WmMultiDimensionLayer2: WmMultiDimensionLayer2
|
|
30814
|
+
WmMultiDimensionLayer2: WmMultiDimensionLayer2,
|
|
30815
|
+
WmMultiDimensionServices: WmMultiDimensionServices
|
|
30828
30816
|
});
|
|
30829
30817
|
|
|
30830
30818
|
function n$4(n,e,r){if(r||2===arguments.length)for(var t,u=0,o=e.length;o>u;u++)!t&&u in e||(t||(t=[].slice.call(e,0,u)),t[u]=e[u]);return n.concat(t||[].slice.call(e))}var e$4=function(n,e){return n===e},r$3=function(){return !1},t$6=function(t,u){void 0===t&&(t=e$4),void 0===u&&(u=r$3);var o=[],c=function(n){var e=o.findIndex((function(e){return t(e.value,n)}));return [o[e],e]};return {getCount:function(n){var e=c(n)[0];return (null==e?void 0:e.count)||0},getItems:function(){return n$4([],o,!0)},add:function(n){var e=c(n)[0];e&&!u(e.value)?e.count+=1:e||o.push({value:n,count:u(n)?1/0:1});},remove:function(n){var e=c(n),r=e[0],t=e[1];r&&!u(r.value)&&(r.count>1?r.count-=1:o.splice(t,1));}}},u$3=Array.isArray,o=function(n){var e=[],r=function(n){n.forEach((function(n){u$3(n)?r(n):e.push(n);}));};return u$3(n)&&r(n),e},c$2=["enhancers","middlewares","beforeAdd","afterAdd","beforeRemove","afterRemove"],a=function(e,r,u,i){void 0===i&&(i=[]);var a,f=i.reduce((function(n,e){return c$2.forEach((function(r){var t,u=e[r];(null==u?void 0:u.length)&&(t=n[r]).push.apply(t,u);})),n}),c$2.reduce((function(n,e){return n[e]=[],n}),{})),d={getItems:(a=t$6((function(n,e){return n.id===e.id}),(function(n){return !!n.keep}))).getItems,getCount:a.getCount,add:function(n){n.forEach((function(n){return a.add(n)}));},remove:function(n){n.forEach((function(n){return a.remove(n)}));}},v=function(n){var e,r=t$6(),u=[];return {mid:function(r){return e=r,function(e){return function(r){return n.apply(void 0,u.map((function(n){return n.act})))(e)(r)}}},add:function(n){n.forEach((function(n){r.getCount(n)||u.push({mid:n,act:n(e)}),r.add(n);}));},remove:function(n){n.forEach((function(n){1===r.getCount(n)&&(u=u.filter((function(e){return n!==e.mid}))),r.remove(n);}));}}}(u),l=function(e){var r,u=t$6(),o={},c=[];return {reducer:function(n,e){void 0===n&&(n={});var t=n;return c.length&&(t=Object.assign({},n),c.forEach((function(n){return delete t[n]})),c=[]),(Object.keys(o).length?r:function(){return {}})(t,e)},add:function(n){var t=[];return n.forEach((function(n){var e=n[0],r=n[1];u.getCount(e)||(o[e]=r,t.push(e)),u.add(e);})),t.length&&(r=e(o)),t},remove:function(t){return t.forEach((function(n){var e=n[0];1===u.getCount(e)&&(delete o[e],c.push(e)),u.remove(e);})),c.length&&(r=e(o)),n$4([],c,!0)}}}(r),g=e(l.reducer,v.mid,f.enhancers,f.middlewares),s=function(n,e,r,t){var u=n.filter((function(n){return n.id}));if(u.length){var o=[],c=[],i=[],a="add"===e;u.forEach((function(n){var e,r=d.getCount(n);(a&&!r||!a&&1===r)&&(o.push(n),(null===(e=n.middlewares)||void 0===e?void 0:e.length)&&c.push.apply(c,n.middlewares),n.reducersMap&&i.push.apply(i,Object.entries(n.reducersMap)));}));var s=o.length;s&&(f[r].forEach((function(n){return n(o,g)})),o.forEach((function(n){var e;return null===(e=n[r])||void 0===e?void 0:e.call(n,g)})),l[e](i).length&&g.dispatch({type:"@@eggs/reduce"}),v[e](c)),d[e](u),s&&(f[t].forEach((function(n){return n(o,g)})),o.forEach((function(n){var e;return null===(e=n[t])||void 0===e?void 0:e.call(n,g)})));}},h=function(n){return s(n,"remove","beforeRemove","afterRemove")};return Object.assign(g,{getEggs:d.getItems,getEggCount:d.getCount,addEggs:function(e){var r=o(e);return s(r,"add","beforeAdd","afterAdd"),function(){return h(n$4([],r,!0).reverse())}},removeEggs:function(n){h(o(n));}})};
|
|
@@ -33050,9 +33038,9 @@ function takeLatest$1(patternOrChannel, worker) {
|
|
|
33050
33038
|
return fork.apply(void 0, [takeLatest, patternOrChannel, worker].concat(args));
|
|
33051
33039
|
}
|
|
33052
33040
|
|
|
33053
|
-
var _marked$
|
|
33054
|
-
_marked2$
|
|
33055
|
-
_marked3$2 = /*#__PURE__*/_regeneratorRuntime().mark(rootSaga$
|
|
33041
|
+
var _marked$6 = /*#__PURE__*/_regeneratorRuntime().mark(updateAnimation),
|
|
33042
|
+
_marked2$4 = /*#__PURE__*/_regeneratorRuntime().mark(handleBaseLayersSaga),
|
|
33043
|
+
_marked3$2 = /*#__PURE__*/_regeneratorRuntime().mark(rootSaga$5);
|
|
33056
33044
|
// Expects start, end time as moment object and interval in minutes
|
|
33057
33045
|
var generateTimeList = function generateTimeList(start, end, interval) {
|
|
33058
33046
|
var timeList = [];
|
|
@@ -33221,7 +33209,7 @@ function updateAnimation(mapId, maxValue) {
|
|
|
33221
33209
|
case "end":
|
|
33222
33210
|
return _context4.stop();
|
|
33223
33211
|
}
|
|
33224
|
-
}, _marked$
|
|
33212
|
+
}, _marked$6);
|
|
33225
33213
|
}
|
|
33226
33214
|
function setLayerDimensionsSaga(_ref4) {
|
|
33227
33215
|
var payload = _ref4.payload;
|
|
@@ -33472,7 +33460,7 @@ function handleBaseLayersSaga(mapId, baseLayers) {
|
|
|
33472
33460
|
case "end":
|
|
33473
33461
|
return _context7.stop();
|
|
33474
33462
|
}
|
|
33475
|
-
}, _marked2$
|
|
33463
|
+
}, _marked2$4);
|
|
33476
33464
|
}
|
|
33477
33465
|
function setMapPresetSaga(_ref6) {
|
|
33478
33466
|
var payload = _ref6.payload;
|
|
@@ -33823,7 +33811,7 @@ function unregisterMapSaga(_ref7) {
|
|
|
33823
33811
|
}, _callee7);
|
|
33824
33812
|
})();
|
|
33825
33813
|
}
|
|
33826
|
-
function rootSaga$
|
|
33814
|
+
function rootSaga$5() {
|
|
33827
33815
|
return _regeneratorRuntime().wrap(function rootSaga$(_context10) {
|
|
33828
33816
|
while (1) switch (_context10.prev = _context10.next) {
|
|
33829
33817
|
case 0:
|
|
@@ -33854,8 +33842,8 @@ function rootSaga$7() {
|
|
|
33854
33842
|
}, _marked3$2);
|
|
33855
33843
|
}
|
|
33856
33844
|
|
|
33857
|
-
var _marked$
|
|
33858
|
-
_marked2$
|
|
33845
|
+
var _marked$5 = /*#__PURE__*/_regeneratorRuntime().mark(fetchServiceSaga),
|
|
33846
|
+
_marked2$3 = /*#__PURE__*/_regeneratorRuntime().mark(rootSaga$4);
|
|
33859
33847
|
function fetchServiceSaga(service) {
|
|
33860
33848
|
var layers;
|
|
33861
33849
|
return _regeneratorRuntime().wrap(function fetchServiceSaga$(_context) {
|
|
@@ -33880,7 +33868,7 @@ function fetchServiceSaga(service) {
|
|
|
33880
33868
|
case "end":
|
|
33881
33869
|
return _context.stop();
|
|
33882
33870
|
}
|
|
33883
|
-
}, _marked$
|
|
33871
|
+
}, _marked$5, null, [[0, 8]]);
|
|
33884
33872
|
}
|
|
33885
33873
|
function fetchInitialServicesSaga(_ref) {
|
|
33886
33874
|
var payload = _ref.payload;
|
|
@@ -33901,7 +33889,7 @@ function fetchInitialServicesSaga(_ref) {
|
|
|
33901
33889
|
}, _callee);
|
|
33902
33890
|
})();
|
|
33903
33891
|
}
|
|
33904
|
-
function rootSaga$
|
|
33892
|
+
function rootSaga$4() {
|
|
33905
33893
|
return _regeneratorRuntime().wrap(function rootSaga$(_context3) {
|
|
33906
33894
|
while (1) switch (_context3.prev = _context3.next) {
|
|
33907
33895
|
case 0:
|
|
@@ -33911,7 +33899,7 @@ function rootSaga$6() {
|
|
|
33911
33899
|
case "end":
|
|
33912
33900
|
return _context3.stop();
|
|
33913
33901
|
}
|
|
33914
|
-
}, _marked2$
|
|
33902
|
+
}, _marked2$3);
|
|
33915
33903
|
}
|
|
33916
33904
|
|
|
33917
33905
|
// TODO: This fixes typecheck errors but maybe there is a better way to do that
|
|
@@ -33919,14 +33907,14 @@ i({
|
|
|
33919
33907
|
extensions: [e$3()]
|
|
33920
33908
|
});
|
|
33921
33909
|
var mapStoreReducers = {
|
|
33922
|
-
webmap: reducer$
|
|
33923
|
-
services: reducer$
|
|
33924
|
-
layers: reducer$
|
|
33910
|
+
webmap: reducer$5,
|
|
33911
|
+
services: reducer$3,
|
|
33912
|
+
layers: reducer$7
|
|
33925
33913
|
};
|
|
33926
33914
|
var mapStoreModuleConfig = {
|
|
33927
33915
|
id: 'webmap-module',
|
|
33928
33916
|
reducersMap: mapStoreReducers,
|
|
33929
|
-
sagas: [rootSaga$
|
|
33917
|
+
sagas: [rootSaga$5, rootSaga$4]
|
|
33930
33918
|
};
|
|
33931
33919
|
|
|
33932
33920
|
/* *
|
|
@@ -33947,618 +33935,6 @@ var mapStoreModuleConfig = {
|
|
|
33947
33935
|
* */
|
|
33948
33936
|
var mapStoreActions = Object.assign(Object.assign(Object.assign({}, layerActions), mapActions), serviceActions);
|
|
33949
33937
|
|
|
33950
|
-
/* *
|
|
33951
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
33952
|
-
* you may not use this file except in compliance with the License.
|
|
33953
|
-
* You may obtain a copy of the License at
|
|
33954
|
-
*
|
|
33955
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
33956
|
-
*
|
|
33957
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
33958
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
33959
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
33960
|
-
* See the License for the specific language governing permissions and
|
|
33961
|
-
* limitations under the License.
|
|
33962
|
-
*
|
|
33963
|
-
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
33964
|
-
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
33965
|
-
* */
|
|
33966
|
-
var FilterType;
|
|
33967
|
-
(function (FilterType) {
|
|
33968
|
-
FilterType["Keyword"] = "keywords";
|
|
33969
|
-
FilterType["Group"] = "groups";
|
|
33970
|
-
})(FilterType || (FilterType = {}));
|
|
33971
|
-
|
|
33972
|
-
var types$1 = /*#__PURE__*/Object.freeze({
|
|
33973
|
-
__proto__: null,
|
|
33974
|
-
get FilterType () { return FilterType; }
|
|
33975
|
-
});
|
|
33976
|
-
|
|
33977
|
-
/* *
|
|
33978
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
33979
|
-
* you may not use this file except in compliance with the License.
|
|
33980
|
-
* You may obtain a copy of the License at
|
|
33981
|
-
*
|
|
33982
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
33983
|
-
*
|
|
33984
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
33985
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
33986
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
33987
|
-
* See the License for the specific language governing permissions and
|
|
33988
|
-
* limitations under the License.
|
|
33989
|
-
*
|
|
33990
|
-
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
33991
|
-
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
33992
|
-
* */
|
|
33993
|
-
var getFilterId = function getFilterId(filterType, filterName) {
|
|
33994
|
-
return "".concat(filterType, "-").concat(filterName);
|
|
33995
|
-
};
|
|
33996
|
-
var produceFilters = function produceFilters(filterNames, filterType, draft, layerSelectFilterAdapter) {
|
|
33997
|
-
filterNames.forEach(function (filterName) {
|
|
33998
|
-
var id = getFilterId(filterType, filterName);
|
|
33999
|
-
if (!draft.filters.filters.entities[id]) {
|
|
34000
|
-
// If this filter doesn't exit yet, add it
|
|
34001
|
-
layerSelectFilterAdapter.addOne(draft.filters.filters, {
|
|
34002
|
-
id: id,
|
|
34003
|
-
name: filterName,
|
|
34004
|
-
amount: 1,
|
|
34005
|
-
amountVisible: 1,
|
|
34006
|
-
checked: true,
|
|
34007
|
-
type: filterType
|
|
34008
|
-
});
|
|
34009
|
-
} else {
|
|
34010
|
-
// If it exists already, up the amounts
|
|
34011
|
-
draft.filters.filters.entities[id].amount += 1;
|
|
34012
|
-
draft.filters.filters.entities[id].amountVisible += 1;
|
|
34013
|
-
}
|
|
34014
|
-
});
|
|
34015
|
-
};
|
|
34016
|
-
var filterLayersFromService = function filterLayersFromService(serviceId, services, filterIds, allFiltersActive, searchString) {
|
|
34017
|
-
var mapStoreService = services[serviceId];
|
|
34018
|
-
if (!mapStoreService) {
|
|
34019
|
-
return [];
|
|
34020
|
-
}
|
|
34021
|
-
if (searchString === '' && allFiltersActive) {
|
|
34022
|
-
return mapStoreService.layers.filter(function (layer) {
|
|
34023
|
-
return layer.leaf;
|
|
34024
|
-
});
|
|
34025
|
-
}
|
|
34026
|
-
var searchStringArray = searchString.split(' ');
|
|
34027
|
-
return mapStoreService.layers.filter(function (layer) {
|
|
34028
|
-
return searchStringArray.every(function (search) {
|
|
34029
|
-
var _a, _b, _c;
|
|
34030
|
-
var searchLowercase = search.toLowerCase();
|
|
34031
|
-
var layerFilterIds = layer.path.map(function (group) {
|
|
34032
|
-
return "".concat(FilterType.Group, "-").concat(group);
|
|
34033
|
-
}).concat(layer.keywords.map(function (keyword) {
|
|
34034
|
-
return "".concat(FilterType.Keyword, "-").concat(keyword);
|
|
34035
|
-
}));
|
|
34036
|
-
var isFilterInLayer = (layerFilterIds === null || layerFilterIds === void 0 ? void 0 : layerFilterIds.some(function (id) {
|
|
34037
|
-
return filterIds.includes(id);
|
|
34038
|
-
})) || allFiltersActive;
|
|
34039
|
-
var isSearchTextInLayerFilter = layerFilterIds === null || layerFilterIds === void 0 ? void 0 : layerFilterIds.some(function (filterId) {
|
|
34040
|
-
return filterId.toLowerCase().includes(searchLowercase);
|
|
34041
|
-
});
|
|
34042
|
-
var isSearchTextInLayerName = (_a = layer.name) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(searchLowercase);
|
|
34043
|
-
var isSearchTextInLayerText = (_b = layer.title) === null || _b === void 0 ? void 0 : _b.toLowerCase().includes(searchLowercase);
|
|
34044
|
-
var isSearchTextInLayerAbstract = (_c = layer["abstract"]) === null || _c === void 0 ? void 0 : _c.toLowerCase().includes(searchLowercase);
|
|
34045
|
-
var isSearchTextInServiceName = mapStoreService.name.toLowerCase().includes(searchLowercase);
|
|
34046
|
-
var isSearchTextInLayer = isSearchTextInLayerName || isSearchTextInLayerText || isSearchTextInLayerAbstract || isSearchTextInLayerFilter || isSearchTextInServiceName;
|
|
34047
|
-
return isFilterInLayer && isSearchTextInLayer;
|
|
34048
|
-
});
|
|
34049
|
-
}).filter(function (layer) {
|
|
34050
|
-
return layer.leaf;
|
|
34051
|
-
});
|
|
34052
|
-
};
|
|
34053
|
-
|
|
34054
|
-
var layerSelectFilterAdapter = createEntityAdapter();
|
|
34055
|
-
var layerSelectActiveServicesAdapter = createEntityAdapter({
|
|
34056
|
-
selectId: function selectId(service) {
|
|
34057
|
-
return service.serviceId;
|
|
34058
|
-
}
|
|
34059
|
-
});
|
|
34060
|
-
var initialServicePopupState = {
|
|
34061
|
-
isOpen: false,
|
|
34062
|
-
url: '',
|
|
34063
|
-
serviceId: '',
|
|
34064
|
-
variant: 'add'
|
|
34065
|
-
};
|
|
34066
|
-
var initialState$4 = {
|
|
34067
|
-
filters: {
|
|
34068
|
-
searchFilter: '',
|
|
34069
|
-
activeServices: layerSelectActiveServicesAdapter.getInitialState(),
|
|
34070
|
-
filters: layerSelectFilterAdapter.getInitialState()
|
|
34071
|
-
},
|
|
34072
|
-
allServicesEnabled: true,
|
|
34073
|
-
activeLayerInfo: {
|
|
34074
|
-
name: '',
|
|
34075
|
-
title: '',
|
|
34076
|
-
leaf: true,
|
|
34077
|
-
path: [],
|
|
34078
|
-
serviceName: ''
|
|
34079
|
-
},
|
|
34080
|
-
servicePopup: initialServicePopupState
|
|
34081
|
-
};
|
|
34082
|
-
var slice$4 = createSlice({
|
|
34083
|
-
initialState: initialState$4,
|
|
34084
|
-
name: DialogTypes.LayerSelect,
|
|
34085
|
-
reducers: {
|
|
34086
|
-
setSearchFilter: function setSearchFilter(draft, action) {
|
|
34087
|
-
var filterText = action.payload.filterText;
|
|
34088
|
-
draft.filters.searchFilter = filterText;
|
|
34089
|
-
},
|
|
34090
|
-
closeServicePopupOpen: function closeServicePopupOpen(draft) {
|
|
34091
|
-
draft.servicePopup.isOpen = false;
|
|
34092
|
-
},
|
|
34093
|
-
toggleServicePopup: function toggleServicePopup(draft, action) {
|
|
34094
|
-
var _action$payload = action.payload,
|
|
34095
|
-
variant = _action$payload.variant,
|
|
34096
|
-
isOpen = _action$payload.isOpen;
|
|
34097
|
-
draft.servicePopup.isOpen = isOpen;
|
|
34098
|
-
draft.servicePopup.url = action.payload.url ? action.payload.url : '';
|
|
34099
|
-
draft.servicePopup.variant = variant;
|
|
34100
|
-
draft.servicePopup.serviceId = action.payload.serviceId ? action.payload.serviceId : '';
|
|
34101
|
-
},
|
|
34102
|
-
layerSelectRemoveService: function layerSelectRemoveService(draft, action) {
|
|
34103
|
-
var serviceId = action.payload.serviceId;
|
|
34104
|
-
// 1. Find a service that is to be removed
|
|
34105
|
-
var foundService = draft.filters.activeServices.entities[serviceId];
|
|
34106
|
-
// 2. Go through all keywords for removed service, and decrement the amount of all found keywords
|
|
34107
|
-
foundService.filterIds.forEach(function (filterId) {
|
|
34108
|
-
var foundObject = draft.filters.filters.entities[filterId];
|
|
34109
|
-
if (foundObject && foundObject.amount) {
|
|
34110
|
-
foundObject.amount -= 1;
|
|
34111
|
-
foundObject.amountVisible -= 1;
|
|
34112
|
-
}
|
|
34113
|
-
if (foundObject && foundObject.amount === 0) {
|
|
34114
|
-
delete draft.filters.filters.entities[filterId];
|
|
34115
|
-
draft.filters.filters.ids = draft.filters.filters.ids.filter(function (serviceId) {
|
|
34116
|
-
return serviceId !== filterId;
|
|
34117
|
-
});
|
|
34118
|
-
}
|
|
34119
|
-
});
|
|
34120
|
-
// Finally remove object from activeServices, so if the service is added again later on, new object and keywords will be re-added
|
|
34121
|
-
layerSelectActiveServicesAdapter.removeOne(draft.filters.activeServices, serviceId);
|
|
34122
|
-
},
|
|
34123
|
-
enableActiveService: function enableActiveService(draft, action) {
|
|
34124
|
-
var activeServicesById = draft.filters.activeServices.entities;
|
|
34125
|
-
var activeServices = lodash.exports.compact(Object.values(activeServicesById));
|
|
34126
|
-
var countPressedServices = activeServices.filter(function (service) {
|
|
34127
|
-
return service.enabled;
|
|
34128
|
-
}).length;
|
|
34129
|
-
var isAllServicesGoingToBeEnabled = countPressedServices === activeServices.length - 1;
|
|
34130
|
-
if (isAllServicesGoingToBeEnabled) {
|
|
34131
|
-
slice$4.caseReducers.enableAllActiveServices(draft);
|
|
34132
|
-
return;
|
|
34133
|
-
}
|
|
34134
|
-
var service = activeServicesById[action.payload.serviceId];
|
|
34135
|
-
service.enabled = true;
|
|
34136
|
-
var _iterator = _createForOfIteratorHelper(service.filterIds),
|
|
34137
|
-
_step;
|
|
34138
|
-
try {
|
|
34139
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
34140
|
-
var keyword = _step.value;
|
|
34141
|
-
draft.filters.filters.entities[keyword].amountVisible += 1;
|
|
34142
|
-
}
|
|
34143
|
-
} catch (err) {
|
|
34144
|
-
_iterator.e(err);
|
|
34145
|
-
} finally {
|
|
34146
|
-
_iterator.f();
|
|
34147
|
-
}
|
|
34148
|
-
},
|
|
34149
|
-
enableAllActiveServices: function enableAllActiveServices(draft) {
|
|
34150
|
-
var activeServices = draft.filters.activeServices.entities;
|
|
34151
|
-
var servicesToTurnOn = lodash.exports.compact(Object.values(activeServices)).filter(function (service) {
|
|
34152
|
-
return !service.enabled;
|
|
34153
|
-
});
|
|
34154
|
-
var updates = servicesToTurnOn.map(function (service) {
|
|
34155
|
-
return {
|
|
34156
|
-
id: service.serviceId,
|
|
34157
|
-
changes: {
|
|
34158
|
-
enabled: true
|
|
34159
|
-
}
|
|
34160
|
-
};
|
|
34161
|
-
});
|
|
34162
|
-
layerSelectActiveServicesAdapter.updateMany(draft.filters.activeServices, updates);
|
|
34163
|
-
var keywords = servicesToTurnOn.flatMap(function (service) {
|
|
34164
|
-
var _a;
|
|
34165
|
-
return (_a = service.filterIds) !== null && _a !== void 0 ? _a : [];
|
|
34166
|
-
});
|
|
34167
|
-
var _iterator2 = _createForOfIteratorHelper(keywords),
|
|
34168
|
-
_step2;
|
|
34169
|
-
try {
|
|
34170
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
34171
|
-
var keyword = _step2.value;
|
|
34172
|
-
draft.filters.filters.entities[keyword].amountVisible += 1;
|
|
34173
|
-
}
|
|
34174
|
-
} catch (err) {
|
|
34175
|
-
_iterator2.e(err);
|
|
34176
|
-
} finally {
|
|
34177
|
-
_iterator2.f();
|
|
34178
|
-
}
|
|
34179
|
-
draft.allServicesEnabled = true;
|
|
34180
|
-
},
|
|
34181
|
-
onlyThisServiceEnabled: function onlyThisServiceEnabled(draft, action) {
|
|
34182
|
-
var activeServicesById = draft.filters.activeServices.entities;
|
|
34183
|
-
var servicesToTurnOff = lodash.exports.compact(Object.values(activeServicesById)).filter(function (service) {
|
|
34184
|
-
return service.serviceId !== action.payload.serviceId;
|
|
34185
|
-
});
|
|
34186
|
-
var updates = servicesToTurnOff.map(function (service) {
|
|
34187
|
-
return {
|
|
34188
|
-
id: service.serviceId,
|
|
34189
|
-
changes: {
|
|
34190
|
-
enabled: false
|
|
34191
|
-
}
|
|
34192
|
-
};
|
|
34193
|
-
});
|
|
34194
|
-
layerSelectActiveServicesAdapter.updateMany(draft.filters.activeServices, updates);
|
|
34195
|
-
var keywords = servicesToTurnOff.flatMap(function (service) {
|
|
34196
|
-
var _a;
|
|
34197
|
-
return (_a = service.filterIds) !== null && _a !== void 0 ? _a : [];
|
|
34198
|
-
});
|
|
34199
|
-
var _iterator3 = _createForOfIteratorHelper(keywords),
|
|
34200
|
-
_step3;
|
|
34201
|
-
try {
|
|
34202
|
-
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
34203
|
-
var keyword = _step3.value;
|
|
34204
|
-
draft.filters.filters.entities[keyword].amountVisible -= 1;
|
|
34205
|
-
}
|
|
34206
|
-
} catch (err) {
|
|
34207
|
-
_iterator3.e(err);
|
|
34208
|
-
} finally {
|
|
34209
|
-
_iterator3.f();
|
|
34210
|
-
}
|
|
34211
|
-
draft.allServicesEnabled = false;
|
|
34212
|
-
},
|
|
34213
|
-
disableActiveService: function disableActiveService(draft, action) {
|
|
34214
|
-
var activeServicesById = draft.filters.activeServices.entities;
|
|
34215
|
-
var countPressedServices = Object.values(activeServicesById).filter(function (service) {
|
|
34216
|
-
return service === null || service === void 0 ? void 0 : service.enabled;
|
|
34217
|
-
}).length;
|
|
34218
|
-
var isAllServicesGoingToBeDisabled = countPressedServices === 1;
|
|
34219
|
-
if (isAllServicesGoingToBeDisabled) {
|
|
34220
|
-
slice$4.caseReducers.enableAllActiveServices(draft);
|
|
34221
|
-
return;
|
|
34222
|
-
}
|
|
34223
|
-
var service = activeServicesById[action.payload.serviceId];
|
|
34224
|
-
service.enabled = false;
|
|
34225
|
-
var _iterator4 = _createForOfIteratorHelper(service.filterIds),
|
|
34226
|
-
_step4;
|
|
34227
|
-
try {
|
|
34228
|
-
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
34229
|
-
var keyword = _step4.value;
|
|
34230
|
-
draft.filters.filters.entities[keyword].amountVisible -= 1;
|
|
34231
|
-
}
|
|
34232
|
-
} catch (err) {
|
|
34233
|
-
_iterator4.e(err);
|
|
34234
|
-
} finally {
|
|
34235
|
-
_iterator4.f();
|
|
34236
|
-
}
|
|
34237
|
-
},
|
|
34238
|
-
toggleFilter: function toggleFilter(draft, action) {
|
|
34239
|
-
var filterIds = action.payload.filterIds;
|
|
34240
|
-
filterIds.forEach(function (filterId) {
|
|
34241
|
-
draft.filters.filters.entities[filterId].checked = !draft.filters.filters.entities[filterId].checked;
|
|
34242
|
-
});
|
|
34243
|
-
},
|
|
34244
|
-
enableOnlyOneFilter: function enableOnlyOneFilter(draft, action) {
|
|
34245
|
-
var filterId = action.payload.filterId;
|
|
34246
|
-
draft.filters.filters.ids.forEach(function (filterId) {
|
|
34247
|
-
draft.filters.filters.entities[filterId].checked = false;
|
|
34248
|
-
});
|
|
34249
|
-
draft.filters.filters.entities[filterId].checked = true;
|
|
34250
|
-
},
|
|
34251
|
-
setActiveLayerInfo: function setActiveLayerInfo(draft, action) {
|
|
34252
|
-
var layer = action.payload.layer;
|
|
34253
|
-
draft.activeLayerInfo = layer;
|
|
34254
|
-
}
|
|
34255
|
-
},
|
|
34256
|
-
extraReducers: function extraReducers(builder) {
|
|
34257
|
-
builder.addCase(serviceActions.serviceSetLayers, function (draft, action) {
|
|
34258
|
-
var _a, _b;
|
|
34259
|
-
var _action$payload2 = action.payload,
|
|
34260
|
-
serviceId = _action$payload2.id,
|
|
34261
|
-
serviceUrl = _action$payload2.serviceUrl,
|
|
34262
|
-
serviceName = _action$payload2.name,
|
|
34263
|
-
scope = _action$payload2.scope,
|
|
34264
|
-
_abstract = _action$payload2["abstract"],
|
|
34265
|
-
layers = _action$payload2.layers,
|
|
34266
|
-
isUpdating = _action$payload2.isUpdating;
|
|
34267
|
-
if (isUpdating) {
|
|
34268
|
-
return;
|
|
34269
|
-
}
|
|
34270
|
-
var keywords = layers.reduce(function (keywords, layer) {
|
|
34271
|
-
var _a;
|
|
34272
|
-
if (layer.leaf) {
|
|
34273
|
-
return keywords.concat((_a = layer.keywords) !== null && _a !== void 0 ? _a : []);
|
|
34274
|
-
}
|
|
34275
|
-
return keywords;
|
|
34276
|
-
}, []);
|
|
34277
|
-
var groups = layers.reduce(function (groups, layer) {
|
|
34278
|
-
var _a;
|
|
34279
|
-
if (layer.leaf) {
|
|
34280
|
-
return groups.concat((_a = layer.path) !== null && _a !== void 0 ? _a : []);
|
|
34281
|
-
}
|
|
34282
|
-
return groups;
|
|
34283
|
-
}, []);
|
|
34284
|
-
if (!((_b = (_a = draft.filters.activeServices.entities[serviceId]) === null || _a === void 0 ? void 0 : _a.filterIds) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
34285
|
-
// If the service has no filters yet, add them
|
|
34286
|
-
produceFilters(groups, FilterType.Group, draft, layerSelectFilterAdapter);
|
|
34287
|
-
produceFilters(keywords, FilterType.Keyword, draft, layerSelectFilterAdapter);
|
|
34288
|
-
}
|
|
34289
|
-
var filterIds = groups.map(function (group) {
|
|
34290
|
-
return getFilterId(FilterType.Group, group);
|
|
34291
|
-
}).concat(keywords.map(function (keyword) {
|
|
34292
|
-
return getFilterId(FilterType.Keyword, keyword);
|
|
34293
|
-
}));
|
|
34294
|
-
draft.filters.activeServices.entities[serviceId] = {
|
|
34295
|
-
serviceId: serviceId,
|
|
34296
|
-
enabled: draft.allServicesEnabled,
|
|
34297
|
-
filterIds: filterIds,
|
|
34298
|
-
scope: scope,
|
|
34299
|
-
serviceName: serviceName,
|
|
34300
|
-
serviceUrl: serviceUrl,
|
|
34301
|
-
"abstract": _abstract,
|
|
34302
|
-
isLoading: false
|
|
34303
|
-
};
|
|
34304
|
-
if (!draft.filters.activeServices.ids.includes(serviceId)) {
|
|
34305
|
-
draft.filters.activeServices.ids.push(serviceId);
|
|
34306
|
-
}
|
|
34307
|
-
}).addCase(serviceActions.fetchInitialServices, function (draft, action) {
|
|
34308
|
-
var services = action.payload.services;
|
|
34309
|
-
services.forEach(function (service) {
|
|
34310
|
-
var serviceId = service.id,
|
|
34311
|
-
serviceName = service.name,
|
|
34312
|
-
serviceUrl = service.serviceUrl,
|
|
34313
|
-
_abstract2 = service["abstract"],
|
|
34314
|
-
scope = service.scope;
|
|
34315
|
-
draft.filters.activeServices.entities[serviceId] = {
|
|
34316
|
-
serviceId: serviceId,
|
|
34317
|
-
enabled: draft.allServicesEnabled,
|
|
34318
|
-
filterIds: [],
|
|
34319
|
-
scope: scope,
|
|
34320
|
-
serviceName: serviceName,
|
|
34321
|
-
serviceUrl: serviceUrl,
|
|
34322
|
-
"abstract": _abstract2,
|
|
34323
|
-
isLoading: true
|
|
34324
|
-
};
|
|
34325
|
-
if (!draft.filters.activeServices.ids.includes(serviceId)) {
|
|
34326
|
-
draft.filters.activeServices.ids.push(serviceId);
|
|
34327
|
-
}
|
|
34328
|
-
});
|
|
34329
|
-
});
|
|
34330
|
-
}
|
|
34331
|
-
});
|
|
34332
|
-
var reducer$4 = slice$4.reducer;
|
|
34333
|
-
var layerSelectActions = slice$4.actions;
|
|
34334
|
-
|
|
34335
|
-
/* *
|
|
34336
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
34337
|
-
* you may not use this file except in compliance with the License.
|
|
34338
|
-
* You may obtain a copy of the License at
|
|
34339
|
-
*
|
|
34340
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
34341
|
-
*
|
|
34342
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
34343
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
34344
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
34345
|
-
* See the License for the specific language governing permissions and
|
|
34346
|
-
* limitations under the License.
|
|
34347
|
-
*
|
|
34348
|
-
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
34349
|
-
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
34350
|
-
* */
|
|
34351
|
-
var layerSelectStore = function layerSelectStore(store) {
|
|
34352
|
-
return store && store.layerSelect ? store.layerSelect : null;
|
|
34353
|
-
};
|
|
34354
|
-
/**
|
|
34355
|
-
* Returns search filter string
|
|
34356
|
-
*
|
|
34357
|
-
* Example getSearchFilter(store);
|
|
34358
|
-
* @param {object} store store: object - store object
|
|
34359
|
-
* @returns {array} returnType: string
|
|
34360
|
-
*/
|
|
34361
|
-
var getSearchFilter = createSelector(layerSelectStore, function (store) {
|
|
34362
|
-
var _a;
|
|
34363
|
-
return ((_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.searchFilter) || '';
|
|
34364
|
-
});
|
|
34365
|
-
/**
|
|
34366
|
-
* Returns active services array
|
|
34367
|
-
*
|
|
34368
|
-
* Example getActiveServices(store);
|
|
34369
|
-
* @param {object} store store: object - store object
|
|
34370
|
-
* @returns {ActiveServiceObjectEntities} returnType: ActiveServiceObjectEntitiesobject of active services
|
|
34371
|
-
*/
|
|
34372
|
-
// cast to usable type - selectEntities returns Dictionary<ActiveServiceObject> which is not usable inside of the code
|
|
34373
|
-
var getActiveServices = function getActiveServices(store) {
|
|
34374
|
-
return getActiveServicesDictionary(store);
|
|
34375
|
-
};
|
|
34376
|
-
var _layerSelectActiveSer = layerSelectActiveServicesAdapter.getSelectors(function (store) {
|
|
34377
|
-
var _a, _b;
|
|
34378
|
-
return ((_b = (_a = store === null || store === void 0 ? void 0 : store.layerSelect) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.activeServices) || {
|
|
34379
|
-
entities: {},
|
|
34380
|
-
ids: []
|
|
34381
|
-
};
|
|
34382
|
-
}),
|
|
34383
|
-
getActiveServicesDictionary = _layerSelectActiveSer.selectEntities,
|
|
34384
|
-
getActiveServiceById = _layerSelectActiveSer.selectById;
|
|
34385
|
-
var getEnabledServiceIds = createSelector(layerSelectStore, function (store) {
|
|
34386
|
-
var _a, _b;
|
|
34387
|
-
var enabledServices = (_b = (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.activeServices.ids.filter(function (serviceId) {
|
|
34388
|
-
var _a, _b, _c;
|
|
34389
|
-
return (_c = (_b = (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.activeServices) === null || _b === void 0 ? void 0 : _b.entities[serviceId]) === null || _c === void 0 ? void 0 : _c.enabled;
|
|
34390
|
-
})) !== null && _b !== void 0 ? _b : [];
|
|
34391
|
-
return enabledServices;
|
|
34392
|
-
}, selectorMemoizationOptions);
|
|
34393
|
-
/**
|
|
34394
|
-
* Returns all ids of checked keywords
|
|
34395
|
-
*
|
|
34396
|
-
* Example getCheckedKeywordIds(store);
|
|
34397
|
-
* @param {object} store store: object - store object
|
|
34398
|
-
* @returns {array} returnType: array of keyword ids that are checked
|
|
34399
|
-
*/
|
|
34400
|
-
var getCheckedFilterIds = createSelector(layerSelectStore, function (store) {
|
|
34401
|
-
var _a, _b, _c;
|
|
34402
|
-
var checkedFilters = (_c = (_b = (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.ids.filter(function (filterId) {
|
|
34403
|
-
var _a, _b, _c;
|
|
34404
|
-
return (_c = (_b = (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.entities[filterId]) === null || _c === void 0 ? void 0 : _c.checked;
|
|
34405
|
-
})) !== null && _c !== void 0 ? _c : [];
|
|
34406
|
-
return checkedFilters.map(function (filterId) {
|
|
34407
|
-
var _a, _b, _c;
|
|
34408
|
-
return (_c = (_b = (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.entities[filterId]) === null || _c === void 0 ? void 0 : _c.id;
|
|
34409
|
-
});
|
|
34410
|
-
}, selectorMemoizationOptions);
|
|
34411
|
-
/**
|
|
34412
|
-
* Returns ids of all keywords
|
|
34413
|
-
*
|
|
34414
|
-
* Example getAllKeywordIds(store);
|
|
34415
|
-
* @param {object} store store: object - store object
|
|
34416
|
-
* @returns {array} returnType: array of all keyword ids
|
|
34417
|
-
*/
|
|
34418
|
-
// cast to usable type - selectIds returns EntityId[] which is not usable inside of the code
|
|
34419
|
-
var getAllFilterIds = function getAllFilterIds(store) {
|
|
34420
|
-
return getAllFilterIdsEntity(store);
|
|
34421
|
-
};
|
|
34422
|
-
var _layerSelectFilterAda = layerSelectFilterAdapter.getSelectors(function (store) {
|
|
34423
|
-
var _a, _b;
|
|
34424
|
-
return ((_b = (_a = store === null || store === void 0 ? void 0 : store.layerSelect) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.filters) || {
|
|
34425
|
-
entities: {},
|
|
34426
|
-
ids: []
|
|
34427
|
-
};
|
|
34428
|
-
}),
|
|
34429
|
-
getAllFilterIdsEntity = _layerSelectFilterAda.selectIds;
|
|
34430
|
-
/**
|
|
34431
|
-
* Returns all filters
|
|
34432
|
-
*
|
|
34433
|
-
* Example getAllFilters(store);
|
|
34434
|
-
* @param {object} store store: object - store object
|
|
34435
|
-
* @returns {array} returnType: array of all filters
|
|
34436
|
-
*/
|
|
34437
|
-
var _layerSelectFilterAda2 = layerSelectFilterAdapter.getSelectors(function (store) {
|
|
34438
|
-
var _a, _b;
|
|
34439
|
-
return ((_b = (_a = store === null || store === void 0 ? void 0 : store.layerSelect) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.filters) || {
|
|
34440
|
-
entities: {},
|
|
34441
|
-
ids: []
|
|
34442
|
-
};
|
|
34443
|
-
}),
|
|
34444
|
-
getAllFilters = _layerSelectFilterAda2.selectAll;
|
|
34445
|
-
var isAllFiltersChecked = createSelector(layerSelectStore, function (store) {
|
|
34446
|
-
var _a, _b;
|
|
34447
|
-
return (_b = (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.ids.every(function (filterId) {
|
|
34448
|
-
var _a, _b, _c;
|
|
34449
|
-
return (_c = (_b = (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.entities[filterId]) === null || _c === void 0 ? void 0 : _c.checked;
|
|
34450
|
-
});
|
|
34451
|
-
});
|
|
34452
|
-
/**
|
|
34453
|
-
* Gets a KeywordObject by its id
|
|
34454
|
-
*
|
|
34455
|
-
* Example: keywordObject = getKeywordObjectById(store, 'keywordId')
|
|
34456
|
-
* @param {object} store object from which the keyword state will be extracted
|
|
34457
|
-
* @param {string} filterId Id of the keyword
|
|
34458
|
-
* @returns {object} object containing keyword information (id, amount, amountVisible, checked)
|
|
34459
|
-
*/
|
|
34460
|
-
var _layerSelectFilterAda3 = layerSelectFilterAdapter.getSelectors(function (store) {
|
|
34461
|
-
var _a, _b;
|
|
34462
|
-
return ((_b = (_a = store === null || store === void 0 ? void 0 : store.layerSelect) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.filters) || {
|
|
34463
|
-
entities: {},
|
|
34464
|
-
ids: []
|
|
34465
|
-
};
|
|
34466
|
-
}),
|
|
34467
|
-
getFilterById = _layerSelectFilterAda3.selectById;
|
|
34468
|
-
var getActiveLayerInfo = createSelector(layerSelectStore, function (store) {
|
|
34469
|
-
return store === null || store === void 0 ? void 0 : store.activeLayerInfo;
|
|
34470
|
-
});
|
|
34471
|
-
/**
|
|
34472
|
-
* Returns a filtered active layer object based on the given filter settings
|
|
34473
|
-
* Example: layerSelectSelectors.getFilteredLayers(store, filteredSettings);
|
|
34474
|
-
* @param {object} store store: object - object from which the service state will be extracted
|
|
34475
|
-
* @returns {array} returnType: ActiveLayerObject - an array of all filtered activelayers
|
|
34476
|
-
*/
|
|
34477
|
-
var getFilteredLayers = createSelector([getEnabledServiceIds, getServices, getCheckedFilterIds, isAllFiltersChecked, getSearchFilter], function (enabledServiceIds, servicesStore, checkedFilterIds, allFiltersActive, searchFilter) {
|
|
34478
|
-
return enabledServiceIds.reduce(function (layerList, serviceId) {
|
|
34479
|
-
return layerList.concat(filterLayersFromService(serviceId, servicesStore, checkedFilterIds, allFiltersActive, searchFilter).map(function (layer) {
|
|
34480
|
-
return Object.assign(Object.assign({}, layer), {
|
|
34481
|
-
serviceName: serviceId
|
|
34482
|
-
});
|
|
34483
|
-
}));
|
|
34484
|
-
}, []);
|
|
34485
|
-
}, selectorMemoizationOptions);
|
|
34486
|
-
/**
|
|
34487
|
-
* Returns service popup details
|
|
34488
|
-
*
|
|
34489
|
-
* Example getActiveServices(store, 'server-id');
|
|
34490
|
-
* @param {object} store store: object - store object
|
|
34491
|
-
* @returns {object} returnType: object of active service
|
|
34492
|
-
*/
|
|
34493
|
-
var getServicePopupDetails = function getServicePopupDetails(store) {
|
|
34494
|
-
var _a;
|
|
34495
|
-
return ((_a = store === null || store === void 0 ? void 0 : store.layerSelect) === null || _a === void 0 ? void 0 : _a.servicePopup) || initialServicePopupState;
|
|
34496
|
-
};
|
|
34497
|
-
|
|
34498
|
-
var selectors$2 = /*#__PURE__*/Object.freeze({
|
|
34499
|
-
__proto__: null,
|
|
34500
|
-
getSearchFilter: getSearchFilter,
|
|
34501
|
-
getActiveServices: getActiveServices,
|
|
34502
|
-
getActiveServicesDictionary: getActiveServicesDictionary,
|
|
34503
|
-
getActiveServiceById: getActiveServiceById,
|
|
34504
|
-
getEnabledServiceIds: getEnabledServiceIds,
|
|
34505
|
-
getCheckedFilterIds: getCheckedFilterIds,
|
|
34506
|
-
getAllFilterIds: getAllFilterIds,
|
|
34507
|
-
getAllFilters: getAllFilters,
|
|
34508
|
-
isAllFiltersChecked: isAllFiltersChecked,
|
|
34509
|
-
getFilterById: getFilterById,
|
|
34510
|
-
getActiveLayerInfo: getActiveLayerInfo,
|
|
34511
|
-
getFilteredLayers: getFilteredLayers,
|
|
34512
|
-
getServicePopupDetails: getServicePopupDetails
|
|
34513
|
-
});
|
|
34514
|
-
|
|
34515
|
-
/* *
|
|
34516
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
34517
|
-
* you may not use this file except in compliance with the License.
|
|
34518
|
-
* You may obtain a copy of the License at
|
|
34519
|
-
*
|
|
34520
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
34521
|
-
*
|
|
34522
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
34523
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
34524
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
34525
|
-
* See the License for the specific language governing permissions and
|
|
34526
|
-
* limitations under the License.
|
|
34527
|
-
*
|
|
34528
|
-
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
34529
|
-
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
34530
|
-
* */
|
|
34531
|
-
var getUserAddedServices = function getUserAddedServices() {
|
|
34532
|
-
try {
|
|
34533
|
-
var storedString = window.localStorage.getItem('userAddedServices');
|
|
34534
|
-
var parsedData = JSON.parse(storedString);
|
|
34535
|
-
if (parsedData && _typeof$1(parsedData) === 'object') {
|
|
34536
|
-
return Object.entries(parsedData).reduce(function (userServices, _ref) {
|
|
34537
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
34538
|
-
serviceUrl = _ref2[0],
|
|
34539
|
-
service = _ref2[1];
|
|
34540
|
-
return Object.assign(Object.assign({}, userServices), isNoIdService(service) ? _defineProperty$1({}, serviceUrl, Object.assign(Object.assign({}, service), {
|
|
34541
|
-
scope: 'user'
|
|
34542
|
-
})) : {});
|
|
34543
|
-
}, {});
|
|
34544
|
-
}
|
|
34545
|
-
} catch (e) {
|
|
34546
|
-
console.error('Unable to read services from localStorage: ', e);
|
|
34547
|
-
}
|
|
34548
|
-
return {};
|
|
34549
|
-
};
|
|
34550
|
-
var setUserAddedServices = function setUserAddedServices(services) {
|
|
34551
|
-
try {
|
|
34552
|
-
window.localStorage.setItem('userAddedServices', JSON.stringify(services));
|
|
34553
|
-
} catch (e) {
|
|
34554
|
-
console.error('Unable to write services to localStorage: ', e);
|
|
34555
|
-
}
|
|
34556
|
-
};
|
|
34557
|
-
var isNoIdService = function isNoIdService(param) {
|
|
34558
|
-
var serviceParam = param;
|
|
34559
|
-
return !!((serviceParam === null || serviceParam === void 0 ? void 0 : serviceParam.name) && (serviceParam === null || serviceParam === void 0 ? void 0 : serviceParam.url));
|
|
34560
|
-
};
|
|
34561
|
-
|
|
34562
33938
|
/* *
|
|
34563
33939
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
34564
33940
|
* you may not use this file except in compliance with the License.
|
|
@@ -34755,16 +34131,7 @@ var getMapBaseLayerActionsTargets = function getMapBaseLayerActionsTargets(state
|
|
|
34755
34131
|
});
|
|
34756
34132
|
};
|
|
34757
34133
|
|
|
34758
|
-
var _marked$
|
|
34759
|
-
var setBaseLayers = layerActions.setBaseLayers,
|
|
34760
|
-
addLayer = layerActions.addLayer,
|
|
34761
|
-
duplicateMapLayer = layerActions.duplicateMapLayer,
|
|
34762
|
-
layerChangeDimension = layerActions.layerChangeDimension,
|
|
34763
|
-
layerChangeEnabled = layerActions.layerChangeEnabled,
|
|
34764
|
-
layerChangeName = layerActions.layerChangeName,
|
|
34765
|
-
layerChangeOpacity = layerActions.layerChangeOpacity,
|
|
34766
|
-
layerChangeStyle = layerActions.layerChangeStyle,
|
|
34767
|
-
layerDelete = layerActions.layerDelete;
|
|
34134
|
+
var _marked$4 = /*#__PURE__*/_regeneratorRuntime().mark(rootSaga$3);
|
|
34768
34135
|
var setTimeValidatorRexexp = /^(19|20)\d\d-(0[1-9]|1[012])-([012]\d|3[01])T([01]\d|2[0-3]):([0-5]\d):([0-5]\d)Z$/;
|
|
34769
34136
|
function setTimeSaga(_ref) {
|
|
34770
34137
|
var payload = _ref.payload;
|
|
@@ -34911,7 +34278,7 @@ function duplicateMapLayerActionsSaga(_ref5) {
|
|
|
34911
34278
|
break;
|
|
34912
34279
|
}
|
|
34913
34280
|
_context5.next = 10;
|
|
34914
|
-
return put(setLayerActionSync(newPayload, targets, addLayer.type));
|
|
34281
|
+
return put(setLayerActionSync(newPayload, targets, layerActions.addLayer.type));
|
|
34915
34282
|
case 10:
|
|
34916
34283
|
case "end":
|
|
34917
34284
|
return _context5.stop();
|
|
@@ -35037,7 +34404,7 @@ function mapBaseLayerActionsSaga(_ref9) {
|
|
|
35037
34404
|
}, _callee9);
|
|
35038
34405
|
})();
|
|
35039
34406
|
}
|
|
35040
|
-
function rootSaga$
|
|
34407
|
+
function rootSaga$3() {
|
|
35041
34408
|
return _regeneratorRuntime().wrap(function rootSaga$(_context10) {
|
|
35042
34409
|
while (1) switch (_context10.prev = _context10.next) {
|
|
35043
34410
|
case 0:
|
|
@@ -35048,28 +34415,28 @@ function rootSaga$5() {
|
|
|
35048
34415
|
return takeLatest$1(setBbox.type, setBBoxSaga);
|
|
35049
34416
|
case 4:
|
|
35050
34417
|
_context10.next = 6;
|
|
35051
|
-
return takeLatest$1(layerChangeName.type, layerActionsSaga);
|
|
34418
|
+
return takeLatest$1(layerActions.layerChangeName.type, layerActionsSaga);
|
|
35052
34419
|
case 6:
|
|
35053
34420
|
_context10.next = 8;
|
|
35054
|
-
return takeLatest$1(layerChangeEnabled.type, layerActionsSaga);
|
|
34421
|
+
return takeLatest$1(layerActions.layerChangeEnabled.type, layerActionsSaga);
|
|
35055
34422
|
case 8:
|
|
35056
34423
|
_context10.next = 10;
|
|
35057
|
-
return takeLatest$1(layerChangeOpacity.type, layerActionsSaga);
|
|
34424
|
+
return takeLatest$1(layerActions.layerChangeOpacity.type, layerActionsSaga);
|
|
35058
34425
|
case 10:
|
|
35059
34426
|
_context10.next = 12;
|
|
35060
|
-
return takeLatest$1(layerChangeDimension.type, layerActionsSaga);
|
|
34427
|
+
return takeLatest$1(layerActions.layerChangeDimension.type, layerActionsSaga);
|
|
35061
34428
|
case 12:
|
|
35062
34429
|
_context10.next = 14;
|
|
35063
|
-
return takeLatest$1(layerChangeStyle.type, layerActionsSaga);
|
|
34430
|
+
return takeLatest$1(layerActions.layerChangeStyle.type, layerActionsSaga);
|
|
35064
34431
|
case 14:
|
|
35065
34432
|
_context10.next = 16;
|
|
35066
|
-
return takeLatest$1(layerDelete.type, deleteLayerActionsSaga);
|
|
34433
|
+
return takeLatest$1(layerActions.layerDelete.type, deleteLayerActionsSaga);
|
|
35067
34434
|
case 16:
|
|
35068
34435
|
_context10.next = 18;
|
|
35069
|
-
return takeLatest$1(addLayer.type, addLayerActionsSaga);
|
|
34436
|
+
return takeLatest$1(layerActions.addLayer.type, addLayerActionsSaga);
|
|
35070
34437
|
case 18:
|
|
35071
34438
|
_context10.next = 20;
|
|
35072
|
-
return takeLatest$1(duplicateMapLayer.type, duplicateMapLayerActionsSaga);
|
|
34439
|
+
return takeLatest$1(layerActions.duplicateMapLayer.type, duplicateMapLayerActionsSaga);
|
|
35073
34440
|
case 20:
|
|
35074
34441
|
_context10.next = 22;
|
|
35075
34442
|
return takeLatest$1(mapActions.layerMoveLayer.type, moveLayerActionsSaga);
|
|
@@ -35078,208 +34445,14 @@ function rootSaga$5() {
|
|
|
35078
34445
|
return takeLatest$1(mapActions.setAutoLayerId.type, setAutoLayerIdActionsSaga);
|
|
35079
34446
|
case 24:
|
|
35080
34447
|
_context10.next = 26;
|
|
35081
|
-
return takeLatest$1(setBaseLayers.type, mapBaseLayerActionsSaga);
|
|
34448
|
+
return takeLatest$1(layerActions.setBaseLayers.type, mapBaseLayerActionsSaga);
|
|
35082
34449
|
case 26:
|
|
35083
34450
|
case "end":
|
|
35084
34451
|
return _context10.stop();
|
|
35085
34452
|
}
|
|
35086
|
-
}, _marked$
|
|
35087
|
-
}
|
|
35088
|
-
|
|
35089
|
-
/* *
|
|
35090
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
35091
|
-
* you may not use this file except in compliance with the License.
|
|
35092
|
-
* You may obtain a copy of the License at
|
|
35093
|
-
*
|
|
35094
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
35095
|
-
*
|
|
35096
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
35097
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
35098
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
35099
|
-
* See the License for the specific language governing permissions and
|
|
35100
|
-
* limitations under the License.
|
|
35101
|
-
*
|
|
35102
|
-
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
35103
|
-
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
35104
|
-
* */
|
|
35105
|
-
var snackbarAdapter = createEntityAdapter();
|
|
35106
|
-
var initialState$3 = snackbarAdapter.getInitialState();
|
|
35107
|
-
var slice$3 = createSlice({
|
|
35108
|
-
initialState: initialState$3,
|
|
35109
|
-
name: 'snackbar',
|
|
35110
|
-
reducers: {
|
|
35111
|
-
// To open the snackbar call this action
|
|
35112
|
-
openSnackbar: function openSnackbar(
|
|
35113
|
-
// eslint-disable-next-line no-unused-vars
|
|
35114
|
-
draft,
|
|
35115
|
-
// eslint-disable-next-line no-unused-vars
|
|
35116
|
-
action) {},
|
|
35117
|
-
// triggerOpenSnackbarBySaga is triggered by the saga to open the snackbar after the current snackbars have all been closed
|
|
35118
|
-
// DO NOT CALL THIS ACTION DIRECTLY!
|
|
35119
|
-
triggerOpenSnackbarBySaga: function triggerOpenSnackbarBySaga(draft, action) {
|
|
35120
|
-
var snackbarContent = action.payload.snackbarContent;
|
|
35121
|
-
// Ensure we have an id before proceeding
|
|
35122
|
-
if (snackbarContent.id === undefined) {
|
|
35123
|
-
return;
|
|
35124
|
-
}
|
|
35125
|
-
snackbarAdapter.setOne(draft, snackbarContent);
|
|
35126
|
-
},
|
|
35127
|
-
closeSnackbar: function closeSnackbar(draft) {
|
|
35128
|
-
snackbarAdapter.removeAll(draft);
|
|
35129
|
-
}
|
|
35130
|
-
}
|
|
35131
|
-
});
|
|
35132
|
-
var reducer$3 = slice$3.reducer;
|
|
35133
|
-
var snackbarActions = slice$3.actions;
|
|
35134
|
-
|
|
35135
|
-
/* *
|
|
35136
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
35137
|
-
* you may not use this file except in compliance with the License.
|
|
35138
|
-
* You may obtain a copy of the License at
|
|
35139
|
-
*
|
|
35140
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
35141
|
-
*
|
|
35142
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
35143
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
35144
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
35145
|
-
* See the License for the specific language governing permissions and
|
|
35146
|
-
* limitations under the License.
|
|
35147
|
-
*
|
|
35148
|
-
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
35149
|
-
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
35150
|
-
* */
|
|
35151
|
-
var getSnackbarStore = function getSnackbarStore(store) {
|
|
35152
|
-
if (store && store.snackbar) {
|
|
35153
|
-
return store.snackbar;
|
|
35154
|
-
}
|
|
35155
|
-
return null;
|
|
35156
|
-
};
|
|
35157
|
-
var _snackbarAdapter$getS = snackbarAdapter.getSelectors(function (state) {
|
|
35158
|
-
var _a;
|
|
35159
|
-
return (_a = state === null || state === void 0 ? void 0 : state.snackbar) !== null && _a !== void 0 ? _a : {
|
|
35160
|
-
entities: {},
|
|
35161
|
-
ids: []
|
|
35162
|
-
};
|
|
35163
|
-
}),
|
|
35164
|
-
getCurrentSnackbarMessages = _snackbarAdapter$getS.selectAll;
|
|
35165
|
-
var getFirstSnackbarMessage = createSelector(getCurrentSnackbarMessages, function (currentMessages) {
|
|
35166
|
-
return currentMessages.length > 0 ? currentMessages[0] : undefined;
|
|
35167
|
-
});
|
|
35168
|
-
|
|
35169
|
-
var selectors$1 = /*#__PURE__*/Object.freeze({
|
|
35170
|
-
__proto__: null,
|
|
35171
|
-
getSnackbarStore: getSnackbarStore,
|
|
35172
|
-
getCurrentSnackbarMessages: getCurrentSnackbarMessages,
|
|
35173
|
-
getFirstSnackbarMessage: getFirstSnackbarMessage
|
|
35174
|
-
});
|
|
35175
|
-
|
|
35176
|
-
/* *
|
|
35177
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
35178
|
-
* you may not use this file except in compliance with the License.
|
|
35179
|
-
* You may obtain a copy of the License at
|
|
35180
|
-
*
|
|
35181
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
35182
|
-
*
|
|
35183
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
35184
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
35185
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
35186
|
-
* See the License for the specific language governing permissions and
|
|
35187
|
-
* limitations under the License.
|
|
35188
|
-
*
|
|
35189
|
-
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
35190
|
-
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
35191
|
-
* */
|
|
35192
|
-
|
|
35193
|
-
var types = /*#__PURE__*/Object.freeze({
|
|
35194
|
-
__proto__: null
|
|
35195
|
-
});
|
|
35196
|
-
|
|
35197
|
-
var _marked$5 = /*#__PURE__*/_regeneratorRuntime().mark(openSnackbarSaga),
|
|
35198
|
-
_marked2$4 = /*#__PURE__*/_regeneratorRuntime().mark(rootSaga$4);
|
|
35199
|
-
var hideTime = 4000;
|
|
35200
|
-
function openSnackbarSaga(capturedAction) {
|
|
35201
|
-
var snackbarMessage, currentSnackbarMessages, id, currentSnackbarMessagesOpen;
|
|
35202
|
-
return _regeneratorRuntime().wrap(function openSnackbarSaga$(_context) {
|
|
35203
|
-
while (1) switch (_context.prev = _context.next) {
|
|
35204
|
-
case 0:
|
|
35205
|
-
snackbarMessage = capturedAction.payload.message;
|
|
35206
|
-
_context.next = 3;
|
|
35207
|
-
return select(getCurrentSnackbarMessages);
|
|
35208
|
-
case 3:
|
|
35209
|
-
currentSnackbarMessages = _context.sent;
|
|
35210
|
-
if (!currentSnackbarMessages.length) {
|
|
35211
|
-
_context.next = 7;
|
|
35212
|
-
break;
|
|
35213
|
-
}
|
|
35214
|
-
_context.next = 7;
|
|
35215
|
-
return put(snackbarActions.closeSnackbar());
|
|
35216
|
-
case 7:
|
|
35217
|
-
// Generate a unique id
|
|
35218
|
-
id = "snackbar".concat(Date.now().toString());
|
|
35219
|
-
_context.next = 10;
|
|
35220
|
-
return put(snackbarActions.triggerOpenSnackbarBySaga({
|
|
35221
|
-
snackbarContent: {
|
|
35222
|
-
message: snackbarMessage,
|
|
35223
|
-
id: id
|
|
35224
|
-
}
|
|
35225
|
-
}));
|
|
35226
|
-
case 10:
|
|
35227
|
-
_context.next = 12;
|
|
35228
|
-
return delay(hideTime);
|
|
35229
|
-
case 12:
|
|
35230
|
-
_context.next = 14;
|
|
35231
|
-
return select(getCurrentSnackbarMessages);
|
|
35232
|
-
case 14:
|
|
35233
|
-
currentSnackbarMessagesOpen = _context.sent;
|
|
35234
|
-
if (!currentSnackbarMessagesOpen.length) {
|
|
35235
|
-
_context.next = 18;
|
|
35236
|
-
break;
|
|
35237
|
-
}
|
|
35238
|
-
_context.next = 18;
|
|
35239
|
-
return put(snackbarActions.closeSnackbar());
|
|
35240
|
-
case 18:
|
|
35241
|
-
case "end":
|
|
35242
|
-
return _context.stop();
|
|
35243
|
-
}
|
|
35244
|
-
}, _marked$5);
|
|
35245
|
-
}
|
|
35246
|
-
function rootSaga$4() {
|
|
35247
|
-
return _regeneratorRuntime().wrap(function rootSaga$(_context2) {
|
|
35248
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
35249
|
-
case 0:
|
|
35250
|
-
_context2.next = 2;
|
|
35251
|
-
return takeLatest$1(snackbarActions.openSnackbar.type, openSnackbarSaga);
|
|
35252
|
-
case 2:
|
|
35253
|
-
case "end":
|
|
35254
|
-
return _context2.stop();
|
|
35255
|
-
}
|
|
35256
|
-
}, _marked2$4);
|
|
34453
|
+
}, _marked$4);
|
|
35257
34454
|
}
|
|
35258
34455
|
|
|
35259
|
-
/* *
|
|
35260
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
35261
|
-
* you may not use this file except in compliance with the License.
|
|
35262
|
-
* You may obtain a copy of the License at
|
|
35263
|
-
*
|
|
35264
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
35265
|
-
*
|
|
35266
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
35267
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
35268
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
35269
|
-
* See the License for the specific language governing permissions and
|
|
35270
|
-
* limitations under the License.
|
|
35271
|
-
*
|
|
35272
|
-
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
35273
|
-
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
35274
|
-
* */
|
|
35275
|
-
var snackbarModuleConfig = {
|
|
35276
|
-
id: 'snackbar-module',
|
|
35277
|
-
reducersMap: {
|
|
35278
|
-
snackbar: reducer$3
|
|
35279
|
-
},
|
|
35280
|
-
sagas: [rootSaga$4]
|
|
35281
|
-
};
|
|
35282
|
-
|
|
35283
34456
|
/* *
|
|
35284
34457
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
35285
34458
|
* you may not use this file except in compliance with the License.
|
|
@@ -35338,8 +34511,8 @@ var utils = /*#__PURE__*/Object.freeze({
|
|
|
35338
34511
|
historyDict: historyDict
|
|
35339
34512
|
});
|
|
35340
34513
|
|
|
35341
|
-
var _marked$
|
|
35342
|
-
_marked2$
|
|
34514
|
+
var _marked$3 = /*#__PURE__*/_regeneratorRuntime().mark(navigateToUrlSaga),
|
|
34515
|
+
_marked2$2 = /*#__PURE__*/_regeneratorRuntime().mark(rootSaga$2);
|
|
35343
34516
|
function navigateToUrlSaga(action) {
|
|
35344
34517
|
var payload;
|
|
35345
34518
|
return _regeneratorRuntime().wrap(function navigateToUrlSaga$(_context) {
|
|
@@ -35352,9 +34525,9 @@ function navigateToUrlSaga(action) {
|
|
|
35352
34525
|
case "end":
|
|
35353
34526
|
return _context.stop();
|
|
35354
34527
|
}
|
|
35355
|
-
}, _marked$
|
|
34528
|
+
}, _marked$3);
|
|
35356
34529
|
}
|
|
35357
|
-
function rootSaga$
|
|
34530
|
+
function rootSaga$2() {
|
|
35358
34531
|
return _regeneratorRuntime().wrap(function rootSaga$(_context2) {
|
|
35359
34532
|
while (1) switch (_context2.prev = _context2.next) {
|
|
35360
34533
|
case 0:
|
|
@@ -35364,7 +34537,7 @@ function rootSaga$3() {
|
|
|
35364
34537
|
case "end":
|
|
35365
34538
|
return _context2.stop();
|
|
35366
34539
|
}
|
|
35367
|
-
}, _marked2$
|
|
34540
|
+
}, _marked2$2);
|
|
35368
34541
|
}
|
|
35369
34542
|
|
|
35370
34543
|
/* *
|
|
@@ -35388,7 +34561,7 @@ var routerModuleConfig = {
|
|
|
35388
34561
|
reducersMap: {
|
|
35389
34562
|
router: reducer$2
|
|
35390
34563
|
},
|
|
35391
|
-
sagas: [rootSaga$
|
|
34564
|
+
sagas: [rootSaga$2]
|
|
35392
34565
|
};
|
|
35393
34566
|
|
|
35394
34567
|
/* *
|
|
@@ -35484,16 +34657,21 @@ var slice = createSlice({
|
|
|
35484
34657
|
registerDrawTool: function registerDrawTool(draft, action) {
|
|
35485
34658
|
var _action$payload = action.payload,
|
|
35486
34659
|
drawToolId = _action$payload.drawToolId,
|
|
35487
|
-
|
|
34660
|
+
_action$payload$defau = _action$payload.defaultDrawModes,
|
|
34661
|
+
defaultDrawModes = _action$payload$defau === void 0 ? [] : _action$payload$defau,
|
|
35488
34662
|
_action$payload$geoJS = _action$payload.geoJSONLayerId,
|
|
35489
34663
|
geoJSONLayerId = _action$payload$geoJS === void 0 ? '' : _action$payload$geoJS,
|
|
34664
|
+
geoJSONIntersectionLayerId = _action$payload.geoJSONIntersectionLayerId,
|
|
34665
|
+
geoJSONIntersectionBoundsLayerId = _action$payload.geoJSONIntersectionBoundsLayerId,
|
|
35490
34666
|
_action$payload$shoul = _action$payload.shouldAllowMultipleShapes,
|
|
35491
34667
|
shouldAllowMultipleShapes = _action$payload$shoul === void 0 ? false : _action$payload$shoul;
|
|
35492
34668
|
drawAdapter.addOne(draft, {
|
|
35493
34669
|
drawToolId: drawToolId,
|
|
35494
34670
|
geoJSONLayerId: geoJSONLayerId,
|
|
34671
|
+
geoJSONIntersectionLayerId: geoJSONIntersectionLayerId,
|
|
34672
|
+
geoJSONIntersectionBoundsLayerId: geoJSONIntersectionBoundsLayerId,
|
|
35495
34673
|
activeDrawModeId: '',
|
|
35496
|
-
drawModes:
|
|
34674
|
+
drawModes: defaultDrawModes,
|
|
35497
34675
|
shouldAllowMultipleShapes: shouldAllowMultipleShapes
|
|
35498
34676
|
});
|
|
35499
34677
|
},
|
|
@@ -35621,6 +34799,12 @@ var _drawAdapter$getSelec = drawAdapter.getSelectors(function (state) {
|
|
|
35621
34799
|
}),
|
|
35622
34800
|
selectDrawToolById = _drawAdapter$getSelec.selectById,
|
|
35623
34801
|
selectAllDrawingTools = _drawAdapter$getSelec.selectAll;
|
|
34802
|
+
var getActiveDrawToolId = createSelector(selectAllDrawingTools, function (drawtools) {
|
|
34803
|
+
var activeDrawTool = drawtools === null || drawtools === void 0 ? void 0 : drawtools.find(function (drawtool) {
|
|
34804
|
+
return drawtool.activeDrawModeId !== '';
|
|
34805
|
+
});
|
|
34806
|
+
return (activeDrawTool === null || activeDrawTool === void 0 ? void 0 : activeDrawTool.drawToolId) || '';
|
|
34807
|
+
});
|
|
35624
34808
|
var getDrawModeById = createSelector(selectDrawToolById, function (_store, _drawToolId, drawModeId) {
|
|
35625
34809
|
return drawModeId;
|
|
35626
34810
|
}, function (draw, drawModeId) {
|
|
@@ -35634,26 +34818,40 @@ var getActiveDrawModeId = createSelector(selectDrawToolById, function (drawingTo
|
|
|
35634
34818
|
var getDrawToolGeoJSONLayerId = createSelector(selectDrawToolById, function (drawingTool) {
|
|
35635
34819
|
return (drawingTool === null || drawingTool === void 0 ? void 0 : drawingTool.geoJSONLayerId) || '';
|
|
35636
34820
|
});
|
|
34821
|
+
var getGeoJSONIntersectionLayerId = createSelector(selectDrawToolById, function (drawingTool) {
|
|
34822
|
+
return drawingTool === null || drawingTool === void 0 ? void 0 : drawingTool.geoJSONIntersectionLayerId;
|
|
34823
|
+
});
|
|
34824
|
+
var getGeoJSONIntersectionBoundsLayerId = createSelector(selectDrawToolById, function (drawingTool) {
|
|
34825
|
+
return drawingTool === null || drawingTool === void 0 ? void 0 : drawingTool.geoJSONIntersectionBoundsLayerId;
|
|
34826
|
+
});
|
|
34827
|
+
var getShouldAllowMultipleShapes = createSelector(selectDrawToolById, function (drawingTool) {
|
|
34828
|
+
return (drawingTool === null || drawingTool === void 0 ? void 0 : drawingTool.shouldAllowMultipleShapes) || false;
|
|
34829
|
+
});
|
|
35637
34830
|
|
|
35638
34831
|
var selectors = /*#__PURE__*/Object.freeze({
|
|
35639
34832
|
__proto__: null,
|
|
35640
34833
|
getDrawingtoolStore: getDrawingtoolStore,
|
|
35641
34834
|
selectDrawToolById: selectDrawToolById,
|
|
35642
34835
|
selectAllDrawingTools: selectAllDrawingTools,
|
|
34836
|
+
getActiveDrawToolId: getActiveDrawToolId,
|
|
35643
34837
|
getDrawModeById: getDrawModeById,
|
|
35644
34838
|
getActiveDrawModeId: getActiveDrawModeId,
|
|
35645
|
-
getDrawToolGeoJSONLayerId: getDrawToolGeoJSONLayerId
|
|
34839
|
+
getDrawToolGeoJSONLayerId: getDrawToolGeoJSONLayerId,
|
|
34840
|
+
getGeoJSONIntersectionLayerId: getGeoJSONIntersectionLayerId,
|
|
34841
|
+
getGeoJSONIntersectionBoundsLayerId: getGeoJSONIntersectionBoundsLayerId,
|
|
34842
|
+
getShouldAllowMultipleShapes: getShouldAllowMultipleShapes
|
|
35646
34843
|
});
|
|
35647
34844
|
|
|
35648
|
-
var _marked$
|
|
34845
|
+
var _marked$2 = /*#__PURE__*/_regeneratorRuntime().mark(drawingSaga);
|
|
34846
|
+
var registerOrigin = 'drawings saga:registerDrawToolSaga';
|
|
35649
34847
|
function registerDrawToolSaga(_ref) {
|
|
35650
34848
|
var payload = _ref.payload;
|
|
35651
34849
|
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
35652
|
-
var mapId, geoJSONLayerId, _payload$defaultGeoJS, defaultGeoJSON;
|
|
34850
|
+
var mapId, geoJSONLayerId, geoJSONIntersectionLayerId, geoJSONIntersectionBoundsLayerId, _payload$defaultGeoJS, defaultGeoJSON, _payload$defaultGeoJS2, defaultGeoJSONIntersection, defaultGeoJSONIntersectionBounds;
|
|
35653
34851
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
35654
34852
|
while (1) switch (_context.prev = _context.next) {
|
|
35655
34853
|
case 0:
|
|
35656
|
-
mapId = payload.mapId, geoJSONLayerId = payload.geoJSONLayerId, _payload$defaultGeoJS = payload.defaultGeoJSON, defaultGeoJSON = _payload$defaultGeoJS === void 0 ? emptyGeoJSON : _payload$defaultGeoJS; // create for every drawTool a draw layer
|
|
34854
|
+
mapId = payload.mapId, geoJSONLayerId = payload.geoJSONLayerId, geoJSONIntersectionLayerId = payload.geoJSONIntersectionLayerId, geoJSONIntersectionBoundsLayerId = payload.geoJSONIntersectionBoundsLayerId, _payload$defaultGeoJS = payload.defaultGeoJSON, defaultGeoJSON = _payload$defaultGeoJS === void 0 ? emptyGeoJSON : _payload$defaultGeoJS, _payload$defaultGeoJS2 = payload.defaultGeoJSONIntersection, defaultGeoJSONIntersection = _payload$defaultGeoJS2 === void 0 ? emptyGeoJSON : _payload$defaultGeoJS2, defaultGeoJSONIntersectionBounds = payload.defaultGeoJSONIntersectionBounds; // create for every drawTool a draw layer
|
|
35657
34855
|
if (!(geoJSONLayerId && mapId)) {
|
|
35658
34856
|
_context.next = 4;
|
|
35659
34857
|
break;
|
|
@@ -35667,9 +34865,39 @@ function registerDrawToolSaga(_ref) {
|
|
|
35667
34865
|
layerType: LayerType.featureLayer
|
|
35668
34866
|
},
|
|
35669
34867
|
layerId: geoJSONLayerId,
|
|
35670
|
-
origin:
|
|
34868
|
+
origin: registerOrigin
|
|
35671
34869
|
}));
|
|
35672
34870
|
case 4:
|
|
34871
|
+
if (!(geoJSONIntersectionLayerId && mapId)) {
|
|
34872
|
+
_context.next = 7;
|
|
34873
|
+
break;
|
|
34874
|
+
}
|
|
34875
|
+
_context.next = 7;
|
|
34876
|
+
return put(mapStoreActions.addLayer({
|
|
34877
|
+
mapId: mapId,
|
|
34878
|
+
layer: {
|
|
34879
|
+
geojson: defaultGeoJSONIntersection,
|
|
34880
|
+
layerType: LayerType.featureLayer
|
|
34881
|
+
},
|
|
34882
|
+
layerId: geoJSONIntersectionLayerId,
|
|
34883
|
+
origin: registerOrigin
|
|
34884
|
+
}));
|
|
34885
|
+
case 7:
|
|
34886
|
+
if (!(geoJSONIntersectionBoundsLayerId && mapId)) {
|
|
34887
|
+
_context.next = 10;
|
|
34888
|
+
break;
|
|
34889
|
+
}
|
|
34890
|
+
_context.next = 10;
|
|
34891
|
+
return put(mapStoreActions.addLayer({
|
|
34892
|
+
mapId: mapId,
|
|
34893
|
+
layer: {
|
|
34894
|
+
geojson: defaultGeoJSONIntersectionBounds,
|
|
34895
|
+
layerType: LayerType.featureLayer
|
|
34896
|
+
},
|
|
34897
|
+
layerId: geoJSONIntersectionBoundsLayerId,
|
|
34898
|
+
origin: registerOrigin
|
|
34899
|
+
}));
|
|
34900
|
+
case 10:
|
|
35673
34901
|
case "end":
|
|
35674
34902
|
return _context.stop();
|
|
35675
34903
|
}
|
|
@@ -35679,7 +34907,7 @@ function registerDrawToolSaga(_ref) {
|
|
|
35679
34907
|
function changeDrawToolSaga(_ref2) {
|
|
35680
34908
|
var payload = _ref2.payload;
|
|
35681
34909
|
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
35682
|
-
var _a, _b, _c, _d, drawModeId, drawToolId, _payload$shouldUpdate, shouldUpdateShape, drawingTool, shouldAllowMultipleShapes, newDrawMode, currentGeoJSONLayer, _ref3, currentGeoJSON, _ref3$selectedFeature, selectedFeatureIndex, currentSelectionType, newSelectionType, isNewToolSelected, shouldUpdateNewShape, geoJSONFeatureCollection, newGeoJSON;
|
|
34910
|
+
var _a, _b, _c, _d, drawModeId, drawToolId, _payload$shouldUpdate, shouldUpdateShape, drawingTool, _drawingTool$shouldAl, shouldAllowMultipleShapes, geoJSONIntersectionLayerId, geoJSONIntersectionBoundsLayerId, newDrawMode, currentGeoJSONLayer, _ref3, currentGeoJSON, _ref3$selectedFeature, selectedFeatureIndex, currentSelectionType, newSelectionType, isNewToolSelected, shouldUpdateNewShape, geoJSONFeatureCollection, newGeoJSON;
|
|
35683
34911
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
35684
34912
|
while (1) switch (_context2.prev = _context2.next) {
|
|
35685
34913
|
case 0:
|
|
@@ -35689,49 +34917,56 @@ function changeDrawToolSaga(_ref2) {
|
|
|
35689
34917
|
return select(selectDrawToolById, drawToolId);
|
|
35690
34918
|
case 4:
|
|
35691
34919
|
drawingTool = _context2.sent;
|
|
35692
|
-
shouldAllowMultipleShapes = drawingTool.
|
|
34920
|
+
_drawingTool$shouldAl = drawingTool.shouldAllowMultipleShapes, shouldAllowMultipleShapes = _drawingTool$shouldAl === void 0 ? false : _drawingTool$shouldAl, geoJSONIntersectionLayerId = drawingTool.geoJSONIntersectionLayerId, geoJSONIntersectionBoundsLayerId = drawingTool.geoJSONIntersectionBoundsLayerId;
|
|
35693
34921
|
_context2.next = 8;
|
|
35694
34922
|
return select(getDrawModeById, drawToolId, drawModeId);
|
|
35695
34923
|
case 8:
|
|
35696
34924
|
newDrawMode = _context2.sent;
|
|
35697
34925
|
if (!(newDrawMode.value === 'DELETE')) {
|
|
35698
|
-
_context2.next =
|
|
34926
|
+
_context2.next = 18;
|
|
35699
34927
|
break;
|
|
35700
34928
|
}
|
|
35701
34929
|
_context2.next = 12;
|
|
35702
34930
|
return put(layerActions.layerChangeGeojson({
|
|
35703
34931
|
layerId: drawingTool.geoJSONLayerId,
|
|
35704
|
-
geojson:
|
|
35705
|
-
type: 'FeatureCollection',
|
|
35706
|
-
features: []
|
|
35707
|
-
}
|
|
34932
|
+
geojson: emptyGeoJSON
|
|
35708
34933
|
}));
|
|
35709
34934
|
case 12:
|
|
35710
|
-
|
|
34935
|
+
if (!geoJSONIntersectionLayerId) {
|
|
34936
|
+
_context2.next = 15;
|
|
34937
|
+
break;
|
|
34938
|
+
}
|
|
34939
|
+
_context2.next = 15;
|
|
34940
|
+
return put(layerActions.layerChangeGeojson({
|
|
34941
|
+
layerId: geoJSONIntersectionLayerId,
|
|
34942
|
+
geojson: emptyGeoJSON
|
|
34943
|
+
}));
|
|
34944
|
+
case 15:
|
|
34945
|
+
_context2.next = 17;
|
|
35711
34946
|
return put(layerActions.toggleFeatureMode({
|
|
35712
34947
|
layerId: drawingTool.geoJSONLayerId,
|
|
35713
34948
|
isInEditMode: false,
|
|
35714
34949
|
drawMode: ''
|
|
35715
34950
|
}));
|
|
35716
|
-
case
|
|
34951
|
+
case 17:
|
|
35717
34952
|
return _context2.abrupt("return");
|
|
35718
|
-
case
|
|
34953
|
+
case 18:
|
|
35719
34954
|
if (!(!drawingTool.activeDrawModeId && newDrawMode.isSelectable)) {
|
|
35720
|
-
_context2.next =
|
|
34955
|
+
_context2.next = 22;
|
|
35721
34956
|
break;
|
|
35722
34957
|
}
|
|
35723
|
-
_context2.next =
|
|
34958
|
+
_context2.next = 21;
|
|
35724
34959
|
return put(layerActions.toggleFeatureMode({
|
|
35725
34960
|
layerId: drawingTool.geoJSONLayerId,
|
|
35726
34961
|
isInEditMode: false,
|
|
35727
34962
|
drawMode: ''
|
|
35728
34963
|
}));
|
|
35729
|
-
case
|
|
34964
|
+
case 21:
|
|
35730
34965
|
return _context2.abrupt("return");
|
|
35731
|
-
case
|
|
35732
|
-
_context2.next =
|
|
34966
|
+
case 22:
|
|
34967
|
+
_context2.next = 24;
|
|
35733
34968
|
return select(getLayerById, drawingTool.geoJSONLayerId);
|
|
35734
|
-
case
|
|
34969
|
+
case 24:
|
|
35735
34970
|
currentGeoJSONLayer = _context2.sent;
|
|
35736
34971
|
_ref3 = currentGeoJSONLayer || {}, currentGeoJSON = _ref3.geojson, _ref3$selectedFeature = _ref3.selectedFeatureIndex, selectedFeatureIndex = _ref3$selectedFeature === void 0 ? 0 : _ref3$selectedFeature;
|
|
35737
34972
|
currentSelectionType = (_b = (_a = currentGeoJSON === null || currentGeoJSON === void 0 ? void 0 : currentGeoJSON.features[selectedFeatureIndex]) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.selectionType;
|
|
@@ -35739,7 +34974,7 @@ function changeDrawToolSaga(_ref2) {
|
|
|
35739
34974
|
isNewToolSelected = currentSelectionType !== newSelectionType;
|
|
35740
34975
|
shouldUpdateNewShape = !((_d = currentGeoJSON === null || currentGeoJSON === void 0 ? void 0 : currentGeoJSON.features) === null || _d === void 0 ? void 0 : _d.length) || shouldAllowMultipleShapes || isNewToolSelected; // don't change anything if same tool is selected again
|
|
35741
34976
|
if (!(shouldUpdateNewShape && shouldUpdateShape)) {
|
|
35742
|
-
_context2.next =
|
|
34977
|
+
_context2.next = 38;
|
|
35743
34978
|
break;
|
|
35744
34979
|
}
|
|
35745
34980
|
geoJSONFeatureCollection = getFeatureCollection(newDrawMode.shape, shouldAllowMultipleShapes, currentGeoJSON);
|
|
@@ -35747,37 +34982,41 @@ function changeDrawToolSaga(_ref2) {
|
|
|
35747
34982
|
if (shouldAllowMultipleShapes) {
|
|
35748
34983
|
moveFeature(currentGeoJSON, newGeoJSON, selectedFeatureIndex, '');
|
|
35749
34984
|
}
|
|
35750
|
-
_context2.next =
|
|
34985
|
+
_context2.next = 36;
|
|
35751
34986
|
return put(layerActions.setSelectedFeature({
|
|
35752
34987
|
layerId: drawingTool.geoJSONLayerId,
|
|
35753
34988
|
selectedFeatureIndex: newGeoJSON.features.length - 1
|
|
35754
34989
|
}));
|
|
35755
|
-
case
|
|
35756
|
-
_context2.next =
|
|
35757
|
-
return put(
|
|
34990
|
+
case 36:
|
|
34991
|
+
_context2.next = 38;
|
|
34992
|
+
return put(layerActions.updateFeature(Object.assign(Object.assign({
|
|
35758
34993
|
layerId: drawingTool.geoJSONLayerId,
|
|
35759
34994
|
geojson: newGeoJSON
|
|
35760
|
-
}
|
|
35761
|
-
|
|
35762
|
-
|
|
34995
|
+
}, geoJSONIntersectionLayerId && {
|
|
34996
|
+
geoJSONIntersectionLayerId: geoJSONIntersectionLayerId
|
|
34997
|
+
}), geoJSONIntersectionBoundsLayerId && {
|
|
34998
|
+
geoJSONIntersectionBoundsLayerId: geoJSONIntersectionBoundsLayerId
|
|
34999
|
+
})));
|
|
35000
|
+
case 38:
|
|
35001
|
+
_context2.next = 40;
|
|
35763
35002
|
return put(layerActions.toggleFeatureMode({
|
|
35764
35003
|
layerId: drawingTool.geoJSONLayerId,
|
|
35765
|
-
isInEditMode:
|
|
35004
|
+
isInEditMode: newDrawMode.isSelectable,
|
|
35766
35005
|
drawMode: newDrawMode.value
|
|
35767
35006
|
}));
|
|
35768
|
-
case
|
|
35769
|
-
_context2.next =
|
|
35007
|
+
case 40:
|
|
35008
|
+
_context2.next = 45;
|
|
35770
35009
|
break;
|
|
35771
|
-
case
|
|
35772
|
-
_context2.prev =
|
|
35010
|
+
case 42:
|
|
35011
|
+
_context2.prev = 42;
|
|
35773
35012
|
_context2.t0 = _context2["catch"](0);
|
|
35774
35013
|
// eslint-disable-next-line no-console
|
|
35775
35014
|
console.log('error changeDrawToolSaga', _context2.t0);
|
|
35776
|
-
case
|
|
35015
|
+
case 45:
|
|
35777
35016
|
case "end":
|
|
35778
35017
|
return _context2.stop();
|
|
35779
35018
|
}
|
|
35780
|
-
}, _callee2, null, [[0,
|
|
35019
|
+
}, _callee2, null, [[0, 42]]);
|
|
35781
35020
|
})();
|
|
35782
35021
|
}
|
|
35783
35022
|
function drawingSaga() {
|
|
@@ -35793,7 +35032,7 @@ function drawingSaga() {
|
|
|
35793
35032
|
case "end":
|
|
35794
35033
|
return _context3.stop();
|
|
35795
35034
|
}
|
|
35796
|
-
}, _marked$
|
|
35035
|
+
}, _marked$2);
|
|
35797
35036
|
}
|
|
35798
35037
|
|
|
35799
35038
|
/* *
|
|
@@ -36059,6 +35298,56 @@ var testGeoJSON = {
|
|
|
36059
35298
|
}
|
|
36060
35299
|
}]
|
|
36061
35300
|
};
|
|
35301
|
+
var webmapStateWithAnimationDelay = function webmapStateWithAnimationDelay(mapId, animationDelay) {
|
|
35302
|
+
var webmap = createWebmapState(mapId);
|
|
35303
|
+
// Add the dimensions to the map state
|
|
35304
|
+
webmap.byId[mapId].animationDelay = animationDelay;
|
|
35305
|
+
return webmap;
|
|
35306
|
+
};
|
|
35307
|
+
var mockStateMapWithAnimationDelayWithoutLayers = function mockStateMapWithAnimationDelayWithoutLayers(mapId) {
|
|
35308
|
+
return {
|
|
35309
|
+
webmap: webmapStateWithAnimationDelay(mapId, defaultAnimationDelayAtStart)
|
|
35310
|
+
};
|
|
35311
|
+
};
|
|
35312
|
+
var webmapStateWithTimeSliderSpan = function webmapStateWithTimeSliderSpan(mapId, timeSliderSpan) {
|
|
35313
|
+
var webmap = createWebmapState(mapId);
|
|
35314
|
+
// Add the span to the map state
|
|
35315
|
+
webmap.byId[mapId].timeSliderSpan = timeSliderSpan;
|
|
35316
|
+
return webmap;
|
|
35317
|
+
};
|
|
35318
|
+
var mockStateMapWithTimeSliderSpanWithoutLayers = function mockStateMapWithTimeSliderSpanWithoutLayers(mapId, timeSliderSpan) {
|
|
35319
|
+
return {
|
|
35320
|
+
webmap: webmapStateWithTimeSliderSpan(mapId, timeSliderSpan)
|
|
35321
|
+
};
|
|
35322
|
+
};
|
|
35323
|
+
var mockStateMapWithDimensions = function mockStateMapWithDimensions(layer, mapId) {
|
|
35324
|
+
return {
|
|
35325
|
+
webmap: webmapStateWithAddedLayer(layer.layerType, layer.id, mapId, layer.dimensions),
|
|
35326
|
+
services: {
|
|
35327
|
+
byId: WmMultiDimensionServices,
|
|
35328
|
+
allIds: ['serviceid_1', 'serviceid_2']
|
|
35329
|
+
},
|
|
35330
|
+
layers: createLayersState(layer.id, {
|
|
35331
|
+
name: layer.name,
|
|
35332
|
+
layerType: layer.layerType,
|
|
35333
|
+
mapId: mapId,
|
|
35334
|
+
service: layer.service,
|
|
35335
|
+
dimensions: layer.dimensions,
|
|
35336
|
+
enabled: (layer === null || layer === void 0 ? void 0 : layer.enabled) !== undefined ? layer.enabled : true
|
|
35337
|
+
})
|
|
35338
|
+
};
|
|
35339
|
+
};
|
|
35340
|
+
var webmapStateWithTimeStep = function webmapStateWithTimeStep(mapId, timeStep) {
|
|
35341
|
+
var webmap = createWebmapState(mapId);
|
|
35342
|
+
// Add the timeStep to the map state
|
|
35343
|
+
webmap.byId[mapId].timeStep = timeStep;
|
|
35344
|
+
return webmap;
|
|
35345
|
+
};
|
|
35346
|
+
var mockStateMapWithTimeStepWithoutLayers = function mockStateMapWithTimeStepWithoutLayers(mapId, timeStep) {
|
|
35347
|
+
return {
|
|
35348
|
+
webmap: webmapStateWithTimeStep(mapId, timeStep)
|
|
35349
|
+
};
|
|
35350
|
+
};
|
|
36062
35351
|
|
|
36063
35352
|
var storeTestUtils = /*#__PURE__*/Object.freeze({
|
|
36064
35353
|
__proto__: null,
|
|
@@ -36069,12 +35358,16 @@ var storeTestUtils = /*#__PURE__*/Object.freeze({
|
|
|
36069
35358
|
webmapStateWithAddedLayer: webmapStateWithAddedLayer,
|
|
36070
35359
|
mockStateMapWithLayer: mockStateMapWithLayer,
|
|
36071
35360
|
mockStateMapWithMultipleLayers: mockStateMapWithMultipleLayers,
|
|
36072
|
-
testGeoJSON: testGeoJSON
|
|
35361
|
+
testGeoJSON: testGeoJSON,
|
|
35362
|
+
mockStateMapWithAnimationDelayWithoutLayers: mockStateMapWithAnimationDelayWithoutLayers,
|
|
35363
|
+
mockStateMapWithTimeSliderSpanWithoutLayers: mockStateMapWithTimeSliderSpanWithoutLayers,
|
|
35364
|
+
mockStateMapWithDimensions: mockStateMapWithDimensions,
|
|
35365
|
+
mockStateMapWithTimeStepWithoutLayers: mockStateMapWithTimeStepWithoutLayers
|
|
36073
35366
|
});
|
|
36074
35367
|
|
|
36075
|
-
var _marked$
|
|
36076
|
-
_marked2$
|
|
36077
|
-
_marked3$1 = /*#__PURE__*/_regeneratorRuntime().mark(rootSaga$
|
|
35368
|
+
var _marked$1 = /*#__PURE__*/_regeneratorRuntime().mark(updateSourceValueWhenLinkingComponentToGroupSaga),
|
|
35369
|
+
_marked2$1 = /*#__PURE__*/_regeneratorRuntime().mark(updateViewStateSaga),
|
|
35370
|
+
_marked3$1 = /*#__PURE__*/_regeneratorRuntime().mark(rootSaga$1);
|
|
36078
35371
|
function updateSourceValueWhenLinkingComponentToGroupSaga(groupId, targetToUpdate) {
|
|
36079
35372
|
var group;
|
|
36080
35373
|
return _regeneratorRuntime().wrap(function updateSourceValueWhenLinkingComponentToGroupSaga$(_context) {
|
|
@@ -36126,7 +35419,7 @@ function updateSourceValueWhenLinkingComponentToGroupSaga(groupId, targetToUpdat
|
|
|
36126
35419
|
case "end":
|
|
36127
35420
|
return _context.stop();
|
|
36128
35421
|
}
|
|
36129
|
-
}, _marked$
|
|
35422
|
+
}, _marked$1);
|
|
36130
35423
|
}
|
|
36131
35424
|
function addGroupTargetSaga(_ref) {
|
|
36132
35425
|
var payload = _ref.payload;
|
|
@@ -36187,9 +35480,9 @@ function updateViewStateSaga() {
|
|
|
36187
35480
|
case "end":
|
|
36188
35481
|
return _context4.stop();
|
|
36189
35482
|
}
|
|
36190
|
-
}, _marked2$
|
|
35483
|
+
}, _marked2$1);
|
|
36191
35484
|
}
|
|
36192
|
-
function rootSaga$
|
|
35485
|
+
function rootSaga$1() {
|
|
36193
35486
|
return _regeneratorRuntime().wrap(function rootSaga$(_context5) {
|
|
36194
35487
|
while (1) switch (_context5.prev = _context5.next) {
|
|
36195
35488
|
case 0:
|
|
@@ -36229,187 +35522,9 @@ function rootSaga$2() {
|
|
|
36229
35522
|
var synchronizationGroupConfig = {
|
|
36230
35523
|
id: 'syncronizationGroupStore-module',
|
|
36231
35524
|
reducersMap: {
|
|
36232
|
-
syncronizationGroupStore: reducer$
|
|
36233
|
-
},
|
|
36234
|
-
sagas: [rootSaga$5, rootSaga$2]
|
|
36235
|
-
};
|
|
36236
|
-
|
|
36237
|
-
var _marked$1 = /*#__PURE__*/_regeneratorRuntime().mark(layerSelectRemoveServiceSaga),
|
|
36238
|
-
_marked2$1 = /*#__PURE__*/_regeneratorRuntime().mark(rootSaga$1);
|
|
36239
|
-
function layerSelectCloseInfoDialogSaga(_ref) {
|
|
36240
|
-
var type = _ref.type,
|
|
36241
|
-
payload = _ref.payload;
|
|
36242
|
-
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
36243
|
-
var togglePayload, activeMapIdPayload, isLayerInfoDialogOpen, _isLayerInfoDialogOpen, filteredLayers, dialogInfo;
|
|
36244
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
36245
|
-
while (1) switch (_context.prev = _context.next) {
|
|
36246
|
-
case 0:
|
|
36247
|
-
_context.t0 = type;
|
|
36248
|
-
_context.next = _context.t0 === uiActions.setToggleOpenDialog.type ? 3 : _context.t0 === uiActions.setActiveMapIdForDialog.type ? 8 : 17;
|
|
36249
|
-
break;
|
|
36250
|
-
case 3:
|
|
36251
|
-
togglePayload = payload;
|
|
36252
|
-
if (!(!togglePayload.setOpen && togglePayload.type === DialogTypes.LayerSelect)) {
|
|
36253
|
-
_context.next = 7;
|
|
36254
|
-
break;
|
|
36255
|
-
}
|
|
36256
|
-
_context.next = 7;
|
|
36257
|
-
return put(uiActions.setToggleOpenDialog({
|
|
36258
|
-
type: DialogTypes.LayerInfo,
|
|
36259
|
-
setOpen: false
|
|
36260
|
-
}));
|
|
36261
|
-
case 7:
|
|
36262
|
-
return _context.abrupt("break", 30);
|
|
36263
|
-
case 8:
|
|
36264
|
-
activeMapIdPayload = payload;
|
|
36265
|
-
if (activeMapIdPayload.setOpen) {
|
|
36266
|
-
_context.next = 16;
|
|
36267
|
-
break;
|
|
36268
|
-
}
|
|
36269
|
-
_context.next = 12;
|
|
36270
|
-
return select(getisDialogOpen, DialogTypes.LayerInfo);
|
|
36271
|
-
case 12:
|
|
36272
|
-
isLayerInfoDialogOpen = _context.sent;
|
|
36273
|
-
if (!isLayerInfoDialogOpen) {
|
|
36274
|
-
_context.next = 16;
|
|
36275
|
-
break;
|
|
36276
|
-
}
|
|
36277
|
-
_context.next = 16;
|
|
36278
|
-
return put(uiActions.setToggleOpenDialog({
|
|
36279
|
-
type: DialogTypes.LayerInfo,
|
|
36280
|
-
setOpen: false
|
|
36281
|
-
}));
|
|
36282
|
-
case 16:
|
|
36283
|
-
return _context.abrupt("break", 30);
|
|
36284
|
-
case 17:
|
|
36285
|
-
_context.next = 19;
|
|
36286
|
-
return select(getisDialogOpen, DialogTypes.LayerInfo);
|
|
36287
|
-
case 19:
|
|
36288
|
-
_isLayerInfoDialogOpen = _context.sent;
|
|
36289
|
-
if (!_isLayerInfoDialogOpen) {
|
|
36290
|
-
_context.next = 30;
|
|
36291
|
-
break;
|
|
36292
|
-
}
|
|
36293
|
-
_context.next = 23;
|
|
36294
|
-
return select(getFilteredLayers);
|
|
36295
|
-
case 23:
|
|
36296
|
-
filteredLayers = _context.sent;
|
|
36297
|
-
_context.next = 26;
|
|
36298
|
-
return select(getActiveLayerInfo);
|
|
36299
|
-
case 26:
|
|
36300
|
-
dialogInfo = _context.sent;
|
|
36301
|
-
if (filteredLayers.map(function (layer) {
|
|
36302
|
-
return layer.title;
|
|
36303
|
-
}).includes(dialogInfo.title)) {
|
|
36304
|
-
_context.next = 30;
|
|
36305
|
-
break;
|
|
36306
|
-
}
|
|
36307
|
-
_context.next = 30;
|
|
36308
|
-
return put(uiActions.setToggleOpenDialog({
|
|
36309
|
-
type: DialogTypes.LayerInfo,
|
|
36310
|
-
setOpen: false
|
|
36311
|
-
}));
|
|
36312
|
-
case 30:
|
|
36313
|
-
case "end":
|
|
36314
|
-
return _context.stop();
|
|
36315
|
-
}
|
|
36316
|
-
}, _callee);
|
|
36317
|
-
})();
|
|
36318
|
-
}
|
|
36319
|
-
function layerSelectRemoveServiceSaga(capturedAction) {
|
|
36320
|
-
var removedService, serviceId, serviceUrl, results, services, servicesEnabled;
|
|
36321
|
-
return _regeneratorRuntime().wrap(function layerSelectRemoveServiceSaga$(_context2) {
|
|
36322
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
36323
|
-
case 0:
|
|
36324
|
-
removedService = capturedAction.payload;
|
|
36325
|
-
serviceId = removedService.serviceId, serviceUrl = removedService.serviceUrl;
|
|
36326
|
-
_context2.next = 4;
|
|
36327
|
-
return select(getActiveServices);
|
|
36328
|
-
case 4:
|
|
36329
|
-
results = _context2.sent;
|
|
36330
|
-
services = results;
|
|
36331
|
-
servicesEnabled = Object.values(services).find(function (service) {
|
|
36332
|
-
return service === null || service === void 0 ? void 0 : service.enabled;
|
|
36333
|
-
});
|
|
36334
|
-
if (!(servicesEnabled === undefined)) {
|
|
36335
|
-
_context2.next = 10;
|
|
36336
|
-
break;
|
|
36337
|
-
}
|
|
36338
|
-
_context2.next = 10;
|
|
36339
|
-
return all(Object.entries(services).map(function (_ref2) {
|
|
36340
|
-
var _ref3 = _slicedToArray(_ref2, 1),
|
|
36341
|
-
serviceId = _ref3[0];
|
|
36342
|
-
return put(layerSelectActions.enableActiveService({
|
|
36343
|
-
serviceId: serviceId
|
|
36344
|
-
}));
|
|
36345
|
-
}));
|
|
36346
|
-
case 10:
|
|
36347
|
-
_context2.next = 12;
|
|
36348
|
-
return put(serviceActions.mapStoreRemoveService({
|
|
36349
|
-
id: serviceId,
|
|
36350
|
-
serviceUrl: serviceUrl
|
|
36351
|
-
}));
|
|
36352
|
-
case 12:
|
|
36353
|
-
case "end":
|
|
36354
|
-
return _context2.stop();
|
|
36355
|
-
}
|
|
36356
|
-
}, _marked$1);
|
|
36357
|
-
}
|
|
36358
|
-
function addServiceToLocalStorageSaga(_ref4) {
|
|
36359
|
-
var payload = _ref4.payload;
|
|
36360
|
-
var scope = payload.scope,
|
|
36361
|
-
name = payload.name,
|
|
36362
|
-
serviceUrl = payload.serviceUrl,
|
|
36363
|
-
_abstract = payload["abstract"];
|
|
36364
|
-
if (!isUserAddedService(scope)) {
|
|
36365
|
-
return;
|
|
36366
|
-
}
|
|
36367
|
-
var localStorageServices = getUserAddedServices();
|
|
36368
|
-
setUserAddedServices(Object.assign(Object.assign({}, localStorageServices), _defineProperty$1({}, serviceUrl, {
|
|
36369
|
-
name: name,
|
|
36370
|
-
url: serviceUrl,
|
|
36371
|
-
"abstract": _abstract
|
|
36372
|
-
})));
|
|
36373
|
-
}
|
|
36374
|
-
function removeServiceFromLocalStorageSaga(_ref5) {
|
|
36375
|
-
var payload = _ref5.payload;
|
|
36376
|
-
var serviceUrl = payload.serviceUrl;
|
|
36377
|
-
var localStorageServices = getUserAddedServices();
|
|
36378
|
-
if (!localStorageServices[serviceUrl]) {
|
|
36379
|
-
return;
|
|
36380
|
-
}
|
|
36381
|
-
var updatedServices = Object.assign({}, localStorageServices);
|
|
36382
|
-
delete updatedServices[serviceUrl];
|
|
36383
|
-
setUserAddedServices(updatedServices);
|
|
36384
|
-
}
|
|
36385
|
-
function rootSaga$1() {
|
|
36386
|
-
return _regeneratorRuntime().wrap(function rootSaga$(_context3) {
|
|
36387
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
36388
|
-
case 0:
|
|
36389
|
-
_context3.next = 2;
|
|
36390
|
-
return takeEvery$1(layerSelectActions.layerSelectRemoveService.type, layerSelectRemoveServiceSaga);
|
|
36391
|
-
case 2:
|
|
36392
|
-
_context3.next = 4;
|
|
36393
|
-
return takeEvery$1(serviceActions.serviceSetLayers.type, addServiceToLocalStorageSaga);
|
|
36394
|
-
case 4:
|
|
36395
|
-
_context3.next = 6;
|
|
36396
|
-
return takeEvery$1(serviceActions.mapStoreRemoveService.type, removeServiceFromLocalStorageSaga);
|
|
36397
|
-
case 6:
|
|
36398
|
-
_context3.next = 8;
|
|
36399
|
-
return takeEvery$1([uiActions.setToggleOpenDialog.type, uiActions.setActiveMapIdForDialog.type, layerSelectActions.disableActiveService.type, layerSelectActions.toggleFilter.type, layerSelectActions.setSearchFilter.type], layerSelectCloseInfoDialogSaga);
|
|
36400
|
-
case 8:
|
|
36401
|
-
case "end":
|
|
36402
|
-
return _context3.stop();
|
|
36403
|
-
}
|
|
36404
|
-
}, _marked2$1);
|
|
36405
|
-
}
|
|
36406
|
-
|
|
36407
|
-
var layerSelectConfig = {
|
|
36408
|
-
id: 'layerSelect-module',
|
|
36409
|
-
reducersMap: {
|
|
36410
|
-
layerSelect: reducer$4
|
|
35525
|
+
syncronizationGroupStore: reducer$4
|
|
36411
35526
|
},
|
|
36412
|
-
sagas: [rootSaga$1]
|
|
35527
|
+
sagas: [rootSaga$3, rootSaga$1]
|
|
36413
35528
|
};
|
|
36414
35529
|
|
|
36415
35530
|
var _marked = /*#__PURE__*/_regeneratorRuntime().mark(registerMapUISaga),
|
|
@@ -36522,7 +35637,7 @@ function rootSaga() {
|
|
|
36522
35637
|
var uiModuleConfig = {
|
|
36523
35638
|
id: 'ui-module',
|
|
36524
35639
|
reducersMap: {
|
|
36525
|
-
ui: reducer$
|
|
35640
|
+
ui: reducer$6
|
|
36526
35641
|
},
|
|
36527
35642
|
sagas: [rootSaga]
|
|
36528
35643
|
};
|
|
@@ -36543,7 +35658,7 @@ var uiModuleConfig = {
|
|
|
36543
35658
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
36544
35659
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
36545
35660
|
* */
|
|
36546
|
-
var coreModuleConfig = [mapStoreModuleConfig, synchronizationGroupConfig, uiModuleConfig,
|
|
35661
|
+
var coreModuleConfig = [mapStoreModuleConfig, synchronizationGroupConfig, uiModuleConfig, drawtoolModuleConfig];
|
|
36547
35662
|
|
|
36548
35663
|
var shim = {exports: {}};
|
|
36549
35664
|
|
|
@@ -36805,6 +35920,8 @@ if (process.env.NODE_ENV === 'production') {
|
|
|
36805
35920
|
shim.exports = useSyncExternalStoreShim_development;
|
|
36806
35921
|
}
|
|
36807
35922
|
|
|
35923
|
+
var withSelector = {exports: {}};
|
|
35924
|
+
|
|
36808
35925
|
var withSelector_production_min = {};
|
|
36809
35926
|
|
|
36810
35927
|
/**
|
|
@@ -36984,7 +36101,11 @@ if (
|
|
|
36984
36101
|
})();
|
|
36985
36102
|
}
|
|
36986
36103
|
|
|
36987
|
-
if (process.env.NODE_ENV === 'production')
|
|
36104
|
+
if (process.env.NODE_ENV === 'production') {
|
|
36105
|
+
withSelector.exports = withSelector_production_min;
|
|
36106
|
+
} else {
|
|
36107
|
+
withSelector.exports = withSelector_development;
|
|
36108
|
+
}
|
|
36988
36109
|
|
|
36989
36110
|
var reactDom = {exports: {}};
|
|
36990
36111
|
|
|
@@ -67885,6 +67006,183 @@ function getContext() {
|
|
|
67885
67006
|
|
|
67886
67007
|
const ReactReduxContext = /*#__PURE__*/getContext();
|
|
67887
67008
|
|
|
67009
|
+
/**
|
|
67010
|
+
* Hook factory, which creates a `useReduxContext` hook bound to a given context. This is a low-level
|
|
67011
|
+
* hook that you should usually not need to call directly.
|
|
67012
|
+
*
|
|
67013
|
+
* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
|
|
67014
|
+
* @returns {Function} A `useReduxContext` hook bound to the specified context.
|
|
67015
|
+
*/
|
|
67016
|
+
function createReduxContextHook(context = ReactReduxContext) {
|
|
67017
|
+
return function useReduxContext() {
|
|
67018
|
+
const contextValue = useContext(context);
|
|
67019
|
+
|
|
67020
|
+
if (process.env.NODE_ENV !== 'production' && !contextValue) {
|
|
67021
|
+
throw new Error('could not find react-redux context value; please ensure the component is wrapped in a <Provider>');
|
|
67022
|
+
}
|
|
67023
|
+
|
|
67024
|
+
return contextValue;
|
|
67025
|
+
};
|
|
67026
|
+
}
|
|
67027
|
+
/**
|
|
67028
|
+
* A hook to access the value of the `ReactReduxContext`. This is a low-level
|
|
67029
|
+
* hook that you should usually not need to call directly.
|
|
67030
|
+
*
|
|
67031
|
+
* @returns {any} the value of the `ReactReduxContext`
|
|
67032
|
+
*
|
|
67033
|
+
* @example
|
|
67034
|
+
*
|
|
67035
|
+
* import React from 'react'
|
|
67036
|
+
* import { useReduxContext } from 'react-redux'
|
|
67037
|
+
*
|
|
67038
|
+
* export const CounterComponent = () => {
|
|
67039
|
+
* const { store } = useReduxContext()
|
|
67040
|
+
* return <div>{store.getState()}</div>
|
|
67041
|
+
* }
|
|
67042
|
+
*/
|
|
67043
|
+
|
|
67044
|
+
const useReduxContext = /*#__PURE__*/createReduxContextHook();
|
|
67045
|
+
|
|
67046
|
+
const notInitialized = () => {
|
|
67047
|
+
throw new Error('uSES not initialized!');
|
|
67048
|
+
};
|
|
67049
|
+
|
|
67050
|
+
let useSyncExternalStoreWithSelector = notInitialized;
|
|
67051
|
+
const initializeUseSelector = fn => {
|
|
67052
|
+
useSyncExternalStoreWithSelector = fn;
|
|
67053
|
+
};
|
|
67054
|
+
|
|
67055
|
+
const refEquality = (a, b) => a === b;
|
|
67056
|
+
/**
|
|
67057
|
+
* Hook factory, which creates a `useSelector` hook bound to a given context.
|
|
67058
|
+
*
|
|
67059
|
+
* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
|
|
67060
|
+
* @returns {Function} A `useSelector` hook bound to the specified context.
|
|
67061
|
+
*/
|
|
67062
|
+
|
|
67063
|
+
|
|
67064
|
+
function createSelectorHook(context = ReactReduxContext) {
|
|
67065
|
+
const useReduxContext$1 = context === ReactReduxContext ? useReduxContext : createReduxContextHook(context);
|
|
67066
|
+
return function useSelector(selector, equalityFnOrOptions = {}) {
|
|
67067
|
+
const {
|
|
67068
|
+
equalityFn = refEquality,
|
|
67069
|
+
stabilityCheck = undefined,
|
|
67070
|
+
noopCheck = undefined
|
|
67071
|
+
} = typeof equalityFnOrOptions === 'function' ? {
|
|
67072
|
+
equalityFn: equalityFnOrOptions
|
|
67073
|
+
} : equalityFnOrOptions;
|
|
67074
|
+
|
|
67075
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
67076
|
+
if (!selector) {
|
|
67077
|
+
throw new Error(`You must pass a selector to useSelector`);
|
|
67078
|
+
}
|
|
67079
|
+
|
|
67080
|
+
if (typeof selector !== 'function') {
|
|
67081
|
+
throw new Error(`You must pass a function as a selector to useSelector`);
|
|
67082
|
+
}
|
|
67083
|
+
|
|
67084
|
+
if (typeof equalityFn !== 'function') {
|
|
67085
|
+
throw new Error(`You must pass a function as an equality function to useSelector`);
|
|
67086
|
+
}
|
|
67087
|
+
}
|
|
67088
|
+
|
|
67089
|
+
const {
|
|
67090
|
+
store,
|
|
67091
|
+
subscription,
|
|
67092
|
+
getServerState,
|
|
67093
|
+
stabilityCheck: globalStabilityCheck,
|
|
67094
|
+
noopCheck: globalNoopCheck
|
|
67095
|
+
} = useReduxContext$1();
|
|
67096
|
+
const firstRun = useRef(true);
|
|
67097
|
+
const wrappedSelector = useCallback({
|
|
67098
|
+
[selector.name](state) {
|
|
67099
|
+
const selected = selector(state);
|
|
67100
|
+
|
|
67101
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
67102
|
+
const finalStabilityCheck = typeof stabilityCheck === 'undefined' ? globalStabilityCheck : stabilityCheck;
|
|
67103
|
+
|
|
67104
|
+
if (finalStabilityCheck === 'always' || finalStabilityCheck === 'once' && firstRun.current) {
|
|
67105
|
+
const toCompare = selector(state);
|
|
67106
|
+
|
|
67107
|
+
if (!equalityFn(selected, toCompare)) {
|
|
67108
|
+
let stack = undefined;
|
|
67109
|
+
|
|
67110
|
+
try {
|
|
67111
|
+
throw new Error();
|
|
67112
|
+
} catch (e) {
|
|
67113
|
+
({
|
|
67114
|
+
stack
|
|
67115
|
+
} = e);
|
|
67116
|
+
}
|
|
67117
|
+
|
|
67118
|
+
console.warn('Selector ' + (selector.name || 'unknown') + ' returned a different result when called with the same parameters. This can lead to unnecessary rerenders.' + '\nSelectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization', {
|
|
67119
|
+
state,
|
|
67120
|
+
selected,
|
|
67121
|
+
selected2: toCompare,
|
|
67122
|
+
stack
|
|
67123
|
+
});
|
|
67124
|
+
}
|
|
67125
|
+
}
|
|
67126
|
+
|
|
67127
|
+
const finalNoopCheck = typeof noopCheck === 'undefined' ? globalNoopCheck : noopCheck;
|
|
67128
|
+
|
|
67129
|
+
if (finalNoopCheck === 'always' || finalNoopCheck === 'once' && firstRun.current) {
|
|
67130
|
+
// @ts-ignore
|
|
67131
|
+
if (selected === state) {
|
|
67132
|
+
let stack = undefined;
|
|
67133
|
+
|
|
67134
|
+
try {
|
|
67135
|
+
throw new Error();
|
|
67136
|
+
} catch (e) {
|
|
67137
|
+
({
|
|
67138
|
+
stack
|
|
67139
|
+
} = e);
|
|
67140
|
+
}
|
|
67141
|
+
|
|
67142
|
+
console.warn('Selector ' + (selector.name || 'unknown') + ' returned the root state when called. This can lead to unnecessary rerenders.' + '\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.', {
|
|
67143
|
+
stack
|
|
67144
|
+
});
|
|
67145
|
+
}
|
|
67146
|
+
}
|
|
67147
|
+
|
|
67148
|
+
if (firstRun.current) firstRun.current = false;
|
|
67149
|
+
}
|
|
67150
|
+
|
|
67151
|
+
return selected;
|
|
67152
|
+
}
|
|
67153
|
+
|
|
67154
|
+
}[selector.name], [selector, globalStabilityCheck, stabilityCheck]);
|
|
67155
|
+
const selectedState = useSyncExternalStoreWithSelector(subscription.addNestedSub, store.getState, getServerState || store.getState, wrappedSelector, equalityFn);
|
|
67156
|
+
useDebugValue(selectedState);
|
|
67157
|
+
return selectedState;
|
|
67158
|
+
};
|
|
67159
|
+
}
|
|
67160
|
+
/**
|
|
67161
|
+
* A hook to access the redux store's state. This hook takes a selector function
|
|
67162
|
+
* as an argument. The selector is called with the store state.
|
|
67163
|
+
*
|
|
67164
|
+
* This hook takes an optional equality comparison function as the second parameter
|
|
67165
|
+
* that allows you to customize the way the selected state is compared to determine
|
|
67166
|
+
* whether the component needs to be re-rendered.
|
|
67167
|
+
*
|
|
67168
|
+
* @param {Function} selector the selector function
|
|
67169
|
+
* @param {Function=} equalityFn the function that will be used to determine equality
|
|
67170
|
+
*
|
|
67171
|
+
* @returns {any} the selected state
|
|
67172
|
+
*
|
|
67173
|
+
* @example
|
|
67174
|
+
*
|
|
67175
|
+
* import React from 'react'
|
|
67176
|
+
* import { useSelector } from 'react-redux'
|
|
67177
|
+
*
|
|
67178
|
+
* export const CounterComponent = () => {
|
|
67179
|
+
* const counter = useSelector(state => state.counter)
|
|
67180
|
+
* return <div>{counter}</div>
|
|
67181
|
+
* }
|
|
67182
|
+
*/
|
|
67183
|
+
|
|
67184
|
+
const useSelector = /*#__PURE__*/createSelectorHook();
|
|
67185
|
+
|
|
67888
67186
|
var reactIs$1 = {exports: {}};
|
|
67889
67187
|
|
|
67890
67188
|
var reactIs_production_min$1 = {};
|
|
@@ -68563,7 +67861,85 @@ function Provider({
|
|
|
68563
67861
|
}, children);
|
|
68564
67862
|
}
|
|
68565
67863
|
|
|
67864
|
+
/**
|
|
67865
|
+
* Hook factory, which creates a `useStore` hook bound to a given context.
|
|
67866
|
+
*
|
|
67867
|
+
* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
|
|
67868
|
+
* @returns {Function} A `useStore` hook bound to the specified context.
|
|
67869
|
+
*/
|
|
67870
|
+
|
|
67871
|
+
function createStoreHook(context = ReactReduxContext) {
|
|
67872
|
+
const useReduxContext$1 = // @ts-ignore
|
|
67873
|
+
context === ReactReduxContext ? useReduxContext : // @ts-ignore
|
|
67874
|
+
createReduxContextHook(context);
|
|
67875
|
+
return function useStore() {
|
|
67876
|
+
const {
|
|
67877
|
+
store
|
|
67878
|
+
} = useReduxContext$1(); // @ts-ignore
|
|
67879
|
+
|
|
67880
|
+
return store;
|
|
67881
|
+
};
|
|
67882
|
+
}
|
|
67883
|
+
/**
|
|
67884
|
+
* A hook to access the redux store.
|
|
67885
|
+
*
|
|
67886
|
+
* @returns {any} the redux store
|
|
67887
|
+
*
|
|
67888
|
+
* @example
|
|
67889
|
+
*
|
|
67890
|
+
* import React from 'react'
|
|
67891
|
+
* import { useStore } from 'react-redux'
|
|
67892
|
+
*
|
|
67893
|
+
* export const ExampleComponent = () => {
|
|
67894
|
+
* const store = useStore()
|
|
67895
|
+
* return <div>{store.getState()}</div>
|
|
67896
|
+
* }
|
|
67897
|
+
*/
|
|
67898
|
+
|
|
67899
|
+
const useStore = /*#__PURE__*/createStoreHook();
|
|
67900
|
+
|
|
67901
|
+
/**
|
|
67902
|
+
* Hook factory, which creates a `useDispatch` hook bound to a given context.
|
|
67903
|
+
*
|
|
67904
|
+
* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
|
|
67905
|
+
* @returns {Function} A `useDispatch` hook bound to the specified context.
|
|
67906
|
+
*/
|
|
67907
|
+
|
|
67908
|
+
function createDispatchHook(context = ReactReduxContext) {
|
|
67909
|
+
const useStore$1 = // @ts-ignore
|
|
67910
|
+
context === ReactReduxContext ? useStore : createStoreHook(context);
|
|
67911
|
+
return function useDispatch() {
|
|
67912
|
+
const store = useStore$1(); // @ts-ignore
|
|
67913
|
+
|
|
67914
|
+
return store.dispatch;
|
|
67915
|
+
};
|
|
67916
|
+
}
|
|
67917
|
+
/**
|
|
67918
|
+
* A hook to access the redux `dispatch` function.
|
|
67919
|
+
*
|
|
67920
|
+
* @returns {any|function} redux store's `dispatch` function
|
|
67921
|
+
*
|
|
67922
|
+
* @example
|
|
67923
|
+
*
|
|
67924
|
+
* import React, { useCallback } from 'react'
|
|
67925
|
+
* import { useDispatch } from 'react-redux'
|
|
67926
|
+
*
|
|
67927
|
+
* export const CounterComponent = ({ value }) => {
|
|
67928
|
+
* const dispatch = useDispatch()
|
|
67929
|
+
* const increaseCounter = useCallback(() => dispatch({ type: 'increase-counter' }), [])
|
|
67930
|
+
* return (
|
|
67931
|
+
* <div>
|
|
67932
|
+
* <span>{value}</span>
|
|
67933
|
+
* <button onClick={increaseCounter}>Increase counter</button>
|
|
67934
|
+
* </div>
|
|
67935
|
+
* )
|
|
67936
|
+
* }
|
|
67937
|
+
*/
|
|
67938
|
+
|
|
67939
|
+
const useDispatch = /*#__PURE__*/createDispatchHook();
|
|
67940
|
+
|
|
68566
67941
|
// The primary entry point assumes we're working with standard ReactDOM/RN, but
|
|
67942
|
+
initializeUseSelector(withSelector.exports.useSyncExternalStoreWithSelector);
|
|
68567
67943
|
// with standard React renderers (ReactDOM, React Native)
|
|
68568
67944
|
|
|
68569
67945
|
setBatch(reactDom.exports.unstable_batchedUpdates);
|
|
@@ -68614,4 +67990,104 @@ var ThemeStoreProvider = function ThemeStoreProvider(_ref2) {
|
|
|
68614
67990
|
}, children));
|
|
68615
67991
|
};
|
|
68616
67992
|
|
|
68617
|
-
|
|
67993
|
+
/* *
|
|
67994
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
67995
|
+
* you may not use this file except in compliance with the License.
|
|
67996
|
+
* You may obtain a copy of the License at
|
|
67997
|
+
*
|
|
67998
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
67999
|
+
*
|
|
68000
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
68001
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
68002
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
68003
|
+
* See the License for the specific language governing permissions and
|
|
68004
|
+
* limitations under the License.
|
|
68005
|
+
*
|
|
68006
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
68007
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
68008
|
+
* */
|
|
68009
|
+
var useSetupDialog = function useSetupDialog(dialogType) {
|
|
68010
|
+
var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'app';
|
|
68011
|
+
var dispatch = useDispatch();
|
|
68012
|
+
var onCloseDialog = useCallback(function () {
|
|
68013
|
+
dispatch(uiActions.setToggleOpenDialog({
|
|
68014
|
+
type: dialogType,
|
|
68015
|
+
setOpen: false
|
|
68016
|
+
}));
|
|
68017
|
+
}, [dialogType, dispatch]);
|
|
68018
|
+
var mapId = useSelector(function (store) {
|
|
68019
|
+
return getDialogMapId(store, dialogType);
|
|
68020
|
+
});
|
|
68021
|
+
var isMapPresent = useSelector(function (store) {
|
|
68022
|
+
return getIsMapPresent(store, mapId);
|
|
68023
|
+
});
|
|
68024
|
+
// Check to ensure the currently active map is still present on screen - if not, close the dialog
|
|
68025
|
+
useEffect(function () {
|
|
68026
|
+
if (mapId !== '' && !isMapPresent) {
|
|
68027
|
+
onCloseDialog();
|
|
68028
|
+
}
|
|
68029
|
+
}, [mapId, isMapPresent, onCloseDialog]);
|
|
68030
|
+
var registerDialog = useCallback(function () {
|
|
68031
|
+
dispatch(uiActions.registerDialog({
|
|
68032
|
+
type: dialogType,
|
|
68033
|
+
setOpen: false,
|
|
68034
|
+
source: source
|
|
68035
|
+
}));
|
|
68036
|
+
}, [dialogType, dispatch, source]);
|
|
68037
|
+
var unregisterDialog = useCallback(function () {
|
|
68038
|
+
dispatch(uiActions.unregisterDialog({
|
|
68039
|
+
type: dialogType
|
|
68040
|
+
}));
|
|
68041
|
+
}, [dialogType, dispatch]);
|
|
68042
|
+
// Register this dialog in the store
|
|
68043
|
+
useEffect(function () {
|
|
68044
|
+
registerDialog();
|
|
68045
|
+
return function () {
|
|
68046
|
+
unregisterDialog();
|
|
68047
|
+
};
|
|
68048
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
68049
|
+
}, []);
|
|
68050
|
+
var uiIsOrderedOnTop = useSelector(function (store) {
|
|
68051
|
+
return getDialogIsOrderedOnTop(store, dialogType);
|
|
68052
|
+
});
|
|
68053
|
+
var setDialogOrder = useCallback(function () {
|
|
68054
|
+
if (!uiIsOrderedOnTop) {
|
|
68055
|
+
dispatch(uiActions.orderDialog({
|
|
68056
|
+
type: dialogType
|
|
68057
|
+
}));
|
|
68058
|
+
}
|
|
68059
|
+
}, [dialogType, dispatch, uiIsOrderedOnTop]);
|
|
68060
|
+
var dialogOrder = useSelector(function (store) {
|
|
68061
|
+
return getDialogOrder(store, dialogType);
|
|
68062
|
+
});
|
|
68063
|
+
var uiSource = useSelector(function (store) {
|
|
68064
|
+
return getDialogSource(store, dialogType);
|
|
68065
|
+
});
|
|
68066
|
+
var isDialogOpen = useSelector(function (store) {
|
|
68067
|
+
return getisDialogOpen(store, dialogType);
|
|
68068
|
+
});
|
|
68069
|
+
var uiIsLoading = useSelector(function (store) {
|
|
68070
|
+
return getDialogIsLoading(store, dialogType);
|
|
68071
|
+
});
|
|
68072
|
+
var uiError = useSelector(function (store) {
|
|
68073
|
+
return getDialogError(store, dialogType);
|
|
68074
|
+
});
|
|
68075
|
+
var setFocused = function setFocused(focused) {
|
|
68076
|
+
dispatch(uiActions.setDialogFocused({
|
|
68077
|
+
type: dialogType,
|
|
68078
|
+
focused: focused
|
|
68079
|
+
}));
|
|
68080
|
+
};
|
|
68081
|
+
return {
|
|
68082
|
+
setDialogOrder: setDialogOrder,
|
|
68083
|
+
dialogOrder: dialogOrder,
|
|
68084
|
+
onCloseDialog: onCloseDialog,
|
|
68085
|
+
uiSource: uiSource,
|
|
68086
|
+
isDialogOpen: isDialogOpen,
|
|
68087
|
+
uiIsLoading: uiIsLoading,
|
|
68088
|
+
uiError: uiError,
|
|
68089
|
+
setFocused: setFocused
|
|
68090
|
+
};
|
|
68091
|
+
};
|
|
68092
|
+
|
|
68093
|
+
export { ThemeStoreProvider, appActions, appModuleConfig, coreModuleConfig, createStore, drawtoolActions, drawtoolModuleConfig, reducer as drawtoolReducer, selectors as drawtoolSelectors, filterLayers$1 as filterLayers, genericActions, rootSaga$3 as genericSaga, selectors$3 as genericSelectors, types$1 as genericTypes, getSingularDrawtoolDrawLayerId, initialState$4 as initialState, layerActions, reducer$7 as layerReducer, selectors$6 as layerSelectors, types$5 as layerTypes, utils$2 as layerUtils, mapActions, constants$1 as mapConstants, enums as mapEnums, selectors$2 as mapSelectors, mapStoreActions, mapStoreModuleConfig, mapStoreReducers, types$4 as mapTypes, mapUtils, routerActions, routerModuleConfig, utils as routerUtils, selectorMemoizationOptions, serviceActions, selectors$1 as serviceSelectors, types as serviceTypes, storeTestSettings, storeTestUtils, utils$1 as storeUtils, constants as syncConstants, actions as syncGroupsActions, reducer$4 as syncGroupsReducer, selector as syncGroupsSelector, selectors$4 as syncGroupsSelectors, types$2 as syncGroupsTypes, types$2 as types, uiActions, uiModuleConfig, reducer$6 as uiReducer, selectors$5 as uiSelectors, types$3 as uiTypes, useSetupDialog, reducer$5 as webmapReducer };
|