@opengeoweb/store 9.12.0 → 9.14.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/store",
3
- "version": "9.12.0",
3
+ "version": "9.14.0",
4
4
  "description": "GeoWeb Store library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -83,6 +83,8 @@ export declare const mapStoreActions: {
83
83
  updateFeatureProperties: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./types").UpdateFeaturePropertiesPayload, "layerReducer/updateFeatureProperties">;
84
84
  toggleFeatureMode: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./types").ToggleFeatureModePayload, "layerReducer/toggleFeatureMode">;
85
85
  exitFeatureDrawMode: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./types").ExitFeatureDrawModePayload, "layerReducer/exitFeatureDrawMode">;
86
+ showLayerInfo: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./types").ShowLayerInfoPayload, "layerReducer/showLayerInfo">;
87
+ hideLayerInfo: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"layerReducer/hideLayerInfo">;
86
88
  };
87
89
  export * from './service';
88
90
  export * from './map';
@@ -0,0 +1,2 @@
1
+ import { CoreAppStore } from '../../types';
2
+ export declare const layersListener: import("@reduxjs/toolkit").ListenerMiddlewareInstance<CoreAppStore, import("@reduxjs/toolkit").ThunkDispatch<CoreAppStore, unknown, import("redux").AnyAction>, unknown>;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,6 +1,6 @@
1
1
  import { Draft, PayloadAction } from '@reduxjs/toolkit';
2
2
  import { SetLayerDimensionsPayload, SetLayerStylePayload, UpdateLayerInfoPayload } from '@opengeoweb/webmap-react';
3
- import { LayerState, Layer, AddLayerPayload, SetLayerDimensionPayload, SetLayerEnabledPayload, SetLayerOpacityPayload, SetLayerNamePayload, SetLayerGeojsonPayload, DeleteLayerPayload, ErrorLayerPayload, SetLayersPayload, SetBaseLayersPayload, AddBaseLayerPayload, AddAvailableBaseLayerPayload, AddAvailableBaseLayersPayload, SetAvailableBaseLayersPayload, SetSelectedFeaturePayload, UpdateFeaturePayload, ExitFeatureDrawModePayload, ToggleFeatureModePayload, UpdateFeaturePropertiesPayload, DuplicateMapLayerPayload } from './types';
3
+ import { LayerState, Layer, AddLayerPayload, SetLayerDimensionPayload, SetLayerEnabledPayload, SetLayerOpacityPayload, SetLayerNamePayload, SetLayerGeojsonPayload, DeleteLayerPayload, ErrorLayerPayload, SetLayersPayload, SetBaseLayersPayload, AddBaseLayerPayload, AddAvailableBaseLayerPayload, AddAvailableBaseLayersPayload, SetAvailableBaseLayersPayload, SetSelectedFeaturePayload, UpdateFeaturePayload, ExitFeatureDrawModePayload, ToggleFeatureModePayload, UpdateFeaturePropertiesPayload, DuplicateMapLayerPayload, ShowLayerInfoPayload } from './types';
4
4
  export declare const createLayer: ({ id, opacity, acceptanceTimeInMinutes, enabled, layerType, status, useLatestReferenceTime, ...props }: Layer) => Layer;
5
5
  export declare const initialState: LayerState;
