@opengeoweb/core 2.6.0 → 2.7.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.
Files changed (26) hide show
  1. package/index.esm.js +7713 -7395
  2. package/index.umd.js +10103 -9749
  3. package/lib/components/ComponentsLookUp/componentsLookUp.d.ts +7 -20
  4. package/lib/components/ConfigurableConnectedMap/ConfigurableConnectedMap.d.ts +1 -7
  5. package/lib/components/ConfigurableMapWithSlider/ConfigurableMapWithSliderConnect.d.ts +1 -2
  6. package/lib/components/MultiMapView/HarmoniePresets/index.d.ts +0 -1
  7. package/lib/components/MultiMapView/{HarmoniePresets/HarmRefTimePreset.d.ts → ModelRunInterval/ModelRunInterval.d.ts} +4 -2
  8. package/lib/components/MultiMapView/{HarmoniePresets/HarmRefTimePreset.spec.d.ts → ModelRunInterval/ModelRunInterval.spec.d.ts} +0 -0
  9. package/lib/components/MultiMapView/ModelRunInterval/ModelRunInterval.stories.d.ts +4 -0
  10. package/lib/components/MultiMapView/ModelRunInterval/index.d.ts +1 -0
  11. package/lib/components/MultiMapView/MultiMapView.stories.d.ts +2 -3
  12. package/lib/components/TimeSlider/TimeSliderUtils.d.ts +1 -2
  13. package/lib/components/WMSLoader/WMSServerList/WMSServerList.d.ts +1 -1
  14. package/lib/index.d.ts +2 -1
  15. package/lib/store/mapStore/layers/actions.d.ts +8 -1
  16. package/lib/store/mapStore/layers/constants.d.ts +1 -0
  17. package/lib/store/mapStore/layers/types.d.ts +11 -3
  18. package/lib/store/mapStore/map/actions.d.ts +17 -1
  19. package/lib/store/mapStore/map/constants.d.ts +3 -0
  20. package/lib/store/mapStore/map/sagas.d.ts +4 -2
  21. package/lib/store/mapStore/map/selectors.d.ts +42 -0
  22. package/lib/store/mapStore/map/types.d.ts +57 -2
  23. package/lib/store/mapStore/map/utils.d.ts +2 -1
  24. package/lib/utils/jsonPresetFilter.d.ts +22 -7
  25. package/lib/utils/types.d.ts +0 -38
  26. package/package.json +5 -5
@@ -1,27 +1,14 @@
1
1
  import React from 'react';
2
- import { Bbox, Layer } from '../../store/mapStore/types';
3
- import { AnimationPayloadType } from '../ConfigurableConnectedMap';
4
- import { InitialHarmRefTimeProps, InitialHarmTempAndPrecipProps } from '../MultiMapView/HarmoniePresets';
5
- interface TSMapPreset {
6
- layers?: Layer[];
7
- activeLayerId?: string;
8
- baseLayer?: Layer;
9
- proj?: {
10
- bbox: Bbox;
11
- srs: string;
12
- };
13
- shouldAutoUpdate?: boolean;
14
- shouldAnimate?: boolean;
15
- animationPayload?: AnimationPayloadType;
16
- displayMapPin?: boolean;
17
- }
2
+ import { MapPreset, MapPresetInitialProps } from '../../store/mapStore/types';
3
+ import { InitialHarmTempAndPrecipProps } from '../MultiMapView/HarmoniePresets';
4
+ import { ModelRunIntervalProps } from '../MultiMapView/ModelRunInterval';
18
5
  interface InitialMultiMapProps {
19
- mapPreset: TSMapPreset[];
6
+ mapPreset: MapPreset[];
20
7
  syncGroupsIds: string[];
21
8
  shouldShowZoomControls?: boolean;
22
9
  }
23
10
  interface InitialMapProps {
24
- mapPreset: TSMapPreset;
11
+ mapPreset: MapPreset;
25
12
  syncGroupsIds: string[];
26
13
  shouldShowZoomControls?: boolean;
27
14
  }
@@ -31,13 +18,13 @@ interface InitialSliderProps {
31
18
  };
32
19
  syncGroupsIds: string[];
33
20
  }
34
- export declare type InitialProps = InitialMultiMapProps | InitialMapProps | InitialSliderProps | InitialHarmTempAndPrecipProps | InitialHarmRefTimeProps;
21
+ export declare type InitialProps = InitialMapProps | InitialMultiMapProps | InitialSliderProps | InitialHarmTempAndPrecipProps | ModelRunIntervalProps | MapPresetInitialProps;
35
22
  /**
36
23
  * The lookup table is for registering your own components with the screenmanager.
37
24
  * @param payload
38
25
  * @returns
39
26
  */
