@opengeoweb/store 9.30.0 → 9.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { webmapUtils, parseISO8601IntervalToDateInterval, LayerType, getWMJSMapById, WMLayer, webmapTestSettings, getWMSRequests, handleDateUtilsISOString, isProjectionSupported, getCapabilities } from '@opengeoweb/webmap';
2
- import { createAction, createSlice, createSelector, createEntityAdapter, createListenerMiddleware, isAnyOf } from '@reduxjs/toolkit';
2
+ import { createAction, createSlice, createSelector, createListenerMiddleware, isAnyOf, createEntityAdapter } from '@reduxjs/toolkit';
3
3
  import { getGeoJson, moveFeature, createInterSections, getLastEmptyFeatureIndex, defaultLayers, emptyGeoJSON, addSelectionTypeToGeoJSON, getFeatureCollection, defaultIntersectionStyleProperties } from '@opengeoweb/webmap-react';
4
4
  export { defaultLayers } from '@opengeoweb/webmap-react';
5
5
  import { dateUtils, PROJECTION, defaultDelay, withEggs } from '@opengeoweb/shared';
@@ -2406,6 +2406,7 @@ const produceLayerDimensionDraftState = (draft, layerId, dimensionValueToUpdate)
2406
2406
  layerDimension.validSyncSelection = dimensionValueToUpdate.validSyncSelection;
2407
2407
  }
2408
2408
  }
2409
+ updateMinMaxValueWhenReferenceTimeChanges(layer, dimensionValueToUpdate);
2409
2410
  };
2410
2411
  const isActionLayerSynced = (state, layerIdFromAction, dimension) => {
2411
2412
  if (dimension.synced !== undefined) {
@@ -2508,6 +2509,34 @@ const filterCurrentValueFromDimensions = dimensions => {
2508
2509
  return dim;
2509
2510
  })) !== null && _a !== void 0 ? _a : [];
2510
2511
  };
2512
+ /**
2513
+ * The timeslider range is depending on values set via reference_time dimension.
2514
+ * This code will update minValue and maxValue accordingly based on the value of the reference_time.
2515
+ *
2516
+ * @param draft
2517
+ * @param layerId
2518
+ * @param dimensionValueToUpdate
2519
+ * @returns
2520
+ */
2521
+ const updateMinMaxValueWhenReferenceTimeChanges = (draftLayer, dimensionValueToUpdate) => {
2522
+ if (!(draftLayer === null || draftLayer === void 0 ? void 0 : draftLayer.id) || !(draftLayer === null || draftLayer === void 0 ? void 0 : draftLayer.dimensions) || dimensionValueToUpdate.name !== 'reference_time') {
2523
+ return;
2524
+ }
2525
+ // If dimension reference_time is updated, we might have to update the time minValue and maxValue as well.
2526
+ const wmLayer = webmapUtils.getWMLayerById(draftLayer.id);
2527
+ if (wmLayer && wmLayer.dimensions.length >= 2) {
2528
+ const referenceTimeDimension = wmLayer.getDimension('reference_time');
2529
+ const timeDimension = wmLayer.getDimension('time');
2530
+ const reduxTimeDim = draftLayer.dimensions.find(d => d.name === 'time');
2531
+ if (reduxTimeDim && timeDimension && referenceTimeDimension) {
2532
+ // When the reference time changes, a new set of timevalues needs to be set in the layer.
2533
+ // From the new timevalues the min.max can be derived.
2534
+ timeDimension === null || timeDimension === void 0 ? void 0 : timeDimension.setTimeValuesForReferenceTime(dimensionValueToUpdate.currentValue, referenceTimeDimension);
2535
+ reduxTimeDim.minValue = timeDimension.getFirstValue();
2536
+ reduxTimeDim.maxValue = timeDimension.getLastValue();
2537
+ }
2538
+ }
2539
+ };
2511
2540
 
