@opengeoweb/core 9.26.0 → 9.27.1

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/README.md CHANGED
@@ -9,7 +9,7 @@ This library was generated with [Nx](https://nx.dev).
9
9
  ## Installation
10
10
 
11
11
  ```
12
- npm install @opengeoweb/core @opengeoweb/store @opengeoweb/timeslider @redux-eggs/redux-toolkit @redux-eggs/saga-extension
12
+ npm install @opengeoweb/core @opengeoweb/store @opengeoweb/timeslider @redux-eggs/redux-toolkit
13
13
  ```
14
14
 
15
15
  ## Use
@@ -27,11 +27,8 @@ import {
27
27
  import { mapActions } from '@opengeoweb/store';
28
28
  import { TimeSliderConnect } from '@opengeoweb/timeslider';
29
29
  import { createStore } from '@redux-eggs/redux-toolkit';
30
- import { getSagaExtension } from '@redux-eggs/saga-extension';
31
30
 
32
- const store = createStore({
33
- extensions: [getSagaExtension()],
34
- });
31
+ const store = createStore({});
35
32
 
36
33
  const ConnectedMapWithTimeSlider = ({ mapId }) => {
37
34
  const dispatch = useDispatch();
package/index.esm.js CHANGED
@@ -6,12 +6,12 @@ import { SHARED_NAMESPACE, sharedTranslations, CustomIconButton, TooltipSelect,
6
6
  import { CollapseSmall, CollapseMedium, CollapseLarge, CollapseWindow, ExpandWindow, LayersAdd, CloudLoading, Copy, None, FastForward, AutoUpdateActive, Both, Visibility, VisibilityOff, Delete, DragHandle as DragHandle$1, Cached, Add, MapAdd, WorldMapProjection, Layers, ExitDomain, Info, Search, Exclamation, MyLocation, Close, ThemeWrapper, lightTheme } from '@opengeoweb/theme';
7
7
  import i18n from 'i18next';
8
8
  import { useTranslation, initReactI18next, I18nextProvider } from 'react-i18next';
9
- import { TIMESLIDER_NAMESPACE, timesliderTranslations, defaultTimeSpan, TIME_SLIDER_LEGEND_HEIGHT, SpeedButton, TimeStepButton, AnimationLengthButton, AnimationLength, TimeSpanButton, marks as marks$1, secondsPerPxFromCanvasWidth, getNewCenterOfFixedPointZoom, OptionsMenuButton, PlayButton, defaultTimeStep, BackwardForwardStepButton, AutoUpdateButton, NowButton, handleSetNowEvent, TimeSliderButtons, TimeSliderCurrentTimeBox, TimeSliderLegend, TimeSlider, onsetNewDateDebounced, getFilteredTime, ControlButtons, OptionsMenu, TimeSliderClock } from '@opengeoweb/timeslider';
10
- import { WEBMAP_REACT_NAMESPACE, webmapReactTranslations, LayerInfoButton, LayerInfoDialog, MapControlButton, MapDimensionSelect, dimensionConfig, DimensionSelectDialog, DimensionSelectButton, ZoomControls, MapView, MapViewLayer, LegendDialog, LegendButton, registerDrawFunction, emptyGeoJSON, MapControls, publicLayers } from '@opengeoweb/webmap-react';
9
+ import { TIMESLIDER_NAMESPACE, timesliderTranslations, defaultTimeSpan, TIME_SLIDER_LEGEND_HEIGHT, SpeedButton, TimeStepButton, AnimationLengthButton, AnimationLength, TimeSpanButton, secondsPerPxFromCanvasWidth, getNewCenterOfFixedPointZoom, OptionsMenuButton, PlayButton, defaultTimeStep, BackwardForwardStepButton, AutoUpdateButton, NowButton, handleSetNowEvent, TimeSliderButtons, TimeSliderCurrentTimeBox, TimeSliderLegend, TimeSlider, onsetNewDateDebounced, getFilteredTime, ControlButtons, OptionsMenu, TimeSliderClock } from '@opengeoweb/timeslider';
10
+ import { WEBMAP_REACT_NAMESPACE, webmapReactTranslations, WEBMAP_NAMESPACE, webmapTranslations, LayerInfoButton, LayerInfoDialog, MapControlButton, MapDimensionSelect, dimensionConfig, DimensionSelectDialog, DimensionSelectButton, ZoomControls, MapView, MapViewLayer, LegendDialog, LegendButton, registerDrawFunction, emptyGeoJSON, MapControls, publicLayers } from '@opengeoweb/webmap-react';
11
11
  import { useDispatch, useSelector, connect, useStore, Provider } from 'react-redux';
12
12
  import { ReactSortable } from 'react-sortablejs';
13
13
  import Sortable from 'sortablejs';
14
- import { layerTypes, layerUtils, layerActions, layerSelectors, serviceSelectors, serviceActions, mapSelectors, mapActions, mapEnums, uiSelectors, uiTypes, useSetupDialog, filterLayers, getUserAddedServices, uiActions, genericActions, drawtoolSelectors, syncConstants, loadingIndicatorActions, IS_LEGEND_OPEN_BY_DEFAULT, defaultLayers, mapStoreActions, getSingularDrawtoolDrawLayerId, syncGroupsSelectors, syncGroupsSelector, coreModuleConfig, routerUtils, routerModuleConfig } from '@opengeoweb/store';
14
+ import { layerTypes, layerUtils, mapSelectors, layerActions, layerSelectors, serviceSelectors, serviceActions, mapActions, mapEnums, uiSelectors, uiTypes, useSetupDialog, filterLayers, getUserAddedServices, uiActions, genericActions, drawtoolSelectors, syncConstants, loadingIndicatorActions, IS_LEGEND_OPEN_BY_DEFAULT, defaultLayers, mapStoreActions, getSingularDrawtoolDrawLayerId, syncGroupsSelectors, syncGroupsSelector, coreModuleConfig, routerUtils, routerModuleConfig } from '@opengeoweb/store';
15
15
  import { webmapUtils, getCapabilities, WMGetServiceFromStore, LayerType, handleDateUtilsISOString, wmServiceListener, EVENT_GETCAPABILITIES_START, EVENT_GETCAPABILITIES_READY, getWMSGetFeatureInfoRequestURL, WMLayer } from '@opengeoweb/webmap';
16
16
  import { Box as Box$1, styled as styled$1 } from '@mui/system';
17
17
  import _, { isEqual, range } from 'lodash';
@@ -1964,24 +1964,28 @@ const initCoreReactI18n = () => {
1964
1964
  en: {
1965
1965
  [CORE_NAMESPACE]: coreTranslations.en,
1966
1966
  [WEBMAP_REACT_NAMESPACE]: webmapReactTranslations.en,
1967
+ [WEBMAP_NAMESPACE]: webmapTranslations.en,
1967
1968
  [SHARED_NAMESPACE]: sharedTranslations.en,
1968
1969
  [TIMESLIDER_NAMESPACE]: timesliderTranslations.en
1969
1970
  },
1970
1971
  fi: {
1971
1972
  [CORE_NAMESPACE]: coreTranslations.fi,
1972
1973
  [WEBMAP_REACT_NAMESPACE]: webmapReactTranslations.fi,
1974
+ [WEBMAP_NAMESPACE]: webmapTranslations.fi,
1973
1975
  [SHARED_NAMESPACE]: sharedTranslations.fi,
1974
1976
  [TIMESLIDER_NAMESPACE]: timesliderTranslations.fi
1975
1977
  },
1976
1978
  no: {
1977
1979
  [CORE_NAMESPACE]: coreTranslations.no,
1978
1980
  [WEBMAP_REACT_NAMESPACE]: webmapReactTranslations.no,
1981
+ [WEBMAP_NAMESPACE]: webmapTranslations.no,
1979
1982
  [SHARED_NAMESPACE]: sharedTranslations.no,
1980
1983
  [TIMESLIDER_NAMESPACE]: timesliderTranslations.no
1981
1984
  },
1982
1985
  nl: {
1983
1986
  [CORE_NAMESPACE]: coreTranslations.nl,
1984
1987
  [WEBMAP_REACT_NAMESPACE]: webmapReactTranslations.nl,
1988
+ [WEBMAP_NAMESPACE]: webmapTranslations.nl,
1985
1989
  [SHARED_NAMESPACE]: sharedTranslations.nl,
1986
1990
  [TIMESLIDER_NAMESPACE]: timesliderTranslations.nl
1987
1991
  }
@@ -4269,14 +4273,16 @@ const DeleteLayerConnect = ({
4269
4273
  icon: _icon = jsx(Delete, {})
4270
4274
  }) => {
4271
4275
  const dispatch = useDispatch();
4276
+ const layerIndex = useSelector(store => mapSelectors.getLayerIndexByLayerId(store, mapId, layerId));
4272
4277
  const layerDelete = React.useCallback(({
4273
4278
  mapId,
4274
4279
  layerId
4275
4280
  }) => dispatch(layerActions.layerDelete({
4276
4281
  mapId,
4277
4282
  layerId,
4283
+ layerIndex,
4278
4284
  origin: layerTypes.LayerActionOrigin.layerManager
4279
- })), [dispatch]);
4285
+ })), [dispatch, layerIndex]);
4280
4286
  const isLayerEnabled = useSelector(store => layerSelectors.getLayerEnabled(store, layerId));
4281
4287
  return jsx(CustomIconButton, Object.assign({
4282
4288
  tooltipTitle: _tooltipTitle,
@@ -8855,7 +8861,7 @@ const TimeStepButtonConnect = ({
8855
8861
  onChangeTimeStep: onSetTimeStep,
8856
8862
  disabled: isAnimating,
8857
8863
  onToggleTimestepAuto: onToggleTimestepAuto,
8858
- isTimestepAuto: Boolean(isTimestepAuto) && Boolean(timeStepFromLayer),
8864
+ isTimestepAuto: isTimestepAuto && Boolean(timeStepFromLayer),
8859
8865
  timeStepFromLayer: timeStepFromLayer
8860
8866
  });
8861
8867
  };
@@ -8918,9 +8924,11 @@ const TimeSpanButtonConnect = ({
8918
8924
  origin: mapEnums.MapActionOrigin.map
8919
8925
  }));
8920
8926
  }, [dispatch, isTimeSpanAuto, mapId]);
8921
- const onChangeTimeSliderSpan = newSliderValue => {
8922
- const newValue = newSliderValue ? Math.round(newSliderValue) : 0;
8923
- const spanInSeconds = marks$1.find(el => el.value === newValue).value;
8927
+ const onChangeTimeSliderSpan = valueInMinutes => {
8928
+ if (isTimeSpanAuto) {
8929
+ onToggleTimeSpanAuto();
8930
+ }
8931
+ const spanInSeconds = valueInMinutes * 60;
8924
8932
  const timeSliderWidth = mapSelectors.getMapTimeSliderWidth(store.getState(), mapId);
8925
8933
  const selectedTime = mapSelectors.getSelectedTime(store.getState(), mapId);
8926
8934
  const secondsPerPx = mapSelectors.getMapTimeSliderSecondsPerPx(store.getState(), mapId);
@@ -8942,12 +8950,6 @@ const TimeSpanButtonConnect = ({
8942
8950
  }));
8943
8951
  }
8944
8952
  };
