@opengeoweb/store 11.1.0 → 12.1.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 +1378 -931
- package/package.json +7 -6
- package/src/store/generic/selectors.d.ts +9 -6
- package/src/store/index.d.ts +1 -0
- package/src/store/map/index.d.ts +1 -1
- package/src/store/map/map/olMapListenerAnimationUtils.d.ts +46 -0
- package/src/store/map/map/olMapListenerAnimationUtils.spec.d.ts +1 -0
- package/src/store/map/map/selectors.d.ts +6 -1
- package/src/store/map/map/types.d.ts +6 -0
- package/src/store/mapStore/openlayers/listener.d.ts +2 -0
- package/src/store/mapStore/openlayers/listener.spec.d.ts +1 -0
- package/src/store/mapStore/openlayers/syncGroupViewStore.d.ts +26 -0
- package/src/store/store.d.ts +1 -0
- package/src/store/ui/types.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/store",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.1.0",
|
|
4
4
|
"description": "GeoWeb Store library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -8,16 +8,17 @@
|
|
|
8
8
|
"url": "git@gitlab.com:opengeoweb/opengeoweb.git"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@opengeoweb/shared": "
|
|
11
|
+
"@opengeoweb/shared": "12.1.0",
|
|
12
12
|
"react-redux": "^8.1.3",
|
|
13
13
|
"@reduxjs/toolkit": "^1.9.7",
|
|
14
|
-
"@opengeoweb/webmap-react": "
|
|
15
|
-
"@opengeoweb/webmap": "
|
|
14
|
+
"@opengeoweb/webmap-react": "12.1.0",
|
|
15
|
+
"@opengeoweb/webmap": "12.1.0",
|
|
16
16
|
"immer": "^10.0.3",
|
|
17
17
|
"lodash": "^4.17.21",
|
|
18
|
-
"@opengeoweb/metronome": "
|
|
19
|
-
"@opengeoweb/timeslider": "
|
|
18
|
+
"@opengeoweb/metronome": "12.1.0",
|
|
19
|
+
"@opengeoweb/timeslider": "12.1.0",
|
|
20
20
|
"react-router-dom": "^6.23.1",
|
|
21
|
+
"ol": "^10.4.0",
|
|
21
22
|
"@turf/turf": "^7.2.0"
|
|
22
23
|
},
|
|
23
24
|
"peerDependencies": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CoreAppStore } from '../types';
|
|
2
|
-
import type { LinkedState, SynchronizationGroupState, SynchronizationSource } from './syncGroups/types';
|
|
2
|
+
import type { LinkedState, PotentialData, SynchronizationGroupState, SynchronizationSource } from './syncGroups/types';
|
|
3
3
|
export declare const getSynchronizationGroupStore: ((state: CoreAppStore) => SynchronizationGroupState) & import("reselect").OutputSelectorFields<(args_0: SynchronizationGroupState) => SynchronizationGroupState, {
|
|
4
4
|
clearCache: () => void;
|
|
5
5
|
}> & {
|
|
@@ -16,7 +16,7 @@ export declare const getLinkedMaps: ((state: any, panelId: string) => string[])
|
|
|
16
16
|
clearCache: () => void;
|
|
17
17
|
};
|
|
18
18
|
export declare const getLinkedFeatureProviders: (linkedState: LinkedState, mapId: string) => string[];
|
|
19
|
-
export declare const selectSharedData: ((state: any, panelId: string) =>
|
|
19
|
+
export declare const selectSharedData: ((state: any, panelId: string) => PotentialData) & import("reselect").OutputSelectorFields<(args_0: LinkedState, args_1: string) => PotentialData, {
|
|
20
20
|
clearCache: () => void;
|
|
21
21
|
}> & {
|
|
22
22
|
clearCache: () => void;
|
|
@@ -59,9 +59,8 @@ export declare const getSelectedFeature: ((state: SynchronizationGroupState, map
|
|
|
59
59
|
lat: number;
|
|
60
60
|
lon: number;
|
|
61
61
|
id: string;
|
|
62
|
-
serviceId: any;
|
|
63
|
-
collectionId: any;
|
|
64
62
|
name: any;
|
|
63
|
+
occurrences: any;
|
|
65
64
|
} | null) & import("reselect").OutputSelectorFields<(args_0: {
|
|
66
65
|
features: {
|
|
67
66
|
id: string;
|
|
@@ -73,11 +72,15 @@ export declare const getSelectedFeature: ((state: SynchronizationGroupState, map
|
|
|
73
72
|
lat: number;
|
|
74
73
|
lon: number;
|
|
75
74
|
id: string;
|
|
76
|
-
serviceId: any;
|
|
77
|
-
collectionId: any;
|
|
78
75
|
name: any;
|
|
76
|
+
occurrences: any;
|
|
79
77
|
} | null, {
|
|
80
78
|
clearCache: () => void;
|
|
81
79
|
}> & {
|
|
82
80
|
clearCache: () => void;
|
|
83
81
|
};
|
|
82
|
+
export declare const getSelectedFeatureAsGeoJSON: ((state: SynchronizationGroupState, mapId: string) => import("geojson").Feature<import("geojson").Geometry, import("geojson").GeoJsonProperties> | null | undefined) & import("reselect").OutputSelectorFields<(args_0: PotentialData) => import("geojson").Feature<import("geojson").Geometry, import("geojson").GeoJsonProperties> | null | undefined, {
|
|
83
|
+
clearCache: () => void;
|
|
84
|
+
}> & {
|
|
85
|
+
clearCache: () => void;
|
|
86
|
+
};
|
package/src/store/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './ui';
|
|
|
3
3
|
export * from './generic';
|
|
4
4
|
export { genericListener } from './generic/listener';
|
|
5
5
|
export { mapListener } from './map/map/listener';
|
|
6
|
+
export { openlayersListener } from './mapStore/openlayers/listener';
|
|
6
7
|
export { serviceListener } from './map/service/listener';
|
|
7
8
|
export { routerListener } from './router/listener';
|
|
8
9
|
export { drawingToolListener } from './drawingTool/listener';
|
package/src/store/map/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './service';
|
|
2
2
|
export * from './map';
|
|
3
3
|
export * from './layer';
|
|
4
|
-
export type { WebMapStateModuleState, MapPreset, MapPresetInitialProps, } from './types';
|
|
4
|
+
export type { WebMapStateModuleState, MapPreset, MapPresetInitialProps, TimeSliderStartCenterEndTime, } from './types';
|
|
5
5
|
export * as storeTestSettings from './storeTestSettings';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Dispatch, ListenerEffectAPI } from '@reduxjs/toolkit';
|
|
2
|
+
import { ReduxLayer } from '../types';
|
|
3
|
+
import { CoreAppStore } from '../../types';
|
|
4
|
+
/**
|
|
5
|
+
* Returns the next step for given timerId.
|
|
6
|
+
* @param timerId The timer id
|
|
7
|
+
* @param numberOfStepsInAnimation Animation length in steps
|
|
8
|
+
* @param numStepsToGoForward Amount of steps to go forwards, defaults to 1. Can be positive and negative
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
export declare const getNextStep: (timerId: string, numberOfStepsInAnimation: number, numStepsToGoForward?: number) => number;
|
|
12
|
+
/**
|
|
13
|
+
* 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.
|
|
14
|
+
* @param timerId The timer id
|
|
15
|
+
* @param numberOfStepsInAnimation Number of steps in the animation
|
|
16
|
+
* @param dwell The number of steps to wait at the end of the animation sequence before to continue
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
19
|
+
export declare const handleTimerDwell: (timerId: string, numberOfStepsInAnimation: number, dwell?: number) => boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Set step for the timerId
|
|
22
|
+
* @param timerId
|
|
23
|
+
* @param timerStep
|
|
24
|
+
*/
|
|
25
|
+
export declare const setStep: (timerId: string, timerStep: number) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Gets the current step for the timer
|
|
28
|
+
* @param timerId
|
|
29
|
+
* @returns
|
|
30
|
+
*/
|
|
31
|
+
export declare const getCurrentStep: (timerId: string) => number;
|
|
32
|
+
/**
|
|
33
|
+
* Checks if the next step is available for all provided layers
|
|
34
|
+
* @param reduxLayers
|
|
35
|
+
* @param nextTimeString
|
|
36
|
+
* @returns
|
|
37
|
+
*/
|
|
38
|
+
export declare const isNextStepAvailable: (reduxLayers: ReduxLayer[], nextTimeString: string) => boolean;
|
|
39
|
+
/**
|
|
40
|
+
* This handler is triggered by the metronome. An array of timerIds is given as argument.
|
|
41
|
+
* It will update the animation loop of multiple maps and sliders
|
|
42
|
+
* It will prefetch images for maps
|
|
43
|
+
* @param timerIds string[] array of timerIds
|
|
44
|
+
* @param listenerApi ListenerEffectAPI<CoreAppStore, Dispatch, unknown> listenerApi as received from listener
|
|
45
|
+
*/
|
|
46
|
+
export declare const olMetronomeHandler: (timerIds: string[], listenerApi: ListenerEffectAPI<CoreAppStore, Dispatch, unknown>) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Bbox, MapPreset, WebMap, WebMapState } from './types';
|
|
2
2
|
import type { CoreAppStore } from '../../types';
|
|
3
|
-
import type { Dimension, Layer, ReduxLayer, WebMapAnimationList } from '../types';
|
|
3
|
+
import type { Dimension, Layer, ReduxLayer, TimeSliderStartCenterEndTime, WebMapAnimationList } from '../types';
|
|
4
4
|
import type { uiTypes } from '../../ui';
|
|
5
5
|
/**
|
|
6
6
|
* Gets the map state by mapId
|
|
@@ -429,6 +429,11 @@ export declare const getMapTimeSliderCenterTime: ((state: CoreAppStore, mapId: s
|
|
|
429
429
|
}> & {
|
|
430
430
|
clearCache: () => void;
|
|
431
431
|
};
|
|
432
|
+
export declare const getMapTimeSliderStartCenterEndAndStep: ((state: CoreAppStore, mapId: string) => TimeSliderStartCenterEndTime) & import("reselect").OutputSelectorFields<(args_0: WebMap | undefined) => TimeSliderStartCenterEndTime, {
|
|
433
|
+
clearCache: () => void;
|
|
434
|
+
}> & {
|
|
435
|
+
clearCache: () => void;
|
|
436
|
+
};
|
|
432
437
|
/**
|
|
433
438
|
* Returns the number of seconds per pixel on the time slider
|
|
434
439
|
*
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { WebMapStateModuleState } from '../../map/types';
|
|
2
|
+
export declare const openlayersListener: import("@reduxjs/toolkit").ListenerMiddlewareInstance<WebMapStateModuleState, import("@reduxjs/toolkit").ThunkDispatch<WebMapStateModuleState, unknown, import("redux").AnyAction>, unknown>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Observable, View } from 'ol';
|
|
2
|
+
export declare const copyView: (view: View) => View;
|
|
3
|
+
/**
|
|
4
|
+
* The StoredView objects keep references to OpenLayers View objects that may be shared
|
|
5
|
+
* between multiple maps (when maps are pan/zoom synced).
|
|
6
|
+
* This file then offers and API for each map to retrieve the StoredView object
|
|
7
|
+
* that is relevant for the current workspace configuration.
|
|
8
|
+
*
|
|
9
|
+
* React is functional, but OpenLayers is object oriented.
|
|
10
|
+
* This component sits in between the two and thus you can make an argument for either style.
|
|
11
|
+
* Object oriented was chosen since:
|
|
12
|
+
* - This allows us to use OpenLayers's Observable as a base class to provide event handling,
|
|
13
|
+
* which is useful for the implementation.
|
|
14
|
+
* - For this mechanism to work smoothly with OpenLayers,
|
|
15
|
+
* we need to pass the exact same View object reference for all maps that are synchronized. Redux stores cannot be used in this context and prop drilling and/or context providers would likely lead to more invasive implementations.
|
|
16
|
+
*/
|
|
17
|
+
export declare class StoredView extends Observable {
|
|
18
|
+
name: string;
|
|
19
|
+
view: View;
|
|
20
|
+
constructor(name: string, view: View);
|
|
21
|
+
setView(view: View): void;
|
|
22
|
+
}
|
|
23
|
+
export declare const clearSyncGroupViewStore: () => void;
|
|
24
|
+
export declare const getViewObjectForMapId: (id: string) => StoredView;
|
|
25
|
+
export declare const createViewObjectForNewMap: (createFromId: string, newId: string) => void;
|
|
26
|
+
export declare const getViewObjectForSyncGroup: (id: string) => StoredView;
|
package/src/store/store.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export declare const storeReducerMap: {
|
|
|
19
19
|
};
|
|
20
20
|
export declare const storeMiddlewares: (ListenerMiddleware<import("./types").CoreAppStore, import("@reduxjs/toolkit").ThunkDispatch<import("./types").CoreAppStore, unknown, import("redux").AnyAction>, unknown> | ListenerMiddleware<import("./router/types").RouterModuleStore, import("@reduxjs/toolkit").ThunkDispatch<import("./router/types").RouterModuleStore, unknown, import("redux").AnyAction>, unknown>)[];
|
|
21
21
|
export declare const createMockStore: (mockState?: WebMapStateModuleState | SynchronizationGroupModuleState | LoadingIndicatorModuleState | UIModuleState | DrawtoolModuleStore) => ToolkitStore;
|
|
22
|
+
export { getViewObjectForSyncGroup, getViewObjectForMapId, createViewObjectForNewMap, } from './mapStore/openlayers/syncGroupViewStore';
|
|
22
23
|
/**
|
|
23
24
|
* This creates an OpenGeoWeb redux store for redux connected components
|
|
24
25
|
*
|
package/src/store/ui/types.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare enum DialogTypes {
|
|
|
7
7
|
TimeSeriesSelect = "timeSeriesSelect",
|
|
8
8
|
TimeSeriesManager = "timeSeriesManager",
|
|
9
9
|
TimeseriesInfo = "timeseriesInfo",
|
|
10
|
+
TimeseriesLocationInfo = "timeseriesLocationInfo",
|
|
10
11
|
KeywordFilter = "keywordFilter",
|
|
11
12
|
DimensionSelectEnsembleMember = "dimensionSelect-ensemble_member",
|
|
12
13
|
DimensionSelectElevation = "dimensionSelect-elevation",
|