2512
2541
  var utils$2 = /*#__PURE__*/Object.freeze({
2513
2542
  __proto__: null,
@@ -2515,7 +2544,8 @@ var utils$2 = /*#__PURE__*/Object.freeze({
2515
2544
  filterNonTimeDimensions: filterNonTimeDimensions,
2516
2545
  isActionLayerSynced: isActionLayerSynced,
2517
2546
  produceDimensionActionForMapLayer: produceDimensionActionForMapLayer,
2518
- produceDraftStateForAllLayersForDimensionWithinMap: produceDraftStateForAllLayersForDimensionWithinMap
2547
+ produceDraftStateForAllLayersForDimensionWithinMap: produceDraftStateForAllLayersForDimensionWithinMap,
2548
+ updateMinMaxValueWhenReferenceTimeChanges: updateMinMaxValueWhenReferenceTimeChanges
2519
2549
  });
2520
2550
 
2521
2551
  /* *
@@ -4312,7 +4342,10 @@ const slice$5 = createSlice({
4312
4342
  // eslint-disable-next-line no-unused-vars
4313
4343
  draft,
4314
4344
  // eslint-disable-next-line no-unused-vars
4315
- action) => {}
4345
+ action) => {},
4346
+ setDefaultMapSettings: (draft, action) => {
4347
+ draft.defaultMapSettings = action.payload.preset;
4348
+ }
4316
4349
  },
4317
4350
  extraReducers: builder => {
4318
4351
  builder.addCase(layerActions.addLayer, (draft, action) => {
@@ -5179,39 +5212,6 @@ const {
5179
5212
  reducer: reducer$3
5180
5213
  } = slice$4;
5181
5214
 
5182
- /* *
5183
- * Licensed under the Apache License, Version 2.0 (the "License");
5184
- * you may not use this file except in compliance with the License.
5185
- * You may obtain a copy of the License at
5186
- *
5187
- * http://www.apache.org/licenses/LICENSE-2.0
5188
- *
5189
- * Unless required by applicable law or agreed to in writing, software
5190
- * distributed under the License is distributed on an "AS IS" BASIS,
5191
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5192
- * See the License for the specific language governing permissions and
5193
- * limitations under the License.
5194
- *
5195
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
5196
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
5197
- * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
5198
- * */
5199
- const SyncGroupTypeList = [SYNCGROUPS_TYPE_SETBBOX, SYNCGROUPS_TYPE_SETTIME];
5200
- var SyncGroupActionOrigin;
5201
- (function (SyncGroupActionOrigin) {
5202
- SyncGroupActionOrigin["delete"] = "ORIGIN_GENERIC_SYNCHRONIZATIONGROUP_UTILS_DELETEACTION";
5203
- SyncGroupActionOrigin["layerActions"] = "ORIGIN_GENERIC_SYNCHRONIZATIONGROUP_UTILS_LAYERACTIONS";
5204
- SyncGroupActionOrigin["move"] = "ORIGIN_GENERIC_SYNCHRONIZATIONGROUP_UTILS_MOVEACTION";
5205
- SyncGroupActionOrigin["add"] = "ORIGIN_GENERIC_SYNCHRONIZATIONGROUP_UTILS_ADDACTION";
5206
- SyncGroupActionOrigin["autoLayerId"] = "ORIGIN_GENERIC_SYNCHRONIZATIONGROUP_UTILS_AUTOLAYERIDACTION";
5207
- })(SyncGroupActionOrigin || (SyncGroupActionOrigin = {}));
5208
-
5209
- var types$2 = /*#__PURE__*/Object.freeze({
5210
- __proto__: null,
5211
- get SyncGroupActionOrigin () { return SyncGroupActionOrigin; },
5212
- SyncGroupTypeList: SyncGroupTypeList
5213
- });
5214
-
5215
5215
  const syncGroupStore = store => store.syncronizationGroupStore || null;
5216
5216
  /**
5217
5217
  * Gets synchronization group state
@@ -5414,6 +5414,105 @@ var selector = /*#__PURE__*/Object.freeze({
5414
5414
  groupTypes: groupTypes
5415
5415
  });
5416
5416
 
5417
+ /* *
5418
+ * Licensed under the Apache License, Version 2.0 (the "License");
5419
+ * you may not use this file except in compliance with the License.
5420
+ * You may obtain a copy of the License at
5421
+ *
5422
+ * http://www.apache.org/licenses/LICENSE-2.0
5423
+ *
5424
+ * Unless required by applicable law or agreed to in writing, software
5425
+ * distributed under the License is distributed on an "AS IS" BASIS,
5426
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5427
+ * See the License for the specific language governing permissions and
5428
+ * limitations under the License.
5429
+ *
5430
+ * Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
5431
+ * Copyright 2024 - Finnish Meteorological Institute (FMI)
5432
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
5433
+ * */
5434
+ const syncGroupsListener = createListenerMiddleware();
5435
+ syncGroupsListener.startListening({
5436
+ matcher: isAnyOf(actions.syncGroupAddTarget, actions.syncGroupLinkTarget),
5437
+ effect: ({
5438
+ payload
5439
+ }, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
5440
+ listenerApi.cancelActiveListeners();
5441
+ const {
5442
+ groupId,
5443
+ linked,
5444
+ targetId: targetToUpdate
5445
+ } = payload;
5446
+ const group = getSynchronizationGroup(listenerApi.getState(), groupId);
5447
+ if (!linked && group) {
5448
+ switch (group.type) {
5449
+ case SYNCGROUPS_TYPE_SETTIME:
5450
+ if (!group.payloadByType[SYNCGROUPS_TYPE_SETTIME]) {
5451
+ return;
5452
+ }
5453
+ listenerApi.dispatch(setTimeSync(group.payloadByType[SYNCGROUPS_TYPE_SETTIME], [{
5454
+ targetId: targetToUpdate,
5455
+ value: group.payloadByType[SYNCGROUPS_TYPE_SETTIME].value
5456
+ }], [groupId]));
5457
+ break;
5458
+ case SYNCGROUPS_TYPE_SETBBOX:
5459
+ if (!group.payloadByType[SYNCGROUPS_TYPE_SETBBOX]) {
5460
+ return;
5461
+ }
5462
+ listenerApi.dispatch(setBboxSync(group.payloadByType[SYNCGROUPS_TYPE_SETBBOX], [{
5463
+ targetId: targetToUpdate,
5464
+ bbox: group.payloadByType[SYNCGROUPS_TYPE_SETBBOX].bbox,
5465
+ srs: group.payloadByType[SYNCGROUPS_TYPE_SETBBOX].srs
5466
+ }], [groupId]));
5467
+ break;
5468
+ }
5469
+ }
5470
+ })
5471
+ });
5472
+ syncGroupsListener.startListening({
5473
+ matcher: isAnyOf(actions.syncGroupAddGroup, actions.syncGroupRemoveGroup, actions.syncGroupAddSource, actions.syncGroupRemoveSource, actions.syncGroupAddTarget, actions.syncGroupRemoveTarget, actions.syncGroupLinkTarget),
5474
+ effect: (_, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
5475
+ listenerApi.cancelActiveListeners();
5476
+ const viewState = createSyncGroupViewStateSelector(listenerApi.getState());
5477
+ listenerApi.dispatch(actions.syncGroupSetViewState({
5478
+ viewState
5479
+ }));
5480
+ })
5481
+ });
5482
+
5483
+ /* *
5484
+ * Licensed under the Apache License, Version 2.0 (the "License");
5485
+ * you may not use this file except in compliance with the License.
5486
+ * You may obtain a copy of the License at
5487
+ *
5488
+ * http://www.apache.org/licenses/LICENSE-2.0
5489
+ *
5490
+ * Unless required by applicable law or agreed to in writing, software
5491
+ * distributed under the License is distributed on an "AS IS" BASIS,
5492
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5493
+ * See the License for the specific language governing permissions and
5494
+ * limitations under the License.
5495
+ *
5496
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
5497
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
5498
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
5499
+ * */
5500
+ const SyncGroupTypeList = [SYNCGROUPS_TYPE_SETBBOX, SYNCGROUPS_TYPE_SETTIME];
5501
+ var SyncGroupActionOrigin;
5502
+ (function (SyncGroupActionOrigin) {
5503
+ SyncGroupActionOrigin["delete"] = "ORIGIN_GENERIC_SYNCHRONIZATIONGROUP_UTILS_DELETEACTION";
5504
+ SyncGroupActionOrigin["layerActions"] = "ORIGIN_GENERIC_SYNCHRONIZATIONGROUP_UTILS_LAYERACTIONS";
5505
+ SyncGroupActionOrigin["move"] = "ORIGIN_GENERIC_SYNCHRONIZATIONGROUP_UTILS_MOVEACTION";
5506
+ SyncGroupActionOrigin["add"] = "ORIGIN_GENERIC_SYNCHRONIZATIONGROUP_UTILS_ADDACTION";
5507
+ SyncGroupActionOrigin["autoLayerId"] = "ORIGIN_GENERIC_SYNCHRONIZATIONGROUP_UTILS_AUTOLAYERIDACTION";
5508
+ })(SyncGroupActionOrigin || (SyncGroupActionOrigin = {}));
5509
+
5510
+ var types$2 = /*#__PURE__*/Object.freeze({
5511
+ __proto__: null,
5512
+ get SyncGroupActionOrigin () { return SyncGroupActionOrigin; },
5513
+ SyncGroupTypeList: SyncGroupTypeList
5514
+ });
5515
+
5417
5516
  /* *
5418
5517
  * Licensed under the Apache License, Version 2.0 (the "License");
5419
5518
  * you may not use this file except in compliance with the License.
@@ -6306,6 +6405,20 @@ const getAnimationRange = createSelector(getLayersById, getAutoTimeStepLayerId,
6306
6405
  animationEndTime
6307
6406
  };
6308
6407
  }, selectorMemoizationOptions);
6408
+ /**
6409
+ * Gets intialViewMapPreset from webmap state
6410
+ *
6411
+ * @param {object} store store: object - Store object
6412
+ * @returns {MapPreset | undefined} returnType: MapPreset
6413
+ */
6414
+ const getdefaultMapSettings = createSelector(getMapStore, state => state && state.defaultMapSettings, selectorMemoizationOptions);
6415
+ /**
6416
+ * Gets the layers of intialViewMapPreset from webmap state
6417
+ *
6418
+ * @param {object} store store: object - Store object
6419
+ * @returns {Layer[] | undefined} returnType: Layer[]
6420
+ */
6421
+ const getdefaultMapSettingsLayers = createSelector(getdefaultMapSettings, state => state && state.layers, selectorMemoizationOptions);
6309
6422
 
