@opengeoweb/webmap-react 12.13.0 → 13.1.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/webmap-react",
3
- "version": "12.13.0",
3
+ "version": "13.1.0",
4
4
  "description": "GeoWeb react wrapper for webmap",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -8,9 +8,9 @@
8
8
  "url": "git@gitlab.com:opengeoweb/opengeoweb.git"
9
9
  },
10
10
  "dependencies": {
11
- "@opengeoweb/webmap": "12.13.0",
12
- "@opengeoweb/theme": "12.13.0",
13
- "@opengeoweb/shared": "12.13.0",
11
+ "@opengeoweb/webmap": "13.1.0",
12
+ "@opengeoweb/theme": "13.1.0",
13
+ "@opengeoweb/shared": "13.1.0",
14
14
  "lodash": "^4.17.21",
15
15
  "ol": "^10.4.0",
16
16
  "proj4": "^2.9.2",
@@ -19,7 +19,7 @@
19
19
  "i18next": "^25.0.1",
20
20
  "@mui/material": "^7.0.1",
21
21
  "react-i18next": "^15.1.1",
22
- "@tanstack/react-query": "^5.69.2",
22
+ "@tanstack/react-query": "^5.85.5",
23
23
  "@types/geojson": "^7946.0.14"
24
24
  },
25
25
  "peerDependencies": {
package/src/index.d.ts CHANGED
@@ -3,8 +3,9 @@ import webmapReactTranslations from '../locales/webmap-react.json';
3
3
  import TimeContext from './lib/components/OpenLayers/context/TimeContext';
4
4
  import { TimeContextType } from './lib/components/OpenLayers/types/Timespan';
5
5
  import { TimeawareImageSource } from './lib/components/OpenLayers/utils/TimeawareImageSource';
6
+ import { makeTimeList } from './lib/components/OpenLayers/utils/makeDimValuesToPrefetch';
6
7
  export * from './lib';
7
8
  export { webmapReactTranslations };
8
9
  export { WEBMAP_NAMESPACE, webmapTranslations };
9
- export { TimeContext, TimeawareImageSource };
10
+ export { TimeContext, TimeawareImageSource, makeTimeList };
10
11
  export type { TimeContextType };
@@ -6,3 +6,5 @@ type Story = StoryObj<typeof Legend>;
6
6
  export declare const SimpleLegend: Story;
7
7
  export declare const SimpleLegendWithMultiDimensions: Story;
8
8
  export declare const SimpleLegendWithoutDimensionsOrGraphic: Story;
9
+ export declare const EDRLegendTemperature: Story;
10
+ export declare const EDRLegendWind: Story;
@@ -17,4 +17,4 @@ export interface FeatureEvent {
17
17
  isInEditMode: boolean;
18
18
  feature: GeoJSON.Feature;
19
19
  }
20
- export type DrawModeExitCallback = 'escaped' | 'doubleClicked' | 'shiftClick';
20
+ export type DrawModeExitCallback = 'escaped' | 'doubleClicked' | 'clickedNearStartingPoint';
@@ -4,6 +4,6 @@ export interface Timespan {
4
4
  step: number;
5
5
  }
6
6
  export interface TimeContextType {
7
- timespan: Timespan;
8
7
  isAnimating: boolean;
8
+ prefetchList: number[];
9
9
  }
@@ -18,8 +18,14 @@ export declare class TimeawareImageSource extends ImageSource {
18
18
  private _extraWMSParams;
19
19
  private _timeStampsToPrefetch;
20
20
  private _prefetchWorkers;
21
- private _wantedExtent;
22
- private _wantedResolution;
21
+ private _lastRequestedExtent;
22
+ private _lastRequestedResolution;
23
+ private _lastRequestedPixelRatio;
24
+ private _lastRequestedProjection;
25
+ private _loadedExtent;
26
+ private _loadedResolution;
27
+ private _loadedPixelRatio;
28
+ private _loadedProjection;
23
29
  private _previousPrefetchExtent;
24
30
  private _dimProperties;
25
31
  private _imWrapperEmptyButLoading;
@@ -27,23 +33,24 @@ export declare class TimeawareImageSource extends ImageSource {
27
33
  private _imWrapperForAltImage;
28
34
  private _styleName;
29
35
  private _layerName;
30
- private _wantedPixelRatio;
31
- private _wantedProjection;
32
36
  private _imWrapperForPrefetch;
33
37
  private throttledPrefetch;
38
+ private throttledImageLoad;
34
39
  constructor({ wmsUrl, timeStampsToPrefetch, layerName, styleName, dimProps, params, visible, }: TimeawareImageSourceOptions);
35
40
  private _conditionalPrefetch;
41
+ private _loadImagery;
36
42
  private prefetch;
37
- triggerPrefetch(extent: Extent, resolution: number, pixelRatio: number, projection: Projection): void;
43
+ triggerPrefetch(): void;
38
44
  getImage(extent: Extent, resolution: number, pixelRatio: number, projection: Projection): ImageWrapper;
39
45
  setDimProps(params: Record<string, string>): void;
40
46
  /**
41
- * Check if an image is available and loaded for requested date.
42
- * @param timeStampsToPrefetch
47
+ * Check if an image is available and loaded for requested date. Used for animation to proceed.
48
+ * @param isoTime
43
49
  * @returns
44
50
  */
45
- hasImageForTimeValue(timeStampsToPrefetch: string): boolean;
46
- loadImageForTimeValue(timeStampsToPrefetch: string): void;
51
+ hasImageLoadedForTimeValue(isoTime: string): boolean;
52
+ isImageLoadingForTimestep(isoTime: string): boolean;
53
+ setImageForTimeValue(timeStampsToPrefetch: string): void;
47
54
  setStyle(styleName: string): void;
48
55
  setLayerName(layerName: string): void;
49
56
  setTimeValuesValuesToPrefetch(timeStampsToPrefetch: string[]): void;
@@ -1,5 +1,5 @@
1
1
  export declare const MAX_NUMBER_TO_PREFETCH = 200;
2
- export declare const MAX_NUMBER_STEPS_IN_TIMESLIDER_TO_PREFETCH = 10000;
2
+ export declare const MAX_NUMBER_STEPS_IN_TIME_SLIDER_TO_PREFETCH = 10000;
3
3
  export declare const NUMBER_PREFETCH_WORKERS = 4;
4
4
  export declare const ENABLE_PREFETCH = true;
5
5
  export declare const ADD_SHOW_DIMS_OPTION = false;
@@ -15,4 +15,4 @@ export declare const getDimensionParamsForWMS: (dimensions: Dimension[] | undefi
15
15
  * @param timespan Object of Timespan, with start/stop/end in milliseconds
16
16
  * @returns Timestams array in milliseconds
17
17
  */
18
- export declare const getTimeStepsToCheckMemoized: ((timespan: Timespan) => number[]) & import("lodash").MemoizedFunction;
18
+ export declare const makeTimeList: ((timespan: Timespan) => number[]) & import("lodash").MemoizedFunction;
@@ -4,5 +4,6 @@ export declare const precipitationMMLegendColorsWoW: ColorMap;
4
4
  export declare const temperatureLegendColorsCWK: ColorMap;
5
5
  export declare const colorMaps: {
6
6
  temperatureLegendColorsWoW: ColorMap;
7
+ precipitationMMLegendColorsWoW: ColorMap;
7
8
  temperatureLegendColorsCWK: ColorMap;
8
9
  };
@@ -10,12 +10,15 @@ export interface EdrMapLegendEntry {
10
10
  export interface EdrOlColorLegend {
11
11
  legend: EdrMapLegendEntry[];
12
12
  }
13
+ export declare const makeLegendFromStyleName: (styleName: string) => EdrOlColorLegend | null;
13
14
  export declare const makeLegendFromColorMap: (props: {
14
15
  colors: ColorMap;
15
16
  min: number;
16
17
  max: number;
17
18
  }) => EdrOlColorLegend;
19
+ export declare const generateImageFromLegend: (edrColorLegend: EdrOlColorLegend, ctx: CanvasRenderingContext2D, opacity?: number) => number;
18
20
  export declare const getLegendClass: (edrColorLegend: EdrOlColorLegend, value: number, clip?: boolean) => EdrMapLegendEntry | undefined;
21
+ export declare const makeFeatureStyleWind: (feature: FeatureLike) => Style[];
19
22
  export declare const makeFeatureStyleMultiParam: (feature: FeatureLike) => Style[];
20
23
  export declare const makeFeatureStyleMultiParamLoading: () => Style;
21
24
  export declare const makeFeatureStyleDisc: (feature: FeatureLike, legend: EdrOlColorLegend) => Style;