@opengeoweb/store 6.0.3 → 6.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 +602 -149
- package/package.json +2 -2
- package/src/store/coreModuleConfig.d.ts +1 -1
- package/src/store/drawingtool/config.d.ts +4 -0
- package/src/store/drawingtool/index.d.ts +4 -0
- package/src/store/drawingtool/reducer.d.ts +33 -0
- package/src/store/drawingtool/reducer.spec.d.ts +21 -0
- package/src/store/drawingtool/sagas.d.ts +6 -0
- package/src/store/drawingtool/sagas.spec.d.ts +1 -0
- package/src/store/drawingtool/selectors.d.ts +8 -0
- package/src/store/drawingtool/selectors.spec.d.ts +1 -0
- package/src/store/drawingtool/testUtils.d.ts +1 -0
- package/src/store/generic/synchronizationGroups/selectors.d.ts +3 -1
- package/src/store/generic/synchronizationGroups/types.d.ts +2 -0
- package/src/store/index.d.ts +1 -0
- package/src/store/layerSelect/types.d.ts +1 -0
- package/src/store/mapStore/index.d.ts +4 -0
- package/src/store/mapStore/layers/reducer.d.ts +9 -1
- package/src/store/mapStore/layers/selectors.d.ts +43 -4
- package/src/store/mapStore/layers/types.d.ts +24 -20
- package/src/store/mapStore/layers/utils.d.ts +6 -0
- package/src/store/mapStore/map/defaultLayers.d.ts +1 -1
- package/src/store/mapStore/map/selectors.d.ts +13 -8
- package/src/store/mapStore/storeTestUtils.d.ts +3 -1
- package/src/store/types.d.ts +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/store",
|
|
3
|
-
"version": "6.0
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"description": "GeoWeb Store library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"main": "./index.esm.js",
|
|
13
13
|
"dependencies": {},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@opengeoweb/webmap": "6.0
|
|
15
|
+
"@opengeoweb/webmap": "6.1.0",
|
|
16
16
|
"@redux-eggs/core": "2.2.0",
|
|
17
17
|
"@redux-eggs/redux-toolkit": "2.2.0",
|
|
18
18
|
"@redux-eggs/saga-extension": "2.2.0",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const coreModuleConfig: (import("@redux-eggs/core").Egg<import("redux").Store<import("./mapStore").WebMapStateModuleState, import("redux").AnyAction>> | import("@redux-eggs/core").Egg<import("redux").Store<import("./generic/synchronizationGroups/types").SynchronizationGroupModuleState, import("redux").AnyAction>> | import("@redux-eggs/core").Egg<import("redux").Store<import("./ui/types").UIModuleState, import("redux").AnyAction>> | import("@redux-eggs/core").Egg<import("redux").Store<import("./layerSelect/types").LayerSelectModuleState, import("redux").AnyAction>> | import("@redux-eggs/core").Egg<import("redux").Store<import("./snackbar/types").SnackbarModuleStore, import("redux").AnyAction>> | import("@redux-eggs/core").Egg<import("redux").Store<import("./drawings/types").DrawModuleStore, import("redux").AnyAction>>)[];
|
|
1
|
+
export declare const coreModuleConfig: (import("@redux-eggs/core").Egg<import("redux").Store<import("./mapStore").WebMapStateModuleState, import("redux").AnyAction>> | import("@redux-eggs/core").Egg<import("redux").Store<import("./generic/synchronizationGroups/types").SynchronizationGroupModuleState, import("redux").AnyAction>> | import("@redux-eggs/core").Egg<import("redux").Store<import("./ui/types").UIModuleState, import("redux").AnyAction>> | import("@redux-eggs/core").Egg<import("redux").Store<import("./layerSelect/types").LayerSelectModuleState, import("redux").AnyAction>> | import("@redux-eggs/core").Egg<import("redux").Store<import("./snackbar/types").SnackbarModuleStore, import("redux").AnyAction>> | import("@redux-eggs/core").Egg<import("redux").Store<import("./drawings/types").DrawModuleStore, import("redux").AnyAction>> | import("@redux-eggs/core").Egg<import("redux").Store<import("./drawingtool").DrawtoolModuleStore, import("redux").AnyAction>>)[];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { PayloadAction, Draft, EntityState } from '@reduxjs/toolkit';
|
|
2
|
+
export type DrawMode = {
|
|
3
|
+
drawModeId: string;
|
|
4
|
+
value: 'POLYGON' | 'BOX' | 'MULTIPOINT' | 'POINT' | 'LINESTRING' | 'DELETE';
|
|
5
|
+
shape: GeoJSON.Feature | GeoJSON.FeatureCollection;
|
|
6
|
+
title: string;
|
|
7
|
+
isSelectable: boolean;
|
|
8
|
+
};
|
|
9
|
+
export interface DrawToolItem {
|
|
10
|
+
drawToolId: string;
|
|
11
|
+
geoJSONLayerId: string;
|
|
12
|
+
activeDrawModeId: string;
|
|
13
|
+
drawModes: DrawMode[];
|
|
14
|
+
}
|
|
15
|
+
export type DrawingToolState = EntityState<DrawToolItem>;
|
|
16
|
+
export interface DrawtoolModuleStore {
|
|
17
|
+
drawingtools?: DrawingToolState;
|
|
18
|
+
}
|
|
19
|
+
export declare const drawAdapter: import("@reduxjs/toolkit").EntityAdapter<DrawToolItem>;
|
|
20
|
+
export declare const getDrawLayerId: (drawToolId: string) => string;
|
|
21
|
+
export declare const initialState: DrawingToolState;
|
|
22
|
+
export declare const reducer: import("redux").Reducer<DrawingToolState, import("redux").AnyAction>;
|
|
23
|
+
export declare const drawtoolActions: import("@reduxjs/toolkit").CaseReducerActions<{
|
|
24
|
+
registerDrawTool: (draft: Draft<DrawingToolState>, action: PayloadAction<{
|
|
25
|
+
mapId: string;
|
|
26
|
+
drawModes: DrawMode[];
|
|
27
|
+
drawToolId: string;
|
|
28
|
+
}>) => void;
|
|
29
|
+
changeDrawToolMode: (draft: Draft<DrawingToolState>, action: PayloadAction<{
|
|
30
|
+
drawToolId: string;
|
|
31
|
+
drawModeId: string;
|
|
32
|
+
}>) => void;
|
|
33
|
+
}, "draw">;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const testDefaultPoint: {
|
|
2
|
+
drawModeId: string;
|
|
3
|
+
value: "POINT";
|
|
4
|
+
title: string;
|
|
5
|
+
shape: import("geojson").Feature<import("geojson").Geometry, import("geojson").GeoJsonProperties>;
|
|
6
|
+
isSelectable: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const testDefaultPolygon: {
|
|
9
|
+
drawModeId: string;
|
|
10
|
+
value: "POLYGON";
|
|
11
|
+
title: string;
|
|
12
|
+
shape: import("geojson").Feature<import("geojson").Geometry, import("geojson").GeoJsonProperties>;
|
|
13
|
+
isSelectable: boolean;
|
|
14
|
+
};
|
|
15
|
+
export declare const testDefaultDelete: {
|
|
16
|
+
drawModeId: string;
|
|
17
|
+
value: "DELETE";
|
|
18
|
+
title: string;
|
|
19
|
+
shape: import("geojson").Feature<import("geojson").Geometry, import("geojson").GeoJsonProperties>;
|
|
20
|
+
isSelectable: boolean;
|
|
21
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SagaIterator } from 'redux-saga';
|
|
2
|
+
import { drawtoolActions } from './reducer';
|
|
3
|
+
export declare function registerDrawToolSaga({ payload, }: ReturnType<typeof drawtoolActions.registerDrawTool>): SagaIterator;
|
|
4
|
+
export declare function changeDrawToolSaga({ payload, }: ReturnType<typeof drawtoolActions.changeDrawToolMode>): SagaIterator;
|
|
5
|
+
declare function drawingSaga(): SagaIterator;
|
|
6
|
+
export default drawingSaga;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DrawingToolState, DrawtoolModuleStore } from './reducer';
|
|
2
|
+
export declare const getDrawingtoolStore: (store: DrawtoolModuleStore) => DrawingToolState;
|
|
3
|
+
export declare const selectDrawingToolByMapId: (state: DrawtoolModuleStore, id: import("@reduxjs/toolkit").EntityId) => import("./reducer").DrawToolItem | undefined;
|
|
4
|
+
export declare const getDrawModeById: ((state: DrawtoolModuleStore, _drawToolId: string, drawModeId: string) => import("./reducer").DrawMode | undefined) & import("reselect").OutputSelectorFields<(args_0: import("./reducer").DrawToolItem | undefined, args_1: string) => import("./reducer").DrawMode | undefined, {
|
|
5
|
+
clearCache: () => void;
|
|
6
|
+
}> & {
|
|
7
|
+
clearCache: () => void;
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const testGeoJSON: GeoJSON.FeatureCollection;
|
|
@@ -19,7 +19,9 @@ export declare const getSynchronizationGroup: (state: CoreAppStore, id: string)
|
|
|
19
19
|
export declare const getSynchronizationGroupSource: (state: CoreAppStore, id: string) => SynchronizationSource;
|
|
20
20
|
export declare const getTargets: (state: CoreAppStore, payload: GenericActionPayload, actionType: SyncType) => GenericSyncActionPayload[];
|
|
21
21
|
export declare const getTargetGroups: (state: CoreAppStore, payload: GenericActionPayload, actionType: SyncType) => string[];
|
|
22
|
-
export declare const getAllTargetGroupsForSource: ((state:
|
|
22
|
+
export declare const getAllTargetGroupsForSource: ((state: CoreAppStore, sourceId: string | {
|
|
23
|
+
sourceId: string;
|
|
24
|
+
}) => string[]) & import("reselect").OutputSelectorFields<(args_0: SynchronizationGroupState, args_1: string) => string[], {
|
|
23
25
|
clearCache: () => void;
|
|
24
26
|
}> & {
|
|
25
27
|
clearCache: () => void;
|
|
@@ -16,6 +16,7 @@ export interface SyncGroupViewState {
|
|
|
16
16
|
timeslider: GroupsAndSources;
|
|
17
17
|
zoompane: GroupsAndSources;
|
|
18
18
|
level: GroupsAndSources;
|
|
19
|
+
[key: string]: GroupsAndSources;
|
|
19
20
|
}
|
|
20
21
|
export interface SynchronizationGroup {
|
|
21
22
|
type: SyncType;
|
|
@@ -63,6 +64,7 @@ export interface SyncGroupTarget {
|
|
|
63
64
|
groupId: string;
|
|
64
65
|
targetId: string;
|
|
65
66
|
linked?: boolean;
|
|
67
|
+
[key: string]: unknown;
|
|
66
68
|
}
|
|
67
69
|
export interface SyncGroupAddTargetPayload extends SyncGroupTarget {
|
|
68
70
|
origin?: Origin;
|
package/src/store/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from './snackbar';
|
|
|
6
6
|
export * from './router';
|
|
7
7
|
export * from './app';
|
|
8
8
|
export * from './drawings';
|
|
9
|
+
export * from './drawingtool';
|
|
9
10
|
export * from './types';
|
|
10
11
|
export * as storeTestUtils from './mapStore/storeTestUtils';
|
|
11
12
|
export * from './coreModuleConfig';
|
|
@@ -67,6 +67,10 @@ export declare const mapStoreActions: {
|
|
|
67
67
|
setAvailableBaseLayers: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./types").SetAvailableBaseLayersPayload, "layerReducer/setAvailableBaseLayers">;
|
|
68
68
|
onUpdateLayerInformation: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./types").UpdateLayerInfoPayload, "layerReducer/onUpdateLayerInformation">;
|
|
69
69
|
setSelectedFeature: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./types").SetSelectedFeaturePayload, "layerReducer/setSelectedFeature">;
|
|
70
|
+
updateFeature: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./types").UpdateFeaturePayload, "layerReducer/updateFeature">;
|
|
71
|
+
updateFeatureProperties: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./types").UpdateFeaturePropertiesPayload, "layerReducer/updateFeatureProperties">;
|
|
72
|
+
toggleFeatureMode: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./types").ToggleFeatureModePayload, "layerReducer/toggleFeatureMode">;
|
|
73
|
+
exitFeatureDrawMode: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./types").ExitFeatureDrawModePayload, "layerReducer/exitFeatureDrawMode">;
|
|
70
74
|
};
|
|
71
75
|
export * from './service';
|
|
72
76
|
export * from './map';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Draft, PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
-
import { LayerState, Layer, AddLayerPayload, SetLayerDimensionPayload, SetLayerEnabledPayload, SetLayerOpacityPayload, SetLayerStylePayload, SetLayerNamePayload, SetLayerGeojsonPayload, DeleteLayerPayload, ErrorLayerPayload, SetLayersPayload, SetBaseLayersPayload, AddBaseLayerPayload, SetLayerDimensionsPayload, AddAvailableBaseLayerPayload, AddAvailableBaseLayersPayload, UpdateLayerInfoPayload, SetAvailableBaseLayersPayload, SetSelectedFeaturePayload } from './types';
|
|
2
|
+
import { LayerState, Layer, AddLayerPayload, SetLayerDimensionPayload, SetLayerEnabledPayload, SetLayerOpacityPayload, SetLayerStylePayload, SetLayerNamePayload, SetLayerGeojsonPayload, DeleteLayerPayload, ErrorLayerPayload, SetLayersPayload, SetBaseLayersPayload, AddBaseLayerPayload, SetLayerDimensionsPayload, AddAvailableBaseLayerPayload, AddAvailableBaseLayersPayload, UpdateLayerInfoPayload, SetAvailableBaseLayersPayload, SetSelectedFeaturePayload, UpdateFeaturePayload, ExitFeatureDrawModePayload, ToggleFeatureModePayload, UpdateFeaturePropertiesPayload } from './types';
|
|
3
3
|
export declare const createLayer: ({ id, opacity, acceptanceTimeInMinutes, enabled, layerType, status, ...props }: Layer) => Layer;
|
|
4
4
|
export declare const initialState: LayerState;
|
|
5
5
|
export declare const slice: import("@reduxjs/toolkit").Slice<LayerState, {
|
|
@@ -26,6 +26,10 @@ export declare const slice: import("@reduxjs/toolkit").Slice<LayerState, {
|
|
|
26
26
|
setAvailableBaseLayers: (draft: Draft<LayerState>, action: PayloadAction<SetAvailableBaseLayersPayload>) => void;
|
|
27
27
|
onUpdateLayerInformation: (draft: Draft<LayerState>, action: PayloadAction<UpdateLayerInfoPayload>) => void;
|
|
28
28
|
setSelectedFeature: (draft: Draft<LayerState>, action: PayloadAction<SetSelectedFeaturePayload>) => void;
|
|
29
|
+
updateFeature: (draft: Draft<LayerState>, action: PayloadAction<UpdateFeaturePayload>) => void;
|
|
30
|
+
updateFeatureProperties: (draft: Draft<LayerState>, action: PayloadAction<UpdateFeaturePropertiesPayload>) => void;
|
|
31
|
+
toggleFeatureMode: (draft: Draft<LayerState>, action: PayloadAction<ToggleFeatureModePayload>) => void;
|
|
32
|
+
exitFeatureDrawMode: (draft: Draft<LayerState>, action: PayloadAction<ExitFeatureDrawModePayload>) => void;
|
|
29
33
|
}, "layerReducer">;
|
|
30
34
|
export declare const reducer: import("redux").Reducer<LayerState, import("redux").AnyAction>;
|
|
31
35
|
export declare const layerActions: import("@reduxjs/toolkit").CaseReducerActions<{
|
|
@@ -52,5 +56,9 @@ export declare const layerActions: import("@reduxjs/toolkit").CaseReducerActions
|
|
|
52
56
|
setAvailableBaseLayers: (draft: Draft<LayerState>, action: PayloadAction<SetAvailableBaseLayersPayload>) => void;
|
|
53
57
|
onUpdateLayerInformation: (draft: Draft<LayerState>, action: PayloadAction<UpdateLayerInfoPayload>) => void;
|
|
54
58
|
setSelectedFeature: (draft: Draft<LayerState>, action: PayloadAction<SetSelectedFeaturePayload>) => void;
|
|
59
|
+
updateFeature: (draft: Draft<LayerState>, action: PayloadAction<UpdateFeaturePayload>) => void;
|
|
60
|
+
updateFeatureProperties: (draft: Draft<LayerState>, action: PayloadAction<UpdateFeaturePropertiesPayload>) => void;
|
|
61
|
+
toggleFeatureMode: (draft: Draft<LayerState>, action: PayloadAction<ToggleFeatureModePayload>) => void;
|
|
62
|
+
exitFeatureDrawMode: (draft: Draft<LayerState>, action: PayloadAction<ExitFeatureDrawModePayload>) => void;
|
|
55
63
|
}, "layerReducer">;
|
|
56
64
|
export type LayerActions = ReturnType<typeof layerActions.layerSetDimensions> | ReturnType<typeof layerActions.layerChangeStyle> | ReturnType<typeof layerActions.addAvailableBaseLayer> | ReturnType<typeof layerActions.addAvailableBaseLayers> | ReturnType<typeof layerActions.addBaseLayer> | ReturnType<typeof layerActions.addLayer> | ReturnType<typeof layerActions.baseLayerDelete> | ReturnType<typeof layerActions.onUpdateLayerInformation> | ReturnType<typeof layerActions.layerChangeDimension> | ReturnType<typeof layerActions.layerChangeEnabled> | ReturnType<typeof layerActions.layerChangeGeojson> | ReturnType<typeof layerActions.layerChangeName> | ReturnType<typeof layerActions.layerChangeOpacity> | ReturnType<typeof layerActions.layerDelete> | ReturnType<typeof layerActions.layerError> | ReturnType<typeof layerActions.setBaseLayers> | ReturnType<typeof layerActions.setLayers>;
|
|
@@ -54,7 +54,7 @@ export declare const getAllLayers: ((state: CoreAppStore) => ReduxLayer[]) & imp
|
|
|
54
54
|
* @param {string} mapId mapId: string - mapId
|
|
55
55
|
* @returns {array} returnType: ReduxLayer[] - an array of all layers containing layer information (service, name, style, enabled etc.)
|
|
56
56
|
*/
|
|
57
|
-
export declare const getLayersByMapId: ((state:
|
|
57
|
+
export declare const getLayersByMapId: ((state: CoreAppStore, _mapId: string) => ReduxLayer[]) & import("reselect").OutputSelectorFields<(args_0: ReduxLayer[], args_1: string) => ReduxLayer[], {
|
|
58
58
|
clearCache: () => void;
|
|
59
59
|
}> & {
|
|
60
60
|
clearCache: () => void;
|
|
@@ -95,6 +95,18 @@ export declare const getOverLayers: ((state: CoreAppStore) => ReduxLayer[]) & im
|
|
|
95
95
|
}> & {
|
|
96
96
|
clearCache: () => void;
|
|
97
97
|
};
|
|
98
|
+
/**
|
|
99
|
+
* Retrieves all featureLayers
|
|
100
|
+
*
|
|
101
|
+
* Example: layers = getFeatureLayers(store)
|
|
102
|
+
* @param {object} store store: object - object from which the layers state will be extracted
|
|
103
|
+
* @returns {array} returnType: array - an array of all featureLayers
|
|
104
|
+
*/
|
|
105
|
+
export declare const getFeatureLayers: ((state: CoreAppStore) => ReduxLayer[]) & import("reselect").OutputSelectorFields<(args_0: ReduxLayer[]) => ReduxLayer[], {
|
|
106
|
+
clearCache: () => void;
|
|
107
|
+
}> & {
|
|
108
|
+
clearCache: () => void;
|
|
109
|
+
};
|
|
98
110
|
/**
|
|
99
111
|
* Gets dimensions of the passed layer
|
|
100
112
|
*
|
|
@@ -148,7 +160,7 @@ export declare const getLayerCurrentTime: ((state: CoreAppStore, layerId?: strin
|
|
|
148
160
|
* @param {string} dimensionName dimensionName: string - name of dimension you want to retrieve the dimension data for
|
|
149
161
|
* @returns {object} returnType: object - object of layer dimension
|
|
150
162
|
*/
|
|
151
|
-
export declare const getLayerDimension: ((state:
|
|
163
|
+
export declare const getLayerDimension: ((state: CoreAppStore, _layerId: string, dimensionName: string) => Dimension) & import("reselect").OutputSelectorFields<(args_0: Dimension[], args_1: string) => Dimension, {
|
|
152
164
|
clearCache: () => void;
|
|
153
165
|
}> & {
|
|
154
166
|
clearCache: () => void;
|
|
@@ -239,7 +251,7 @@ export declare const getLayerStatus: ((state: CoreAppStore, layerId?: string | u
|
|
|
239
251
|
* @param {string} mapId mapId: string - Id of the map we want to retrieve the available baselayers for
|
|
240
252
|
* @returns {array} returnType: array - array containing all available base layers
|
|
241
253
|
*/
|
|
242
|
-
export declare const getAvailableBaseLayersForMap: ((state:
|
|
254
|
+
export declare const getAvailableBaseLayersForMap: ((state: CoreAppStore, _mapId: string) => Layer[]) & import("reselect").OutputSelectorFields<(args_0: LayerState | undefined, args_1: string) => Layer[], {
|
|
243
255
|
clearCache: () => void;
|
|
244
256
|
}> & {
|
|
245
257
|
clearCache: () => void;
|
|
@@ -257,6 +269,33 @@ export declare const getSelectedFeatureIndex: ((state: CoreAppStore, layerId?: s
|
|
|
257
269
|
}> & {
|
|
258
270
|
clearCache: () => void;
|
|
259
271
|
};
|
|
272
|
+
/**
|
|
273
|
+
* Returns the layer is in edit mode
|
|
274
|
+
*
|
|
275
|
+
* Example const isLayerInEditMode = getIsLayerInEditMode(store, 'layerId1')
|
|
276
|
+
* @param {object} store store: object - store object
|
|
277
|
+
* @param {string} mapId layerId: string - Id of the layer
|
|
278
|
+
* @returns {number} isLayerInEditMode: boolean - isInEditMode
|
|
279
|
+
*/
|
|
280
|
+
export declare const getIsLayerInEditMode: ((state: CoreAppStore, layerId?: string | undefined) => boolean) & import("reselect").OutputSelectorFields<(args_0: Layer | undefined) => boolean, {
|
|
281
|
+
clearCache: () => void;
|
|
282
|
+
}> & {
|
|
283
|
+
clearCache: () => void;
|
|
284
|
+
};
|
|
285
|
+
export declare const getFeatureLayerGeoJSON: ((state: CoreAppStore, layerId?: string | undefined) => import("geojson").FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties> | undefined) & import("reselect").OutputSelectorFields<(args_0: Layer | undefined) => import("geojson").FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties> | undefined, {
|
|
286
|
+
clearCache: () => void;
|
|
287
|
+
}> & {
|
|
288
|
+
clearCache: () => void;
|
|
289
|
+
};
|
|
290
|
+
export declare const getFeatureLayerGeoJSONProperties: ((state: CoreAppStore, layerId?: string | undefined) => {
|
|
291
|
+
[name: string]: any;
|
|
292
|
+
}) & import("reselect").OutputSelectorFields<(args_0: Layer | undefined) => {
|
|
293
|
+
[name: string]: any;
|
|
294
|
+
}, {
|
|
295
|
+
clearCache: () => void;
|
|
296
|
+
}> & {
|
|
297
|
+
clearCache: () => void;
|
|
298
|
+
};
|
|
260
299
|
/**
|
|
261
300
|
* Gets layerIds that contain passed dimension
|
|
262
301
|
*
|
|
@@ -265,7 +304,7 @@ export declare const getSelectedFeatureIndex: ((state: CoreAppStore, layerId?: s
|
|
|
265
304
|
* @param {string} dimensionName dimensionName: string - name of dimension you want to retrieve the dimension data for
|
|
266
305
|
* @returns {string[]} returnType: string[] - layerIds
|
|
267
306
|
*/
|
|
268
|
-
export declare const getDimensionLayerIds: ((state:
|
|
307
|
+
export declare const getDimensionLayerIds: ((state: CoreAppStore, dimensionName: string) => string[]) & import("reselect").OutputSelectorFields<(args_0: string[], args_1: Record<string, ReduxLayer> | null, args_2: string) => string[], {
|
|
269
308
|
clearCache: () => void;
|
|
270
309
|
}> & {
|
|
271
310
|
clearCache: () => void;
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { Action } from '@reduxjs/toolkit';
|
|
2
2
|
import { FeatureCollection } from 'geojson';
|
|
3
|
+
import { LayerFoundation } from '@opengeoweb/webmap';
|
|
3
4
|
import type { Dimension, UpdateAllMapDimensionsPayload } from '../map/types';
|
|
4
5
|
import type { SyncGroupActionOrigin } from '../../generic/synchronizationGroups/types';
|
|
5
|
-
export declare enum LayerType {
|
|
6
|
-
mapLayer = "mapLayer",
|
|
7
|
-
baseLayer = "baseLayer",
|
|
8
|
-
overLayer = "overLayer"
|
|
9
|
-
}
|
|
10
6
|
export declare enum LayerStatus {
|
|
11
7
|
default = "default",
|
|
12
8
|
error = "error"
|
|
@@ -19,27 +15,21 @@ export declare enum LayerActionOrigin {
|
|
|
19
15
|
toggleAutoUpdateSaga = "toggleAutoUpdateSaga",
|
|
20
16
|
unregisterMapSaga = "unregisterMapSaga"
|
|
21
17
|
}
|
|
18
|
+
export interface FeatureLayer {
|
|
19
|
+
geojson?: FeatureCollection;
|
|
20
|
+
selectedFeatureIndex?: number;
|
|
21
|
+
isInEditMode?: boolean;
|
|
22
|
+
drawMode?: string;
|
|
23
|
+
}
|
|
22
24
|
/**
|
|
23
25
|
* ReduxLayer is used to reflect the shape of the layer in the redux layers store.
|
|
24
26
|
* It is a subset of Layer since some properties like the styles list now come from the service store.
|
|
25
27
|
*/
|
|
26
|
-
export interface ReduxLayer {
|
|
27
|
-
|
|
28
|
-
mapId?: string;
|
|
29
|
-
service?: string;
|
|
30
|
-
name?: string;
|
|
31
|
-
title?: string;
|
|
32
|
-
enabled?: boolean;
|
|
33
|
-
style?: string;
|
|
28
|
+
export interface ReduxLayer extends LayerFoundation, FeatureLayer {
|
|
29
|
+
acceptanceTimeInMinutes?: number;
|
|
34
30
|
dimensions?: Dimension[];
|
|
35
|
-
|
|
36
|
-
type?: string;
|
|
37
|
-
layerType?: LayerType;
|
|
31
|
+
mapId?: string;
|
|
38
32
|
status?: LayerStatus;
|
|
39
|
-
format?: string;
|
|
40
|
-
geojson?: FeatureCollection;
|
|
41
|
-
selectedFeatureIndex?: number;
|
|
42
|
-
acceptanceTimeInMinutes?: number;
|
|
43
33
|
}
|
|
44
34
|
/**
|
|
45
35
|
* Layer is used to define a layer with all its possible properties.
|
|
@@ -147,3 +137,17 @@ export interface UpdateLayerInfo extends Action {
|
|
|
147
137
|
export interface SetSelectedFeaturePayload extends LayerPayload {
|
|
148
138
|
selectedFeatureIndex: number;
|
|
149
139
|
}
|
|
140
|
+
export interface UpdateFeaturePayload extends LayerPayload {
|
|
141
|
+
geojson: GeoJSON.FeatureCollection;
|
|
142
|
+
shouldAllowMultipleShapes?: boolean;
|
|
143
|
+
}
|
|
144
|
+
export interface UpdateFeaturePropertiesPayload extends LayerPayload {
|
|
145
|
+
properties: GeoJSON.GeoJsonProperties;
|
|
146
|
+
}
|
|
147
|
+
export interface ToggleFeatureModePayload extends LayerPayload {
|
|
148
|
+
isInEditMode?: boolean;
|
|
149
|
+
drawMode?: string;
|
|
150
|
+
}
|
|
151
|
+
export interface ExitFeatureDrawModePayload extends LayerPayload {
|
|
152
|
+
reason: string;
|
|
153
|
+
}
|
|
@@ -16,3 +16,9 @@ export declare const produceDraftStateForAllLayersForDimensionWithinMap: (draft:
|
|
|
16
16
|
* @param dimensions Dimension[]
|
|
17
17
|
*/
|
|
18
18
|
export declare const filterNonTimeDimensions: (dimensions: Dimension[]) => Dimension[];
|
|
19
|
+
/**
|
|
20
|
+
* Returns geoJSON based on type and multipleShapes
|
|
21
|
+
* @param geoJSON: GeoJSON.FeatureCollection
|
|
22
|
+
* @param shouldAllowMultipleshapes: boolean
|
|
23
|
+
*/
|
|
24
|
+
export declare const getGeoJson: (geojson: GeoJSON.FeatureCollection, shouldAllowMultipleshapes: boolean) => GeoJSON.FeatureCollection;
|
|
@@ -26,7 +26,7 @@ export declare const getAllMapIds: (store: CoreAppStore) => string[];
|
|
|
26
26
|
* @param {object} store store object from which the map state wll be extracted
|
|
27
27
|
* @returns {object} object containing map state (isAnimating, bbox, baseLayers, layers etc.)
|
|
28
28
|
*/
|
|
29
|
-
export declare const getFirstMap: ((state:
|
|
29
|
+
export declare const getFirstMap: ((state: CoreAppStore) => WebMap | null) & import("reselect").OutputSelectorFields<(args_0: string[], args_1: Record<string, WebMap>) => WebMap | null, {
|
|
30
30
|
clearCache: () => void;
|
|
31
31
|
}> & {
|
|
32
32
|
clearCache: () => void;
|
|
@@ -38,7 +38,7 @@ export declare const getFirstMap: ((state: any) => any) & import("reselect").Out
|
|
|
38
38
|
* @param {object} store store: object from which the map state wll be extracted
|
|
39
39
|
* @returns {string} returnType:string - map id
|
|
40
40
|
*/
|
|
41
|
-
export declare const getFirstMapId: ((state:
|
|
41
|
+
export declare const getFirstMapId: ((state: CoreAppStore) => string) & import("reselect").OutputSelectorFields<(args_0: WebMap | null) => string, {
|
|
42
42
|
clearCache: () => void;
|
|
43
43
|
}> & {
|
|
44
44
|
clearCache: () => void;
|
|
@@ -120,6 +120,11 @@ export declare const getMapOverLayersIds: ((state: CoreAppStore | undefined, map
|
|
|
120
120
|
}> & {
|
|
121
121
|
clearCache: () => void;
|
|
122
122
|
};
|
|
123
|
+
export declare const getMapFeatureLayers: ((state: CoreAppStore, mapId: string) => import("../types").ReduxLayer[]) & import("reselect").OutputSelectorFields<(args_0: WebMap | undefined, args_1: import("../types").ReduxLayer[]) => import("../types").ReduxLayer[], {
|
|
124
|
+
clearCache: () => void;
|
|
125
|
+
}> & {
|
|
126
|
+
clearCache: () => void;
|
|
127
|
+
};
|
|
123
128
|
/**
|
|
124
129
|
* Gets all overLayers for a map
|
|
125
130
|
*
|
|
@@ -480,7 +485,7 @@ export declare const isTimeSliderVisible: ((state: CoreAppStore | undefined, map
|
|
|
480
485
|
* @param {string} mapId layerId: string - Id of the layer
|
|
481
486
|
* @returns {boolean} returnType: boolean
|
|
482
487
|
*/
|
|
483
|
-
export declare const getIsLayerActiveLayer: ((state:
|
|
488
|
+
export declare const getIsLayerActiveLayer: ((state: CoreAppStore, _mapId: string, layerId: string) => boolean) & import("reselect").OutputSelectorFields<(args_0: string | undefined, args_1: string) => boolean, {
|
|
484
489
|
clearCache: () => void;
|
|
485
490
|
}> & {
|
|
486
491
|
clearCache: () => void;
|
|
@@ -507,7 +512,7 @@ export declare const getMapIdFromLayerId: ((state: CoreAppStore, layerId?: strin
|
|
|
507
512
|
* @param {string} layerId layerId: string - Id of the layer
|
|
508
513
|
* @returns {string} returnType: string - the layerId, or null if not found
|
|
509
514
|
*/
|
|
510
|
-
export declare const getLayerIdByLayerName: ((state:
|
|
515
|
+
export declare const getLayerIdByLayerName: ((state: CoreAppStore, _mapId: string, layerName: string) => string) & import("reselect").OutputSelectorFields<(args_0: import("../types").ReduxLayer[], args_1: string) => string, {
|
|
511
516
|
clearCache: () => void;
|
|
512
517
|
}> & {
|
|
513
518
|
clearCache: () => void;
|
|
@@ -521,7 +526,7 @@ export declare const getLayerIdByLayerName: ((state: any, _mapId: any, layerName
|
|
|
521
526
|
* @param {string} layerId layerId: string - Id of the layer
|
|
522
527
|
* @returns {number} returnType: index number or -1 if not found
|
|
523
528
|
*/
|
|
524
|
-
export declare const getLayerIndexByLayerId: ((state:
|
|
529
|
+
export declare const getLayerIndexByLayerId: ((state: CoreAppStore, _mapId: string, layerId?: string | undefined) => number) & import("reselect").OutputSelectorFields<(args_0: import("../types").ReduxLayer[], args_1: string | undefined) => number, {
|
|
525
530
|
clearCache: () => void;
|
|
526
531
|
}> & {
|
|
527
532
|
clearCache: () => void;
|
|
@@ -535,7 +540,7 @@ export declare const getLayerIndexByLayerId: ((state: any, _mapId: any, layerId?
|
|
|
535
540
|
* @param {number} layerIndex layerId: number - Index of the layer in the map
|
|
536
541
|
* @returns {object} returnType: layer, or null if not found
|
|
537
542
|
*/
|
|
538
|
-
export declare const getLayerByLayerIndex: ((state:
|
|
543
|
+
export declare const getLayerByLayerIndex: ((state: CoreAppStore, _mapId: string, layerIndex: number) => Layer) & import("reselect").OutputSelectorFields<(args_0: import("../types").ReduxLayer[], args_1: number) => Layer, {
|
|
539
544
|
clearCache: () => void;
|
|
540
545
|
}> & {
|
|
541
546
|
clearCache: () => void;
|
|
@@ -547,7 +552,7 @@ export declare const getLayerByLayerIndex: ((state: any, _mapId: any, layerIndex
|
|
|
547
552
|
* @param {object} store store: object - store object
|
|
548
553
|
* @returns {array} returnType: array of dimension names
|
|
549
554
|
*/
|
|
550
|
-
export declare const getAllUniqueDimensions: ((state:
|
|
555
|
+
export declare const getAllUniqueDimensions: ((state: CoreAppStore) => string[]) & import("reselect").OutputSelectorFields<(args_0: string[], args_1: CoreAppStore) => string[], {
|
|
551
556
|
clearCache: () => void;
|
|
552
557
|
}> & {
|
|
553
558
|
clearCache: () => void;
|
|
@@ -639,7 +644,7 @@ export declare const getMapLayerIdsEnabled: ((state: CoreAppStore, mapId: string
|
|
|
639
644
|
* @param {string} dimensionName dimensionName: string - name of the dimension
|
|
640
645
|
* @returns {Boolean} returnType: boolean
|
|
641
646
|
*/
|
|
642
|
-
export declare const getIsEnabledLayersForMapDimension: ((state:
|
|
647
|
+
export declare const getIsEnabledLayersForMapDimension: ((state: CoreAppStore, _mapId: string, dimensionName: string) => boolean) & import("reselect").OutputSelectorFields<(args_0: string[], args_1: string[]) => boolean, {
|
|
643
648
|
clearCache: () => void;
|
|
644
649
|
}> & {
|
|
645
650
|
clearCache: () => void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LayerType } from '@opengeoweb/webmap';
|
|
1
2
|
import type { CoreAppStore } from '../types';
|
|
2
3
|
import { layerTypes } from './layers';
|
|
3
4
|
import { mapTypes } from './map';
|
|
@@ -5,6 +6,7 @@ export declare const createLayersState: (layerId: string, props?: {}) => layerTy
|
|
|
5
6
|
export declare const createMultipleLayersState: (layers: layerTypes.Layer[], mapId: string) => layerTypes.LayerState;
|
|
6
7
|
export declare const createWebmapState: (...mapIds: string[]) => mapTypes.WebMapState;
|
|
7
8
|
export declare const createMapDimensionsState: (dimensions?: mapTypes.Dimension[], ...mapIds: string[]) => mapTypes.WebMapState;
|
|
8
|
-
export declare const webmapStateWithAddedLayer: (layerType:
|
|
9
|
+
export declare const webmapStateWithAddedLayer: (layerType: LayerType, layerId: string, mapId: string, dimensions?: mapTypes.Dimension[]) => mapTypes.WebMapState;
|
|
9
10
|
export declare const mockStateMapWithLayer: (layer: layerTypes.Layer, mapId: string) => CoreAppStore;
|
|
10
11
|
export declare const mockStateMapWithMultipleLayers: (layers: layerTypes.Layer[], mapId: string) => CoreAppStore;
|
|
12
|
+
export declare const testGeoJSON: GeoJSON.FeatureCollection;
|
package/src/store/types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { WebMapStateModuleState } from './mapStore/types';
|
|
2
2
|
import type { SynchronizationGroupModuleState } from './generic/synchronizationGroups/types';
|
|
3
3
|
import type { uiTypes, layerSelectTypes } from '.';
|
|
4
|
+
import type { DrawtoolModuleStore } from './drawingtool';
|
|
4
5
|
import { DrawModuleStore } from './drawings/types';
|
|
5
|
-
export interface CoreAppStore extends SynchronizationGroupModuleState, uiTypes.UIModuleState, WebMapStateModuleState, layerSelectTypes.LayerSelectModuleState, DrawModuleStore {
|
|
6
|
+
export interface CoreAppStore extends SynchronizationGroupModuleState, uiTypes.UIModuleState, WebMapStateModuleState, layerSelectTypes.LayerSelectModuleState, DrawtoolModuleStore, DrawModuleStore {
|
|
6
7
|
}
|