6310
6423
  var selectors$2 = /*#__PURE__*/Object.freeze({
6311
6424
  __proto__: null,
@@ -6357,6 +6470,8 @@ var selectors$2 = /*#__PURE__*/Object.freeze({
6357
6470
  getPinLocation: getPinLocation,
6358
6471
  getSelectedTime: getSelectedTime,
6359
6472
  getSrs: getSrs,
6473
+ getdefaultMapSettings: getdefaultMapSettings,
6474
+ getdefaultMapSettingsLayers: getdefaultMapSettingsLayers,
6360
6475
  isAnimating: isAnimating,
6361
6476
  isAnimationLengthAuto: isAnimationLengthAuto,
6362
6477
  isAutoUpdating: isAutoUpdating,
@@ -8316,10 +8431,13 @@ mapListener.startListening({
8316
8431
  autoUpdateLayerId: (_c = newLayerIds.autoUpdateLayerId) !== null && _c !== void 0 ? _c : firstLayerId
8317
8432
  }));
8318
8433
  }
8434
+ const customLayers = getdefaultMapSettingsLayers(listenerApi.getState());
8435
+ const customBaseLayer = customLayers === null || customLayers === void 0 ? void 0 : customLayers.find(layer => layer.layerType === LayerType.baseLayer);
8436
+ const customOverLayer = customLayers === null || customLayers === void 0 ? void 0 : customLayers.find(layer => layer.layerType === LayerType.overLayer);
8319
8437
  // sets (default) baseLayers
8320
- const baseLayersWithDefaultLayer = baseLayers.length ? baseLayers : [defaultLayers.baseLayerGrey];
8438
+ const baseLayersWithDefaultLayer = baseLayers.length ? baseLayers : [customBaseLayer || defaultLayers.baseLayerGrey];
8321
8439
  // sets (default) overLayers
8322
- const overLayersWithDefaultLayer = overLayers.length ? overLayers : [defaultLayers.overLayer];
8440
+ const overLayersWithDefaultLayer = overLayers.length ? overLayers : [customOverLayer || defaultLayers.overLayer];
8323
8441
  const allBaseLayers = [...baseLayersWithDefaultLayer, ...overLayersWithDefaultLayer].map(layer => Object.assign(Object.assign({}, layer), {
8324
8442
  id: webmapUtils.generateLayerId()
8325
8443
  }));
@@ -9818,72 +9936,6 @@ var storeTestUtils = /*#__PURE__*/Object.freeze({
9818
9936
  webmapStateWithAddedLayer: webmapStateWithAddedLayer
9819
9937
  });
9820
9938
 
9821
- /* *
9822
- * Licensed under the Apache License, Version 2.0 (the "License");
9823
- * you may not use this file except in compliance with the License.
9824
- * You may obtain a copy of the License at
9825
- *
9826
- * http://www.apache.org/licenses/LICENSE-2.0
9827
- *
9828
- * Unless required by applicable law or agreed to in writing, software
9829
- * distributed under the License is distributed on an "AS IS" BASIS,
9830
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9831
- * See the License for the specific language governing permissions and
9832
- * limitations under the License.
9833
- *
9834
- * Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9835
- * Copyright 2024 - Finnish Meteorological Institute (FMI)
9836
- * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
9837
- * */
9838
- const syncGroupsListener = createListenerMiddleware();
9839
- syncGroupsListener.startListening({
9840
- matcher: isAnyOf(actions.syncGroupAddTarget, actions.syncGroupLinkTarget),
9841
- effect: ({
9842
- payload
9843
- }, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
9844
- listenerApi.cancelActiveListeners();
9845
- const {
9846
- groupId,
9847
- linked,
9848
- targetId: targetToUpdate
9849
- } = payload;
9850
- const group = getSynchronizationGroup(listenerApi.getState(), groupId);
9851
- if (!linked && group) {
9852
- switch (group.type) {
9853
- case SYNCGROUPS_TYPE_SETTIME:
9854
- if (!group.payloadByType[SYNCGROUPS_TYPE_SETTIME]) {
9855
- return;
9856
- }
9857
- listenerApi.dispatch(setTimeSync(group.payloadByType[SYNCGROUPS_TYPE_SETTIME], [{
9858
- targetId: targetToUpdate,
9859
- value: group.payloadByType[SYNCGROUPS_TYPE_SETTIME].value
9860
- }], [groupId]));
9861
- break;
9862
- case SYNCGROUPS_TYPE_SETBBOX:
9863
- if (!group.payloadByType[SYNCGROUPS_TYPE_SETBBOX]) {
9864
- return;
9865
- }
9866
- listenerApi.dispatch(setBboxSync(group.payloadByType[SYNCGROUPS_TYPE_SETBBOX], [{
9867
- targetId: targetToUpdate,
9868
- bbox: group.payloadByType[SYNCGROUPS_TYPE_SETBBOX].bbox,
9869
- srs: group.payloadByType[SYNCGROUPS_TYPE_SETBBOX].srs
9870
- }], [groupId]));
9871
- break;
9872
- }
9873
- }
9874
- })
9875
- });
9876
- syncGroupsListener.startListening({
9877
- matcher: isAnyOf(actions.syncGroupAddGroup, actions.syncGroupRemoveGroup, actions.syncGroupAddSource, actions.syncGroupRemoveSource, actions.syncGroupAddTarget, actions.syncGroupRemoveTarget, actions.syncGroupLinkTarget),
9878
- effect: (_, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
9879
- listenerApi.cancelActiveListeners();
9880
- const viewState = createSyncGroupViewStateSelector(listenerApi.getState());
9881
- listenerApi.dispatch(actions.syncGroupSetViewState({
9882
- viewState
9883
- }));
9884
- })
9885
- });
9886
-
9887
9939
  const synchronizationGroupConfig = {
9888
9940
  id: 'syncronizationGroupStore-module',
9889
9941
  reducersMap: {
@@ -9957,4 +10009,4 @@ const StoreProvider = ({
9957
10009
  })
9958
10010
  }));
