@opengeoweb/store 9.25.0 → 9.25.3
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
CHANGED
|
@@ -10,7 +10,7 @@ import { useSelector, useDispatch, Provider } from 'react-redux';
|
|
|
10
10
|
import { useCallback, useEffect } from 'react';
|
|
11
11
|
import { createStore as createStore$1 } from '@redux-eggs/redux-toolkit';
|
|
12
12
|
import { getSagaExtension } from '@redux-eggs/saga-extension';
|
|
13
|
-
import {
|
|
13
|
+
import { takeEvery, call as call$e, put, select, delay, all, takeLatest } from 'redux-saga/effects';
|
|
14
14
|
import { metronome } from '@opengeoweb/metronome';
|
|
15
15
|
import { jsx } from 'react/jsx-runtime';
|
|
16
16
|
|
|
@@ -1988,6 +1988,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
1988
1988
|
*
|
|
1989
1989
|
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1990
1990
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
1991
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
1991
1992
|
* */
|
|
1992
1993
|
var LayerStatus;
|
|
1993
1994
|
(function (LayerStatus) {
|
|
@@ -1999,7 +2000,7 @@ var LayerActionOrigin;
|
|
|
1999
2000
|
LayerActionOrigin["layerManager"] = "layerManager";
|
|
2000
2001
|
LayerActionOrigin["wmsLoader"] = "WMSLayerTreeConnect";
|
|
2001
2002
|
LayerActionOrigin["ReactMapViewParseLayer"] = "ReactMapViewParseLayer";
|
|
2002
|
-
LayerActionOrigin["
|
|
2003
|
+
LayerActionOrigin["updateLayerInformationListener"] = "updateLayerInformationListener";
|
|
2003
2004
|
LayerActionOrigin["toggleAutoUpdateListener"] = "toggleAutoUpdateListener";
|
|
2004
2005
|
LayerActionOrigin["unregisterMapSaga"] = "unregisterMapSaga";
|
|
2005
2006
|
})(LayerActionOrigin || (LayerActionOrigin = {}));
|
|
@@ -2394,6 +2395,7 @@ var utils$2 = /*#__PURE__*/Object.freeze({
|
|
|
2394
2395
|
*
|
|
2395
2396
|
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2396
2397
|
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
2398
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
2397
2399
|
* */
|
|
2398
2400
|
/**
|
|
2399
2401
|
* These actions causes circular dependency if they are defined in the reducer.ts file.
|
|
@@ -2418,6 +2420,7 @@ const setMapPreset = createAction('SET_MAP_PRESET');
|
|
|
2418
2420
|
*
|
|
2419
2421
|
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2420
2422
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
2423
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
2421
2424
|
* */
|
|
2422
2425
|
/**
|
|
2423
2426
|
* Generic action to set the time.
|
|
@@ -2462,6 +2465,7 @@ const setBbox = createAction('GENERIC_SETBBOX');
|
|
|
2462
2465
|
*
|
|
2463
2466
|
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2464
2467
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
2468
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
2465
2469
|
* */
|
|
2466
2470
|
/**
|
|
2467
2471
|
* These actions are fired by the generic/saga.ts, based on generic actions and the synchronizationGroup state.
|
|
@@ -3106,6 +3110,7 @@ const layerActions = slice$7.actions;
|
|
|
3106
3110
|
*
|
|
3107
3111
|
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
3108
3112
|
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
3113
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
3109
3114
|
* */
|
|
3110
3115
|
const selectorMemoizationOptions = {
|
|
3111
3116
|
memoizeOptions: {
|
|
@@ -3476,6 +3481,7 @@ var selectors$7 = /*#__PURE__*/Object.freeze({
|
|
|
3476
3481
|
*
|
|
3477
3482
|
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
3478
3483
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
3484
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
3479
3485
|
* */
|
|
3480
3486
|
var AnimationLength;
|
|
3481
3487
|
(function (AnimationLength) {
|
|
@@ -4617,6 +4623,7 @@ var selectors$6 = /*#__PURE__*/Object.freeze({
|
|
|
4617
4623
|
*
|
|
4618
4624
|
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
4619
4625
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
4626
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
4620
4627
|
* */
|
|
4621
4628
|
var DialogTypes;
|
|
4622
4629
|
(function (DialogTypes) {
|
|
@@ -4658,6 +4665,7 @@ var types$3 = /*#__PURE__*/Object.freeze({
|
|
|
4658
4665
|
*
|
|
4659
4666
|
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
4660
4667
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
4668
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
4661
4669
|
* */
|
|
4662
4670
|
const useSetupDialog = (dialogType, source = 'app') => {
|
|
4663
4671
|
const dispatch = useDispatch();
|
|
@@ -4726,6 +4734,7 @@ const useSetupDialog = (dialogType, source = 'app') => {
|
|
|
4726
4734
|
*
|
|
4727
4735
|
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
4728
4736
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
4737
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
4729
4738
|
* */
|
|
4730
4739
|
/* Type constants */
|
|
4731
4740
|
const SYNCGROUPS_TYPE_SETTIME = 'SYNCGROUPS_TYPE_SETTIME';
|
|
@@ -4756,6 +4765,7 @@ var constants$1 = /*#__PURE__*/Object.freeze({
|
|
|
4756
4765
|
*
|
|
4757
4766
|
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
4758
4767
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
4768
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
4759
4769
|
* */
|
|
4760
4770
|
/**
|
|
4761
4771
|
* The removeInPlace() method modifies an array in place, by removing elements that pass the test implemented by the provided function.
|
|
@@ -5021,6 +5031,7 @@ const {
|
|
|
5021
5031
|
*
|
|
5022
5032
|
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
5023
5033
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
5034
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
5024
5035
|
* */
|
|
5025
5036
|
const SyncGroupTypeList = [SYNCGROUPS_TYPE_SETBBOX, SYNCGROUPS_TYPE_SETTIME];
|
|
5026
5037
|
var SyncGroupActionOrigin;
|
|
@@ -5255,6 +5266,7 @@ var selector = /*#__PURE__*/Object.freeze({
|
|
|
5255
5266
|
*
|
|
5256
5267
|
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
5257
5268
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
5269
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
5258
5270
|
* */
|
|
5259
5271
|
const synchronizationGroupStore = store => store && store.syncronizationGroupStore ? store.syncronizationGroupStore : null;
|
|
5260
5272
|
const getSynchronizationGroupStore = createSelector(synchronizationGroupStore, store => store, selectorMemoizationOptions);
|
|
@@ -5297,6 +5309,7 @@ var selectors$4 = /*#__PURE__*/Object.freeze({
|
|
|
5297
5309
|
*
|
|
5298
5310
|
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
5299
5311
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
5312
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
5300
5313
|
* */
|
|
5301
5314
|
|
|
5302
5315
|
var types$1 = /*#__PURE__*/Object.freeze({
|
|
@@ -5318,6 +5331,7 @@ var types$1 = /*#__PURE__*/Object.freeze({
|
|
|
5318
5331
|
*
|
|
5319
5332
|
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
5320
5333
|
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
5334
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
5321
5335
|
* */
|
|
5322
5336
|
const ANY_EDR_SERVICE = 'any_edr';
|
|
5323
5337
|
|
|
@@ -5341,6 +5355,7 @@ var constants = /*#__PURE__*/Object.freeze({
|
|
|
5341
5355
|
*
|
|
5342
5356
|
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
5343
5357
|
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
5358
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
5344
5359
|
* */
|
|
5345
5360
|
const loadingIndicatorAdapter = createEntityAdapter();
|
|
5346
5361
|
const initLoadingIndicatorStateForId = (draft, id) => {
|
|
@@ -5411,6 +5426,7 @@ const {
|
|
|
5411
5426
|
*
|
|
5412
5427
|
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
5413
5428
|
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
5429
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
5414
5430
|
* */
|
|
5415
5431
|
const {
|
|
5416
5432
|
selectById: selectLoadingIndicatorById
|
|
@@ -6196,6 +6212,7 @@ var selectors$2 = /*#__PURE__*/Object.freeze({
|
|
|
6196
6212
|
*
|
|
6197
6213
|
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6198
6214
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
6215
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6199
6216
|
* */
|
|
6200
6217
|
var MapActionOrigin;
|
|
6201
6218
|
(function (MapActionOrigin) {
|
|
@@ -6222,6 +6239,7 @@ var enums = /*#__PURE__*/Object.freeze({
|
|
|
6222
6239
|
*
|
|
6223
6240
|
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6224
6241
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
6242
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6225
6243
|
* */
|
|
6226
6244
|
const IS_LEGEND_OPEN_BY_DEFAULT = false;
|
|
6227
6245
|
|
|
@@ -6333,6 +6351,7 @@ const serviceActions = slice$2.actions;
|
|
|
6333
6351
|
*
|
|
6334
6352
|
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6335
6353
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
6354
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6336
6355
|
* */
|
|
6337
6356
|
const getServicesStore = store => store === null || store === void 0 ? void 0 : store.services;
|
|
6338
6357
|
/**
|
|
@@ -6437,6 +6456,7 @@ var selectors$1 = /*#__PURE__*/Object.freeze({
|
|
|
6437
6456
|
*
|
|
6438
6457
|
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6439
6458
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
6459
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6440
6460
|
* */
|
|
6441
6461
|
|
|
6442
6462
|
var types = /*#__PURE__*/Object.freeze({
|
|
@@ -6576,6 +6596,7 @@ if ($stringify) {
|
|
|
6576
6596
|
*
|
|
6577
6597
|
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6578
6598
|
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
6599
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6579
6600
|
* */
|
|
6580
6601
|
const getUserAddedServices = () => {
|
|
6581
6602
|
try {
|
|
@@ -6620,6 +6641,7 @@ const isNoIdService = param => {
|
|
|
6620
6641
|
*
|
|
6621
6642
|
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6622
6643
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
6644
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6623
6645
|
* */
|
|
6624
6646
|
const {
|
|
6625
6647
|
WmLayerWithoutTimeDimension,
|
|
@@ -7631,104 +7653,6 @@ const isAnimationEndTimeValid = animationEndTime => {
|
|
|
7631
7653
|
const parsedDate = dateUtils.parseISO(animationEndTime);
|
|
7632
7654
|
return dateUtils.isValid(parsedDate);
|
|
7633
7655
|
};
|
|
7634
|
-
function* deleteLayerSaga({
|
|
7635
|
-
payload
|
|
7636
|
-
}) {
|
|
7637
|
-
const {
|
|
7638
|
-
mapId
|
|
7639
|
-
} = payload;
|
|
7640
|
-
const layers = yield select(getMapLayersWithoutDimensionCurrentValue, mapId);
|
|
7641
|
-
if (!layers.length) {
|
|
7642
|
-
yield put(mapActions.mapStopAnimation({
|
|
7643
|
-
mapId
|
|
7644
|
-
}));
|
|
7645
|
-
}
|
|
7646
|
-
}
|
|
7647
|
-
function* updateAnimation$1(mapId, maxValue) {
|
|
7648
|
-
const shouldEndtimeOverride$1 = yield select(shouldEndtimeOverride, mapId);
|
|
7649
|
-
if (shouldEndtimeOverride$1 === true) {
|
|
7650
|
-
return;
|
|
7651
|
-
}
|
|
7652
|
-
const animationStart = yield select(getAnimationStartTime, mapId);
|
|
7653
|
-
// Calculate how much time the animation start need to move forwards
|
|
7654
|
-
const animationEnd = yield select(getAnimationEndTime, mapId);
|
|
7655
|
-
const animationEndUnix = dateUtils.unix(dateUtils.utc(animationEnd));
|
|
7656
|
-
const maxTimeAsUnix = dateUtils.unix(dateUtils.utc(maxValue));
|
|
7657
|
-
const timeInSecondToShiftAnimationForwards = maxTimeAsUnix - animationEndUnix;
|
|
7658
|
-
const animationStartUnix = dateUtils.unix(dateUtils.utc(animationStart));
|
|
7659
|
-
const newAnimationStartTime = dateUtils.dateToString(dateUtils.fromUnix(animationStartUnix + timeInSecondToShiftAnimationForwards), dateFormat);
|
|
7660
|
-
const newAnimationEndTime = dateUtils.dateToString(dateUtils.fromUnix(animationEndUnix + timeInSecondToShiftAnimationForwards), dateFormat);
|
|
7661
|
-
if (!newAnimationStartTime || !newAnimationEndTime) {
|
|
7662
|
-
return;
|
|
7663
|
-
}
|
|
7664
|
-
yield put(mapActions.setAnimationEndTime({
|
|
7665
|
-
mapId,
|
|
7666
|
-
animationEndTime: newAnimationEndTime
|
|
7667
|
-
}));
|
|
7668
|
-
yield put(mapActions.setAnimationStartTime({
|
|
7669
|
-
mapId,
|
|
7670
|
-
animationStartTime: newAnimationStartTime
|
|
7671
|
-
}));
|
|
7672
|
-
}
|
|
7673
|
-
function* setLayerDimensionsSaga({
|
|
7674
|
-
payload
|
|
7675
|
-
}) {
|
|
7676
|
-
try {
|
|
7677
|
-
const {
|
|
7678
|
-
layerDimensions
|
|
7679
|
-
} = payload;
|
|
7680
|
-
if (!layerDimensions) {
|
|
7681
|
-
return;
|
|
7682
|
-
}
|
|
7683
|
-
const {
|
|
7684
|
-
dimensions,
|
|
7685
|
-
layerId
|
|
7686
|
-
} = layerDimensions;
|
|
7687
|
-
const layer = yield select(getLayerById, layerId);
|
|
7688
|
-
if (!layer) {
|
|
7689
|
-
return;
|
|
7690
|
-
}
|
|
7691
|
-
const newTimeDimension = dimensions.find(dimension => dimension.name === 'time');
|
|
7692
|
-
const {
|
|
7693
|
-
mapId
|
|
7694
|
-
} = layer;
|
|
7695
|
-
const autoUpdateLayerId = yield select(getAutoUpdateLayerId, mapId);
|
|
7696
|
-
const shouldAutoUpdate = yield select(isAutoUpdating, mapId);
|
|
7697
|
-
const prevTimeDimension = yield select(getLayerTimeDimension, layerId);
|
|
7698
|
-
const isAutoUpdateLayer = layerId === autoUpdateLayerId;
|
|
7699
|
-
const incomingMaxTime = newTimeDimension === null || newTimeDimension === void 0 ? void 0 : newTimeDimension.maxValue;
|
|
7700
|
-
const isIncomingMaxTimeLaterThanCurrentLayerTime = incomingMaxTime && (prevTimeDimension === null || prevTimeDimension === void 0 ? void 0 : prevTimeDimension.currentValue) && prevTimeDimension.currentValue !== incomingMaxTime;
|
|
7701
|
-
if (isAutoUpdateLayer &&
|
|
7702
|
-
// only update the active layer
|
|
7703
|
-
shouldAutoUpdate && isIncomingMaxTimeLaterThanCurrentLayerTime) {
|
|
7704
|
-
const isMapAnimating = yield select(isAnimating, mapId);
|
|
7705
|
-
if (!isMapAnimating) {
|
|
7706
|
-
yield put(layerActions.layerChangeDimension({
|
|
7707
|
-
layerId,
|
|
7708
|
-
origin: LayerActionOrigin.setLayerDimensionSaga,
|
|
7709
|
-
dimension: {
|
|
7710
|
-
name: 'time',
|
|
7711
|
-
currentValue: incomingMaxTime
|
|
7712
|
-
}
|
|
7713
|
-
}));
|
|
7714
|
-
// Each time a layer updates, set the new time for all synced timesliders
|
|
7715
|
-
const syncedMapIds = yield select(getSyncedMapIdsForTimeslider);
|
|
7716
|
-
if (syncedMapIds) {
|
|
7717
|
-
// Change time value for all other timesliders
|
|
7718
|
-
yield all(syncedMapIds.map(syncedMapId => put(setTime({
|
|
7719
|
-
origin: 'mapStore saga',
|
|
7720
|
-
sourceId: syncedMapId,
|
|
7721
|
-
value: incomingMaxTime
|
|
7722
|
-
}))));
|
|
7723
|
-
}
|
|
7724
|
-
}
|
|
7725
|
-
yield call$e(updateAnimation$1, mapId, incomingMaxTime);
|
|
7726
|
-
}
|
|
7727
|
-
} catch (error) {
|
|
7728
|
-
// eslint-disable-next-line no-console
|
|
7729
|
-
console.warn(error);
|
|
7730
|
-
}
|
|
7731
|
-
}
|
|
7732
7656
|
function* handleBaseLayersSaga(mapId, baseLayers) {
|
|
7733
7657
|
const baseLayer = baseLayers.find(layer => layer.layerType === 'baseLayer');
|
|
7734
7658
|
const currentAvailableBaseLayers = yield select(getAvailableBaseLayersForMap, mapId);
|
|
@@ -8058,8 +7982,6 @@ function* setStepBackwardOrForwardSaga({
|
|
|
8058
7982
|
}
|
|
8059
7983
|
function* rootSaga$2() {
|
|
8060
7984
|
// resets IWMJSMap state
|
|
8061
|
-
yield takeLatest(layerActions.layerDelete.type, deleteLayerSaga);
|
|
8062
|
-
yield takeLatest(layerActions.onUpdateLayerInformation.type, setLayerDimensionsSaga);
|
|
8063
7985
|
yield takeEvery(mapActions.setMapPreset.type, setMapPresetSaga);
|
|
8064
7986
|
yield takeEvery(mapActions.unregisterMap.type, unregisterMapSaga);
|
|
8065
7987
|
yield takeEvery(mapActions.setStepBackwardOrForward.type, setStepBackwardOrForwardSaga);
|
|
@@ -8273,6 +8195,7 @@ metronomeListener.startListening({
|
|
|
8273
8195
|
*
|
|
8274
8196
|
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8275
8197
|
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
8198
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
8276
8199
|
* */
|
|
8277
8200
|
const layersListener = createListenerMiddleware();
|
|
8278
8201
|
layersListener.startListening({
|
|
@@ -8367,6 +8290,85 @@ mapUiListener.startListening({
|
|
|
8367
8290
|
});
|
|
8368
8291
|
|
|
8369
8292
|
const mapListener = createListenerMiddleware();
|
|
8293
|
+
mapListener.startListening({
|
|
8294
|
+
actionCreator: layerActions.layerDelete,
|
|
8295
|
+
effect: ({
|
|
8296
|
+
payload
|
|
8297
|
+
}, listenerApi) => {
|
|
8298
|
+
const {
|
|
8299
|
+
mapId
|
|
8300
|
+
} = payload;
|
|
8301
|
+
const layers = getMapLayersWithoutDimensionCurrentValue(listenerApi.getState(), mapId);
|
|
8302
|
+
if (!layers.length) {
|
|
8303
|
+
listenerApi.dispatch(mapActions.mapStopAnimation({
|
|
8304
|
+
mapId
|
|
8305
|
+
}));
|
|
8306
|
+
}
|
|
8307
|
+
}
|
|
8308
|
+
});
|
|
8309
|
+
// update layer, synced maps and animation on latest max time if autoupdating
|
|
8310
|
+
mapListener.startListening({
|
|
8311
|
+
actionCreator: layerActions.onUpdateLayerInformation,
|
|
8312
|
+
effect: ({
|
|
8313
|
+
payload
|
|
8314
|
+
}, listenerApi) => {
|
|
8315
|
+
try {
|
|
8316
|
+
const {
|
|
8317
|
+
layerDimensions
|
|
8318
|
+
} = payload;
|
|
8319
|
+
if (!layerDimensions) {
|
|
8320
|
+
return;
|
|
8321
|
+
}
|
|
8322
|
+
const {
|
|
8323
|
+
dimensions,
|
|
8324
|
+
layerId
|
|
8325
|
+
} = layerDimensions;
|
|
8326
|
+
const layer = getLayerById(listenerApi.getState(), layerId);
|
|
8327
|
+
if (!layer) {
|
|
8328
|
+
return;
|
|
8329
|
+
}
|
|
8330
|
+
const newTimeDimension = dimensions.find(dimension => dimension.name === 'time');
|
|
8331
|
+
const {
|
|
8332
|
+
mapId
|
|
8333
|
+
} = layer;
|
|
8334
|
+
const autoUpdateLayerId = getAutoUpdateLayerId(listenerApi.getState(), mapId);
|
|
8335
|
+
const shouldAutoUpdate = isAutoUpdating(listenerApi.getState(), mapId);
|
|
8336
|
+
const prevTimeDimension = getLayerTimeDimension(listenerApi.getState(), layerId);
|
|
8337
|
+
const isAutoUpdateLayer = layerId === autoUpdateLayerId;
|
|
8338
|
+
const incomingMaxTime = newTimeDimension === null || newTimeDimension === void 0 ? void 0 : newTimeDimension.maxValue;
|
|
8339
|
+
const isIncomingMaxTimeLaterThanCurrentLayerTime = incomingMaxTime && (prevTimeDimension === null || prevTimeDimension === void 0 ? void 0 : prevTimeDimension.currentValue) && prevTimeDimension.currentValue !== incomingMaxTime;
|
|
8340
|
+
if (isAutoUpdateLayer &&
|
|
8341
|
+
// only update the active layer
|
|
8342
|
+
shouldAutoUpdate && isIncomingMaxTimeLaterThanCurrentLayerTime) {
|
|
8343
|
+
const isMapAnimating = isAnimating(listenerApi.getState(), mapId);
|
|
8344
|
+
if (!isMapAnimating) {
|
|
8345
|
+
listenerApi.dispatch(layerActions.layerChangeDimension({
|
|
8346
|
+
layerId,
|
|
8347
|
+
origin: LayerActionOrigin.updateLayerInformationListener,
|
|
8348
|
+
dimension: {
|
|
8349
|
+
name: 'time',
|
|
8350
|
+
currentValue: incomingMaxTime
|
|
8351
|
+
}
|
|
8352
|
+
}));
|
|
8353
|
+
// Each time a layer updates, set the new time for all synced timesliders
|
|
8354
|
+
const syncedMapIds = getSyncedMapIdsForTimeslider(listenerApi.getState());
|
|
8355
|
+
if (syncedMapIds) {
|
|
8356
|
+
// Change time value for all other timesliders
|
|
8357
|
+
syncedMapIds.map(syncedMapId => listenerApi.dispatch(setTime({
|
|
8358
|
+
origin: LayerActionOrigin.updateLayerInformationListener,
|
|
8359
|
+
sourceId: syncedMapId,
|
|
8360
|
+
value: incomingMaxTime
|
|
8361
|
+
})));
|
|
8362
|
+
}
|
|
8363
|
+
}
|
|
8364
|
+
updateAnimation(mapId, incomingMaxTime, listenerApi);
|
|
8365
|
+
}
|
|
8366
|
+
} catch (error) {
|
|
8367
|
+
// eslint-disable-next-line no-console
|
|
8368
|
+
console.warn(error);
|
|
8369
|
+
}
|
|
8370
|
+
}
|
|
8371
|
+
});
|
|
8370
8372
|
const updateAnimation = (mapId, maxValue, listenerApi) => {
|
|
8371
8373
|
const shouldEndtimeOverride$1 = shouldEndtimeOverride(listenerApi.getState(), mapId);
|
|
8372
8374
|
if (shouldEndtimeOverride$1 === true) {
|
|
@@ -8763,6 +8765,7 @@ genericListener.startListening({
|
|
|
8763
8765
|
*
|
|
8764
8766
|
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8765
8767
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
8768
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
8766
8769
|
* */
|
|
8767
8770
|
const initialState$1 = {};
|
|
8768
8771
|
const slice$1 = createSlice({
|
|
@@ -8796,6 +8799,7 @@ const routerActions = slice$1.actions;
|
|
|
8796
8799
|
*
|
|
8797
8800
|
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8798
8801
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
8802
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
8799
8803
|
* */
|
|
8800
8804
|
// stores navigate hook method to object, so it can be used outside components
|
|
8801
8805
|
const historyDict = {
|
|
@@ -8823,6 +8827,7 @@ var utils = /*#__PURE__*/Object.freeze({
|
|
|
8823
8827
|
*
|
|
8824
8828
|
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8825
8829
|
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
8830
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
8826
8831
|
* */
|
|
8827
8832
|
const routerListener = createListenerMiddleware();
|
|
8828
8833
|
routerListener.startListening({
|
|
@@ -8850,6 +8855,7 @@ routerListener.startListening({
|
|
|
8850
8855
|
*
|
|
8851
8856
|
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8852
8857
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
8858
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
8853
8859
|
* */
|
|
8854
8860
|
const routerModuleConfig = {
|
|
8855
8861
|
id: 'router',
|
|
@@ -9034,6 +9040,7 @@ const drawtoolActions = slice.actions;
|
|
|
9034
9040
|
*
|
|
9035
9041
|
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9036
9042
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
9043
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9037
9044
|
* */
|
|
9038
9045
|
const getDrawingtoolStore = store => {
|
|
9039
9046
|
if (store && store.drawingtools) {
|
|
@@ -9304,6 +9311,7 @@ drawingToolListener.startListening({
|
|
|
9304
9311
|
*
|
|
9305
9312
|
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9306
9313
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
9314
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9307
9315
|
* */
|
|
9308
9316
|
const drawtoolModuleConfig = {
|
|
9309
9317
|
id: 'drawtool-module',
|
|
@@ -9328,6 +9336,7 @@ const drawtoolModuleConfig = {
|
|
|
9328
9336
|
*
|
|
9329
9337
|
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9330
9338
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
9339
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9331
9340
|
* */
|
|
9332
9341
|
const getSingularDrawtoolDrawLayerId = mapId => `drawlayer-${mapId}`;
|
|
9333
9342
|
|
|
@@ -9613,6 +9622,7 @@ var storeTestUtils = /*#__PURE__*/Object.freeze({
|
|
|
9613
9622
|
*
|
|
9614
9623
|
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9615
9624
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
9625
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9616
9626
|
* */
|
|
9617
9627
|
function* addLayerActionsSaga({
|
|
9618
9628
|
payload,
|
|
@@ -9713,6 +9723,7 @@ function* rootSaga() {
|
|
|
9713
9723
|
*
|
|
9714
9724
|
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9715
9725
|
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
9726
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9716
9727
|
* */
|
|
9717
9728
|
const syncGroupsListener = createListenerMiddleware();
|
|
9718
9729
|
syncGroupsListener.startListening({
|
|
@@ -9788,6 +9799,7 @@ const synchronizationGroupConfig = {
|
|
|
9788
9799
|
*
|
|
9789
9800
|
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9790
9801
|
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
9802
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9791
9803
|
* */
|
|
9792
9804
|
const uiModuleConfig = {
|
|
9793
9805
|
id: 'ui-module',
|
|
@@ -9811,6 +9823,7 @@ const uiModuleConfig = {
|
|
|
9811
9823
|
*
|
|
9812
9824
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9813
9825
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
9826
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9814
9827
|
* */
|
|
9815
9828
|
const coreModuleConfig = [mapStoreModuleConfig, synchronizationGroupConfig, uiModuleConfig, drawtoolModuleConfig];
|
|
9816
9829
|
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@ export declare enum LayerActionOrigin {
|
|
|
13
13
|
layerManager = "layerManager",
|
|
14
14
|
wmsLoader = "WMSLayerTreeConnect",
|
|
15
15
|
ReactMapViewParseLayer = "ReactMapViewParseLayer",
|
|
16
|
-
|
|
16
|
+
updateLayerInformationListener = "updateLayerInformationListener",
|
|
17
17
|
toggleAutoUpdateListener = "toggleAutoUpdateListener",
|
|
18
18
|
unregisterMapSaga = "unregisterMapSaga"
|
|
19
19
|
}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { SagaIterator } from 'redux-saga';
|
|
2
2
|
import { mapActions } from '.';
|
|
3
|
-
import { layerActions } from '../layers';
|
|
4
3
|
import { Layer } from '../layers/types';
|
|
5
4
|
export declare const getAnimationEndTime: (animationEndTime: string) => string;
|
|
6
5
|
export declare const isAnimationEndTimeValid: (animationEndTime: string) => boolean;
|
|
7
|
-
export declare function deleteLayerSaga({ payload, }: ReturnType<typeof layerActions.layerDelete>): SagaIterator;
|
|
8
6
|
export declare function updateAnimation(mapId: string, maxValue: string): SagaIterator;
|
|
9
|
-
export declare function setLayerDimensionsSaga({ payload, }: ReturnType<typeof layerActions.onUpdateLayerInformation>): SagaIterator;
|
|
10
7
|
export declare function handleBaseLayersSaga(mapId: string, baseLayers: Layer[]): SagaIterator;
|
|
11
8
|
export declare function setMapPresetSaga({ payload, }: ReturnType<typeof mapActions.setMapPreset>): SagaIterator;
|
|
12
9
|
export declare function unregisterMapSaga({ payload, }: ReturnType<typeof mapActions.unregisterMap>): Generator;
|