@opengeoweb/core 9.26.0 → 9.27.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
@@ -6,8 +6,8 @@ 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';
@@ -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
  }
@@ -8855,7 +8859,7 @@ const TimeStepButtonConnect = ({
8855
8859
  onChangeTimeStep: onSetTimeStep,
8856
8860
  disabled: isAnimating,
8857
8861
  onToggleTimestepAuto: onToggleTimestepAuto,
8858
- isTimestepAuto: Boolean(isTimestepAuto) && Boolean(timeStepFromLayer),
8862
+ isTimestepAuto: isTimestepAuto && Boolean(timeStepFromLayer),
8859
8863
  timeStepFromLayer: timeStepFromLayer
8860
8864
  });
8861
8865
  };
@@ -8918,9 +8922,11 @@ const TimeSpanButtonConnect = ({
8918
8922
  origin: mapEnums.MapActionOrigin.map
8919
8923
  }));
8920
8924
  }, [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;
8925
+ const onChangeTimeSliderSpan = valueInMinutes => {
8926
+ if (isTimeSpanAuto) {
8927
+ onToggleTimeSpanAuto();
8928
+ }
8929
+ const spanInSeconds = valueInMinutes * 60;
8924
8930
  const timeSliderWidth = mapSelectors.getMapTimeSliderWidth(store.getState(), mapId);
8925
8931
  const selectedTime = mapSelectors.getSelectedTime(store.getState(), mapId);
8926
8932
  const secondsPerPx = mapSelectors.getMapTimeSliderSecondsPerPx(store.getState(), mapId);
@@ -8942,12 +8948,6 @@ const TimeSpanButtonConnect = ({
8942
8948
  }));
8943
8949
  }
8944
8950
  };
8945
- const onMenuItemClick = markValue => {
8946
- if (isTimeSpanAuto) {
8947
- onToggleTimeSpanAuto();
8948
- }
8949
- onChangeTimeSliderSpan(markValue);
8950
- };
8951
8951
  const onToggleTimeSpan = () => {
8952
8952
  if (isTimeSpanAuto) {
8953
8953
  return;
@@ -8955,11 +8955,10 @@ const TimeSpanButtonConnect = ({
8955
8955
  onToggleTimeSpanAuto();
8956
8956
  };
8957
8957
  return jsx(TimeSpanButton, {
8958
- timeSliderSpan: timeSliderSpan,
8958
+ timeSliderSpan: timeSliderSpan / 60,
8959
8959
  disabled: isAnimating,
8960
8960
  onChangeSliderValue: onChangeTimeSliderSpan,
8961
8961
  onToggleTimeSpan: onToggleTimeSpan,
8962
- onMenuItemClick: onMenuItemClick,
8963
8962
  isTimeSpanAuto: Boolean(isTimeSpanAuto) && Boolean(timeStepFromLayer),
8964
8963
  layerHasTimeStep: Boolean(timeStepFromLayer)
8965
8964
  });
@@ -9602,9 +9601,10 @@ const ConfigurableMapConnect = _a => {
9602
9601
  shouldDisplayDrawControls = false,
9603
9602
  displaySearchButtonInMap = false,
9604
9603
  mapControls,
9605
- children
9604
+ children,
9605
+ shouldDisablePrefetching
9606
9606
  } = _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"]);
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", "shouldDisablePrefetching"]);
9608
9608
  const dispatch = useDispatch();
9609
9609
  const mapId = React__default.useRef(id || webmapUtils.generateMapId()).current;
9610
9610
  React__default.useEffect(() => {
@@ -9719,7 +9719,8 @@ const ConfigurableMapConnect = _a => {
9719
9719
  displayTimeInMap: displayTimeInMap,
9720
9720
  showScaleBar: false,
9721
9721
  shouldAutoFetch: shouldAutoFetch,
9722
- mapId: mapId
9722
+ mapId: mapId,
9723
+ shouldDisablePrefetching: shouldDisablePrefetching
9723
9724
  }, {
9724
9725
  children: children
9725
9726
  })), multiLegend && jsx(LegendConnect, {
@@ -9739,7 +9740,7 @@ const ConfigurableMapConnect = _a => {
9739
9740
  isDocked: true
9740
9741
  })]
9741
9742
  }));
9742
- }, [children, disableTimeSlider, displayDimensionSelectButtonInMap, displayGetFeatureInfoButtonInMap, displayLayerManagerAndLegendButtonInMap, displaySearchButtonInMap, displayTimeInMap, id, mapControls, mapControlsPositionTop, mapId, multiLegend, showClock, shouldAutoFetch, title]);
9743
+ }, [children, disableTimeSlider, displayDimensionSelectButtonInMap, displayGetFeatureInfoButtonInMap, displayLayerManagerAndLegendButtonInMap, displaySearchButtonInMap, displayTimeInMap, id, mapControls, mapControlsPositionTop, mapId, multiLegend, showClock, shouldAutoFetch, title, shouldDisablePrefetching]);
9743
9744
  };
9744
9745
 
9745
9746
  var uncurryThis$1 = functionUncurryThis;
@@ -10024,7 +10025,8 @@ const MultiMapViewConnect = ({
10024
10025
  showTimeSlider: false,
10025
10026
  disableTimeSlider: true,
10026
10027
  showClock: false,
10027
- multiLegend: _multiLegend
10028
+ multiLegend: _multiLegend,
10029
+ shouldDisablePrefetching: map.componentType === 'MultiMap'
10028
10030
  })
10029
10031
  }), mapId);
10030
10032
  })]
@@ -10077,6 +10079,7 @@ const makeMapPreset = (timeIncrement, uniqueId, referenceTime, layers, syncGroup
10077
10079
  top: 7540256.313079321
10078
10080
  },
10079
10081
  srs: PROJECTION.EPSG_3857.value,
10082
+ componentType: 'MultiMap',
10080
10083
  layers: layers.map((layer, index) => Object.assign(Object.assign({}, layer), {
10081
10084
  id: `${uniqueId}-${index}`,
10082
10085
  dimensions: [{
@@ -10168,6 +10171,7 @@ const HarmonieTempAndPrecipPreset = ({
10168
10171
  top: 7438773.776232235
10169
10172
  },
10170
10173
  srs: PROJECTION.EPSG_3857.value,
10174
+ componentType: 'MultiMap',
10171
10175
  layers: [Object.assign(Object.assign({}, layer), {
10172
10176
  id: uniqueId,
10173
10177
  dimensions: [{
@@ -10256,7 +10260,8 @@ const componentsLookUp = ({
10256
10260
  autoUpdateLayerId,
10257
10261
  autoTimeStepLayerId,
10258
10262
  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
10263
+ srs: (_d = (_c = mapPreset[0]) === null || _c === void 0 ? void 0 : _c.proj) === null || _d === void 0 ? void 0 : _d.srs,
10264
+ componentType: 'MultiMap'
10260
10265
  };
10261
10266
  }),
10262
10267
  "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.0",
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;