9959
10011
 
9960
- export { IS_LEGEND_OPEN_BY_DEFAULT, StoreProvider, coreModuleConfig, createCustomStore, drawtoolActions, drawtoolModuleConfig, reducer as drawtoolReducer, selectors as drawtoolSelectors, filterLayers$1 as filterLayers, genericActions, genericListener, selectors$4 as genericSelectors, types$1 as genericTypes, getSingularDrawtoolDrawLayerId, getUserAddedServices, initialState$3 as initialState, layerActions, reducer$6 as layerReducer, selectors$7 as layerSelectors, types$5 as layerTypes, utils$2 as layerUtils, loadingIndicatorActions, constants as loadingIndicatorConstants, loadingIndicatorReducer, selectors$3 as loadingIndicatorSelectors, mapActions, enums as mapEnums, mapListener, selectors$2 as mapSelectors, mapStoreActions, mapStoreModuleConfig, mapStoreReducers, types$4 as mapTypes, mapUtils, routerActions, routerModuleConfig, utils as routerUtils, selectorMemoizationOptions, serviceActions, selectors$1 as serviceSelectors, types as serviceTypes, setUserAddedServices, storeTestSettings, storeTestUtils, utils$1 as storeUtils, constants$1 as syncConstants, actions as syncGroupsActions, reducer$3 as syncGroupsReducer, selector as syncGroupsSelector, selectors$5 as syncGroupsSelectors, types$2 as syncGroupsTypes, types$2 as types, uiActions, uiModuleConfig, reducer$5 as uiReducer, selectors$6 as uiSelectors, types$3 as uiTypes, useSetupDialog, reducer$4 as webmapReducer };
10012
+ export { IS_LEGEND_OPEN_BY_DEFAULT, StoreProvider, coreModuleConfig, createCustomStore, drawtoolActions, drawtoolModuleConfig, reducer as drawtoolReducer, selectors as drawtoolSelectors, filterLayers$1 as filterLayers, genericActions, genericListener, selectors$4 as genericSelectors, types$1 as genericTypes, getSingularDrawtoolDrawLayerId, getUserAddedServices, initialState$3 as initialState, layerActions, reducer$6 as layerReducer, selectors$7 as layerSelectors, types$5 as layerTypes, utils$2 as layerUtils, loadingIndicatorActions, constants as loadingIndicatorConstants, loadingIndicatorReducer, selectors$3 as loadingIndicatorSelectors, mapActions, enums as mapEnums, mapListener, selectors$2 as mapSelectors, mapStoreActions, mapStoreModuleConfig, mapStoreReducers, types$4 as mapTypes, mapUtils, routerActions, routerModuleConfig, utils as routerUtils, selectorMemoizationOptions, serviceActions, selectors$1 as serviceSelectors, types as serviceTypes, setUserAddedServices, storeTestSettings, storeTestUtils, utils$1 as storeUtils, constants$1 as syncConstants, actions as syncGroupsActions, syncGroupsListener, reducer$3 as syncGroupsReducer, selector as syncGroupsSelector, selectors$5 as syncGroupsSelectors, types$2 as syncGroupsTypes, types$2 as types, uiActions, uiModuleConfig, reducer$5 as uiReducer, selectors$6 as uiSelectors, types$3 as uiTypes, useSetupDialog, reducer$4 as webmapReducer };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/store",
3
- "version": "9.30.0",
3
+ "version": "9.31.0",
4
4
  "description": "GeoWeb Store library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -1,3 +1,5 @@