8945
- const onMenuItemClick = markValue => {
8946
- if (isTimeSpanAuto) {
8947
- onToggleTimeSpanAuto();
8948
- }
8949
- onChangeTimeSliderSpan(markValue);
8950
- };
8951
8953
  const onToggleTimeSpan = () => {
8952
8954
  if (isTimeSpanAuto) {
8953
8955
  return;
@@ -8955,11 +8957,10 @@ const TimeSpanButtonConnect = ({
8955
8957
  onToggleTimeSpanAuto();
8956
8958
  };
8957
8959
  return jsx(TimeSpanButton, {
8958
- timeSliderSpan: timeSliderSpan,
8960
+ timeSliderSpan: timeSliderSpan / 60,
8959
8961
  disabled: isAnimating,
8960
8962
  onChangeSliderValue: onChangeTimeSliderSpan,
8961
8963
  onToggleTimeSpan: onToggleTimeSpan,
8962
- onMenuItemClick: onMenuItemClick,
8963
8964
  isTimeSpanAuto: Boolean(isTimeSpanAuto) && Boolean(timeStepFromLayer),
8964
8965
  layerHasTimeStep: Boolean(timeStepFromLayer)
8965
8966
  });
@@ -9602,9 +9603,10 @@ const ConfigurableMapConnect = _a => {
9602
9603
  shouldDisplayDrawControls = false,
9603
9604
  displaySearchButtonInMap = false,
9604
9605
  mapControls,
9605
- children
9606
+ children,
9607
+ shouldDisablePrefetching
9606
9608
  } = _a,
9607
- props = __rest(_a, ["id", "dockedLayerManagerSize", "title", "layers", "dimensions", "shouldAutoUpdate", "shouldAnimate", "shouldAutoFetch", "bbox", "srs", "shouldShowZoomControls", "displayMapPin", "showTimeSlider", "disableTimeSlider", "displayTimeInMap", "displayLayerManagerAndLegendButtonInMap", "displayDimensionSelectButtonInMap", "multiLegend", "shouldShowLayerManager", "shouldShowDockedLayerManager", "showClock", "displayGetFeatureInfoButtonInMap", "shouldDisplayDrawControls", "displaySearchButtonInMap", "mapControls", "children"]);
9609
+ props = __rest(_a, ["id", "dockedLayerManagerSize", "title", "layers", "dimensions", "shouldAutoUpdate", "shouldAnimate", "shouldAutoFetch", "bbox", "srs", "shouldShowZoomControls", "displayMapPin", "showTimeSlider", "disableTimeSlider", "displayTimeInMap", "displayLayerManagerAndLegendButtonInMap", "displayDimensionSelectButtonInMap", "multiLegend", "shouldShowLayerManager", "shouldShowDockedLayerManager", "showClock", "displayGetFeatureInfoButtonInMap", "shouldDisplayDrawControls", "displaySearchButtonInMap", "mapControls", "children", "shouldDisablePrefetching"]);
9608
9610
  const dispatch = useDispatch();
9609
9611
  const mapId = React__default.useRef(id || webmapUtils.generateMapId()).current;
9610
9612
  React__default.useEffect(() => {
@@ -9719,7 +9721,8 @@ const ConfigurableMapConnect = _a => {
9719
9721
  displayTimeInMap: displayTimeInMap,
9720
9722
  showScaleBar: false,
9721
9723
  shouldAutoFetch: shouldAutoFetch,
9722
- mapId: mapId
9724
+ mapId: mapId,
9725
+ shouldDisablePrefetching: shouldDisablePrefetching
9723
9726
  }, {
9724
9727
  children: children
9725
9728
  })), multiLegend && jsx(LegendConnect, {
@@ -9739,7 +9742,7 @@ const ConfigurableMapConnect = _a => {
9739
9742
  isDocked: true
9740
9743
  })]
9741
9744
  }));
