@opengeoweb/store 12.11.0 → 12.12.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
CHANGED
|
@@ -1556,8 +1556,8 @@ var updateMinMaxValueWhenReferenceTimeChanges = function updateMinMaxValueWhenRe
|
|
|
1556
1556
|
if (wmLayer && wmLayer.dimensions.length >= 2) {
|
|
1557
1557
|
var referenceTimeDimension = wmLayer.getDimension('reference_time');
|
|
1558
1558
|
var timeDimension = wmLayer.getDimension('time');
|
|
1559
|
-
var reduxTimeDim = draftLayer.dimensions.find(function (
|
|
1560
|
-
return
|
|
1559
|
+
var reduxTimeDim = draftLayer.dimensions.find(function (dimension) {
|
|
1560
|
+
return dimension.name === 'time';
|
|
1561
1561
|
});
|
|
1562
1562
|
if (reduxTimeDim && timeDimension && referenceTimeDimension) {
|
|
1563
1563
|
// When the reference time changes, a new set of timevalues needs to be set in the layer.
|
|
@@ -2671,14 +2671,23 @@ var slice$4 = createSlice({
|
|
|
2671
2671
|
action) {},
|
|
2672
2672
|
setDefaultMapSettings: function setDefaultMapSettings(draft, action) {
|
|
2673
2673
|
draft.defaultMapSettings = action.payload.preset;
|
|
2674
|
+
},
|
|
2675
|
+
changeOverlayer: function changeOverlayer(draft, action) {
|
|
2676
|
+
var _action$payload26 = action.payload,
|
|
2677
|
+
mapId = _action$payload26.mapId,
|
|
2678
|
+
selectedOverlayer = _action$payload26.selectedOverlayer;
|
|
2679
|
+
if (!draft.byId[mapId]) {
|
|
2680
|
+
return;
|
|
2681
|
+
}
|
|
2682
|
+
draft.byId[mapId].overLayers = [selectedOverlayer];
|
|
2674
2683
|
}
|
|
2675
2684
|
},
|
|
2676
2685
|
extraReducers: function extraReducers(builder) {
|
|
2677
2686
|
builder.addCase(layerActions.addLayer, function (draft, action) {
|
|
2678
|
-
var _action$
|
|
2679
|
-
layerId = _action$
|
|
2680
|
-
mapId = _action$
|
|
2681
|
-
layer = _action$
|
|
2687
|
+
var _action$payload27 = action.payload,
|
|
2688
|
+
layerId = _action$payload27.layerId,
|
|
2689
|
+
mapId = _action$payload27.mapId,
|
|
2690
|
+
layer = _action$payload27.layer;
|
|
2682
2691
|
if (!draft.byId[mapId]) {
|
|
2683
2692
|
return;
|
|
2684
2693
|
}
|
|
@@ -2697,9 +2706,9 @@ var slice$4 = createSlice({
|
|
|
2697
2706
|
draft.byId[mapId].mapLayers.unshift(layerId);
|
|
2698
2707
|
}
|
|
2699
2708
|
}).addCase(layerActions.duplicateMapLayer, function (draft, action) {
|
|
2700
|
-
var _action$
|
|
2701
|
-
newLayerId = _action$
|
|
2702
|
-
mapId = _action$
|
|
2709
|
+
var _action$payload28 = action.payload,
|
|
2710
|
+
newLayerId = _action$payload28.newLayerId,
|
|
2711
|
+
mapId = _action$payload28.mapId;
|
|
2703
2712
|
if (!draft.byId[mapId]) {
|
|
2704
2713
|
return;
|
|
2705
2714
|
}
|
|
@@ -2709,10 +2718,10 @@ var slice$4 = createSlice({
|
|
|
2709
2718
|
}
|
|
2710
2719
|
draft.byId[mapId].mapLayers.unshift(newLayerId);
|
|
2711
2720
|
}).addCase(layerActions.addBaseLayer, function (draft, action) {
|
|
2712
|
-
var _action$
|
|
2713
|
-
layer = _action$
|
|
2714
|
-
layerId = _action$
|
|
2715
|
-
mapId = _action$
|
|
2721
|
+
var _action$payload29 = action.payload,
|
|
2722
|
+
layer = _action$payload29.layer,
|
|
2723
|
+
layerId = _action$payload29.layerId,
|
|
2724
|
+
mapId = _action$payload29.mapId;
|
|
2716
2725
|
if (!draft.byId[mapId]) {
|
|
2717
2726
|
return;
|
|
2718
2727
|
}
|
|
@@ -2742,9 +2751,9 @@ var slice$4 = createSlice({
|
|
|
2742
2751
|
draft.byId[mapId].autoTimeStepLayerId = activeLayerId;
|
|
2743
2752
|
}
|
|
2744
2753
|
}).addCase(layerActions.setBaseLayers, function (draft, action) {
|
|
2745
|
-
var _action$
|
|
2746
|
-
layers = _action$
|
|
2747
|
-
mapId = _action$
|
|
2754
|
+
var _action$payload30 = action.payload,
|
|
2755
|
+
layers = _action$payload30.layers,
|
|
2756
|
+
mapId = _action$payload30.mapId;
|
|
2748
2757
|
// Split into base and overlayers
|
|
2749
2758
|
var baseLayers = [];
|
|
2750
2759
|
var overLayers = [];
|
|
@@ -2774,9 +2783,9 @@ var slice$4 = createSlice({
|
|
|
2774
2783
|
}
|
|
2775
2784
|
}
|
|
2776
2785
|
}).addCase(layerActions.layerDelete, function (draft, action) {
|
|
2777
|
-
var _action$
|
|
2778
|
-
mapId = _action$
|
|
2779
|
-
layerId = _action$
|
|
2786
|
+
var _action$payload31 = action.payload,
|
|
2787
|
+
mapId = _action$payload31.mapId,
|
|
2788
|
+
layerId = _action$payload31.layerId;
|
|
2780
2789
|
var map = draft.byId[mapId];
|
|
2781
2790
|
if (!map) {
|
|
2782
2791
|
return;
|
|
@@ -2802,9 +2811,9 @@ var slice$4 = createSlice({
|
|
|
2802
2811
|
return id !== layerId;
|
|
2803
2812
|
});
|
|
2804
2813
|
}).addCase(layerActions.baseLayerDelete, function (draft, action) {
|
|
2805
|
-
var _action$
|
|
2806
|
-
mapId = _action$
|
|
2807
|
-
layerId = _action$
|
|
2814
|
+
var _action$payload32 = action.payload,
|
|
2815
|
+
mapId = _action$payload32.mapId,
|
|
2816
|
+
layerId = _action$payload32.layerId;
|
|
2808
2817
|
if (!draft.byId[mapId]) {
|
|
2809
2818
|
return;
|
|
2810
2819
|
}
|
|
@@ -2815,14 +2824,14 @@ var slice$4 = createSlice({
|
|
|
2815
2824
|
return id !== layerId;
|
|
2816
2825
|
});
|
|
2817
2826
|
}).addCase(layerActions.layerChangeDimension, function (draft, action) {
|
|
2818
|
-
var _action$
|
|
2819
|
-
layerId = _action$
|
|
2820
|
-
dimension = _action$
|
|
2827
|
+
var _action$payload33 = action.payload,
|
|
2828
|
+
layerId = _action$payload33.layerId,
|
|
2829
|
+
dimension = _action$payload33.dimension;
|
|
2821
2830
|
produceDraftStateSetMapDimensionFromLayerChangeDimension(draft, layerId, dimension);
|
|
2822
2831
|
}).addCase(setTimeSync, function (draft, action) {
|
|
2823
|
-
var _action$
|
|
2824
|
-
targetsFromAction = _action$
|
|
2825
|
-
source = _action$
|
|
2832
|
+
var _action$payload34 = action.payload,
|
|
2833
|
+
targetsFromAction = _action$payload34.targets,
|
|
2834
|
+
source = _action$payload34.source;
|
|
2826
2835
|
/* Because we want backwards compatibility with the previous code, we also need to listen to the original source action */
|
|
2827
2836
|
var targets = [];
|
|
2828
2837
|
if (source) {
|
|
@@ -2846,9 +2855,9 @@ var slice$4 = createSlice({
|
|
|
2846
2855
|
}
|
|
2847
2856
|
});
|
|
2848
2857
|
}).addCase(setBboxSync, function (draft, action) {
|
|
2849
|
-
var _action$
|
|
2850
|
-
targetsFromAction = _action$
|
|
2851
|
-
source = _action$
|
|
2858
|
+
var _action$payload35 = action.payload,
|
|
2859
|
+
targetsFromAction = _action$payload35.targets,
|
|
2860
|
+
source = _action$payload35.source;
|
|
2852
2861
|
/* Because we want backwards compatibility with the previous code, we also need to listen to the original source action */
|
|
2853
2862
|
var targets = [];
|
|
2854
2863
|
if (source) {
|
|
@@ -2880,9 +2889,9 @@ var slice$4 = createSlice({
|
|
|
2880
2889
|
* These targets can be used as payloads in new Layer actions.
|
|
2881
2890
|
* These actions are here handled via the layer reducer, as it is the same logic
|
|
2882
2891
|
*/
|
|
2883
|
-
var _action$
|
|
2884
|
-
targets = _action$
|
|
2885
|
-
source = _action$
|
|
2892
|
+
var _action$payload36 = action.payload,
|
|
2893
|
+
targets = _action$payload36.targets,
|
|
2894
|
+
source = _action$payload36.source;
|
|
2886
2895
|
return targets.reduce(function (prevState, target) {
|
|
2887
2896
|
var actionType = (source === null || source === void 0 ? void 0 : source.type) || 'GENERIC_SYNC_SETLAYERACTIONS';
|
|
2888
2897
|
var action = {
|
|
@@ -2904,9 +2913,9 @@ var slice$4 = createSlice({
|
|
|
2904
2913
|
});
|
|
2905
2914
|
return draft;
|
|
2906
2915
|
}).addCase(mapChangeDimension, function (draft, action) {
|
|
2907
|
-
var _action$
|
|
2908
|
-
mapId = _action$
|
|
2909
|
-
dimensionFromAction = _action$
|
|
2916
|
+
var _action$payload37 = action.payload,
|
|
2917
|
+
mapId = _action$payload37.mapId,
|
|
2918
|
+
dimensionFromAction = _action$payload37.dimension;
|
|
2910
2919
|
produceDraftStateSetWebMapDimension(draft, mapId, dimensionFromAction, true);
|
|
2911
2920
|
}).addCase(setMapPreset, function (draft, action) {
|
|
2912
2921
|
var mapId = action.payload.mapId;
|
|
@@ -2926,9 +2935,9 @@ var slice$4 = createSlice({
|
|
|
2926
2935
|
draft.byId[mapId].animationDelay = defaultAnimationDelayAtStart;
|
|
2927
2936
|
draft.byId[mapId].dockedLayerManagerSize = '';
|
|
2928
2937
|
}).addCase(uiActions.registerDialog, function (draft, action) {
|
|
2929
|
-
var _action$
|
|
2930
|
-
mapId = _action$
|
|
2931
|
-
type = _action$
|
|
2938
|
+
var _action$payload38 = action.payload,
|
|
2939
|
+
mapId = _action$payload38.mapId,
|
|
2940
|
+
type = _action$payload38.type;
|
|
2932
2941
|
if (!draft.byId[mapId]) {
|
|
2933
2942
|
return;
|
|
2934
2943
|
}
|
|
@@ -3362,6 +3371,27 @@ var getTimeStepForLayerId = createSelector(getLayerTimeDimension, function (time
|
|
|
3362
3371
|
var getActiveLayerInfo = createSelector(layerStore, function (store) {
|
|
3363
3372
|
return store === null || store === void 0 ? void 0 : store.activeLayerInfo;
|
|
3364
3373
|
});
|
|
3374
|
+
/**
|
|
3375
|
+
* Gets all overlayers for a given mapId
|
|
3376
|
+
* Example: overlayers = getOverlayersForMapId(store, 'mapId123')
|
|
3377
|
+
* @param {CoreAppStore} store - The Redux store from which the layers state will be extracted.
|
|
3378
|
+
* @param {string} mapId - The ID of the map for which to retrieve the overlayers.
|
|
3379
|
+
* @returns {Array<{ id: string; name: string }>} - An array of overlayers containing layer information (id and name).
|
|
3380
|
+
*/
|
|
3381
|
+
var getOverlayersForMapId = createSelector([layerStore, function (_store, mapId) {
|
|
3382
|
+
return mapId;
|
|
3383
|
+
}], function (store, mapId) {
|
|
3384
|
+
var overLayers = [];
|
|
3385
|
+
(store === null || store === void 0 ? void 0 : store.byId) && Object.values(store.byId).forEach(function (layer) {
|
|
3386
|
+
if (layer.layerType === LayerType.overLayer && layer.mapId === mapId) {
|
|
3387
|
+
overLayers.push({
|
|
3388
|
+
id: layer.id || '',
|
|
3389
|
+
name: layer.name || ''
|
|
3390
|
+
});
|
|
3391
|
+
}
|
|
3392
|
+
});
|
|
3393
|
+
return overLayers;
|
|
3394
|
+
}, selectorMemoizationOptions);
|
|
3365
3395
|
|
|
3366
3396
|
var selectors$6 = /*#__PURE__*/Object.freeze({
|
|
3367
3397
|
__proto__: null,
|
|
@@ -3397,6 +3427,7 @@ var selectors$6 = /*#__PURE__*/Object.freeze({
|
|
|
3397
3427
|
getLayersByMapId: getLayersByMapId,
|
|
3398
3428
|
getLayersIds: getLayersIds,
|
|
3399
3429
|
getOverLayers: getOverLayers,
|
|
3430
|
+
getOverlayersForMapId: getOverlayersForMapId,
|
|
3400
3431
|
getSelectedFeatureIndex: getSelectedFeatureIndex,
|
|
3401
3432
|
getTimeStepForLayerId: getTimeStepForLayerId,
|
|
3402
3433
|
getUseLatestReferenceTime: getUseLatestReferenceTime
|
|
@@ -3772,18 +3803,18 @@ var constants$2 = /*#__PURE__*/Object.freeze({
|
|
|
3772
3803
|
* @param condition Function to check each element in the array
|
|
3773
3804
|
*/
|
|
3774
3805
|
var removeInPlace = function removeInPlace(inDraftArray, condition) {
|
|
3775
|
-
var
|
|
3806
|
+
var index = 0;
|
|
3776
3807
|
inDraftArray.forEach(function (e, i) {
|
|
3777
3808
|
if (!condition(e)) {
|
|
3778
|
-
if (i !==
|
|
3809
|
+
if (i !== index) {
|
|
3779
3810
|
// eslint-disable-next-line no-param-reassign
|
|
3780
|
-
inDraftArray[
|
|
3811
|
+
inDraftArray[index] = e;
|
|
3781
3812
|
}
|
|
3782
|
-
|
|
3813
|
+
index += 1;
|
|
3783
3814
|
}
|
|
3784
3815
|
});
|
|
3785
3816
|
// eslint-disable-next-line no-param-reassign
|
|
3786
|
-
inDraftArray.length =
|
|
3817
|
+
inDraftArray.length = index;
|
|
3787
3818
|
};
|
|
3788
3819
|
|
|
3789
3820
|
var initialState$2 = {
|
|
@@ -5516,7 +5547,9 @@ var getLegendId = createSelector(getMapById, function (store) {
|
|
|
5516
5547
|
* @param {string} mapId mapId: string - Id of the map
|
|
5517
5548
|
* @returns {MapPreset} returnType: MapPreset
|
|
5518
5549
|
*/
|
|
5519
|
-
var getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLayers, getBbox, getSrs, getActiveLayerId, getAutoTimeStepLayerId, getAutoUpdateLayerId, isAnimating, isAutoUpdating, isTimeSliderVisible, getDisplayMapPin, isZoomControlsVisible, getMapTimeStep, getMapAnimationDelay, getAnimationStartTime, getAnimationEndTime, getMapTimeSliderSpan, isTimestepAuto, isTimeSpanAuto, getLegendId, getUiStore, function (
|
|
5550
|
+
var getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLayers, getBbox, getSrs, getActiveLayerId, getAutoTimeStepLayerId, getAutoUpdateLayerId, isAnimating, isAutoUpdating, isTimeSliderVisible, getDisplayMapPin, isZoomControlsVisible, getMapTimeStep, getMapAnimationDelay, getAnimationStartTime, getAnimationEndTime, getMapTimeSliderSpan, isTimestepAuto, isTimeSpanAuto, getLegendId, getUiStore, function (_store, mapId) {
|
|
5551
|
+
return mapId;
|
|
5552
|
+
}, function (mapLayers, baseLayers, overLayers, bbox, srs, activeLayerId, autoTimeStepLayerId, autoUpdateLayerId, isAnimating, isAutoUpdating, isTimeSliderVisible, displayMapPin, isZoomControlsVisible, mapTimeStep, mapAnimationDelay, animationStartTime, animationEndTime, timeSliderSpan, isTimestepAuto, isTimeSpanAuto, legendId, uiStore, mapId) {
|
|
5520
5553
|
var _uiStore$dialogs$lege;
|
|
5521
5554
|
var allLayers = [].concat(_toConsumableArray(baseLayers), _toConsumableArray(overLayers), _toConsumableArray(mapLayers)).map(function (_ref3) {
|
|
5522
5555
|
_ref3.mapId;
|
|
@@ -5538,6 +5571,8 @@ var getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLaye
|
|
|
5538
5571
|
duration: getAnimationDuration(animationEndTime, animationStartTime)
|
|
5539
5572
|
};
|
|
5540
5573
|
var shouldShowLegend = legendId ? uiStore === null || uiStore === void 0 || (_uiStore$dialogs$lege = uiStore.dialogs[legendId]) === null || _uiStore$dialogs$lege === void 0 ? void 0 : _uiStore$dialogs$lege.isOpen : false;
|
|
5574
|
+
var dataExplorerDialog = uiStore === null || uiStore === void 0 ? void 0 : uiStore.dialogs[DialogTypes.DataExplorer];
|
|
5575
|
+
var shouldShowDataExplorer = (dataExplorerDialog === null || dataExplorerDialog === void 0 ? void 0 : dataExplorerDialog.isOpen) && (dataExplorerDialog === null || dataExplorerDialog === void 0 ? void 0 : dataExplorerDialog.activeMapId) === mapId || false;
|
|
5541
5576
|
return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
5542
5577
|
layers: allLayers
|
|
5543
5578
|
}, activeLayerId !== undefined && {
|
|
@@ -5560,7 +5595,8 @@ var getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLaye
|
|
|
5560
5595
|
toggleTimestepAuto: isTimestepAuto,
|
|
5561
5596
|
toggleTimeSpanAuto: isTimeSpanAuto,
|
|
5562
5597
|
shouldShowLegend: shouldShowLegend,
|
|
5563
|
-
timeSliderSpan: timeSliderSpan
|
|
5598
|
+
timeSliderSpan: timeSliderSpan,
|
|
5599
|
+
shouldShowDataExplorer: shouldShowDataExplorer
|
|
5564
5600
|
});
|
|
5565
5601
|
}, selectorMemoizationOptions);
|
|
5566
5602
|
/**
|
|
@@ -5683,6 +5719,15 @@ var getdefaultMapSettings = createSelector(getMapStore, function (state) {
|
|
|
5683
5719
|
var getdefaultMapSettingsLayers = createSelector(getdefaultMapSettings, function (state) {
|
|
5684
5720
|
return state && state.layers;
|
|
5685
5721
|
}, selectorMemoizationOptions);
|
|
5722
|
+
/**
|
|
5723
|
+
* Gets the selected overlayer from webmap state
|
|
5724
|
+
*
|
|
5725
|
+
* @param {CoreAppStore} store - The Redux store from which the layers state will be extracted.
|
|
5726
|
+
* @returns {string | null} returnType: string | null
|
|
5727
|
+
*/
|
|
5728
|
+
var getSelectedOverlayerByMapId = createSelector(getMapById, function (store) {
|
|
5729
|
+
return (store === null || store === void 0 ? void 0 : store.overLayers[0]) || null;
|
|
5730
|
+
}, selectorMemoizationOptions);
|
|
5686
5731
|
|
|
5687
5732
|
var selectors$1 = /*#__PURE__*/Object.freeze({
|
|
5688
5733
|
__proto__: null,
|
|
@@ -5733,6 +5778,7 @@ var selectors$1 = /*#__PURE__*/Object.freeze({
|
|
|
5733
5778
|
getMapTimeStep: getMapTimeStep,
|
|
5734
5779
|
getMapTimeStepWithoutDefault: getMapTimeStepWithoutDefault,
|
|
5735
5780
|
getPinLocation: getPinLocation,
|
|
5781
|
+
getSelectedOverlayerByMapId: getSelectedOverlayerByMapId,
|
|
5736
5782
|
getSelectedTime: getSelectedTime,
|
|
5737
5783
|
getSrs: getSrs,
|
|
5738
5784
|
getdefaultMapSettings: getdefaultMapSettings,
|
|
@@ -6574,27 +6620,27 @@ var isNextStepAvailable = function isNextStepAvailable(reduxLayers, nextTimeStri
|
|
|
6574
6620
|
// Get all wmLayers for the found id's
|
|
6575
6621
|
var wmLayers = reduxLayers.map(function (reduxLayer) {
|
|
6576
6622
|
return reduxLayer.id && getWMLayerById(reduxLayer.id);
|
|
6577
|
-
}).filter(function (
|
|
6578
|
-
return !!
|
|
6623
|
+
}).filter(function (layer) {
|
|
6624
|
+
return !!layer;
|
|
6579
6625
|
});
|
|
6580
6626
|
// Returns a layer which could have an image for the requested time, but which isn't loaded yet.
|
|
6581
|
-
var isThereSomethingNotAvailable = wmLayers.map(function (
|
|
6582
|
-
var
|
|
6583
|
-
if (!
|
|
6627
|
+
var isThereSomethingNotAvailable = wmLayers.map(function (layer) {
|
|
6628
|
+
var _layer$getDimension;
|
|
6629
|
+
if (!layer || !layer.olSource) {
|
|
6584
6630
|
// No OpenLayers source, do nothing, so do not flag that something is not available
|
|
6585
6631
|
return {
|
|
6586
6632
|
status: true
|
|
6587
6633
|
};
|
|
6588
6634
|
}
|
|
6589
6635
|
// Check if there is a timevalue available
|
|
6590
|
-
var closestValue = (
|
|
6636
|
+
var closestValue = (_layer$getDimension = layer.getDimension('time')) === null || _layer$getDimension === void 0 ? void 0 : _layer$getDimension.getClosestValue(nextTimeString);
|
|
6591
6637
|
if (!closestValue || WMInvalidDateValues.has(closestValue)) {
|
|
6592
6638
|
// No value available, so do not flag that something is not available
|
|
6593
6639
|
return {
|
|
6594
6640
|
status: true
|
|
6595
6641
|
};
|
|
6596
6642
|
}
|
|
6597
|
-
var olSource =
|
|
6643
|
+
var olSource = layer.olSource;
|
|
6598
6644
|
var hasImageAvailableForRequestedTimeStep = olSource.hasImageForTimeValue(closestValue);
|
|
6599
6645
|
// If there is no image available for requested timestep, return true and flag that this thing is not ready yet.
|
|
6600
6646
|
if (hasImageAvailableForRequestedTimeStep) {
|
|
@@ -6607,8 +6653,8 @@ var isNextStepAvailable = function isNextStepAvailable(reduxLayers, nextTimeStri
|
|
|
6607
6653
|
status: false
|
|
6608
6654
|
};
|
|
6609
6655
|
});
|
|
6610
|
-
var nextStepIsAvailable = isThereSomethingNotAvailable.filter(function (
|
|
6611
|
-
return
|
|
6656
|
+
var nextStepIsAvailable = isThereSomethingNotAvailable.filter(function (step) {
|
|
6657
|
+
return step.status === true;
|
|
6612
6658
|
}).length === wmLayers.length;
|
|
6613
6659
|
return nextStepIsAvailable;
|
|
6614
6660
|
};
|
|
@@ -6645,8 +6691,8 @@ var olMetronomeHandler = function olMetronomeHandler(timerIds, listenerApi) {
|
|
|
6645
6691
|
// Collect all layers for this syncgroups target
|
|
6646
6692
|
var reduxLayers = [];
|
|
6647
6693
|
targets.forEach(function (target) {
|
|
6648
|
-
reduxLayers.push.apply(reduxLayers, _toConsumableArray(getLayersByMapId(listenerApi.getState(), target.targetId).filter(function (
|
|
6649
|
-
return
|
|
6694
|
+
reduxLayers.push.apply(reduxLayers, _toConsumableArray(getLayersByMapId(listenerApi.getState(), target.targetId).filter(function (layer) {
|
|
6695
|
+
return layer.layerType === LayerType.mapLayer;
|
|
6650
6696
|
})));
|
|
6651
6697
|
});
|
|
6652
6698
|
var nextStep = getNextStep(timerId, animationListValues.length, 1);
|
|
@@ -6948,7 +6994,7 @@ mapListener.startListening({
|
|
|
6948
6994
|
actionCreator: mapActions.setMapPreset,
|
|
6949
6995
|
effect: function () {
|
|
6950
6996
|
var _effect2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref6, listenerApi) {
|
|
6951
|
-
var payload, mapId, initialProps, mapPreset, layers, activeLayerId, autoTimeStepLayerId, autoUpdateLayerId, proj, shouldAutoUpdate, shouldAnimate, animationPayload, toggleTimestepAuto, showTimeSlider, displayMapPin, shouldShowZoomControls, shouldShowLegend, dockedLayerManagerSize, timeSliderSpan, toggleTimeSpanAuto, _filterLayers, mapLayers, baseLayers, overLayers, _newLayerIds$layers$f, _newLayerIds$layers$f2, autoTimeStepLayerIdNew, autoUpdateLayerIdNew, onlyActiveLayerIdIsSet, newLayerIds, newAutoTimeStepLayerId, newAutoUpdateLayerId, customLayers, customBaseLayer, customOverLayer, baseLayersWithDefaultLayer, overLayersWithDefaultLayer, allBaseLayers, checkIsprojectionSupported, animationLength, animationEndTime, shouldEndtimeOverride, interval, endTime, startTime, centerTimeInSeconds, animationEnd, _startTime, duration, _animationEnd, animationStart, shouldOpenLegend, legendId, fiveMinuteDelayForAnimation, _animationEnd2, _animationStart;
|
|
6997
|
+
var payload, mapId, initialProps, mapPreset, layers, activeLayerId, autoTimeStepLayerId, autoUpdateLayerId, proj, shouldAutoUpdate, shouldAnimate, animationPayload, toggleTimestepAuto, showTimeSlider, displayMapPin, shouldShowZoomControls, shouldShowLegend, shouldShowDataExplorer, dockedLayerManagerSize, timeSliderSpan, toggleTimeSpanAuto, _filterLayers, mapLayers, baseLayers, overLayers, _newLayerIds$layers$f, _newLayerIds$layers$f2, autoTimeStepLayerIdNew, autoUpdateLayerIdNew, onlyActiveLayerIdIsSet, newLayerIds, newAutoTimeStepLayerId, newAutoUpdateLayerId, customLayers, customBaseLayer, customOverLayer, baseLayersWithDefaultLayer, overLayersWithDefaultLayer, allBaseLayers, checkIsprojectionSupported, animationLength, animationEndTime, shouldEndtimeOverride, interval, endTime, startTime, centerTimeInSeconds, animationEnd, _startTime, duration, _animationEnd, animationStart, shouldOpenLegend, legendId, fiveMinuteDelayForAnimation, _animationEnd2, _animationStart;
|
|
6952
6998
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
6953
6999
|
while (1) switch (_context2.prev = _context2.next) {
|
|
6954
7000
|
case 0:
|
|
@@ -6957,10 +7003,10 @@ mapListener.startListening({
|
|
|
6957
7003
|
mapId = payload.mapId, initialProps = payload.initialProps;
|
|
6958
7004
|
mapPreset = initialProps.mapPreset;
|
|
6959
7005
|
if (!mapPreset) {
|
|
6960
|
-
_context2.next =
|
|
7006
|
+
_context2.next = 51;
|
|
6961
7007
|
break;
|
|
6962
7008
|
}
|
|
6963
|
-
layers = mapPreset.layers, activeLayerId = mapPreset.activeLayerId, autoTimeStepLayerId = mapPreset.autoTimeStepLayerId, autoUpdateLayerId = mapPreset.autoUpdateLayerId, proj = mapPreset.proj, shouldAutoUpdate = mapPreset.shouldAutoUpdate, shouldAnimate = mapPreset.shouldAnimate, animationPayload = mapPreset.animationPayload, toggleTimestepAuto = mapPreset.toggleTimestepAuto, showTimeSlider = mapPreset.showTimeSlider, displayMapPin = mapPreset.displayMapPin, shouldShowZoomControls = mapPreset.shouldShowZoomControls, shouldShowLegend = mapPreset.shouldShowLegend, dockedLayerManagerSize = mapPreset.dockedLayerManagerSize, timeSliderSpan = mapPreset.timeSliderSpan, toggleTimeSpanAuto = mapPreset.toggleTimeSpanAuto;
|
|
7009
|
+
layers = mapPreset.layers, activeLayerId = mapPreset.activeLayerId, autoTimeStepLayerId = mapPreset.autoTimeStepLayerId, autoUpdateLayerId = mapPreset.autoUpdateLayerId, proj = mapPreset.proj, shouldAutoUpdate = mapPreset.shouldAutoUpdate, shouldAnimate = mapPreset.shouldAnimate, animationPayload = mapPreset.animationPayload, toggleTimestepAuto = mapPreset.toggleTimestepAuto, showTimeSlider = mapPreset.showTimeSlider, displayMapPin = mapPreset.displayMapPin, shouldShowZoomControls = mapPreset.shouldShowZoomControls, shouldShowLegend = mapPreset.shouldShowLegend, shouldShowDataExplorer = mapPreset.shouldShowDataExplorer, dockedLayerManagerSize = mapPreset.dockedLayerManagerSize, timeSliderSpan = mapPreset.timeSliderSpan, toggleTimeSpanAuto = mapPreset.toggleTimeSpanAuto;
|
|
6964
7010
|
_filterLayers = filterLayers(layers), mapLayers = _filterLayers.mapLayers, baseLayers = _filterLayers.baseLayers, overLayers = _filterLayers.overLayers;
|
|
6965
7011
|
if (layers) {
|
|
6966
7012
|
// make sure all layers have a unique id before going forward
|
|
@@ -7167,21 +7213,30 @@ mapListener.startListening({
|
|
|
7167
7213
|
setOpen: shouldOpenLegend
|
|
7168
7214
|
}));
|
|
7169
7215
|
}
|
|
7216
|
+
// show data explorer
|
|
7217
|
+
if (shouldShowDataExplorer) {
|
|
7218
|
+
listenerApi.dispatch(uiActions.setActiveMapIdForDialog({
|
|
7219
|
+
type: DialogTypes.DataExplorer,
|
|
7220
|
+
setOpen: true,
|
|
7221
|
+
source: 'app',
|
|
7222
|
+
mapId: mapId
|
|
7223
|
+
}));
|
|
7224
|
+
}
|
|
7170
7225
|
if (dockedLayerManagerSize) {
|
|
7171
7226
|
listenerApi.dispatch(mapActions.setDockedLayerManagerSize({
|
|
7172
7227
|
mapId: mapId,
|
|
7173
7228
|
dockedLayerManagerSize: dockedLayerManagerSize
|
|
7174
7229
|
}));
|
|
7175
7230
|
}
|
|
7176
|
-
case
|
|
7231
|
+
case 41:
|
|
7177
7232
|
if (!(animationEndTime && (shouldEndtimeOverride || !(shouldAutoUpdate || shouldAnimate)))) {
|
|
7178
|
-
_context2.next =
|
|
7233
|
+
_context2.next = 51;
|
|
7179
7234
|
break;
|
|
7180
7235
|
}
|
|
7181
7236
|
fiveMinuteDelayForAnimation = 1000 * 60 * 5; // eslint-disable-next-line no-await-in-loop
|
|
7182
|
-
_context2.next =
|
|
7237
|
+
_context2.next = 45;
|
|
7183
7238
|
return listenerApi.delay(fiveMinuteDelayForAnimation);
|
|
7184
|
-
case
|
|
7239
|
+
case 45:
|
|
7185
7240
|
_animationEnd2 = getAnimationEndTime(listenerApi.getState(), mapId);
|
|
7186
7241
|
listenerApi.dispatch(mapActions.setAnimationEndTime({
|
|
7187
7242
|
mapId: mapId,
|
|
@@ -7196,13 +7251,13 @@ mapListener.startListening({
|
|
|
7196
7251
|
minutes: 5
|
|
7197
7252
|
}).toISOString()
|
|
7198
7253
|
}));
|
|
7199
|
-
_context2.next =
|
|
7254
|
+
_context2.next = 41;
|
|
7200
7255
|
break;
|
|
7201
|
-
case
|
|
7202
|
-
_context2.next =
|
|
7256
|
+
case 51:
|
|
7257
|
+
_context2.next = 56;
|
|
7203
7258
|
break;
|
|
7204
|
-
case
|
|
7205
|
-
_context2.prev =
|
|
7259
|
+
case 53:
|
|
7260
|
+
_context2.prev = 53;
|
|
7206
7261
|
_context2.t0 = _context2["catch"](1);
|
|
7207
7262
|
if (_context2.t0 instanceof Error) {
|
|
7208
7263
|
listenerApi.dispatch(mapActions.setMapPresetError({
|
|
@@ -7210,11 +7265,11 @@ mapListener.startListening({
|
|
|
7210
7265
|
error: _context2.t0.message
|
|
7211
7266
|
}));
|
|
7212
7267
|
}
|
|
7213
|
-
case
|
|
7268
|
+
case 56:
|
|
7214
7269
|
case "end":
|
|
7215
7270
|
return _context2.stop();
|
|
7216
7271
|
}
|
|
7217
|
-
}, _callee2, null, [[1,
|
|
7272
|
+
}, _callee2, null, [[1, 53]]);
|
|
7218
7273
|
}));
|
|
7219
7274
|
function effect(_x3, _x4) {
|
|
7220
7275
|
return _effect2.apply(this, arguments);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/store",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.12.0",
|
|
4
4
|
"description": "GeoWeb Store library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
"url": "git@gitlab.com:opengeoweb/opengeoweb.git"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@opengeoweb/shared": "12.
|
|
11
|
+
"@opengeoweb/shared": "12.12.0",
|
|
12
12
|
"react-redux": "^9.2.0",
|
|
13
13
|
"@reduxjs/toolkit": "^2.6.1",
|
|
14
|
-
"@opengeoweb/webmap-react": "12.
|
|
15
|
-
"@opengeoweb/webmap": "12.
|
|
14
|
+
"@opengeoweb/webmap-react": "12.12.0",
|
|
15
|
+
"@opengeoweb/webmap": "12.12.0",
|
|
16
16
|
"immer": "^10.0.3",
|
|
17
17
|
"lodash": "^4.17.21",
|
|
18
|
-
"@opengeoweb/metronome": "12.
|
|
19
|
-
"@opengeoweb/timeslider": "12.
|
|
18
|
+
"@opengeoweb/metronome": "12.12.0",
|
|
19
|
+
"@opengeoweb/timeslider": "12.12.0",
|
|
20
20
|
"react-router-dom": "^6.23.1",
|
|
21
21
|
"ol": "^10.4.0",
|
|
22
22
|
"@turf/turf": "^7.2.0",
|
|
@@ -2120,3 +2120,43 @@ export declare const getActiveLayerInfo: ((state: CoreAppStore) => {
|
|
|
2120
2120
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
2121
2121
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
2122
2122
|
};
|
|
2123
|
+
/**
|
|
2124
|
+
* Gets all overlayers for a given mapId
|
|
2125
|
+
* Example: overlayers = getOverlayersForMapId(store, 'mapId123')
|
|
2126
|
+
* @param {CoreAppStore} store - The Redux store from which the layers state will be extracted.
|
|
2127
|
+
* @param {string} mapId - The ID of the map for which to retrieve the overlayers.
|
|
2128
|
+
* @returns {Array<{ id: string; name: string }>} - An array of overlayers containing layer information (id and name).
|
|
2129
|
+
*/
|
|
2130
|
+
export declare const getOverlayersForMapId: ((state: CoreAppStore, mapId: string) => {
|
|
2131
|
+
id: string;
|
|
2132
|
+
name: string;
|
|
2133
|
+
}[]) & {
|
|
2134
|
+
clearCache: () => void;
|
|
2135
|
+
resultsCount: () => number;
|
|
2136
|
+
resetResultsCount: () => void;
|
|
2137
|
+
} & {
|
|
2138
|
+
resultFunc: (resultFuncArgs_0: LayerState | undefined, resultFuncArgs_1: string) => {
|
|
2139
|
+
id: string;
|
|
2140
|
+
name: string;
|
|
2141
|
+
}[];
|
|
2142
|
+
memoizedResultFunc: ((resultFuncArgs_0: LayerState | undefined, resultFuncArgs_1: string) => {
|
|
2143
|
+
id: string;
|
|
2144
|
+
name: string;
|
|
2145
|
+
}[]) & {
|
|
2146
|
+
clearCache: () => void;
|
|
2147
|
+
resultsCount: () => number;
|
|
2148
|
+
resetResultsCount: () => void;
|
|
2149
|
+
};
|
|
2150
|
+
lastResult: () => {
|
|
2151
|
+
id: string;
|
|
2152
|
+
name: string;
|
|
2153
|
+
}[];
|
|
2154
|
+
dependencies: [(store: CoreAppStore) => LayerState | undefined, (_store: CoreAppStore, mapId: string) => string];
|
|
2155
|
+
recomputations: () => number;
|
|
2156
|
+
resetRecomputations: () => void;
|
|
2157
|
+
dependencyRecomputations: () => number;
|
|
2158
|
+
resetDependencyRecomputations: () => void;
|
|
2159
|
+
} & {
|
|
2160
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
2161
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
2162
|
+
};
|
|
@@ -60,6 +60,10 @@ export declare const slice: import("@reduxjs/toolkit").Slice<WebMapState, {
|
|
|
60
60
|
error: string;
|
|
61
61
|
}>) => void;
|
|
62
62
|
setDefaultMapSettings: (draft: Draft<WebMapState>, action: PayloadAction<SetDefaultMapSettingsPayload>) => void;
|
|
63
|
+
changeOverlayer: (draft: Draft<WebMapState>, action: PayloadAction<{
|
|
64
|
+
mapId: string;
|
|
65
|
+
selectedOverlayer: string;
|
|
66
|
+
}>) => void;
|
|
63
67
|
}, "mapReducer", "mapReducer", import("@reduxjs/toolkit").SliceSelectors<WebMapState>>;
|
|
64
68
|
export declare const mapActions: {
|
|
65
69
|
setMapPreset: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./types").SetMapPresetPayload, string>;
|
|
@@ -112,5 +116,9 @@ export declare const mapActions: {
|
|
|
112
116
|
error: string;
|
|
113
117
|
}, "mapReducer/setMapPresetError">;
|
|
114
118
|
setDefaultMapSettings: import("@reduxjs/toolkit").ActionCreatorWithPayload<SetDefaultMapSettingsPayload, "mapReducer/setDefaultMapSettings">;
|
|
119
|
+
changeOverlayer: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
120
|
+
mapId: string;
|
|
121
|
+
selectedOverlayer: string;
|
|
122
|
+
}, "mapReducer/changeOverlayer">;
|
|
115
123
|
};
|
|
116
124
|
export declare const mapReducer: import("redux").Reducer<WebMapState>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Bbox, MapPreset, WebMap, WebMapState } from './types';
|
|
2
2
|
import type { CoreAppStore } from '../../types';
|
|
3
|
+
import { uiTypes } from '../../ui';
|
|
3
4
|
import type { Dimension, Layer, ReduxLayer, TimeSliderStartCenterEndTime, WebMapAnimationList } from '../types';
|
|
4
|
-
import type { uiTypes } from '../../ui';
|
|
5
5
|
/**
|
|
6
6
|
* Gets the map state by mapId
|
|
7
7
|
*
|
|
@@ -2051,8 +2051,8 @@ export declare const getMapPreset: ((state: CoreAppStore & uiTypes.UIModuleState
|
|
|
2051
2051
|
resultsCount: () => number;
|
|
2052
2052
|
resetResultsCount: () => void;
|
|
2053
2053
|
} & {
|
|
2054
|
-
resultFunc: (resultFuncArgs_0: ReduxLayer[], resultFuncArgs_1: ReduxLayer[], resultFuncArgs_2: ReduxLayer[], resultFuncArgs_3: Bbox, resultFuncArgs_4: string, resultFuncArgs_5: string | undefined, resultFuncArgs_6: string | undefined, resultFuncArgs_7: string | undefined, resultFuncArgs_8: boolean, resultFuncArgs_9: boolean, resultFuncArgs_10: boolean | undefined, resultFuncArgs_11: boolean | undefined, resultFuncArgs_12: boolean | undefined, resultFuncArgs_13: number, resultFuncArgs_14: number | undefined, resultFuncArgs_15: string | undefined, resultFuncArgs_16: string | undefined, resultFuncArgs_17: number | undefined, resultFuncArgs_18: boolean | undefined, resultFuncArgs_19: boolean | undefined, resultFuncArgs_20: string | undefined, resultFuncArgs_21: uiTypes.UIStoreType) => MapPreset;
|
|
2055
|
-
memoizedResultFunc: ((resultFuncArgs_0: ReduxLayer[], resultFuncArgs_1: ReduxLayer[], resultFuncArgs_2: ReduxLayer[], resultFuncArgs_3: Bbox, resultFuncArgs_4: string, resultFuncArgs_5: string | undefined, resultFuncArgs_6: string | undefined, resultFuncArgs_7: string | undefined, resultFuncArgs_8: boolean, resultFuncArgs_9: boolean, resultFuncArgs_10: boolean | undefined, resultFuncArgs_11: boolean | undefined, resultFuncArgs_12: boolean | undefined, resultFuncArgs_13: number, resultFuncArgs_14: number | undefined, resultFuncArgs_15: string | undefined, resultFuncArgs_16: string | undefined, resultFuncArgs_17: number | undefined, resultFuncArgs_18: boolean | undefined, resultFuncArgs_19: boolean | undefined, resultFuncArgs_20: string | undefined, resultFuncArgs_21: uiTypes.UIStoreType) => MapPreset) & {
|
|
2054
|
+
resultFunc: (resultFuncArgs_0: ReduxLayer[], resultFuncArgs_1: ReduxLayer[], resultFuncArgs_2: ReduxLayer[], resultFuncArgs_3: Bbox, resultFuncArgs_4: string, resultFuncArgs_5: string | undefined, resultFuncArgs_6: string | undefined, resultFuncArgs_7: string | undefined, resultFuncArgs_8: boolean, resultFuncArgs_9: boolean, resultFuncArgs_10: boolean | undefined, resultFuncArgs_11: boolean | undefined, resultFuncArgs_12: boolean | undefined, resultFuncArgs_13: number, resultFuncArgs_14: number | undefined, resultFuncArgs_15: string | undefined, resultFuncArgs_16: string | undefined, resultFuncArgs_17: number | undefined, resultFuncArgs_18: boolean | undefined, resultFuncArgs_19: boolean | undefined, resultFuncArgs_20: string | undefined, resultFuncArgs_21: uiTypes.UIStoreType, resultFuncArgs_22: string) => MapPreset;
|
|
2055
|
+
memoizedResultFunc: ((resultFuncArgs_0: ReduxLayer[], resultFuncArgs_1: ReduxLayer[], resultFuncArgs_2: ReduxLayer[], resultFuncArgs_3: Bbox, resultFuncArgs_4: string, resultFuncArgs_5: string | undefined, resultFuncArgs_6: string | undefined, resultFuncArgs_7: string | undefined, resultFuncArgs_8: boolean, resultFuncArgs_9: boolean, resultFuncArgs_10: boolean | undefined, resultFuncArgs_11: boolean | undefined, resultFuncArgs_12: boolean | undefined, resultFuncArgs_13: number, resultFuncArgs_14: number | undefined, resultFuncArgs_15: string | undefined, resultFuncArgs_16: string | undefined, resultFuncArgs_17: number | undefined, resultFuncArgs_18: boolean | undefined, resultFuncArgs_19: boolean | undefined, resultFuncArgs_20: string | undefined, resultFuncArgs_21: uiTypes.UIStoreType, resultFuncArgs_22: string) => MapPreset) & {
|
|
2056
2056
|
clearCache: () => void;
|
|
2057
2057
|
resultsCount: () => number;
|
|
2058
2058
|
resetResultsCount: () => void;
|
|
@@ -2578,7 +2578,7 @@ export declare const getMapPreset: ((state: CoreAppStore & uiTypes.UIModuleState
|
|
|
2578
2578
|
} & {
|
|
2579
2579
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
2580
2580
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
2581
|
-
}, (store: uiTypes.UIModuleState) => uiTypes.UIStoreType];
|
|
2581
|
+
}, (store: uiTypes.UIModuleState) => uiTypes.UIStoreType, (_store: CoreAppStore, mapId: string) => string];
|
|
2582
2582
|
recomputations: () => number;
|
|
2583
2583
|
resetRecomputations: () => void;
|
|
2584
2584
|
dependencyRecomputations: () => number;
|
|
@@ -3094,3 +3094,30 @@ export declare const getdefaultMapSettingsLayers: ((state: CoreAppStore) => Laye
|
|
|
3094
3094
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
3095
3095
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
3096
3096
|
};
|
|
3097
|
+
/**
|
|
3098
|
+
* Gets the selected overlayer from webmap state
|
|
3099
|
+
*
|
|
3100
|
+
* @param {CoreAppStore} store - The Redux store from which the layers state will be extracted.
|
|
3101
|
+
* @returns {string | null} returnType: string | null
|
|
3102
|
+
*/
|
|
3103
|
+
export declare const getSelectedOverlayerByMapId: ((state: CoreAppStore, mapId: string) => string | null) & {
|
|
3104
|
+
clearCache: () => void;
|
|
3105
|
+
resultsCount: () => number;
|
|
3106
|
+
resetResultsCount: () => void;
|
|
3107
|
+
} & {
|
|
3108
|
+
resultFunc: (resultFuncArgs_0: WebMap | undefined) => string | null;
|
|
3109
|
+
memoizedResultFunc: ((resultFuncArgs_0: WebMap | undefined) => string | null) & {
|
|
3110
|
+
clearCache: () => void;
|
|
3111
|
+
resultsCount: () => number;
|
|
3112
|
+
resetResultsCount: () => void;
|
|
3113
|
+
};
|
|
3114
|
+
lastResult: () => string | null;
|
|
3115
|
+
dependencies: [(store: CoreAppStore, mapId: string) => WebMap | undefined];
|
|
3116
|
+
recomputations: () => number;
|
|
3117
|
+
resetRecomputations: () => void;
|
|
3118
|
+
dependencyRecomputations: () => number;
|
|
3119
|
+
resetDependencyRecomputations: () => void;
|
|
3120
|
+
} & {
|
|
3121
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
3122
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
3123
|
+
};
|