1
+ import { syncGroupsListener } from './listener';
2
+ export { syncGroupsListener };
1
3
  export { actions as syncGroupsActions, initialState, reducer as syncGroupsReducer, } from './reducer';
2
4
  export * as syncConstants from './constants';
3
5
  export * as types from './types';
@@ -49,6 +49,7 @@ export declare const mapStoreActions: {
49
49
  mapId: string;
50
50
  error: string;
51
51
  }, "mapReducer/setMapPresetError">;
52
+ setDefaultMapSettings: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./types").SetDefaultMapSettingsPayload, "mapReducer/setDefaultMapSettings">;
52
53
  addLayer: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./types").AddLayerPayload, "layerReducer/addLayer">;
53
54
  duplicateMapLayer: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./types").DuplicateMapLayerPayload, "layerReducer/duplicateMapLayer">;
54
55
  layerChangeDimension: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./types").SetLayerDimensionPayload, "layerReducer/layerChangeDimension">;
@@ -1,6 +1,6 @@
1
1
  import { Draft } from '@reduxjs/toolkit';
2
2
  import { WMJSDimension } from '@opengeoweb/webmap';
3
- import type { Dimension } from '../types';
3
+ import type { Dimension, ReduxLayer } from '../types';
4
4
  import type { LayerState } from './types';
