@opengeoweb/store 12.6.0 → 12.7.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 +44 -245
- package/package.json +6 -6
- package/src/store/generic/index.d.ts +1 -0
- package/src/store/generic/selectors.d.ts +7 -7
- package/src/store/generic/syncGroups/reducer.d.ts +2 -0
- package/src/store/map/map/mapListenerAnimationUtils.d.ts +0 -10
- package/src/store/ui/types.d.ts +2 -0
package/index.esm.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createSlice, createSelector, createAction, createListenerMiddleware, isAnyOf, createEntityAdapter, combineReducers, configureStore } from '@reduxjs/toolkit';
|
|
2
2
|
import { isEqual, isEmpty, compact } from 'lodash';
|
|
3
3
|
import { dateUtils, PROJECTION, defaultDelay } from '@opengeoweb/shared';
|
|
4
|
-
import { webmapUtils, parseISO8601IntervalToDateInterval, LayerType,
|
|
4
|
+
import { webmapUtils, parseISO8601IntervalToDateInterval, LayerType, webmapTestSettings, WMLayer, getWMLayerById, WMInvalidDateValues, handleDateUtilsISOString, isProjectionSupported, queryWMSLayers } from '@opengeoweb/webmap';
|
|
5
5
|
import { defaultSecondsPerPx, defaultAnimationDelayAtStart, defaultTimeStep, defaultTimeSpan, roundWithTimeStep, getSpeedDelay } from '@opengeoweb/timeslider';
|
|
6
6
|
import { produce } from 'immer';
|
|
7
|
-
import { getLastEmptyFeatureIndex, getGeoJson, moveFeature, createInterSections,
|
|
7
|
+
import { getLastEmptyFeatureIndex, getGeoJson, moveFeature, createInterSections, defaultLayers, emptyGeoJSON, defaultIntersectionStyleProperties, addSelectionTypeToGeoJSON, getFeatureCollection } from '@opengeoweb/webmap-react';
|
|
8
8
|
export { defaultLayers } from '@opengeoweb/webmap-react';
|
|
9
9
|
import { useSelector, useDispatch } from 'react-redux';
|
|
10
10
|
import { useCallback, useEffect } from 'react';
|
|
@@ -2461,10 +2461,6 @@ var slice$4 = createSlice({
|
|
|
2461
2461
|
return;
|
|
2462
2462
|
}
|
|
2463
2463
|
draft.byId[mapId].isAnimating = true;
|
|
2464
|
-
var wmMap = getWMJSMapById(mapId);
|
|
2465
|
-
if (wmMap) {
|
|
2466
|
-
wmMap.shouldPrefetch = false;
|
|
2467
|
-
}
|
|
2468
2464
|
// Animation is defined by one of the following:
|
|
2469
2465
|
// - start, end and interval for a continuous animation loop with constant interval
|
|
2470
2466
|
// - timeList, for a custom timeList
|
|
@@ -2489,10 +2485,6 @@ var slice$4 = createSlice({
|
|
|
2489
2485
|
return;
|
|
2490
2486
|
}
|
|
2491
2487
|
draft.byId[mapId].isAnimating = false;
|
|
2492
|
-
var wmMap = getWMJSMapById(mapId);
|
|
2493
|
-
if (wmMap) {
|
|
2494
|
-
wmMap.shouldPrefetch = true;
|
|
2495
|
-
}
|
|
2496
2488
|
},
|
|
2497
2489
|
setTimeSliderSpan: function setTimeSliderSpan(draft, action) {
|
|
2498
2490
|
var _action$payload4 = action.payload,
|
|
@@ -2803,32 +2795,6 @@ var slice$4 = createSlice({
|
|
|
2803
2795
|
draft.byId[mapId].mapLayers = layerIds;
|
|
2804
2796
|
draft.byId[mapId].autoUpdateLayerId = activeLayerId;
|
|
2805
2797
|
draft.byId[mapId].autoTimeStepLayerId = activeLayerId;
|
|
2806
|
-
var webmapInstance = webmapUtils.getWMJSMapById(mapId);
|
|
2807
|
-
if (webmapInstance) {
|
|
2808
|
-
var mapDims = webmapInstance.getDimensionList();
|
|
2809
|
-
if (!draft.byId[mapId].dimensions) {
|
|
2810
|
-
draft.byId[mapId].dimensions = [];
|
|
2811
|
-
}
|
|
2812
|
-
var draftDims = draft.byId[mapId].dimensions;
|
|
2813
|
-
if (mapDims && draftDims) {
|
|
2814
|
-
mapDims.forEach(function (dim) {
|
|
2815
|
-
var draftMapDimIndex = draftDims.findIndex(function (draftDim) {
|
|
2816
|
-
return draftDim.name === dim.name;
|
|
2817
|
-
});
|
|
2818
|
-
if (draftMapDimIndex !== -1) {
|
|
2819
|
-
draftDims[draftMapDimIndex].name = dim.name;
|
|
2820
|
-
draftDims[draftMapDimIndex].units = dim.units;
|
|
2821
|
-
draftDims[draftMapDimIndex].currentValue = dim.currentValue;
|
|
2822
|
-
} else {
|
|
2823
|
-
draftDims.push({
|
|
2824
|
-
name: dim.name,
|
|
2825
|
-
units: dim.units,
|
|
2826
|
-
currentValue: dim.currentValue
|
|
2827
|
-
});
|
|
2828
|
-
}
|
|
2829
|
-
});
|
|
2830
|
-
}
|
|
2831
|
-
}
|
|
2832
2798
|
}
|
|
2833
2799
|
}).addCase(layerActions.setBaseLayers, function (draft, action) {
|
|
2834
2800
|
var _action$payload31 = action.payload,
|
|
@@ -3714,6 +3680,8 @@ var DialogTypes;
|
|
|
3714
3680
|
DialogTypes["PublicWarnings"] = "publicWarnings";
|
|
3715
3681
|
DialogTypes["Search"] = "search";
|
|
3716
3682
|
DialogTypes["AreaObjectLoader"] = "areaObjectLoader";
|
|
3683
|
+
DialogTypes["DataExplorer"] = "dataExplorer";
|
|
3684
|
+
DialogTypes["DataExplorerInfo"] = "dataExplorerInfo";
|
|
3717
3685
|
DialogTypes["SoundingsSources"] = "soundingsSources";
|
|
3718
3686
|
DialogTypes["SoundingsLocations"] = "soundingsLocations";
|
|
3719
3687
|
})(DialogTypes || (DialogTypes = {}));
|
|
@@ -3930,6 +3898,31 @@ var slice$3 = createSlice({
|
|
|
3930
3898
|
mapIds = _action$payload.mapIds;
|
|
3931
3899
|
draft.linkedState.links[panelId] = mapIds;
|
|
3932
3900
|
},
|
|
3901
|
+
removeLinkedMap: function removeLinkedMap(draft, action) {
|
|
3902
|
+
var panelId = action.payload;
|
|
3903
|
+
// Remove panelId from sources
|
|
3904
|
+
delete draft.sources.byId[panelId];
|
|
3905
|
+
removeInPlace(draft.sources.allIds, function (_id) {
|
|
3906
|
+
return _id === panelId;
|
|
3907
|
+
});
|
|
3908
|
+
// Remove panelId from any arrays in linkedState
|
|
3909
|
+
delete draft.linkedState.links[panelId];
|
|
3910
|
+
delete draft.linkedState.sharedData[panelId];
|
|
3911
|
+
Object.keys(draft.linkedState.links).forEach(function (key) {
|
|
3912
|
+
var arr = draft.linkedState.links[key];
|
|
3913
|
+
removeInPlace(arr, function (_id) {
|
|
3914
|
+
return _id === panelId;
|
|
3915
|
+
});
|
|
3916
|
+
});
|
|
3917
|
+
// Remove panelId from groups
|
|
3918
|
+
Object.keys(draft.groups.byId).forEach(function (groupId) {
|
|
3919
|
+
var group = draft.groups.byId[groupId];
|
|
3920
|
+
delete group.targets.byId[panelId];
|
|
3921
|
+
removeInPlace(group.targets.allIds, function (_id) {
|
|
3922
|
+
return _id === panelId;
|
|
3923
|
+
});
|
|
3924
|
+
});
|
|
3925
|
+
},
|
|
3933
3926
|
addSharedData: function addSharedData(draft, action) {
|
|
3934
3927
|
var _action$payload2 = action.payload,
|
|
3935
3928
|
panelId = _action$payload2.panelId,
|
|
@@ -4558,10 +4551,9 @@ var getLinkedMaps = createSelector([selectLinkedState, function (store, panelId)
|
|
|
4558
4551
|
return panelId && linkedState.links[panelId] || [];
|
|
4559
4552
|
}, selectorMemoizationOptions);
|
|
4560
4553
|
var getLinkedFeatureProviders = function getLinkedFeatureProviders(linkedState, mapId) {
|
|
4561
|
-
return linkedState ? Object.keys(linkedState.links).filter(function (panelId) {
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
});
|
|
4554
|
+
return linkedState !== null && linkedState !== void 0 && linkedState.links ? Object.keys(linkedState.links).filter(function (panelId) {
|
|
4555
|
+
var _linkedState$links;
|
|
4556
|
+
return (_linkedState$links = linkedState.links) === null || _linkedState$links === void 0 || (_linkedState$links = _linkedState$links[panelId]) === null || _linkedState$links === void 0 ? void 0 : _linkedState$links.includes(mapId);
|
|
4565
4557
|
}) : [];
|
|
4566
4558
|
};
|
|
4567
4559
|
var selectSharedData = createSelector([selectLinkedState, function (store, panelId) {
|
|
@@ -4595,23 +4587,23 @@ var selectLinkedFeatures = createSelector([function (linkedState) {
|
|
|
4595
4587
|
return linkedState;
|
|
4596
4588
|
}, getLinkedFeatureProviders], function (linkedState, featureProviders) {
|
|
4597
4589
|
var features = featureProviders.flatMap(function (providerId) {
|
|
4598
|
-
var _linkedState$sharedDa;
|
|
4599
|
-
return (
|
|
4600
|
-
})
|
|
4601
|
-
|
|
4590
|
+
var _linkedState$sharedDa, _linkedState$sharedDa2;
|
|
4591
|
+
return (_linkedState$sharedDa = linkedState === null || linkedState === void 0 || (_linkedState$sharedDa2 = linkedState.sharedData) === null || _linkedState$sharedDa2 === void 0 || (_linkedState$sharedDa2 = _linkedState$sharedDa2[providerId]) === null || _linkedState$sharedDa2 === void 0 ? void 0 : _linkedState$sharedDa2.features) !== null && _linkedState$sharedDa !== void 0 ? _linkedState$sharedDa : [];
|
|
4592
|
+
});
|
|
4593
|
+
return features.filter(function (feature) {
|
|
4594
|
+
return feature !== undefined;
|
|
4602
4595
|
});
|
|
4603
|
-
return features;
|
|
4604
4596
|
});
|
|
4605
4597
|
var selectLinkedFormFeatures = createSelector([function (linkedState) {
|
|
4606
4598
|
return linkedState;
|
|
4607
4599
|
}, getLinkedFeatureProviders], function (linkedState, featureProviders) {
|
|
4608
4600
|
var features = featureProviders.flatMap(function (providerId) {
|
|
4609
|
-
var _linkedState$
|
|
4610
|
-
return ((_linkedState$
|
|
4611
|
-
})
|
|
4612
|
-
|
|
4601
|
+
var _linkedState$sharedDa3, _linkedState$sharedDa4;
|
|
4602
|
+
return (_linkedState$sharedDa3 = linkedState === null || linkedState === void 0 || (_linkedState$sharedDa4 = linkedState.sharedData) === null || _linkedState$sharedDa4 === void 0 || (_linkedState$sharedDa4 = _linkedState$sharedDa4[providerId]) === null || _linkedState$sharedDa4 === void 0 ? void 0 : _linkedState$sharedDa4.formFeatures) !== null && _linkedState$sharedDa3 !== void 0 ? _linkedState$sharedDa3 : [];
|
|
4603
|
+
});
|
|
4604
|
+
return features.filter(function (feature) {
|
|
4605
|
+
return feature !== undefined;
|
|
4613
4606
|
});
|
|
4614
|
-
return features;
|
|
4615
4607
|
});
|
|
4616
4608
|
var getSelectedFeature = createSelector([
|
|
4617
4609
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
@@ -6568,134 +6560,6 @@ genericListener.startListening({
|
|
|
6568
6560
|
}()
|
|
6569
6561
|
});
|
|
6570
6562
|
|
|
6571
|
-
/* A map with all the timerIds and their current step */
|
|
6572
|
-
var stepMap$1 = new Map();
|
|
6573
|
-
/* A map with a list of timers and their dwell */
|
|
6574
|
-
var timerDwellMap$1 = new Map();
|
|
6575
|
-
/**
|
|
6576
|
-
* Returns the next step for given timerId.
|
|
6577
|
-
* @param timerId The timer id
|
|
6578
|
-
* @param numberOfStepsInAnimation Animation length in steps
|
|
6579
|
-
* @param numStepsToGoForward Amount of steps to go forwards, defaults to 1. Can be positive and negative
|
|
6580
|
-
* @returns
|
|
6581
|
-
*/
|
|
6582
|
-
var getNextStep$1 = function getNextStep(timerId, numberOfStepsInAnimation) {
|
|
6583
|
-
var numStepsToGoForward = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
6584
|
-
var currentStep = getCurrentStep$1(timerId);
|
|
6585
|
-
var nextStep = currentStep + numStepsToGoForward;
|
|
6586
|
-
var nextStepClipped = (nextStep % numberOfStepsInAnimation + numberOfStepsInAnimation) % numberOfStepsInAnimation;
|
|
6587
|
-
return nextStepClipped;
|
|
6588
|
-
};
|
|
6589
|
-
/**
|
|
6590
|
-
* Handles dwell at the end of the animation loop sequence. The number of steps to wait till proceed can be set by the dwell parameter.
|
|
6591
|
-
* @param timerId The timer id
|
|
6592
|
-
* @param numberOfStepsInAnimation Number of steps in the animation
|
|
6593
|
-
* @param dwell The number of steps to wait at the end of the animation sequence before to continue
|
|
6594
|
-
* @returns
|
|
6595
|
-
*/
|
|
6596
|
-
var handleTimerDwell$1 = function handleTimerDwell(timerId, numberOfStepsInAnimation) {
|
|
6597
|
-
var dwell = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 8;
|
|
6598
|
-
if (dwell > 0) {
|
|
6599
|
-
var currentStep = getCurrentStep$1(timerId);
|
|
6600
|
-
// Reset the dwell if we are not at the last animation step
|
|
6601
|
-
if (currentStep < numberOfStepsInAnimation - 1) {
|
|
6602
|
-
timerDwellMap$1.set(timerId, dwell);
|
|
6603
|
-
return false;
|
|
6604
|
-
}
|
|
6605
|
-
// We are at the last animation step, check the dwell
|
|
6606
|
-
var timerDwell = timerDwellMap$1.has(timerId) && timerDwellMap$1.get(timerId) || 0;
|
|
6607
|
-
if (currentStep === numberOfStepsInAnimation - 1 && timerDwell > 0) {
|
|
6608
|
-
timerDwellMap$1.set(timerId, timerDwell - 1);
|
|
6609
|
-
return true;
|
|
6610
|
-
}
|
|
6611
|
-
}
|
|
6612
|
-
return false;
|
|
6613
|
-
};
|
|
6614
|
-
/**
|
|
6615
|
-
* Set step for the timerId
|
|
6616
|
-
* @param timerId
|
|
6617
|
-
* @param timerStep
|
|
6618
|
-
*/
|
|
6619
|
-
var setStep$1 = function setStep(timerId, timerStep) {
|
|
6620
|
-
stepMap$1.set(timerId, timerStep);
|
|
6621
|
-
};
|
|
6622
|
-
/**
|
|
6623
|
-
* Gets the current step for the timer
|
|
6624
|
-
* @param timerId
|
|
6625
|
-
* @returns
|
|
6626
|
-
*/
|
|
6627
|
-
var getCurrentStep$1 = function getCurrentStep(timerId) {
|
|
6628
|
-
return stepMap$1.get(timerId) || 0;
|
|
6629
|
-
};
|
|
6630
|
-
var MAX_NUMBER_STEPS_FORWARD_TO_PREFETCH = 2;
|
|
6631
|
-
var MAX_NUMBER_OF_PARALLEL_LOADING_IMAGES = 8;
|
|
6632
|
-
/**
|
|
6633
|
-
* This prefetches all images connected to the same sync group as provided timerId
|
|
6634
|
-
* @param timerId The timerId
|
|
6635
|
-
* @param animationListValues List of animation steps in isostring to animate
|
|
6636
|
-
* @param targets List of targets to check
|
|
6637
|
-
* @returns True if all maps are ready to go forward, false if the map has no data to display yet.
|
|
6638
|
-
*/
|
|
6639
|
-
var prefetchAnimationTargetsForMetronome = function prefetchAnimationTargetsForMetronome(timerId, animationListValues, targets) {
|
|
6640
|
-
var timerShouldStepForward = true;
|
|
6641
|
-
// The following code prefetches/buffers for all maps in the group
|
|
6642
|
-
for (var numPrefetch = 0; numPrefetch < MAX_NUMBER_STEPS_FORWARD_TO_PREFETCH; numPrefetch += 1) {
|
|
6643
|
-
var nextStep = getNextStep$1(timerId, animationListValues.length, numPrefetch + 1);
|
|
6644
|
-
var nextTimeValueStepToCheck = animationListValues[nextStep];
|
|
6645
|
-
var _iterator = _createForOfIteratorHelper(targets),
|
|
6646
|
-
_step;
|
|
6647
|
-
try {
|
|
6648
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
6649
|
-
var target = _step.value;
|
|
6650
|
-
var targetMapId = target.targetId;
|
|
6651
|
-
var wmMap = getWMJSMapById(targetMapId);
|
|
6652
|
-
if (!wmMap) {
|
|
6653
|
-
return true; // Map was not registered so there is nothing to prefetch, do not block going forward
|
|
6654
|
-
}
|
|
6655
|
-
var layersImageUrls = getWMSRequests(wmMap, [{
|
|
6656
|
-
name: 'time',
|
|
6657
|
-
currentValue: nextTimeValueStepToCheck
|
|
6658
|
-
}]);
|
|
6659
|
-
var _iterator2 = _createForOfIteratorHelper(layersImageUrls),
|
|
6660
|
-
_step2;
|
|
6661
|
-
try {
|
|
6662
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
6663
|
-
var layersImageUrl = _step2.value;
|
|
6664
|
-
var image = wmMap.getMapImageStore.getImage(layersImageUrl.url);
|
|
6665
|
-
if (!image.isLoaded()) {
|
|
6666
|
-
if (wmMap.getMapImageStore.getNumImagesLoading() < MAX_NUMBER_OF_PARALLEL_LOADING_IMAGES) {
|
|
6667
|
-
image.load();
|
|
6668
|
-
}
|
|
6669
|
-
if (numPrefetch === 0) {
|
|
6670
|
-
var altImage = wmMap.getAlternativeImage(layersImageUrl.url, wmMap.getBBOX(), true);
|
|
6671
|
-
// No alternative image available yet, so skipping animation.
|
|
6672
|
-
if (altImage.length === 0) {
|
|
6673
|
-
// This is useful to indicate that the map is loading and has nothing yet to display.
|
|
6674
|
-
// console.warn('No data available: Not stepping forward');
|
|
6675
|
-
timerShouldStepForward = false;
|
|
6676
|
-
}
|
|
6677
|
-
}
|
|
6678
|
-
} else if (image.isStale()) {
|
|
6679
|
-
if (wmMap.getMapImageStore.getNumImagesLoading() < MAX_NUMBER_OF_PARALLEL_LOADING_IMAGES) {
|
|
6680
|
-
image.forceReload(true);
|
|
6681
|
-
}
|
|
6682
|
-
}
|
|
6683
|
-
}
|
|
6684
|
-
} catch (err) {
|
|
6685
|
-
_iterator2.e(err);
|
|
6686
|
-
} finally {
|
|
6687
|
-
_iterator2.f();
|
|
6688
|
-
}
|
|
6689
|
-
}
|
|
6690
|
-
} catch (err) {
|
|
6691
|
-
_iterator.e(err);
|
|
6692
|
-
} finally {
|
|
6693
|
-
_iterator.f();
|
|
6694
|
-
}
|
|
6695
|
-
}
|
|
6696
|
-
return timerShouldStepForward;
|
|
6697
|
-
};
|
|
6698
|
-
|
|
6699
6563
|
/* A map with all the timerIds and their current step */
|
|
6700
6564
|
var stepMap = new Map();
|
|
6701
6565
|
/* A map with a list of timers and their dwell */
|
|
@@ -7087,11 +6951,7 @@ mapListener.startListening({
|
|
|
7087
6951
|
return timeNameValue.value === initialTime;
|
|
7088
6952
|
});
|
|
7089
6953
|
if (initalTimerStep !== -1) {
|
|
7090
|
-
|
|
7091
|
-
setStep(useMapId, initalTimerStep);
|
|
7092
|
-
} else {
|
|
7093
|
-
setStep$1(useMapId, initalTimerStep);
|
|
7094
|
-
}
|
|
6954
|
+
setStep(useMapId, initalTimerStep);
|
|
7095
6955
|
}
|
|
7096
6956
|
}
|
|
7097
6957
|
}
|
|
@@ -8387,67 +8247,6 @@ layersListener.startListening({
|
|
|
8387
8247
|
}()
|
|
8388
8248
|
});
|
|
8389
8249
|
|
|
8390
|
-
/**
|
|
8391
|
-
* This handler is triggered by the metronome. An array of timerIds is given as argument.
|
|
8392
|
-
* It will update the animation loop of multiple maps and sliders
|
|
8393
|
-
* It will prefetch images for maps
|
|
8394
|
-
* @param timerIds string[] array of timerIds
|
|
8395
|
-
* @param listenerApi ListenerEffectAPI<CoreAppStore, Dispatch, unknown> listenerApi as received from listener
|
|
8396
|
-
*/
|
|
8397
|
-
var metronomeHandler = function metronomeHandler(timerIds, listenerApi) {
|
|
8398
|
-
if (isOpenLayersEnabled()) {
|
|
8399
|
-
olMetronomeHandler(timerIds, listenerApi);
|
|
8400
|
-
return;
|
|
8401
|
-
}
|
|
8402
|
-
var targetsWithUpdateValue = [];
|
|
8403
|
-
var _iterator = _createForOfIteratorHelper(timerIds),
|
|
8404
|
-
_step;
|
|
8405
|
-
try {
|
|
8406
|
-
var _loop = function _loop() {
|
|
8407
|
-
var timerId = _step.value;
|
|
8408
|
-
var animationListValuesNameAndValue = getAnimationList(listenerApi.getState(), timerId);
|
|
8409
|
-
var animationListValues = animationListValuesNameAndValue.map(function (nameAndValue) {
|
|
8410
|
-
return nameAndValue.value;
|
|
8411
|
-
});
|
|
8412
|
-
var targets = getTargets(listenerApi.getState(), {
|
|
8413
|
-
sourceId: timerId,
|
|
8414
|
-
origin: timerId
|
|
8415
|
-
}, SYNCGROUPS_TYPE_SETTIME);
|
|
8416
|
-
if (targets.length === 0) {
|
|
8417
|
-
// When there are no targets, default to one
|
|
8418
|
-
targets.push({
|
|
8419
|
-
targetId: timerId,
|
|
8420
|
-
value: ''
|
|
8421
|
-
});
|
|
8422
|
-
}
|
|
8423
|
-
var timerIsInDwell = handleTimerDwell$1(timerId, animationListValues.length);
|
|
8424
|
-
var timerShouldStepForward = prefetchAnimationTargetsForMetronome(timerId, animationListValues, targets) && !timerIsInDwell;
|
|
8425
|
-
// Determine the next step
|
|
8426
|
-
var timerStep = timerShouldStepForward ? getNextStep$1(timerId, animationListValues.length) : getCurrentStep$1(timerId);
|
|
8427
|
-
setStep$1(timerId, timerStep);
|
|
8428
|
-
var updatedValue = animationListValues[timerStep];
|
|
8429
|
-
targetsWithUpdateValue.push.apply(targetsWithUpdateValue, _toConsumableArray(targets.map(function (target) {
|
|
8430
|
-
return _objectSpread2(_objectSpread2({}, target), {}, {
|
|
8431
|
-
value: updatedValue
|
|
8432
|
-
});
|
|
8433
|
-
})));
|
|
8434
|
-
var speedDelay = getMapAnimationDelay(listenerApi.getState(), timerId);
|
|
8435
|
-
var speed = 1000 / (speedDelay || 1);
|
|
8436
|
-
metronome.setSpeed(timerId, speed);
|
|
8437
|
-
};
|
|
8438
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
8439
|
-
_loop();
|
|
8440
|
-
}
|
|
8441
|
-
// Update all targets of all sync groups in one action.
|
|
8442
|
-
} catch (err) {
|
|
8443
|
-
_iterator.e(err);
|
|
8444
|
-
} finally {
|
|
8445
|
-
_iterator.f();
|
|
8446
|
-
}
|
|
8447
|
-
if (targetsWithUpdateValue.length > 0) {
|
|
8448
|
-
listenerApi.dispatch(setTimeSync(null, targetsWithUpdateValue, ['metronomelistener']));
|
|
8449
|
-
}
|
|
8450
|
-
};
|
|
8451
8250
|
var metronomeListener = createListenerMiddleware();
|
|
8452
8251
|
metronomeListener.startListening({
|
|
8453
8252
|
actionCreator: mapActions.mapStartAnimation,
|
|
@@ -8458,7 +8257,7 @@ metronomeListener.startListening({
|
|
|
8458
8257
|
case 0:
|
|
8459
8258
|
// register handler with access to listenerApi
|
|
8460
8259
|
metronome.handleTimerTicks = function (timerIds) {
|
|
8461
|
-
|
|
8260
|
+
olMetronomeHandler(timerIds, listenerApi);
|
|
8462
8261
|
};
|
|
8463
8262
|
case 1:
|
|
8464
8263
|
case "end":
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/store",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.7.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.7.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.7.0",
|
|
15
|
+
"@opengeoweb/webmap": "12.7.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.7.0",
|
|
19
|
+
"@opengeoweb/timeslider": "12.7.0",
|
|
20
20
|
"react-router-dom": "^6.23.1",
|
|
21
21
|
"ol": "^10.4.0",
|
|
22
22
|
"@turf/turf": "^7.2.0"
|
|
@@ -4,6 +4,7 @@ export declare const genericActions: {
|
|
|
4
4
|
setBbox: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./types").SetBboxPayload, string>;
|
|
5
5
|
setLinkedMap: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./syncGroups/types").SetLinkedMap, "synchronizationGroupsReducer/setLinkedMap">;
|
|
6
6
|
updateLinkedMap: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./syncGroups/types").UpdateLinkedMap, "synchronizationGroupsReducer/updateLinkedMap">;
|
|
7
|
+
removeLinkedMap: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "synchronizationGroupsReducer/removeLinkedMap">;
|
|
7
8
|
addSharedData: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./syncGroups/types").AddSharedData, "synchronizationGroupsReducer/addSharedData">;
|
|
8
9
|
deleteSharedData: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./syncGroups/types").DeleteSharedData, "synchronizationGroupsReducer/deleteSharedData">;
|
|
9
10
|
syncGroupAddSource: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./syncGroups/types").SyncGroupsAddSourcePayload, "synchronizationGroupsReducer/syncGroupAddSource">;
|
|
@@ -83,7 +83,7 @@ export declare const getLinkedMaps: ((state: any, panelId?: string | undefined)
|
|
|
83
83
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
84
84
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
85
85
|
};
|
|
86
|
-
export declare const getLinkedFeatureProviders: (linkedState: LinkedState, mapId: string) => string[];
|
|
86
|
+
export declare const getLinkedFeatureProviders: (linkedState: LinkedState | undefined, mapId: string) => string[];
|
|
87
87
|
export declare const selectSharedData: ((state: any, panelId: string) => PotentialData) & {
|
|
88
88
|
clearCache: () => void;
|
|
89
89
|
resultsCount: () => number;
|
|
@@ -196,12 +196,12 @@ export declare const selectLinkedFeatures: ((state: any, mapId: string) => {
|
|
|
196
196
|
resultsCount: () => number;
|
|
197
197
|
resetResultsCount: () => void;
|
|
198
198
|
} & {
|
|
199
|
-
resultFunc: (resultFuncArgs_0: LinkedState, resultFuncArgs_1: string[]) => {
|
|
199
|
+
resultFunc: (resultFuncArgs_0: LinkedState | undefined, resultFuncArgs_1: string[]) => {
|
|
200
200
|
id: string;
|
|
201
201
|
originalId?: string | undefined;
|
|
202
202
|
geoJSON: import("geojson").FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties>;
|
|
203
203
|
}[];
|
|
204
|
-
memoizedResultFunc: ((resultFuncArgs_0: LinkedState, resultFuncArgs_1: string[]) => {
|
|
204
|
+
memoizedResultFunc: ((resultFuncArgs_0: LinkedState | undefined, resultFuncArgs_1: string[]) => {
|
|
205
205
|
id: string;
|
|
206
206
|
originalId?: string | undefined;
|
|
207
207
|
geoJSON: import("geojson").FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties>;
|
|
@@ -215,7 +215,7 @@ export declare const selectLinkedFeatures: ((state: any, mapId: string) => {
|
|
|
215
215
|
originalId?: string | undefined;
|
|
216
216
|
geoJSON: import("geojson").FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties>;
|
|
217
217
|
}[];
|
|
218
|
-
dependencies: [(linkedState: any) => LinkedState, (linkedState: LinkedState, mapId: string) => string[]];
|
|
218
|
+
dependencies: [(linkedState: any) => LinkedState | undefined, (linkedState: LinkedState | undefined, mapId: string) => string[]];
|
|
219
219
|
recomputations: () => number;
|
|
220
220
|
resetRecomputations: () => void;
|
|
221
221
|
dependencyRecomputations: () => number;
|
|
@@ -232,11 +232,11 @@ export declare const selectLinkedFormFeatures: ((state: any, mapId: string) => {
|
|
|
232
232
|
resultsCount: () => number;
|
|
233
233
|
resetResultsCount: () => void;
|
|
234
234
|
} & {
|
|
235
|
-
resultFunc: (resultFuncArgs_0: LinkedState, resultFuncArgs_1: string[]) => {
|
|
235
|
+
resultFunc: (resultFuncArgs_0: LinkedState | undefined, resultFuncArgs_1: string[]) => {
|
|
236
236
|
id: string;
|
|
237
237
|
geoJSON: import("geojson").FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties>;
|
|
238
238
|
}[];
|
|
239
|
-
memoizedResultFunc: ((resultFuncArgs_0: LinkedState, resultFuncArgs_1: string[]) => {
|
|
239
|
+
memoizedResultFunc: ((resultFuncArgs_0: LinkedState | undefined, resultFuncArgs_1: string[]) => {
|
|
240
240
|
id: string;
|
|
241
241
|
geoJSON: import("geojson").FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties>;
|
|
242
242
|
}[]) & {
|
|
@@ -248,7 +248,7 @@ export declare const selectLinkedFormFeatures: ((state: any, mapId: string) => {
|
|
|
248
248
|
id: string;
|
|
249
249
|
geoJSON: import("geojson").FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties>;
|
|
250
250
|
}[];
|
|
251
|
-
dependencies: [(linkedState: any) => LinkedState, (linkedState: LinkedState, mapId: string) => string[]];
|
|
251
|
+
dependencies: [(linkedState: any) => LinkedState | undefined, (linkedState: LinkedState | undefined, mapId: string) => string[]];
|
|
252
252
|
recomputations: () => number;
|
|
253
253
|
resetRecomputations: () => void;
|
|
254
254
|
dependencyRecomputations: () => number;
|
|
@@ -15,6 +15,7 @@ export declare const slice: import("@reduxjs/toolkit").Slice<SynchronizationGrou
|
|
|
15
15
|
* @param {string[]} action.mapIds the new linked maps
|
|
16
16
|
*/
|
|
17
17
|
updateLinkedMap: (draft: Draft<SynchronizationGroupState>, action: PayloadAction<UpdateLinkedMap>) => void;
|
|
18
|
+
removeLinkedMap: (draft: Draft<SynchronizationGroupState>, action: PayloadAction<string>) => void;
|
|
18
19
|
addSharedData: (draft: Draft<SynchronizationGroupState>, action: PayloadAction<AddSharedData>) => void;
|
|
19
20
|
deleteSharedData: (draft: Draft<SynchronizationGroupState>, action: PayloadAction<DeleteSharedData>) => void;
|
|
20
21
|
syncGroupAddSource: (draft: Draft<SynchronizationGroupState>, action: PayloadAction<SyncGroupsAddSourcePayload>) => void;
|
|
@@ -43,6 +44,7 @@ export declare const syncGroupsReducer: import("redux").Reducer<SynchronizationG
|
|
|
43
44
|
* @param {string[]} action.mapIds the new linked maps
|
|
44
45
|
*/
|
|
45
46
|
updateLinkedMap: (draft: Draft<SynchronizationGroupState>, action: PayloadAction<UpdateLinkedMap>) => void;
|
|
47
|
+
removeLinkedMap: (draft: Draft<SynchronizationGroupState>, action: PayloadAction<string>) => void;
|
|
46
48
|
addSharedData: (draft: Draft<SynchronizationGroupState>, action: PayloadAction<AddSharedData>) => void;
|
|
47
49
|
deleteSharedData: (draft: Draft<SynchronizationGroupState>, action: PayloadAction<DeleteSharedData>) => void;
|
|
48
50
|
syncGroupAddSource: (draft: Draft<SynchronizationGroupState>, action: PayloadAction<SyncGroupsAddSourcePayload>) => void;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { SetTimeSyncPayload } from '../../generic/synchronizationActions/types';
|
|
2
1
|
/**
|
|
3
2
|
* Returns the next step for given timerId.
|
|
4
3
|
* @param timerId The timer id
|
|
@@ -27,12 +26,3 @@ export declare const setStep: (timerId: string, timerStep: number) => void;
|
|
|
27
26
|
* @returns
|
|
28
27
|
*/
|
|
29
28
|
export declare const getCurrentStep: (timerId: string) => number;
|
|
30
|
-
export declare const MAX_NUMBER_STEPS_FORWARD_TO_PREFETCH = 2;
|
|
31
|
-
/**
|
|
32
|
-
* This prefetches all images connected to the same sync group as provided timerId
|
|
33
|
-
* @param timerId The timerId
|
|
34
|
-
* @param animationListValues List of animation steps in isostring to animate
|
|
35
|
-
* @param targets List of targets to check
|
|
36
|
-
* @returns True if all maps are ready to go forward, false if the map has no data to display yet.
|
|
37
|
-
*/
|
|
38
|
-
export declare const prefetchAnimationTargetsForMetronome: (timerId: string, animationListValues: string[], targets: SetTimeSyncPayload[]) => boolean;
|
package/src/store/ui/types.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export declare enum DialogTypes {
|
|
|
19
19
|
PublicWarnings = "publicWarnings",
|
|
20
20
|
Search = "search",
|
|
21
21
|
AreaObjectLoader = "areaObjectLoader",
|
|
22
|
+
DataExplorer = "dataExplorer",
|
|
23
|
+
DataExplorerInfo = "dataExplorerInfo",
|
|
22
24
|
SoundingsSources = "soundingsSources",
|
|
23
25
|
SoundingsLocations = "soundingsLocations"
|
|
24
26
|
}
|