6
6
  export declare const slice: import("@reduxjs/toolkit").Slice<LayerState, {
@@ -39,6 +39,8 @@ export declare const slice: import("@reduxjs/toolkit").Slice<LayerState, {
39
39
  updateFeatureProperties: (draft: Draft<LayerState>, action: PayloadAction<UpdateFeaturePropertiesPayload>) => void;
40
40
  toggleFeatureMode: (draft: Draft<LayerState>, action: PayloadAction<ToggleFeatureModePayload>) => void;
41
41
  exitFeatureDrawMode: (draft: Draft<LayerState>, action: PayloadAction<ExitFeatureDrawModePayload>) => void;
42
+ showLayerInfo: (draft: Draft<LayerState>, action: PayloadAction<ShowLayerInfoPayload>) => void;
43
+ hideLayerInfo: (draft: Draft<LayerState>) => void;
42
44
  }, "layerReducer">;
43
45
  export declare const reducer: import("redux").Reducer<LayerState, import("redux").AnyAction>;
44
46
  export declare const layerActions: import("@reduxjs/toolkit").CaseReducerActions<{
@@ -77,5 +79,7 @@ export declare const layerActions: import("@reduxjs/toolkit").CaseReducerActions
77
79
  updateFeatureProperties: (draft: Draft<LayerState>, action: PayloadAction<UpdateFeaturePropertiesPayload>) => void;
78
80
  toggleFeatureMode: (draft: Draft<LayerState>, action: PayloadAction<ToggleFeatureModePayload>) => void;
79
81
  exitFeatureDrawMode: (draft: Draft<LayerState>, action: PayloadAction<ExitFeatureDrawModePayload>) => void;
82
+ showLayerInfo: (draft: Draft<LayerState>, action: PayloadAction<ShowLayerInfoPayload>) => void;
83
+ hideLayerInfo: (draft: Draft<LayerState>) => void;
80
84
  }, "layerReducer">;
81
85
  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>;
@@ -317,6 +317,11 @@ export declare const getFeatureLayerGeoJSON: ((state: any, layerId: any) => impo
317
317
  }> & {
318
318
  clearCache: () => void;
319
319
  };
320
+ export declare const getHasFeatureLayerGeoJSON: ((state: any, layerId: any) => boolean) & import("reselect").OutputSelectorFields<(args_0: import("geojson").FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties> | undefined) => boolean, {
321
+ clearCache: () => void;
322
+ }> & {
323
+ clearCache: () => void;
324
+ };
320
325
  export declare const getFeatureLayerGeoJSONProperties: ((state: any, layerId: any) => {
321
326
  [name: string]: any;
322
327
  }) & import("reselect").OutputSelectorFields<(args_0: ReduxLayer | undefined, args_1: number | undefined) => {
@@ -362,3 +367,14 @@ export declare const getTimeStepForLayerId: ((state: any, layerId: any) => numbe
362
367
  }> & {
363
368
  clearCache: () => void;
364
369
  };
370
+ export declare const getActiveLayerInfo: ((state: CoreAppStore) => {
371
+ layerName: string;
372
+ serviceUrl: string;
373
+ } | undefined) & import("reselect").OutputSelectorFields<(args_0: LayerState | undefined) => {
374
+ layerName: string;
375
+ serviceUrl: string;
376
+ } | undefined, {
377
+ clearCache: () => void;
378
+ }> & {
379
+ clearCache: () => void;
380
+ };
@@ -4,6 +4,7 @@ import { LayerFoundation } from '@opengeoweb/webmap';
4
4
  import { UpdateLayerInfoPayload } from '@opengeoweb/webmap-react';
5
5
  import type { Dimension } from '../map/types';
6
6
  import type { SyncGroupActionOrigin } from '../../generic/synchronizationGroups/types';
7
+ import { uiTypes } from '../../ui';
7
8
  export declare enum LayerStatus {
8
9
  default = "default",
9
10
  error = "error"
@@ -47,6 +48,10 @@ export interface LayerState {
47
48
  byId: Record<string, ReduxLayer>;
48
49
  allIds: string[];
49
50
  availableBaseLayers: AvailableBaseLayersType;
51
+ activeLayerInfo?: {
52
+ layerName: string;
53
+ serviceUrl: string;
54
+ };
50
55
  }
51
56
  export interface LayerPayload {
52
57
  layerId: string;
@@ -150,3 +155,9 @@ export interface ExitFeatureDrawModePayload extends LayerPayload {
150
155
  reason: string;
151
156
  shouldAllowMultipleShapes?: boolean;
152
157
  }
158
+ export interface ShowLayerInfoPayload {
159
+ serviceUrl: string;
160
+ layerName: string;
161
+ mapId: string;
162
+ source?: uiTypes.Source;
163
+ }
@@ -16,3 +16,8 @@ export declare const produceDraftStateForAllLayersForDimensionWithinMap: (draft:
16
16
  * @param dimensions Dimension[]
17
17
  */
18
18
  export declare const filterNonTimeDimensions: (dimensions: Dimension[]) => Dimension[];
19
+ /**
20
+ * Returns the list of dimensions without the time dimension
21
+ * @param dimensions Dimension[]
22
+ */
23
+ export declare const filterCurrentValueFromDimensions: (dimensions: Dimension[]) => Dimension[];
@@ -8,7 +8,7 @@ export declare function startAnimationSaga({ payload, }: ReturnType<typeof mapAc
8
8
  export declare function stopAnimationSaga({ payload, }: ReturnType<typeof mapActions.mapStopAnimation>): Generator;
9
9
  export declare function deleteLayerSaga({ payload, }: ReturnType<typeof layerActions.layerDelete>): SagaIterator;
10
10
  export declare function updateAnimation(mapId: string, maxValue: string): SagaIterator;
11
- export declare function updateAnimationWithLatestUpdate({ payload, }: ReturnType<typeof layerActions.onUpdateLayerInformation>): SagaIterator;
11
+ export declare function setLayerDimensionsSaga({ payload, }: ReturnType<typeof layerActions.onUpdateLayerInformation>): SagaIterator;
12
12
  export declare function toggleAutoUpdateSaga({ payload, }: ReturnType<typeof mapActions.toggleAutoUpdate>): SagaIterator;
13
13
  export declare function handleBaseLayersSaga(mapId: string, baseLayers: Layer[]): SagaIterator;
14
14
  export declare function setMapPresetSaga({ payload, }: ReturnType<typeof mapActions.setMapPreset>): SagaIterator;
@@ -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, WebMapAnimationList } from '../types';
3
+ import type { Dimension, Layer, ReduxLayer, WebMapAnimationList } from '../types';
4
4
  import type { uiTypes } from '../../ui';
5
5
  /**
6
6
  * Gets the map state by mapId
@@ -89,7 +89,22 @@ export declare const getLayerIds: ((state: any, mapId: any) => string[]) & impor
89
89
  * @param {string} mapId mapId: string - Id of the map
90
90
  * @returns {array} returnType: array - array containing all layer states for the map
91
91
  */
92
- export declare const getMapLayers: ((state: any, mapId: any) => import("../types").ReduxLayer[]) & import("reselect").OutputSelectorFields<(args_0: string[], args_1: Record<string, import("../types").ReduxLayer> | null) => import("../types").ReduxLayer[], {
92
+ export declare const getMapLayers: ((state: any, mapId: any) => ReduxLayer[]) & import("reselect").OutputSelectorFields<(args_0: string[], args_1: Record<string, ReduxLayer> | null) => ReduxLayer[], {
93
+ clearCache: () => void;
94
+ }> & {
95
+ clearCache: () => void;
96
+ };
97
+ /**
98
+ * Gets all layer states for a map, but where Dimensions have no currentValue set
99
+ *
100
+ * Use this instead of getMapLayers to prevent unnecessary re-renders
101
+ *
102
+ * Example: layers = getMapLayers(store, 'mapid_1')
103
+ * @param {object} store store: object - store object
104
+ * @param {string} mapId mapId: string - Id of the map
105
+ * @returns {array} returnType: array - array containing all layer states for the map
106
+ */
107
+ export declare const getMapLayersWithoutDimensionCurrentValue: ((state: any, mapId: any) => ReduxLayer[]) & import("reselect").OutputSelectorFields<(args_0: string[], args_1: Record<string, ReduxLayer> | null) => ReduxLayer[], {
93
108
  clearCache: () => void;
94
109
  }> & {
95
110
  clearCache: () => void;
@@ -115,7 +130,7 @@ export declare const getMapBaseLayersIds: ((state: any, mapId: any) => string[])
115
130
  * @param {string} mapId mapId: string - Id of the map
116
131
  * @returns {array} returnType: array - array containing all baselayers for the map
117
132
  */
118
- export declare const getMapBaseLayers: ((state: any, mapId: any) => import("../types").ReduxLayer[]) & import("reselect").OutputSelectorFields<(args_0: string[], args_1: Record<string, import("../types").ReduxLayer> | null) => import("../types").ReduxLayer[], {
133
+ export declare const getMapBaseLayers: ((state: any, mapId: any) => ReduxLayer[]) & import("reselect").OutputSelectorFields<(args_0: string[], args_1: Record<string, ReduxLayer> | null) => ReduxLayer[], {
119
134
  clearCache: () => void;
120
135
  }> & {
121
136
  clearCache: () => void;
@@ -133,7 +148,7 @@ export declare const getMapOverLayersIds: ((state: any, mapId: any) => string[])
133
148
  }> & {
134
149
  clearCache: () => void;
135
150
  };
136
- export declare const getMapFeatureLayers: ((state: any, mapId: any) => import("../types").ReduxLayer[]) & import("reselect").OutputSelectorFields<(args_0: WebMap | undefined, args_1: import("../types").ReduxLayer[]) => import("../types").ReduxLayer[], {
151
+ export declare const getMapFeatureLayers: ((state: any, mapId: any) => ReduxLayer[]) & import("reselect").OutputSelectorFields<(args_0: WebMap | undefined, args_1: ReduxLayer[]) => ReduxLayer[], {
137
152
  clearCache: () => void;
138
153
  }> & {
139
154
  clearCache: () => void;
@@ -146,7 +161,7 @@ export declare const getMapFeatureLayers: ((state: any, mapId: any) => import(".
146
161
  * @param {string} mapId mapId: string - Id of the map
147
162
  * @returns {array} returnType: array - array containing all overLayers for the map
148
163
  */
149
- export declare const getMapOverLayers: ((state: any, mapId: any) => import("../types").ReduxLayer[]) & import("reselect").OutputSelectorFields<(args_0: string[], args_1: Record<string, import("../types").ReduxLayer> | null) => import("../types").ReduxLayer[], {
164
+ export declare const getMapOverLayers: ((state: any, mapId: any) => ReduxLayer[]) & import("reselect").OutputSelectorFields<(args_0: string[], args_1: Record<string, ReduxLayer> | null) => ReduxLayer[], {
150
165
  clearCache: () => void;
151
166
  }> & {
152
167
  clearCache: () => void;
@@ -190,7 +205,7 @@ export declare const getSelectedTime: ((state: CoreAppStore, mapId: string) => n
190
205
  }> & {
191
206
  clearCache: () => void;
192
207
  };
193
- export declare const getDataLimitsFromLayers: ((state: any, mapId: any) => number[]) & import("reselect").OutputSelectorFields<(args_0: import("../types").ReduxLayer[]) => number[], {
208
+ export declare const getDataLimitsFromLayers: ((state: any, mapId: any) => number[]) & import("reselect").OutputSelectorFields<(args_0: ReduxLayer[]) => number[], {
194
209
  clearCache: () => void;
195
210
  }> & {
196
211
  clearCache: () => void;
@@ -528,7 +543,7 @@ export declare const getMapIdFromLayerId: ((state: CoreAppStore, layerId?: strin
528
543
  * @param {string} layerId layerId: string - Id of the layer
529
544
  * @returns {string} returnType: string - the layerId, or null if not found
530
545
  */
531
- export declare const getLayerIdByLayerName: ((state: any, _mapId: any, layerName: string) => string) & import("reselect").OutputSelectorFields<(args_0: import("../types").ReduxLayer[], args_1: string) => string, {
546
+ export declare const getLayerIdByLayerName: ((state: any, _mapId: any, layerName: string) => string) & import("reselect").OutputSelectorFields<(args_0: ReduxLayer[], args_1: string) => string, {
532
547
  clearCache: () => void;
533
548
  }> & {
534
549
  clearCache: () => void;
@@ -542,7 +557,7 @@ export declare const getLayerIdByLayerName: ((state: any, _mapId: any, layerName
542
557
  * @param {string} layerId layerId: string - Id of the layer
543
558
  * @returns {number} returnType: index number or -1 if not found
544
559
  */
545
- export declare const getLayerIndexByLayerId: ((state: any, _mapId: any, layerId?: string | undefined) => number) & import("reselect").OutputSelectorFields<(args_0: import("../types").ReduxLayer[], args_1: string | undefined) => number, {
560
+ export declare const getLayerIndexByLayerId: ((state: any, _mapId: any, layerId?: string | undefined) => number) & import("reselect").OutputSelectorFields<(args_0: ReduxLayer[], args_1: string | undefined) => number, {
546
561
  clearCache: () => void;
547
562
  }> & {
548
563
  clearCache: () => void;
@@ -556,7 +571,7 @@ export declare const getLayerIndexByLayerId: ((state: any, _mapId: any, layerId?
556
571
  * @param {number} layerIndex layerId: number - Index of the layer in the map
557
572
  * @returns {object} returnType: layer, or null if not found
558
573
  */
559
- export declare const getLayerByLayerIndex: ((state: any, _mapId: any, layerIndex: number) => Layer) & import("reselect").OutputSelectorFields<(args_0: import("../types").ReduxLayer[], args_1: number) => Layer, {
574
+ export declare const getLayerByLayerIndex: ((state: any, _mapId: any, layerIndex: number) => Layer) & import("reselect").OutputSelectorFields<(args_0: ReduxLayer[], args_1: number) => Layer, {
560
575
  clearCache: () => void;
561
576
  }> & {
562
577
  clearCache: () => void;
@@ -633,7 +648,7 @@ export declare const getLegendId: ((state: any, mapId: any) => string | undefine
633
648
  * @param {string} mapId mapId: string - Id of the map
634
649
  * @returns {MapPreset} returnType: MapPreset
635
650
  */
636
- export declare const getMapPreset: ((state: any, mapId: any) => MapPreset) & import("reselect").OutputSelectorFields<(args_0: import("../types").ReduxLayer[], args_1: import("../types").ReduxLayer[], args_2: import("../types").ReduxLayer[], args_3: Bbox, args_4: string, args_5: string | undefined, args_6: string | undefined, args_7: string | undefined, args_8: boolean, args_9: boolean, args_10: boolean | undefined, args_11: boolean | undefined, args_12: boolean | undefined, args_13: number, args_14: number | undefined, args_15: string | undefined, args_16: string | undefined, args_17: boolean | undefined, args_18: string | undefined, args_19: uiTypes.UIStoreType) => MapPreset, {
651
+ export declare const getMapPreset: ((state: any, mapId: any) => MapPreset) & import("reselect").OutputSelectorFields<(args_0: ReduxLayer[], args_1: ReduxLayer[], args_2: ReduxLayer[], args_3: Bbox, args_4: string, args_5: string | undefined, args_6: string | undefined, args_7: string | undefined, args_8: boolean, args_9: boolean, args_10: boolean | undefined, args_11: boolean | undefined, args_12: boolean | undefined, args_13: number, args_14: number | undefined, args_15: string | undefined, args_16: string | undefined, args_17: boolean | undefined, args_18: string | undefined, args_19: uiTypes.UIStoreType) => MapPreset, {
637
652
  clearCache: () => void;
638
653
  }> & {
639
654
  clearCache: () => void;
@@ -646,7 +661,7 @@ export declare const getMapPreset: ((state: any, mapId: any) => MapPreset) & imp
646
661
  * @param {string} mapId mapId: string - Id of the map
647
662
  * @returns {string[]} returnType: string[] - array of enabled layerIds
648
663
  */
649
- export declare const getMapLayerIdsEnabled: ((state: any, mapId: any) => string[]) & import("reselect").OutputSelectorFields<(args_0: string[], args_1: Record<string, import("../types").ReduxLayer> | null) => string[], {
664
+ export declare const getMapLayerIdsEnabled: ((state: any, mapId: any) => string[]) & import("reselect").OutputSelectorFields<(args_0: string[], args_1: Record<string, ReduxLayer> | null) => string[], {
650
665
  clearCache: () => void;
651
666
  }> & {
652
667
  clearCache: () => void;