5
5
  export declare const isActionLayerSynced: (state: LayerState, layerIdFromAction: string, dimension: Dimension) => boolean;
6
6
  export declare const produceDimensionActionForMapLayer: (layerDim: Dimension, wmjsDimension: WMJSDimension, newDimension: Dimension) => Dimension;
@@ -21,3 +21,13 @@ export declare const filterNonTimeDimensions: (dimensions: Dimension[]) => Dimen
21
21
  * @param dimensions Dimension[]
22
22
  */
23
23
  export declare const filterCurrentValueFromDimensions: (dimensions: Dimension[]) => Dimension[];
24
+ /**
25
+ * The timeslider range is depending on values set via reference_time dimension.
26
+ * This code will update minValue and maxValue accordingly based on the value of the reference_time.
27
+ *
28
+ * @param draft
29
+ * @param layerId
30
+ * @param dimensionValueToUpdate
31
+ * @returns
32
+ */
33
+ export declare const updateMinMaxValueWhenReferenceTimeChanges: (draftLayer: Draft<ReduxLayer>, dimensionValueToUpdate: Dimension) => void;
@@ -1,6 +1,6 @@
1
1
  import { PayloadAction, Draft } from '@reduxjs/toolkit';
2
2
  import { MapPinLocationPayload, SetBboxPayload, SetStepBackWardOrForward, UpdateAllMapDimensionsPayload } from '@opengeoweb/webmap-react';
