@opengeoweb/store 9.16.0 → 9.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js
CHANGED
|
@@ -2003,7 +2003,7 @@ var types$5 = /*#__PURE__*/Object.freeze({
|
|
|
2003
2003
|
get LayerActionOrigin () { return LayerActionOrigin; }
|
|
2004
2004
|
});
|
|
2005
2005
|
|
|
2006
|
-
const dateFormat =
|
|
2006
|
+
const dateFormat = dateUtils.DATE_FORMAT_UTC;
|
|
2007
2007
|
const createMap = ({
|
|
2008
2008
|
id,
|
|
2009
2009
|
isAnimating: _isAnimating = false,
|
|
@@ -5722,7 +5722,7 @@ const getAnimationStartTime = createSelector(getMapById, store => (store === nul
|
|
|
5722
5722
|
* @param {string} mapId mapId: string - Id of the map
|
|
5723
5723
|
* @returns {string} returnType: string
|
|
5724
5724
|
*/
|
|
5725
|
-
const getAnimationEndTime
|
|
5725
|
+
const getAnimationEndTime = createSelector(getMapById, store => (store === null || store === void 0 ? void 0 : store.animationEndTime) ? store.animationEndTime : dateUtils.dateToString(dateUtils.sub(dateUtils.utc(), {
|
|
5726
5726
|
minutes: 10
|
|
5727
5727
|
}), dateFormat), selectorMemoizationOptions);
|
|
5728
5728
|
/**
|
|
@@ -6000,7 +6000,7 @@ const getLegendId = createSelector(getMapById, store => store ? store.legendId :
|
|
|
6000
6000
|
* @param {string} mapId mapId: string - Id of the map
|
|
6001
6001
|
* @returns {MapPreset} returnType: MapPreset
|
|
6002
6002
|
*/
|
|
6003
|
-
const getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLayers, getBbox, getSrs, getActiveLayerId, getAutoTimeStepLayerId, getAutoUpdateLayerId, isAnimating, isAutoUpdating, isTimeSliderVisible, getDisplayMapPin, isZoomControlsVisible, getMapTimeStep, getMapAnimationDelay, getAnimationStartTime, getAnimationEndTime
|
|
6003
|
+
const getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLayers, getBbox, getSrs, getActiveLayerId, getAutoTimeStepLayerId, getAutoUpdateLayerId, isAnimating, isAutoUpdating, isTimeSliderVisible, getDisplayMapPin, isZoomControlsVisible, getMapTimeStep, getMapAnimationDelay, getAnimationStartTime, getAnimationEndTime, isTimestepAuto, getLegendId, getUiStore, (mapLayers, baseLayers, overLayers, bbox, srs, activeLayerId, autoUpdateLayerId, autoTimeStepLayerId, isAnimating, isAutoUpdating, isTimeSliderVisible, displayMapPin, isZoomControlsVisible, mapTimeStep, mapAnimationDelay, animationStartTime, animationEndTime, isTimestepAuto, legendId, uiStore) => {
|
|
6004
6004
|
var _a;
|
|
6005
6005
|
const allLayers = [...baseLayers, ...overLayers, ...mapLayers].map(_a => {
|
|
6006
6006
|
var layer = __rest(_a, ["mapId"]);
|
|
@@ -6080,7 +6080,7 @@ const getDockedLayerManagerSize = createSelector(getMapById, store => store ? st
|
|
|
6080
6080
|
* @param {string} mapId mapId: string - Id of the map
|
|
6081
6081
|
* @returns {animationList} returnType: WebMapAnimationList, list of timesteps to animate for this map.
|
|
6082
6082
|
*/
|
|
6083
|
-
const getAnimationList = createSelector(getMapById, getAnimationStartTime, getAnimationEndTime
|
|
6083
|
+
const getAnimationList = createSelector(getMapById, getAnimationStartTime, getAnimationEndTime, getMapTimeStep, (mapStore, animationStart, animationEnd, animationInterval) => {
|
|
6084
6084
|
// Animation is defined by one of the following:
|
|
6085
6085
|
// - start, end and interval for a continuous animation loop with constant interval
|
|
6086
6086
|
// - timeList, for a custom timeList
|
|
@@ -6129,7 +6129,7 @@ var selectors$2 = /*#__PURE__*/Object.freeze({
|
|
|
6129
6129
|
isAnimating: isAnimating,
|
|
6130
6130
|
linkedMapAnimationInfo: linkedMapAnimationInfo,
|
|
6131
6131
|
getAnimationStartTime: getAnimationStartTime,
|
|
6132
|
-
getAnimationEndTime: getAnimationEndTime
|
|
6132
|
+
getAnimationEndTime: getAnimationEndTime,
|
|
6133
6133
|
isAutoUpdating: isAutoUpdating,
|
|
6134
6134
|
shouldEndtimeOverride: shouldEndtimeOverride,
|
|
6135
6135
|
getActiveLayerId: getActiveLayerId,
|
|
@@ -7673,6 +7673,10 @@ const prefetchAnimationTargetsForMetronome = (timerId, animationListValues, targ
|
|
|
7673
7673
|
timerShouldStepForward = false;
|
|
7674
7674
|
}
|
|
7675
7675
|
}
|
|
7676
|
+
} else if (image.isStale()) {
|
|
7677
|
+
if (wmMap.getMapImageStore.getNumImagesLoading() < MAX_NUMBER_OF_PARALLEL_LOADING_IMAGES) {
|
|
7678
|
+
image.forceReload(true);
|
|
7679
|
+
}
|
|
7676
7680
|
}
|
|
7677
7681
|
}
|
|
7678
7682
|
} else {
|
|
@@ -7683,25 +7687,6 @@ const prefetchAnimationTargetsForMetronome = (timerId, animationListValues, targ
|
|
|
7683
7687
|
return timerShouldStepForward;
|
|
7684
7688
|
};
|
|
7685
7689
|
|
|
7686
|
-
// Expects start, end time as Date object and interval in minutes
|
|
7687
|
-
const getAnimationEndTime = animationEndTime => {
|
|
7688
|
-
const ISOtime = dateUtils.parseISO(animationEndTime);
|
|
7689
|
-
if (dateUtils.isValid(ISOtime)) {
|
|
7690
|
-
return ISOtime.toISOString();
|
|
7691
|
-
}
|
|
7692
|
-
const calculateFromNow = animationEndTime.split(/[-+]/)[0] === 'NOW';
|
|
7693
|
-
const isAddingTime = animationEndTime.indexOf('+') !== -1;
|
|
7694
|
-
const duration = animationEndTime.substring(animationEndTime.indexOf('PT') + 2);
|
|
7695
|
-
const [hours, minutes] = duration.split('H');
|
|
7696
|
-
const timeInMinutes = parseInt(hours, 10) * 60 + parseInt(minutes, 10);
|
|
7697
|
-
const startingTime = calculateFromNow ? dateUtils.utc() : dateUtils.startOfDay(dateUtils.utc());
|
|
7698
|
-
const newAnimationEndTime = isAddingTime ? dateUtils.add(startingTime, {
|
|
7699
|
-
minutes: timeInMinutes
|
|
7700
|
-
}).toISOString() : dateUtils.sub(startingTime, {
|
|
7701
|
-
minutes: timeInMinutes
|
|
7702
|
-
}).toISOString();
|
|
7703
|
-
return newAnimationEndTime;
|
|
7704
|
-
};
|
|
7705
7690
|
const isAnimationEndTimeValid = animationEndTime => {
|
|
7706
7691
|
const hasValidPrefix = animationEndTime.split(/[-+]/)[0] === 'NOW' || animationEndTime.split(/[-+]/)[0] === 'TODAY';
|
|
7707
7692
|
const durationString = animationEndTime.substring(animationEndTime.indexOf('PT') + 2);
|
|
@@ -7763,7 +7748,7 @@ function* updateAnimation(mapId, maxValue) {
|
|
|
7763
7748
|
}
|
|
7764
7749
|
const animationStart = yield select(getAnimationStartTime, mapId);
|
|
7765
7750
|
// Calculate how much time the animation start need to move forwards
|
|
7766
|
-
const animationEnd = yield select(getAnimationEndTime
|
|
7751
|
+
const animationEnd = yield select(getAnimationEndTime, mapId);
|
|
7767
7752
|
const animationEndUnix = dateUtils.unix(dateUtils.utc(animationEnd));
|
|
7768
7753
|
const maxTimeAsUnix = dateUtils.unix(dateUtils.utc(maxValue));
|
|
7769
7754
|
const timeInSecondToShiftAnimationForwards = maxTimeAsUnix - animationEndUnix;
|
|
@@ -8047,28 +8032,43 @@ function* setMapPresetSaga({
|
|
|
8047
8032
|
}
|
|
8048
8033
|
// sets animationEndTime by endTime of animationPayload
|
|
8049
8034
|
if (animationEndTime) {
|
|
8035
|
+
const endTime = animationEndTime.includes('NOW') || animationEndTime.includes('TODAY') ? dateUtils.convertNOWandTODAYFormatsToUTC(animationEndTime) : animationEndTime;
|
|
8050
8036
|
yield put(mapActions.setAnimationEndTime({
|
|
8051
8037
|
mapId,
|
|
8052
|
-
animationEndTime:
|
|
8038
|
+
animationEndTime: handleDateUtilsISOString(endTime)
|
|
8039
|
+
}));
|
|
8040
|
+
const startTime = handleDateUtilsISOString(dateUtils.sub(dateUtils.utc(endTime), {
|
|
8041
|
+
minutes: 5 * 60 // set to default of 5 hours
|
|
8042
|
+
}).toISOString());
|
|
8043
|
+
yield put(mapActions.setAnimationStartTime({
|
|
8044
|
+
mapId,
|
|
8045
|
+
animationStartTime: startTime
|
|
8046
|
+
}));
|
|
8047
|
+
yield put(genericActions.setTime({
|
|
8048
|
+
origin: '',
|
|
8049
|
+
sourceId: mapId,
|
|
8050
|
+
value: startTime
|
|
8051
|
+
}));
|
|
8052
|
+
const centerTimeInSeconds = new Date(handleDateUtilsISOString(endTime)).getTime();
|
|
8053
|
+
yield put(mapActions.setTimeSliderCenterTime({
|
|
8054
|
+
mapId,
|
|
8055
|
+
timeSliderCenterTime: centerTimeInSeconds
|
|
8053
8056
|
}));
|
|
8054
|
-
if (!animationLength) {
|
|
8055
|
-
const animationEnd = yield select(getAnimationEndTime$1, mapId);
|
|
8056
|
-
yield put(mapActions.setAnimationStartTime({
|
|
8057
|
-
mapId,
|
|
8058
|
-
animationStartTime: dateUtils.sub(dateUtils.utc(animationEnd), {
|
|
8059
|
-
minutes: 5 * 60 // set to default of 5 hours
|
|
8060
|
-
}).toISOString()
|
|
8061
|
-
}));
|
|
8062
|
-
}
|
|
8063
8057
|
}
|
|
8064
8058
|
// sets animationStartTime by duration of animationPayload
|
|
8065
8059
|
if (animationLength) {
|
|
8066
|
-
const animationEnd = yield select(getAnimationEndTime
|
|
8060
|
+
const animationEnd = yield select(getAnimationEndTime, mapId);
|
|
8061
|
+
const startTime = handleDateUtilsISOString(dateUtils.sub(dateUtils.utc(animationEnd), {
|
|
8062
|
+
minutes: animationLength
|
|
8063
|
+
}).toISOString());
|
|
8067
8064
|
yield put(mapActions.setAnimationStartTime({
|
|
8068
8065
|
mapId,
|
|
8069
|
-
animationStartTime:
|
|
8070
|
-
|
|
8071
|
-
|
|
8066
|
+
animationStartTime: startTime
|
|
8067
|
+
}));
|
|
8068
|
+
yield put(genericActions.setTime({
|
|
8069
|
+
origin: '',
|
|
8070
|
+
sourceId: mapId,
|
|
8071
|
+
value: startTime
|
|
8072
8072
|
}));
|
|
8073
8073
|
}
|
|
8074
8074
|
// sets animationDelay by speed of animationPayload
|
|
@@ -8081,7 +8081,7 @@ function* setMapPresetSaga({
|
|
|
8081
8081
|
// turn animation on
|
|
8082
8082
|
if (shouldAnimate === true) {
|
|
8083
8083
|
const duration = animationPayload && animationPayload.duration ? animationPayload.duration : 5 * 60; // set to default of 5 hours
|
|
8084
|
-
const animationEnd = shouldEndtimeOverride && animationEndTime ? yield select(getAnimationEndTime
|
|
8084
|
+
const animationEnd = shouldEndtimeOverride && animationEndTime ? yield select(getAnimationEndTime, mapId) : dateUtils.dateToString(dateUtils.utc(), dateFormat);
|
|
8085
8085
|
const animationStart = shouldEndtimeOverride && animationLength ? yield select(getAnimationStartTime, mapId) : dateUtils.dateToString(dateUtils.sub(dateUtils.utc(animationEnd), {
|
|
8086
8086
|
minutes: duration
|
|
8087
8087
|
}), dateFormat);
|
|
@@ -8123,7 +8123,7 @@ function* setMapPresetSaga({
|
|
|
8123
8123
|
while (animationEndTime && (shouldEndtimeOverride || !(shouldAutoUpdate || shouldAnimate))) {
|
|
8124
8124
|
const fiveMinuteDelayForAnimation = 1000 * 60 * 5;
|
|
8125
8125
|
yield delay(fiveMinuteDelayForAnimation);
|
|
8126
|
-
const animationEnd = yield select(getAnimationEndTime
|
|
8126
|
+
const animationEnd = yield select(getAnimationEndTime, mapId);
|
|
8127
8127
|
yield put(mapActions.setAnimationEndTime({
|
|
8128
8128
|
mapId,
|
|
8129
8129
|
animationEndTime: dateUtils.add(dateUtils.utc(animationEnd), {
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import * as utils from './utils';
|
|
|
3
3
|
export declare const mapUtils: {
|
|
4
4
|
replaceLayerIdsToEnsureUniqueLayerIdsInStore: (layerIds: import("./replaceLayerIdsToEnsureUniqueLayerIdsInStore").LayersAndAutoLayerIds) => import("./replaceLayerIdsToEnsureUniqueLayerIdsInStore").LayersAndAutoLayerIds;
|
|
5
5
|
moveArrayElements<T>(array: T[], oldIndex: number, newIndex: number): T[];
|
|
6
|
-
dateFormat: "yyyy-MM-dd'T'HH:mm:ss'Z";
|
|
6
|
+
dateFormat: "yyyy-MM-dd'T'HH:mm:ss'Z'";
|
|
7
7
|
createMap: ({ id, isAnimating, animationStartTime, animationEndTime, isAutoUpdating, shouldEndtimeOverride, bbox, srs, baseLayers, overLayers, mapLayers, featureLayers, dimensions, autoUpdateLayerId, autoTimeStepLayerId, timeSliderSpan, timeStep, animationDelay, timeSliderWidth, timeSliderCenterTime, timeSliderSecondsPerPx, isTimestepAuto, isTimeSpanAuto, isTimeSliderHoverOn, isTimeSliderVisible, displayMapPin, disableMapPin, shouldShowZoomControls, }: utils.CreateMapProps) => mapTypes.WebMap;
|
|
8
8
|
checkValidLayersPayload: (layers: import("../types").Layer[], mapId: string) => boolean;
|
|
9
9
|
getDraftMapById: (mapId: string, draft: mapTypes.WebMapState) => mapTypes.WebMap;
|
|
@@ -3,7 +3,7 @@ import { SpeedFactorType } from '@opengeoweb/timeslider';
|
|
|
3
3
|
import { Bbox, Dimension } from './types';
|
|
4
4
|
import type { WebMapState, WebMap } from '../types';
|
|
5
5
|
import type { Layer } from '../layers/types';
|
|
6
|
-
export declare const dateFormat = "yyyy-MM-dd'T'HH:mm:ss'Z";
|
|
6
|
+
export declare const dateFormat = "yyyy-MM-dd'T'HH:mm:ss'Z'";
|
|
7
7
|
export interface CreateMapProps {
|
|
8
8
|
id: string;
|
|
9
9
|
isAnimating?: boolean;
|