@opengeoweb/store 9.20.2 → 9.21.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
@@ -3911,6 +3911,7 @@ const slice$5 = createSlice({
3911
3911
  return;
3912
3912
  }
3913
3913
  draft.byId[mapId].animationStartTime = animationStartTime;
3914
+ draft.byId[mapId].isAnimationLengthAuto = false;
3914
3915
  },
3915
3916
  setAnimationEndTime: (draft, action) => {
3916
3917
  const {
@@ -3921,6 +3922,7 @@ const slice$5 = createSlice({
3921
3922
  return;
3922
3923
  }
3923
3924
  draft.byId[mapId].animationEndTime = animationEndTime;
3925
+ draft.byId[mapId].isAnimationLengthAuto = false;
3924
3926
  },
3925
3927
  setAnimationDelay: (draft, action) => {
3926
3928
  const {
@@ -4057,6 +4059,16 @@ const slice$5 = createSlice({
4057
4059
  }
4058
4060
  draft.byId[mapId].isTimeSpanAuto = timeSpanAuto;
4059
4061
  },
4062
+ toggleAnimationLengthAuto: (draft, action) => {
4063
+ const {
4064
+ mapId,
4065
+ autoAnimationLength
4066
+ } = action.payload;
4067
+ if (!draft.byId[mapId]) {
4068
+ return;
4069
+ }
4070
+ draft.byId[mapId].isAnimationLengthAuto = autoAnimationLength;
4071
+ },
4060
4072
  toggleTimeSliderHover: (draft, action) => {
4061
4073
  const {
4062
4074
  mapId,
@@ -5825,6 +5837,13 @@ const getMapTimeSliderSecondsPerPx = createSelector(getMapById, store => store ?
5825
5837
  * @returns {boolean} returnType: boolean
5826
5838
  */
5827
5839
  const isTimestepAuto = createSelector(getMapById, store => store ? store.isTimestepAuto : false, selectorMemoizationOptions);
5840
+ /**
5841
+ * Returns map is animation auto
5842
+ * @param {object} store store: object - store object
5843
+ * @param {string} mapId mapId: string - Id of the map
5844
+ * @returns {boolean} returnType: boolean
5845
+ */
5846
+ const isAnimationLengthAuto = createSelector(getMapById, store => (store === null || store === void 0 ? void 0 : store.isAnimationLengthAuto) || false, selectorMemoizationOptions);
5828
5847
  /**
5829
5848
  * Returns map is timespan auto
5830
5849
  *
@@ -6089,6 +6108,25 @@ const getAnimationList = createSelector(getMapById, getAnimationStartTime, getAn
6089
6108
  }
6090
6109
  return timeList;
6091
6110
  }, selectorMemoizationOptions);
6111
+ /**
6112
+ * @param {object} store store: object - store object
6113
+ * @param {string} mapId mapId: string - Id of the map
6114
+ * @returns {object} Returns min and max value of time dimension of autoTimeStep-layer. If no autoTimeStep-layer it returns default start/end time from store.
6115
+ */
6116
+ const getAnimationRange = createSelector(store => store, getAutoTimeStepLayerId, getAnimationStartTime, getAnimationEndTime, isAnimationLengthAuto, getLayerTimeDimension, (store, autoTimeStepLayerId, startTime, endTime, isAnimationLengthAuto) => {
6117
+ const layerTimeDimension = getLayerTimeDimension(store, autoTimeStepLayerId);
6118
+ const {
6119
+ minValue,
6120
+ maxValue
6121
+ } = layerTimeDimension || {};
6122
+ const hasTimeDimension = minValue && maxValue;
6123
+ const animationStartTime = isAnimationLengthAuto && autoTimeStepLayerId && hasTimeDimension ? minValue : startTime;
6124
+ const animationEndTime = isAnimationLengthAuto && autoTimeStepLayerId && hasTimeDimension ? maxValue : endTime;
6125
+ return {
6126
+ animationStartTime,
6127
+ animationEndTime
6128
+ };
6129
+ });
6092
6130
 
6093
6131
  var selectors$2 = /*#__PURE__*/Object.freeze({
6094
6132
  __proto__: null,
@@ -6098,6 +6136,7 @@ var selectors$2 = /*#__PURE__*/Object.freeze({
6098
6136
  getAllUniqueDimensions: getAllUniqueDimensions,
6099
6137
  getAnimationEndTime: getAnimationEndTime,
6100
6138
  getAnimationList: getAnimationList,
6139
+ getAnimationRange: getAnimationRange,
6101
6140
  getAnimationStartTime: getAnimationStartTime,
6102
6141
  getAutoTimeStepLayerId: getAutoTimeStepLayerId,
6103
6142
  getAutoUpdateLayerId: getAutoUpdateLayerId,
@@ -6140,6 +6179,7 @@ var selectors$2 = /*#__PURE__*/Object.freeze({
6140
6179
  getSelectedTime: getSelectedTime,
6141
6180
  getSrs: getSrs,
6142
6181
  isAnimating: isAnimating,
6182
+ isAnimationLengthAuto: isAnimationLengthAuto,
6143
6183
  isAutoUpdating: isAutoUpdating,
6144
6184
  isTimeSliderHoverOn: isTimeSliderHoverOn,
6145
6185
  isTimeSliderVisible: isTimeSliderVisible,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/store",
3
- "version": "9.20.2",
3
+ "version": "9.21.0",
4
4
  "description": "GeoWeb Store library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -37,6 +37,7 @@ export declare const mapStoreActions: {
37
37
  setEndTimeOverriding: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./types").SetEndTimeOverriding, "mapReducer/setEndTimeOverriding">;
38
38
  toggleTimestepAuto: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./types").ToggleTimestepAutoPayload, "mapReducer/toggleTimestepAuto">;
39
39
  toggleTimeSpanAuto: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./types").ToggleTimeSpanAutoPayload, "mapReducer/toggleTimeSpanAuto">;
40
+ toggleAnimationLengthAuto: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./types").ToggleAnimationLengthAutoPayload, "mapReducer/toggleAnimationLengthAuto">;
40
41
  toggleTimeSliderHover: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./types").ToggleTimeSliderHoverPayload, "mapReducer/toggleTimeSliderHover">;
41
42
  toggleTimeSliderIsVisible: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./types").ToggleTimeSliderIsVisiblePayload, "mapReducer/toggleTimeSliderIsVisible">;
42
43
  toggleZoomControls: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./types").ToggleZoomControlsPayload, "mapReducer/toggleZoomControls">;
@@ -1,6 +1,6 @@
1
1
  import { PayloadAction, Draft } from '@reduxjs/toolkit';
2
2
  import { MapPinLocationPayload, SetBboxPayload, SetStepBackWardOrForward, UpdateAllMapDimensionsPayload } from '@opengeoweb/webmap-react';
3
- import type { WebMapState, SetAutoLayerIdPayload, SetMapAnimationStartPayload, SetMapAnimationStopPayload, SetTimeSliderSpanPayload, SetTimeStepPayload, SetAnimationStartTimePayload, SetAnimationEndTimePayload, SetAnimationDelayPayload, MoveLayerPayload, SetTimeSliderWidthPayload, SetTimeSliderCenterTimePayload, SetEndTimeOverriding, ToggleAutoUpdatePayload, ToggleTimestepAutoPayload, ToggleTimeSpanAutoPayload, ToggleTimeSliderHoverPayload, DisableMapPinPayload, SetTimeSliderSecondsPerPxPayload, ToggleTimeSliderIsVisiblePayload, SetDockedLayerManagerSize } from './types';
3
+ import type { WebMapState, SetAutoLayerIdPayload, SetMapAnimationStartPayload, SetMapAnimationStopPayload, SetTimeSliderSpanPayload, SetTimeStepPayload, SetAnimationStartTimePayload, SetAnimationEndTimePayload, SetAnimationDelayPayload, MoveLayerPayload, SetTimeSliderWidthPayload, SetTimeSliderCenterTimePayload, SetEndTimeOverriding, ToggleAutoUpdatePayload, ToggleTimestepAutoPayload, ToggleTimeSpanAutoPayload, ToggleTimeSliderHoverPayload, DisableMapPinPayload, SetTimeSliderSecondsPerPxPayload, ToggleTimeSliderIsVisiblePayload, SetDockedLayerManagerSize, ToggleAnimationLengthAutoPayload } from './types';
4
4
  import { ToggleMapPinIsVisiblePayload, ToggleZoomControlsPayload } from '../types';
5
5
  /**
6
6
  * Checks if the layer id is already taken in one of the maps.
@@ -44,6 +44,7 @@ export declare const slice: import("@reduxjs/toolkit").Slice<WebMapState, {
44
44
  setEndTimeOverriding: (draft: Draft<WebMapState>, action: PayloadAction<SetEndTimeOverriding>) => void;
45
45
  toggleTimestepAuto: (draft: Draft<WebMapState>, action: PayloadAction<ToggleTimestepAutoPayload>) => void;
46
46
  toggleTimeSpanAuto: (draft: Draft<WebMapState>, action: PayloadAction<ToggleTimeSpanAutoPayload>) => void;
47
+ toggleAnimationLengthAuto: (draft: Draft<WebMapState>, action: PayloadAction<ToggleAnimationLengthAutoPayload>) => void;
47
48
  toggleTimeSliderHover: (draft: Draft<WebMapState>, action: PayloadAction<ToggleTimeSliderHoverPayload>) => void;
48
49
  toggleTimeSliderIsVisible: (draft: Draft<WebMapState>, action: PayloadAction<ToggleTimeSliderIsVisiblePayload>) => void;
49
50
  toggleZoomControls: (draft: Draft<WebMapState>, action: PayloadAction<ToggleZoomControlsPayload>) => void;
@@ -92,6 +93,7 @@ export declare const mapActions: {
92
93
  setEndTimeOverriding: import("@reduxjs/toolkit").ActionCreatorWithPayload<SetEndTimeOverriding, "mapReducer/setEndTimeOverriding">;
93
94
  toggleTimestepAuto: import("@reduxjs/toolkit").ActionCreatorWithPayload<ToggleTimestepAutoPayload, "mapReducer/toggleTimestepAuto">;
94
95
  toggleTimeSpanAuto: import("@reduxjs/toolkit").ActionCreatorWithPayload<ToggleTimeSpanAutoPayload, "mapReducer/toggleTimeSpanAuto">;
96
+ toggleAnimationLengthAuto: import("@reduxjs/toolkit").ActionCreatorWithPayload<ToggleAnimationLengthAutoPayload, "mapReducer/toggleAnimationLengthAuto">;
95
97
  toggleTimeSliderHover: import("@reduxjs/toolkit").ActionCreatorWithPayload<ToggleTimeSliderHoverPayload, "mapReducer/toggleTimeSliderHover">;
96
98
  toggleTimeSliderIsVisible: import("@reduxjs/toolkit").ActionCreatorWithPayload<ToggleTimeSliderIsVisiblePayload, "mapReducer/toggleTimeSliderIsVisible">;
97
99
  toggleZoomControls: import("@reduxjs/toolkit").ActionCreatorWithPayload<ToggleZoomControlsPayload, "mapReducer/toggleZoomControls">;
@@ -455,6 +455,17 @@ export declare const isTimestepAuto: ((state: any, mapId: any) => boolean | unde
455
455
  }> & {
456
456
  clearCache: () => void;
457
457
  };
458
+ /**
459
+ * Returns map is animation auto
460
+ * @param {object} store store: object - store object
461
+ * @param {string} mapId mapId: string - Id of the map
462
+ * @returns {boolean} returnType: boolean
463
+ */
464
+ export declare const isAnimationLengthAuto: ((state: any, mapId: any) => boolean) & import("reselect").OutputSelectorFields<(args_0: WebMap | undefined) => boolean, {
465
+ clearCache: () => void;
466
+ }> & {
467
+ clearCache: () => void;
468
+ };
458
469
  /**
459
470
  * Returns map is timespan auto
460
471
  *
@@ -704,3 +715,19 @@ export declare const getAnimationList: ((state: any, mapId: any) => WebMapAnimat
704
715
  }> & {
705
716
  clearCache: () => void;
706
717
  };
718
+ /**
719
+ * @param {object} store store: object - store object
720
+ * @param {string} mapId mapId: string - Id of the map
721
+ * @returns {object} Returns min and max value of time dimension of autoTimeStep-layer. If no autoTimeStep-layer it returns default start/end time from store.
722
+ */
723
+ export declare const getAnimationRange: ((state: any, mapId: any) => {
724
+ animationStartTime: string | undefined;
725
+ animationEndTime: string | undefined;
726
+ }) & import("reselect").OutputSelectorFields<(args_0: CoreAppStore, args_1: string | undefined, args_2: string | undefined, args_3: string | undefined, args_4: boolean, args_5: Dimension | undefined) => {
727
+ animationStartTime: string | undefined;
728
+ animationEndTime: string | undefined;
729
+ }, {
730
+ clearCache: () => void;
731
+ }> & {
732
+ clearCache: () => void;
733
+ };
@@ -43,6 +43,7 @@ export interface WebMap {
43
43
  timeSliderSecondsPerPx?: number;
44
44
  isTimestepAuto?: boolean;
45
45
  isTimeSpanAuto?: boolean;
46
+ isAnimationLengthAuto?: boolean;
46
47
  isTimeSliderHoverOn?: boolean;
47
48
  isTimeSliderVisible?: boolean;
48
49
  shouldShowZoomControls?: boolean;
@@ -179,6 +180,11 @@ export interface ToggleTimeSpanAutoPayload {
179
180
  timeSpanAuto: boolean;
180
181
  origin?: MapActionOrigin;
181
182
  }
183
+ export interface ToggleAnimationLengthAutoPayload {
184
+ mapId: string;
185
+ autoAnimationLength: boolean;
186
+ origin?: MapActionOrigin;
187
+ }
182
188
  export interface ToggleTimeSliderHoverPayload {
183
189
  mapId: string;
184
190
  isTimeSliderHoverOn: boolean;