9742
- }, [children, disableTimeSlider, displayDimensionSelectButtonInMap, displayGetFeatureInfoButtonInMap, displayLayerManagerAndLegendButtonInMap, displaySearchButtonInMap, displayTimeInMap, id, mapControls, mapControlsPositionTop, mapId, multiLegend, showClock, shouldAutoFetch, title]);
9745
+ }, [children, disableTimeSlider, displayDimensionSelectButtonInMap, displayGetFeatureInfoButtonInMap, displayLayerManagerAndLegendButtonInMap, displaySearchButtonInMap, displayTimeInMap, id, mapControls, mapControlsPositionTop, mapId, multiLegend, showClock, shouldAutoFetch, title, shouldDisablePrefetching]);
9743
9746
  };
9744
9747
 
9745
9748
  var uncurryThis$1 = functionUncurryThis;
@@ -10024,7 +10027,8 @@ const MultiMapViewConnect = ({
10024
10027
  showTimeSlider: false,
10025
10028
  disableTimeSlider: true,
10026
10029
  showClock: false,
10027
- multiLegend: _multiLegend
10030
+ multiLegend: _multiLegend,
10031
+ shouldDisablePrefetching: map.componentType === 'MultiMap'
10028
10032
  })
10029
10033
  }), mapId);
10030
10034
  })]