3
- import type { WebMapState, SetAutoLayerIdPayload, SetMapAnimationStartPayload, SetMapAnimationStopPayload, SetTimeSliderSpanPayload, SetTimeStepPayload, SetAnimationStartTimePayload, SetAnimationEndTimePayload, SetAnimationDelayPayload, MoveLayerPayload, SetTimeSliderWidthPayload, SetTimeSliderCenterTimePayload, SetEndTimeOverriding, ToggleAutoUpdatePayload, ToggleTimestepAutoPayload, ToggleTimeSpanAutoPayload, ToggleTimeSliderHoverPayload, DisableMapPinPayload, SetTimeSliderSecondsPerPxPayload, ToggleTimeSliderIsVisiblePayload, SetDockedLayerManagerSize, ToggleAnimationLengthAutoPayload } from './types';
3
+ import type { WebMapState, SetAutoLayerIdPayload, SetMapAnimationStartPayload, SetMapAnimationStopPayload, SetTimeSliderSpanPayload, SetTimeStepPayload, SetAnimationStartTimePayload, SetAnimationEndTimePayload, SetAnimationDelayPayload, MoveLayerPayload, SetTimeSliderWidthPayload, SetTimeSliderCenterTimePayload, SetEndTimeOverriding, ToggleAutoUpdatePayload, ToggleTimestepAutoPayload, ToggleTimeSpanAutoPayload, ToggleTimeSliderHoverPayload, DisableMapPinPayload, SetTimeSliderSecondsPerPxPayload, ToggleTimeSliderIsVisiblePayload, SetDockedLayerManagerSize, ToggleAnimationLengthAutoPayload, SetDefaultMapSettingsPayload } from './types';
4
4
  import { ToggleMapPinIsVisiblePayload, ToggleZoomControlsPayload } from '../types';