40
- export declare type SupportedComponentTypes = 'ConfigurableMap' | 'ConfigurableMapWithSlider' | 'HarmRefTimePreset' | 'HarmonieTempAndPrecipPreset' | 'ConfigurableMultiMapWithSlider' | 'TimeSlider';
27
+ export declare type SupportedComponentTypes = 'Map' | 'ConfigurableMap' | 'ConfigurableMapWithSlider' | 'ModelRunInterval' | 'HarmonieTempAndPrecipPreset' | 'ConfigurableMultiMapWithSlider' | 'TimeSlider';
41
28
  export interface ComponentsLookUpPayload {
42
29
  componentType: SupportedComponentTypes;
43
30
  id: string;
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import { Bbox, Layer } from '../../store/mapStore/types';
3
- import { SpeedFactorType } from '../TimeSlider/TimeSliderUtils';
2
+ import { AnimationPayloadType, Bbox, Layer } from '../../store/mapStore/types';
4
3
  export declare const defaultBbox: {
5
4
  srs: string;
6
5
  bbox: {
@@ -10,11 +9,6 @@ export declare const defaultBbox: {
10
9
  top: number;
11
10
  };
12
11
  };
13
- export interface AnimationPayloadType {
14
- duration?: number;
15
- interval?: number;
16
- speed?: SpeedFactorType;
17
- }
18
12
  export interface ConfigurableConnectedMapProps {
19
13
  title?: string;
20
14
  id?: string;
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import { Bbox, Layer } from '../../store/mapStore/types';
3
- import { AnimationPayloadType } from '../ConfigurableConnectedMap';
2
+ import { AnimationPayloadType, Bbox, Layer } from '../../store/mapStore/types';
4
3
  export interface ConfigurableMapWithSliderConnectProps {
5
4
  id?: string;
6
5
  activeLayerId?: string;
@@ -1,2 +1 @@
1
- export * from './HarmRefTimePreset';
2
1
  export * from './HarmonieTempAndPrecipPreset';
@@ -2,8 +2,10 @@ import * as React from 'react';
2
2
  import { Layer } from '../../../store/mapStore/types';
3
3
  import { MultiMapPreset } from '../MultiMapViewConnect';
4
4
  export declare const makeMapPreset: (timeIncrement: number, uniqueId: string, referenceTime: string, layers: Layer[], syncGroupsIds: string[], displayLayerManagerButtonInMap: boolean, displayDimensionSelectButtonInMap: boolean) => MultiMapPreset;
5
- export interface InitialHarmRefTimeProps {
5
+ export interface ModelRunIntervalProps {
6
6
  layers?: Layer[];
7
7
  syncGroupsIds: string[];
8
+ interval?: number;
9
+ startTimeIncrement?: number;
8
10
  }
9
- export declare const HarmRefTimePreset: React.FC<InitialHarmRefTimeProps>;
11
+ export declare const ModelRunInterval: React.FC<ModelRunIntervalProps>;
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ export declare const ModelRunIntervalDefault: () => React.ReactElement;
3
+ export declare const ModelRunIntervalHourly: () => React.ReactElement;
4
+ export declare const ModelRunIntervalCustomStart: () => React.ReactElement;
@@ -0,0 +1 @@
1
+ export * from './ModelRunInterval';
@@ -1,9 +1,8 @@
1
1
  import { MultiMapViewStory2x2 } from './MultiMapView2x2.stories';
2
2
  import { MultiMapViewStory4x3 } from './MultiMapView4x3.stories';
3
3
  import { MultiMapViewStory10x10 } from './MultiMapView10x10.stories';
4
- export { MultiMapViewStory2x2 };
5
- export { MultiMapViewStory4x3 };
6
- export { MultiMapViewStory10x10 };
4
+ import { ModelRunIntervalCustomStart, ModelRunIntervalDefault, ModelRunIntervalHourly } from './ModelRunInterval/ModelRunInterval.stories';
5
+ export { MultiMapViewStory2x2, MultiMapViewStory4x3, MultiMapViewStory10x10, ModelRunIntervalDefault, ModelRunIntervalHourly, ModelRunIntervalCustomStart, };
7
6
  declare const _default: {
8
7
  title: string;
9
8
  };
@@ -1,12 +1,11 @@
1
1
  import moment from 'moment';
2
2
  import React from 'react';
3
3
  import { DateInterval } from '@opengeoweb/webmap';
4
- import { Dimension, Layer, Scale } from '../../store/mapStore/types';
4
+ import { Dimension, Layer, Scale, SpeedFactorType } from '../../store/mapStore/types';
5
5
  import CanvasComponent from '../CanvasComponent/CanvasComponent';
6
6
  export declare const defaultAnimationDelayAtStart = 250;
7
7
  export declare const defaultDelay = 1000;
8
8
  export declare const speedFactors: SpeedFactorType[];
9
- export declare type SpeedFactorType = 0.1 | 0.2 | 0.5 | 1 | 2 | 4 | 8 | 16;
10
9
  export interface TimeBounds {
11
10
  selectedTime: number;
12
11
  startTime: number;
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { Service } from '../services';
3
3
  interface WMSServerListProps {
4
4
  availableServices: Service[];
5
- handleChangeService: (index: number) => void;
5
+ handleChangeService: (service: Service) => void;
6
6
  service: Service;
7
7
  }
8
8
  declare const WMSServerList: React.FC<WMSServerListProps>;
package/lib/index.d.ts CHANGED
@@ -8,6 +8,7 @@ import * as uiSelectors from './store/ui/selectors';
8
8
  import * as uiTypes from './store/ui/types';
9
9
  import * as syncGroupActions from './store/generic/actions';
10
10
  import * as layerReducer from './store/mapStore/layers/reducer';
11
+ import * as layerActions from './store/mapStore/layers/actions';
11
12
  import synchronizationGroupConfig from './store/generic/config';
12
13
  import * as SyncGroups from './store/generic/synchronizationGroups';
13
14
  import coreModuleConfig from './store/coreModuleConfig';
@@ -21,7 +22,7 @@ export { LegendConnect, Legend, LegendMapButtonConnect, } from './components/Leg
21
22
  export { ZoomControls, ZoomControlConnect } from './components/MapControls';
22
23
  export { TimeSliderConnect } from './components/TimeSlider';
23
24
  export { MapControls } from './components/MapControls';
24
- export { mapActions, mapSelectors, mapTypes, mapConstants, mapUtils, layerReducer, uiActions, uiSelectors, uiTypes, syncGroupActions, };
25
+ export { mapActions, mapSelectors, mapTypes, mapConstants, mapUtils, layerReducer, layerActions, uiActions, uiSelectors, uiTypes, syncGroupActions, };
25
26
  export { synchronizationGroupConfig as synchronizationGroupModuleConfig };
26
27
  export * from './components/ComponentsLookUp';
27
28
  export * from './components/ConfigurableMapWithSlider';
@@ -1,4 +1,4 @@
1
- import { SetLayerOpacityPayload, SetLayerEnabledPayload, SetLayerDimensionPayload, SetLayerNamePayload, SetLayerStylePayload, LayerActions, AddLayerPayload, DeleteLayerPayload, SetLayersPayload, SetBaseLayersPayload, AddBaseLayerPayload, ErrorLayerPayload, AddAvailableBaseLayerPayload, AddAvailableBaseLayersPayload, SetLayerDimensionsPayload, UpdateLayerInfoPayload } from './types';
1
+ import { SetLayerOpacityPayload, SetLayerEnabledPayload, SetLayerDimensionPayload, SetLayerNamePayload, SetLayerStylePayload, LayerActions, AddLayerPayload, DeleteLayerPayload, SetLayersPayload, SetBaseLayersPayload, AddBaseLayerPayload, ErrorLayerPayload, AddAvailableBaseLayerPayload, AddAvailableBaseLayersPayload, SetLayerDimensionsPayload, UpdateLayerInfoPayload, SetLayerGeojsonPayload } from './types';
2
2
  /**
3
3
  * Set the layers for a map. Erases all previous layers.
4
4
  * The following action types are triggered after the getCapabilities are parsed:
@@ -86,6 +86,13 @@ export declare const layerChangeName: (payload: SetLayerNamePayload) => LayerAct
86
86
  * @param {object} payload Object with a layerId: string, style: string, origin?: string, service?: string;
87
87
  */
88
88
  export declare const layerChangeStyle: (payload: SetLayerStylePayload) => LayerActions;
89
+ /**
90
+ * Changes the geojson of a layer
91
+ *
92
+ * Example: layerChangeGeojson({ layerId: 'layerId1', geojson: geojson })
93
+ * @param {object} payload Object with a layerId: string, geojson: FeatureCollection;
94
+ */
95
+ export declare const layerChangeGeojson: (payload: SetLayerGeojsonPayload) => LayerActions;
89
96
  /**
90
97
  * Deletes a layer
91
98
  *
@@ -2,6 +2,7 @@ export declare const WEBMAP_LAYER_CHANGE_OPACITY = "WEBMAP_LAYER_CHANGE_OPACITY"
2
2
  export declare const WEBMAP_LAYER_CHANGE_NAME = "WEBMAP_LAYER_CHANGE_NAME";
3
3
  export declare const WEBMAP_LAYER_CHANGE_STYLE = "WEBMAP_LAYER_CHANGE_STYLE";
4
4
  export declare const WEBMAP_LAYER_CHANGE_DIMENSION = "WEBMAP_LAYER_CHANGE_DIMENSION";
5
+ export declare const WEBMAP_LAYER_CHANGE_GEOJSON = "WEBMAP_LAYER_CHANGE_GEOJSON";
5
6
  export declare const WEBMAP_LAYER_SET_DIMENSIONS = "WEBMAP_LAYER_SET_DIMENSIONS";
6
7
  export declare const WEBMAP_LAYER_CHANGE_ENABLED = "WEBMAP_LAYER_CHANGE_ENABLED";
7
8
  export declare const WEBMAP_LAYER_DELETE = "WEBMAP_LAYER_DELETE";
@@ -1,7 +1,8 @@
1
1
  import { Action } from 'redux';
2
2
  import { Style } from '@opengeoweb/webmap';
3
+ import { FeatureCollection } from 'geojson';
3
4
  import { Dimension, UpdateAllMapDimensionsPayload } from '../map/types';
4
- import { WEBMAP_LAYER_CHANGE_OPACITY, WEBMAP_LAYER_CHANGE_NAME, WEBMAP_LAYER_CHANGE_STYLE, WEBMAP_LAYER_CHANGE_DIMENSION, WEBMAP_LAYER_CHANGE_ENABLED, WEBMAP_LAYER_DELETE, WEBMAP_ADD_LAYER, WEBMAP_SET_LAYERS, WEBMAP_SET_BASELAYERS, WEBMAP_ADD_BASELAYER, WEBMAP_BASELAYER_DELETE, WEBMAP_LAYER_ERROR, WEBMAP_ADD_AVAILABLE_BASELAYER, WEBMAP_ADD_AVAILABLE_BASELAYERS, WEBMAP_LAYER_SET_DIMENSIONS, WEBMAP_UPDATE_LAYER_INFO } from './constants';
5
+ import { WEBMAP_LAYER_CHANGE_OPACITY, WEBMAP_LAYER_CHANGE_NAME, WEBMAP_LAYER_CHANGE_STYLE, WEBMAP_LAYER_CHANGE_DIMENSION, WEBMAP_LAYER_CHANGE_ENABLED, WEBMAP_LAYER_DELETE, WEBMAP_ADD_LAYER, WEBMAP_SET_LAYERS, WEBMAP_SET_BASELAYERS, WEBMAP_ADD_BASELAYER, WEBMAP_BASELAYER_DELETE, WEBMAP_LAYER_ERROR, WEBMAP_ADD_AVAILABLE_BASELAYER, WEBMAP_ADD_AVAILABLE_BASELAYERS, WEBMAP_LAYER_SET_DIMENSIONS, WEBMAP_UPDATE_LAYER_INFO, WEBMAP_LAYER_CHANGE_GEOJSON } from './constants';
5
6
  import type { SetLayersForServicePayload } from '../types';
6
7
  export interface WMJSDimension {
7
8
  getFirstValue(): string;
@@ -45,13 +46,13 @@ export interface ReduxLayer {
45
46
  layerType?: LayerType;
46
47
  status?: LayerStatus;
47
48
  format?: string;
49
+ geojson?: FeatureCollection;
48
50
  }
49
51
  /**
50
52
  * Layer is used to define a layer with all its possible properties.
51
53
  */
52
54
  export interface Layer extends ReduxLayer {
53
55
  styles?: Style[];
54
- geojson?: GeoJSON.FeatureCollection;
55
56
  headers?: Headers[];
56
57
  }
57
58
  export interface AvailableBaseLayersType {
@@ -130,6 +131,13 @@ export interface SetLayerStyle extends Action {
130
131
  type: typeof WEBMAP_LAYER_CHANGE_STYLE;
131
132
  payload: SetLayerStylePayload;
132
133
  }
134
+ export interface SetLayerGeojson extends Action {
135
+ type: typeof WEBMAP_LAYER_CHANGE_GEOJSON;
136
+ payload: SetLayerGeojsonPayload;
137
+ }
138
+ export interface SetLayerGeojsonPayload extends LayerPayload {
139
+ geojson: FeatureCollection;
140
+ }
133
141
  export interface DeleteLayerPayload extends LayerPayload {
134
142
  mapId: string;
135
143
  layerIndex: number;
@@ -196,4 +204,4 @@ export interface UpdateLayerInfo extends Action {
196
204
  type: typeof WEBMAP_UPDATE_LAYER_INFO;
197
205
  payload: UpdateLayerInfoPayload;
198
206
  }
199
- export declare type LayerActions = SetLayerDimensions | SetLayerOpacity | SetLayerEnabled | SetLayerDimension | SetLayerStyle | SetLayerName | DeleteLayer | DeleteBaseLayer | AddLayer | SetLayers | SetBaseLayers | AddBaseLayer | ErrorLayer | AddAvailableBaseLayer | AddAvailableBaseLayers | UpdateLayerInfo;
207
+ export declare type LayerActions = SetLayerDimensions | SetLayerOpacity | SetLayerEnabled | SetLayerDimension | SetLayerStyle | SetLayerName | SetLayerGeojson | DeleteLayer | DeleteBaseLayer | AddLayer | SetLayers | SetBaseLayers | AddBaseLayer | ErrorLayer | AddAvailableBaseLayer | AddAvailableBaseLayers | UpdateLayerInfo;
@@ -1,4 +1,5 @@
1
- import { MapActions, SetBboxPayload, MoveLayerPayload, SetMapDimensionPayload, UpdateAllMapDimensionsPayload, SetMapAnimationStartPayload, SetMapAnimationStopPayload, SetActiveLayerIdPayload, MoveLayer, SetActiveLayerId, ToggleAutoUpdatePayload, ToggleAutoUpdate, SetTimeSliderScalePayload, SetTimeStepPayload, SetAnimationDelayPayload, SetAnimationStartTimePayload, SetAnimationEndTimePayload, ToggleTimestepAutoPayload, ToggleTimestepAuto, ToggleTimeSliderHoverPayload, ToggleTimeSliderHover, SetTimeSliderCenterTimePayload, SetTimeSliderSecondsPerPxPayload, SetTimeSliderDataScaleToSecondsPerPxPayload, MapPinLocationPayload, DisableMapPinPayload } from './types';
1
+ import { SetMapPresetPayload } from '../types';
2
+ import { MapActions, SetBboxPayload, MoveLayerPayload, SetMapDimensionPayload, UpdateAllMapDimensionsPayload, SetMapAnimationStartPayload, SetMapAnimationStopPayload, SetActiveLayerIdPayload, MoveLayer, SetActiveLayerId, ToggleAutoUpdatePayload, ToggleAutoUpdate, SetTimeSliderScalePayload, SetTimeStepPayload, SetAnimationDelayPayload, SetAnimationStartTimePayload, SetAnimationEndTimePayload, ToggleTimestepAutoPayload, ToggleTimestepAuto, ToggleTimeSliderHoverPayload, ToggleTimeSliderHover, SetTimeSliderCenterTimePayload, SetTimeSliderSecondsPerPxPayload, SetTimeSliderDataScaleToSecondsPerPxPayload, MapPinLocationPayload, DisableMapPinPayload, SetSelectedFeaturePayload, SetActiveMapPresetPayload } from './types';
2
3
  /**
3
4
  * Registers the map in the store and creates the map state
4
5
  *
@@ -154,3 +155,18 @@ export declare const setMapPinLocation: (payload: MapPinLocationPayload) => MapA
154
155
  * @param {object} payload object with mapId: string, diableMapPin: boolean
155
156
  */
156
157
  export declare const setDisableMapPin: (payload: DisableMapPinPayload) => MapActions;
158
+ /**
159
+ * Sets the selected geojson feature index, for example the selected polygon index in the FeatureCollection
160
+ *
161
+ * Example: setSelectedFeature({ mapId: 'mapId1', selectedFeatureIndex: 1 })
162
+ * @param {object} payload object with mapId: string, selectedFeatureIndex: number
163
+ */
164
+ export declare const setSelectedFeature: (payload: SetSelectedFeaturePayload) => MapActions;
165
+ export declare const setMapPreset: (payload: SetMapPresetPayload) => MapActions;
166
+ /**
167
+ * Sets the active mappreset id
168
+ *
169
+ * Example: setActiveMapPresetId({ mapId: 'mapId1', presetId: 'preset1 })
170
+ * @param {object} payload object with mapId: string, presetId: string
171
+ */
172
+ export declare const setActiveMapPresetId: (payload: SetActiveMapPresetPayload) => MapActions;
@@ -21,3 +21,6 @@ export declare const WEBMAP_SET_TIME_SLIDER_SECONDS_PER_PX = "WEBMAP_SET_TIME_SL
21
21
  export declare const WEBMAP_SET_TIME_SLIDER_DATA_SCALE_TO_SECONDS_PER_PX = "WEBMAP_SET_TIME_SLIDER_DATA_SCALE_TO_SECONDS_PER_PX";
22
22
  export declare const WEBMAP_SET_PIN = "WEBMAP_SET_PIN";
23
23
  export declare const WEBMAP_DISABLE_PIN = "WEBMAP_DISABLE_PIN";
24
+ export declare const WEBMAP_SET_SELECTED_FEATURE_INDEX = "WEBMAP_SET_SELECTED_FEATURE_INDEX";
25
+ export declare const WEBMAP_SET_MAPPRESET = "WEBMAP_SET_MAPPRESET";
26
+ export declare const WEBMAP_SET_ACTIVE_MAPPRESET_ID = "WEBMAP_SET_ACTIVE_MAPPRESET_ID";
@@ -1,7 +1,7 @@
1
1
  import { SagaIterator } from 'redux-saga';
2
2
  import { Moment } from 'moment';
3
- import { SetMapAnimationStop, SetMapAnimationStart, ToggleAutoUpdate } from './types';
4
- import { DeleteLayer, UpdateLayerInfo } from '../layers/types';
3
+ import { SetMapAnimationStop, SetMapAnimationStart, ToggleAutoUpdate, SetMapPreset } from './types';
4
+ import { DeleteLayer, Layer, UpdateLayerInfo } from '../layers/types';
5
5
  export declare const generateTimeList: (start: Moment, end: Moment, interval: number) => {
6
6
  name: string;
7
7
  value: string;
@@ -13,5 +13,7 @@ export declare function deleteLayerSaga({ payload }: DeleteLayer): SagaIterator;
13
13
  export declare function updateAnimation(mapId: string, maxValue: string): SagaIterator;
14
14
  export declare function setLayerDimensionsSaga({ payload, }: UpdateLayerInfo): SagaIterator;
15
15
  export declare function toggleAutoUpdateSaga({ payload, }: ToggleAutoUpdate): SagaIterator;
16
+ export declare function handleBaseLayersSaga(mapId: string, baseLayers: Layer[]): SagaIterator;
17
+ export declare function setMapPresetSaga({ payload }: SetMapPreset): SagaIterator;
16
18
  export declare function rootSaga(): SagaIterator;
17
19
  export default rootSaga;
@@ -760,3 +760,45 @@ export declare const getDisableMapPin: ((state: {
760
760
  }> & {
761
761
  clearCache: () => void;
762
762
  };
763
+ /**
764
+ * Returns the selected geojson feature for the given map
765
+ *
766
+ * Example const selectedFeature = getSelectedFeature(store, 'mapId1')
767
+ * @param {object} store store: object - store object
768
+ * @param {string} mapId mapId: string - Id of the map
769
+ * @returns {number} selectedFeatureIndex: the index of the selected geojson feature
770
+ */
771
+ export declare const getSelectedFeatureIndex: ((state: {
772
+ advancedLayerStore?: import("../../advancedLayerStore/types").AdvancedLayerStoreState;
773
+ syncronizationGroupStore?: import("../../generic/synchronizationGroups/types").SynchronizationGroupState;
774
+ ui?: import("../../ui/types").UIStoreType;
775
+ webmap?: WebMapState;
776
+ services?: import("../types").ServiceState;
777
+ layers?: import("../types").LayerState;
778
+ layerSelect?: import("../../layerSelect/types").LayerSelectStoreType;
779
+ }, params_0: string) => number) & import("reselect").OutputSelectorFields<(args_0: WebMap) => number & {
780
+ clearCache: () => void;
781
+ }> & {
782
+ clearCache: () => void;
783
+ };
784
+ /**
785
+ * Returns the active map preset id
786
+ *
787
+ * Example getActivePresetId(store);
788
+ * @param {object} store store: object - store object
789
+ * @param {string} mapId mapId: string - Id of the map
790
+ * @returns {boolean} returnType: boolean or undefined
791
+ */
792
+ export declare const getActiveMapPresetId: ((state: {
793
+ advancedLayerStore?: import("../../advancedLayerStore/types").AdvancedLayerStoreState;
794
+ syncronizationGroupStore?: import("../../generic/synchronizationGroups/types").SynchronizationGroupState;
795
+ ui?: import("../../ui/types").UIStoreType;
796
+ webmap?: WebMapState;
797
+ services?: import("../types").ServiceState;
798
+ layers?: import("../types").LayerState;
799
+ layerSelect?: import("../../layerSelect/types").LayerSelectStoreType;
800
+ }, params_0: string) => string) & import("reselect").OutputSelectorFields<(args_0: WebMap) => string & {
801
+ clearCache: () => void;
802
+ }> & {
803
+ clearCache: () => void;
804
+ };
@@ -1,6 +1,7 @@
1
1
  import { DateInterval } from '@opengeoweb/webmap';
2
2
  import { Action } from 'redux';
3
- import { WEBMAP_LAYER_MOVE, WEBMAP_SET_BBOX, WEBMAP_MAP_UPDATE_ALL_DIMENSIONS, WEBMAP_MAP_CHANGE_DIMENSION, WEBMAP_START_ANIMATION, WEBMAP_STOP_ANIMATION, WEBMAP_REGISTER_MAP, WEBMAP_UNREGISTER_MAP, WEBMAP_SET_ACTIVELAYERID, WEBMAP_TOGGLE_AUTO_UPDATE, WEBMAP_TOGGLE_LOOP, WEBMAP_SET_TIME_SLIDER_SCALE, WEBMAP_SET_TIME_STEP, WEBMAP_SET_ANIMATION_DELAY, WEBMAP_SET_ANIMATION_START_TIME, WEBMAP_SET_ANIMATION_END_TIME, WEBMAP_TOGGLE_TIMESTEP_AUTO, WEBMAP_TOGGLE_TIME_SLIDER_HOVER, WEBMAP_SET_TIME_SLIDER_CENTER_TIME, WEBMAP_SET_TIME_SLIDER_SECONDS_PER_PX, WEBMAP_SET_TIME_SLIDER_DATA_SCALE_TO_SECONDS_PER_PX, WEBMAP_SET_PIN, WEBMAP_DISABLE_PIN } from './constants';
3
+ import type { Layer } from '../layers/types';
4
+ import { WEBMAP_LAYER_MOVE, WEBMAP_SET_BBOX, WEBMAP_MAP_UPDATE_ALL_DIMENSIONS, WEBMAP_MAP_CHANGE_DIMENSION, WEBMAP_START_ANIMATION, WEBMAP_STOP_ANIMATION, WEBMAP_REGISTER_MAP, WEBMAP_UNREGISTER_MAP, WEBMAP_SET_ACTIVELAYERID, WEBMAP_TOGGLE_AUTO_UPDATE, WEBMAP_TOGGLE_LOOP, WEBMAP_SET_TIME_SLIDER_SCALE, WEBMAP_SET_TIME_STEP, WEBMAP_SET_ANIMATION_DELAY, WEBMAP_SET_ANIMATION_START_TIME, WEBMAP_SET_ANIMATION_END_TIME, WEBMAP_TOGGLE_TIMESTEP_AUTO, WEBMAP_TOGGLE_TIME_SLIDER_HOVER, WEBMAP_SET_TIME_SLIDER_CENTER_TIME, WEBMAP_SET_TIME_SLIDER_SECONDS_PER_PX, WEBMAP_SET_TIME_SLIDER_DATA_SCALE_TO_SECONDS_PER_PX, WEBMAP_SET_PIN, WEBMAP_DISABLE_PIN, WEBMAP_SET_SELECTED_FEATURE_INDEX, WEBMAP_SET_MAPPRESET, WEBMAP_SET_ACTIVE_MAPPRESET_ID } from './constants';
4
5
  export interface Dimension {
5
6
  name?: string;
6
7
  units?: string;
@@ -37,6 +38,8 @@ export interface WebMap {
37
38
  isTimeSliderHoverOn?: boolean;
38
39
  mapPinLocation?: MapLocation;
39
40
  disableMapPin?: boolean;
41
+ selectedFeatureIndex?: number;
42
+ activePresetId?: string;
40
43
  }
41
44
  export interface WebMapState {
42
45
  byId: Record<string, WebMap>;
@@ -63,6 +66,34 @@ export declare enum Scale {
63
66
  Year = 7,
64
67
  DataScale = 8
65
68
  }
69
+ export declare type SpeedFactorType = 0.1 | 0.2 | 0.5 | 1 | 2 | 4 | 8 | 16;
70
+ export interface AnimationPayloadType {
71
+ duration?: number;
72
+ interval?: number;
73
+ speed?: SpeedFactorType;
74
+ }
75
+ export interface MapPreset {
76
+ layers?: Layer[];
77
+ overLayers?: Layer[];
78
+ baseLayer?: Layer;
79
+ activeLayerId?: string;
80
+ proj?: {
81
+ bbox: Bbox;
82
+ srs: string;
83
+ };
84
+ shouldAnimate?: boolean;
85
+ animationPayload?: AnimationPayloadType;
86
+ shouldShowZoomControls?: boolean;
87
+ shouldAutoUpdate?: boolean;
88
+ showTimeSlider?: boolean;
89
+ displayMapPin?: boolean;
90
+ toggleTimestepAuto?: boolean;
91
+ setTimestep?: number;
92
+ }
93
+ export interface MapPresetInitialProps {
94
+ mapPreset: MapPreset;
95
+ syncGroupsIds?: string[];
96
+ }
66
97
  export interface RegisterMap extends Action {
67
98
  type: typeof WEBMAP_REGISTER_MAP;
68
99
  payload: {
@@ -254,4 +285,28 @@ export interface DisableMapPinPayload {
254
285
  mapId: string;
255
286
  disableMapPin: boolean;
256
287
  }
257
- export declare type MapActions = RegisterMap | UnregisterMap | SetMapDimension | UpdateAllMapDimensions | SetMapAnimationStart | SetMapAnimationStop | SetBbox | MoveLayer | SetActiveLayerId | ToggleAutoUpdate | ToggleLoop | SetTimeStep | SetTimeSliderScale | SetAnimationDelay | SetAnimationStartTime | SetAnimationEndTime | ToggleTimestepAuto | ToggleTimeSliderHover | SetTimeSliderCenterTime | SetTimeSliderSecondsPerPx | SetTimeSliderDataScaleToSecondsPerPx | SetMapPinLocation | SetDisableMapPin;
288
+ export interface SetSelectedFeature {
289
+ type: typeof WEBMAP_SET_SELECTED_FEATURE_INDEX;
290
+ payload: SetSelectedFeaturePayload;
291
+ }
292
+ export interface SetSelectedFeaturePayload {
293
+ mapId: string;
294
+ selectedFeatureIndex: number;
295
+ }
296
+ export interface SetMapPresetPayload {
297
+ mapId: string;
298
+ initialProps: MapPresetInitialProps;
299
+ }
300
+ export interface SetMapPreset extends Action {
301
+ type: typeof WEBMAP_SET_MAPPRESET;
302
+ payload: SetMapPresetPayload;
303
+ }
304
+ export interface SetActiveMapPresetPayload {
305
+ mapId: string;
306
+ presetId: string;
307
+ }
308
+ export interface SetActiveMapPresetId extends Action {
309
+ type: typeof WEBMAP_SET_ACTIVE_MAPPRESET_ID;
310
+ payload: SetActiveMapPresetPayload;
311
+ }
312
+ export declare type MapActions = RegisterMap | UnregisterMap | SetMapDimension | UpdateAllMapDimensions | SetMapAnimationStart | SetMapAnimationStop | SetBbox | MoveLayer | SetActiveLayerId | ToggleAutoUpdate | ToggleLoop | SetTimeStep | SetTimeSliderScale | SetAnimationDelay | SetAnimationStartTime | SetAnimationEndTime | ToggleTimestepAuto | ToggleTimeSliderHover | SetTimeSliderCenterTime | SetTimeSliderSecondsPerPx | SetTimeSliderDataScaleToSecondsPerPx | SetMapPinLocation | SetDisableMapPin | SetSelectedFeature | SetMapPreset | SetActiveMapPresetId;
@@ -24,8 +24,9 @@ interface CreateMapProps {
24
24
  timeSliderDataScaleToSecondsPerPx?: number;
25
25
  isTimestepAuto?: boolean;
26
26
  isTimeSliderHoverOn?: boolean;
27
+ activePresetId?: string;
27
28
  }
28
- export declare const createMap: ({ id, isAnimating, animationStartTime, animationEndTime, isAutoUpdating, isLooping, bbox, srs, baseLayers, overLayers, mapLayers, featureLayers, dimensions, activeLayerId, timeSliderScale, timeStep, animationDelay, timeSliderCenterTime, timeSliderSecondsPerPx, timeSliderDataScaleToSecondsPerPx, isTimestepAuto, isTimeSliderHoverOn, }: CreateMapProps) => WebMap;
29
+ export declare const createMap: ({ id, isAnimating, animationStartTime, animationEndTime, isAutoUpdating, isLooping, bbox, srs, baseLayers, overLayers, mapLayers, featureLayers, dimensions, activeLayerId, timeSliderScale, timeStep, animationDelay, timeSliderCenterTime, timeSliderSecondsPerPx, timeSliderDataScaleToSecondsPerPx, isTimestepAuto, isTimeSliderHoverOn, activePresetId, }: CreateMapProps) => WebMap;
29
30
  export declare const checkValidLayersPayload: (layers: Layer[], mapId: string) => boolean;
30
31
  /**
31
32
  * This will get the map from the map draftstate.
@@ -1,11 +1,26 @@
1
1
  import { Service } from '../components/WMSLoader/services';
2
- import { Bbox, Layer } from '../store/mapStore/types';
3
- import { FilteredMapPresets, MapPresets, LayerDimension } from './types';
2
+ import { Layer } from '../store/mapStore/types';
3
+ interface FilteredMapPresets {
4
+ services?: Service[];
5
+ baseServices?: Service[];
6
+ baseLayers: Layer[];
7
+ mapLayers: Layer[];
8
+ }
9
+ export interface InitialAppPresetProps {
10
+ presetType?: string;
11
+ presetId?: string;
12
+ presetName?: string;
13
+ services?: Service[];
14
+ baseServices?: Service[];
15
+ layers?: Layer[];
16
+ baseLayers?: Layer[];
17
+ }
18
+ export interface InitialAppPreset {
19
+ preset: InitialAppPresetProps;
20
+ }
4
21
  export declare const filterBaseLayers: (presetArray: unknown[]) => Layer[];
5
22
  export declare const filterMapLayers: (presetArray: unknown[]) => Layer[];
6
23
  export declare const filterServices: (presetArray: Service[]) => Service[];
7
- export declare const filterBbox: (presetBbox: Bbox) => Bbox;
8
- export declare const filterSrs: (presetSrs: string) => string;
9
- export declare const filterDimensions: (mapLayers: Layer[]) => LayerDimension[];
10
- export declare const filterMapPresets: (presets: MapPresets) => FilteredMapPresets;
11
- export declare const getInitialPresets: (mapPresets: MapPresets, defaultInitialPresets: MapPresets) => FilteredMapPresets;
24
+ export declare const filterMapPresets: (presets: InitialAppPreset) => FilteredMapPresets;
25
+ export declare const getInitialPresets: (mapPreset: InitialAppPreset, defaultInitialPresets: InitialAppPreset) => InitialAppPresetProps;
26
+ export {};
@@ -1,42 +1,4 @@
1
1
  import { Service } from '../components/WMSLoader/services';
2
- import { Bbox, Dimension, Layer } from '../store/mapStore/types';
3
- export interface PresetLayer {
4
- id?: string;
5
- mapId?: string;
6
- service?: string;
7
- name?: string;
8
- format?: string;
9
- enabled?: string;
10
- style?: string;
11
- dimensions?: Dimension[];
12
- opacity?: number;
13
- type?: string;
14
- layerType?: string;
15
- status?: string;
16
- }
17
- export interface MapPreset {
18
- presetType?: string;
19
- presetId?: string;
20
- presetName?: string;
21
- srs?: string;
22
- bbox?: Bbox;
23
- services?: Service[];
24
- baseServices?: Service[];
25
- layers?: PresetLayer[];
26
- activeLayerId?: string;
27
- }
28
- export interface MapPresets {
29
- preset: MapPreset;
30
- }
31
- export interface LayerDimension {
32
- dimension?: Dimension;
33
- layerId?: string;
34
- }
35
- export interface FilteredMapPresets extends MapPreset {
36
- baseLayers?: Layer[];
37
- mapLayers?: Layer[];
38
- layerDimensions?: LayerDimension[];
39
- }
40
2
  export interface UserAddedServices {
41
3
  [id: string]: Service;
42
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/core",
3
- "version": "2.6.0",
3
+ "version": "2.7.0",
4
4
  "description": "GeoWeb Core library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -13,23 +13,23 @@
13
13
  "dependencies": {},
14
14
  "peerDependencies": {
15
15
  "react": "^17.0.2",
16
- "@opengeoweb/theme": "2.6.0",
16
+ "@opengeoweb/theme": "2.7.0",
17
17
  "@mui/material": "^5.2.8",
18
18
  "@mui/styles": "^5.2.3",
19
19
  "@mui/icons-material": "^5.2.5",
20
20
  "react-redux": "7.2.2",
21
21
  "moment": "^2.29.0",
22
22
  "react-intl": "^5.17.5",
23
- "@opengeoweb/shared": "2.6.0",
23
+ "@opengeoweb/shared": "2.7.0",
24
24
  "react-draggable": "^4.4.3",
25
25
  "re-resizable": "^6.9.0",
26
26
  "lodash": "^4.17.20",
27
- "@opengeoweb/form-fields": "2.6.0",
27
+ "@opengeoweb/form-fields": "2.7.0",
28
28
  "react-hook-form": "^6.12.1",
29
29
  "moment-timezone": "^0.5.31",
30
30
  "@mui/lab": "^5.0.0-alpha.64",
31
31
  "axios": "^0.25.0",
32
- "@opengeoweb/webmap": "2.6.0",
32
+ "@opengeoweb/webmap": "2.7.0",
33
33
  "throttle-debounce": "^3.0.1",
34
34
  "proj4": "^2.6.2",
35
35
  "react-sortablejs": "^6.0.0",