@@ -10077,6 +10081,7 @@ const makeMapPreset = (timeIncrement, uniqueId, referenceTime, layers, syncGroup
10077
10081
  top: 7540256.313079321
10078
10082
  },
10079
10083
  srs: PROJECTION.EPSG_3857.value,
10084
+ componentType: 'MultiMap',
10080
10085
  layers: layers.map((layer, index) => Object.assign(Object.assign({}, layer), {
10081
10086
  id: `${uniqueId}-${index}`,
10082
10087
  dimensions: [{
@@ -10168,6 +10173,7 @@ const HarmonieTempAndPrecipPreset = ({
10168
10173
  top: 7438773.776232235
10169
10174
  },
10170
10175
  srs: PROJECTION.EPSG_3857.value,
10176
+ componentType: 'MultiMap',
10171
10177
  layers: [Object.assign(Object.assign({}, layer), {
10172
10178
  id: uniqueId,
10173
10179
  dimensions: [{
@@ -10256,7 +10262,8 @@ const componentsLookUp = ({
10256
10262
  autoUpdateLayerId,
10257
10263
  autoTimeStepLayerId,
10258
10264
  bbox: (_b = (_a = mapPreset[0]) === null || _a === void 0 ? void 0 : _a.proj) === null || _b === void 0 ? void 0 : _b.bbox,
10259
- srs: (_d = (_c = mapPreset[0]) === null || _c === void 0 ? void 0 : _c.proj) === null || _d === void 0 ? void 0 : _d.srs
10265
+ srs: (_d = (_c = mapPreset[0]) === null || _c === void 0 ? void 0 : _c.proj) === null || _d === void 0 ? void 0 : _d.srs,
10266
+ componentType: 'MultiMap'
10260
10267
  };
10261
10268
  }),
10262
10269
  "data-testid": "coreMultiMapViewConnect"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/core",
3
- "version": "9.26.0",
3
+ "version": "9.27.1",
4
4
  "description": "GeoWeb Core library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -32,7 +32,9 @@
32
32
  "@sentry/react": "^7.109.0"
33
33
  },
34
34
  "peerDependencies": {
35
- "react": "18"
35
+ "react": "18",
36
+ "@emotion/react": "*",
37
+ "@emotion/styled": "*"
36
38
  },
37
39
  "module": "./index.esm.js",
38
40
  "type": "module",
@@ -40,5 +40,6 @@ export interface ConfigurableMapConnectProps {
40
40
  displaySearchButtonInMap?: boolean;
41
41
  children?: React.ReactNode;
42
42
  mapControls?: React.ReactNode;
43
+ shouldDisablePrefetching?: boolean;
43
44
  }
44
45
  export declare const ConfigurableMapConnect: React.FC<ConfigurableMapConnectProps>;
@@ -13,6 +13,7 @@ export interface MultiMapPreset {
13
13
  displayLayerManagerAndLegendButtonInMap?: boolean;
14
14
  displayDimensionSelectButtonInMap?: boolean;
15
15
  syncGroupsIds?: string[];
16
+ componentType?: string;
16
17
  }
17
18
  export interface MultiMapViewProps {
18
19
  rows: number;