5
5
  /**
6
6
  * Checks if the layer id is already taken in one of the maps.
@@ -56,6 +56,7 @@ export declare const slice: import("@reduxjs/toolkit").Slice<WebMapState, {
56
56
  mapId: string;
57
57
  error: string;
58
58
  }>) => void;
59
+ setDefaultMapSettings: (draft: Draft<WebMapState>, action: PayloadAction<SetDefaultMapSettingsPayload>) => void;
59
60
  }, "mapReducer">;
60
61
  export declare const mapActions: {
61
62
  setMapPreset: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("./types").SetMapPresetPayload, string>;
@@ -105,5 +106,6 @@ export declare const mapActions: {
105
106
  mapId: string;
106
107
  error: string;
107
108
  }, "mapReducer/setMapPresetError">;
109
+ setDefaultMapSettings: import("@reduxjs/toolkit").ActionCreatorWithPayload<SetDefaultMapSettingsPayload, "mapReducer/setDefaultMapSettings">;
108
110
  };
109
111
  export declare const reducer: import("redux").Reducer<WebMapState>;
@@ -731,3 +731,25 @@ export declare const getAnimationRange: ((state: any, mapId: any) => {
731
731
  }> & {
732
732
  clearCache: () => void;
733
733
  };
734
+ /**
735
+ * Gets intialViewMapPreset from webmap state
736
+ *
737
+ * @param {object} store store: object - Store object
738
+ * @returns {MapPreset | undefined} returnType: MapPreset
739
+ */
740
+ export declare const getdefaultMapSettings: ((state: CoreAppStore) => MapPreset | undefined) & import("reselect").OutputSelectorFields<(args_0: WebMapState | undefined) => MapPreset | undefined, {
741
+ clearCache: () => void;
742
+ }> & {
743
+ clearCache: () => void;
744
+ };
745
+ /**
746
+ * Gets the layers of intialViewMapPreset from webmap state
747
+ *
748
+ * @param {object} store store: object - Store object
749
+ * @returns {Layer[] | undefined} returnType: Layer[]
750
+ */
751
+ export declare const getdefaultMapSettingsLayers: ((state: CoreAppStore) => Layer[] | undefined) & import("reselect").OutputSelectorFields<(args_0: MapPreset | undefined) => Layer[] | undefined, {
752
+ clearCache: () => void;
753
+ }> & {
754
+ clearCache: () => void;
755
+ };
@@ -57,6 +57,7 @@ export type DockedLayerManagerSize = 'sizeSmall' | 'sizeMedium' | 'sizeLarge' |
57
57
  export interface WebMapState {
58
58
  byId: Record<string, WebMap>;
59
59
  allIds: string[];
60
+ defaultMapSettings?: MapPreset;
60
61
  }
61
62
  export interface Bbox {
62
63
  left: number;
@@ -231,3 +232,6 @@ export interface ISO8601Interval {
231
232
  endTime: string;
232
233
  duration: string;
233
234
  }
235
+ export interface SetDefaultMapSettingsPayload {
236
+ preset: MapPreset;
237
+ }