@opengeoweb/webmap 15.3.0 → 17.0.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 (65) hide show
  1. package/index.esm.js +390 -156
  2. package/package.json +2 -2
  3. package/src/index.d.ts +0 -16
  4. package/src/lib/components/LoadDurationCounter.d.ts +0 -17
  5. package/src/lib/components/LoadDurationCounter.spec.d.ts +0 -1
  6. package/src/lib/components/WMBBOX.d.ts +0 -32
  7. package/src/lib/components/WMBBOX.spec.d.ts +0 -1
  8. package/src/lib/components/WMConstants.d.ts +0 -31
  9. package/src/lib/components/WMImage.d.ts +0 -111
  10. package/src/lib/components/WMImage.spec.d.ts +0 -1
  11. package/src/lib/components/WMImageStore.d.ts +0 -61
  12. package/src/lib/components/WMImageStore.spec.d.ts +0 -1
  13. package/src/lib/components/WMJSDimension.d.ts +0 -126
  14. package/src/lib/components/WMJSDimension.spec.d.ts +0 -1
  15. package/src/lib/components/WMJSDimensionModes.d.ts +0 -15
  16. package/src/lib/components/WMJSDimensionModes.spec.d.ts +0 -1
  17. package/src/lib/components/WMJSTools.d.ts +0 -62
  18. package/src/lib/components/WMJSTools.spec.d.ts +0 -1
  19. package/src/lib/components/WMLayer.d.ts +0 -117
  20. package/src/lib/components/WMLayer.spec.d.ts +0 -1
  21. package/src/lib/components/WMLayerTypes.d.ts +0 -65
  22. package/src/lib/components/WMLayerUtils.d.ts +0 -22
  23. package/src/lib/components/WMLegend.d.ts +0 -6
  24. package/src/lib/components/WMLegend.spec.d.ts +0 -1
  25. package/src/lib/components/WMListener.d.ts +0 -57
  26. package/src/lib/components/WMListener.spec.d.ts +0 -1
  27. package/src/lib/components/WMProjection.d.ts +0 -17
  28. package/src/lib/components/WMTime.d.ts +0 -44
  29. package/src/lib/components/WMTime.spec.d.ts +0 -1
  30. package/src/lib/components/WMTimeTypes.d.ts +0 -19
  31. package/src/lib/components/WMXMLParser.d.ts +0 -9
  32. package/src/lib/components/WMXMLParser.spec.d.ts +0 -1
  33. package/src/lib/components/index.d.ts +0 -25
  34. package/src/lib/components/makeHashUrlForGeoReferencedImage.d.ts +0 -6
  35. package/src/lib/components/makeHashUrlForGeoReferencedImage.spec.d.ts +0 -1
  36. package/src/lib/components/types.d.ts +0 -231
  37. package/src/lib/index.d.ts +0 -6
  38. package/src/lib/query/fakeApiWmtsQueries.d.ts +0 -208
  39. package/src/lib/query/queryConstants.d.ts +0 -7
  40. package/src/lib/query/queryWMS.d.ts +0 -69
  41. package/src/lib/query/queryWMS.spec.d.ts +0 -1
  42. package/src/lib/specs/getCapabilitySpecs/WMS111GetCapabilitiesGeoServicesRADAR.d.ts +0 -1
  43. package/src/lib/specs/getCapabilitySpecs/WMS130GetCapabilitiesHarmN25.d.ts +0 -2
  44. package/src/lib/specs/getCapabilitySpecs/WMS130GetCapabilitiesRadarTestWithInheritAndReplaceLayerprops.d.ts +0 -2
  45. package/src/lib/specs/getCapabilitySpecs/WMS130GetCapabilitiesRadarTestWithInheritLayerprops.d.ts +0 -2
  46. package/src/lib/specs/getCapabilitySpecs/WMS130GetCapabilitiesRadarTestWithInheritLayerpropsToLayerTree.d.ts +0 -76
  47. package/src/lib/specs/getCapabilitySpecs/WMS130GetCapabilitiesRadarTestWithoutInheritLayerprops.d.ts +0 -2
  48. package/src/lib/specs/getCapabilitySpecs/WMSGetCapabilitiesMissingLegend.d.ts +0 -1
  49. package/src/lib/specs/getCapabilitySpecs/WMSSmartMet.d.ts +0 -2
  50. package/src/lib/specs/getCapabilitySpecs/radarGetCapabilities.d.ts +0 -244
  51. package/src/lib/specs/index.d.ts +0 -93
  52. package/src/lib/specs/layerSpecs.d.ts +0 -34
  53. package/src/lib/specs/mockGetCapabilities.d.ts +0 -90
  54. package/src/lib/utils/consoleErrorMessages.d.ts +0 -12
  55. package/src/lib/utils/fakeMaxAgeResponses.d.ts +0 -1
  56. package/src/lib/utils/getCapabilities/getWMSServiceId.d.ts +0 -10
  57. package/src/lib/utils/getCapabilities/index.d.ts +0 -4
  58. package/src/lib/utils/getCapabilities/utils.d.ts +0 -64
  59. package/src/lib/utils/getCapabilities/utils.spec.d.ts +0 -1
  60. package/src/lib/utils/getCapabilities/wmsQueryClient.d.ts +0 -7
  61. package/src/lib/utils/i18n.d.ts +0 -6
  62. package/src/lib/utils/index.d.ts +0 -3
  63. package/src/lib/utils/tilesettings.d.ts +0 -27
  64. package/src/lib/utils/utils.d.ts +0 -31
  65. package/src/lib/utils/utils.spec.d.ts +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/webmap",
3
- "version": "15.3.0",
3
+ "version": "17.0.0",
4
4
  "description": "GeoWeb webmap library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -8,7 +8,7 @@
8
8
  "url": "git@gitlab.com:opengeoweb/opengeoweb.git"
9
9
  },
10
10
  "dependencies": {
11
- "@opengeoweb/shared": "15.3.0",
11
+ "@opengeoweb/shared": "17.0.0",
12
12
  "@tanstack/query-core": "^5.69.2",
13
13
  "lodash": "^4.17.21",
14
14
  "i18next": "^25.0.1",
package/src/index.d.ts DELETED
@@ -1,16 +0,0 @@
1
- import WMImageStore from './lib/components/WMImageStore';
2
- import { mockGetCapabilities } from './lib/specs';
3
- export * from './lib';
4
- export * as webmapUtils from './lib/utils/utils';
5
- export * as webmapTestSettings from './lib/specs';
6
- export { mockGetCapabilities };
7
- declare const privateWebMapUtils: {
8
- privateWmsGetCapabilities: (serviceUrl: string, headers?: import("./lib").Header[], forceReload?: boolean) => Promise<import("./lib").WMSGetCapabilities>;
9
- privateGetWMSServiceInfo: (getCapabilitiesJson: import("./lib").WMSGetCapabilities, serviceUrl: string) => import("./lib").WMSServiceInfo;
10
- privateWmsGetLayerTree: (jsonData: import("./lib").OGCWMSWMTSGetCapabilities) => import("./lib").LayerTree | null;
11
- privateWmsFlattenLayerTree: (layerTree: import("./lib").LayerTree) => import("./lib").LayerProps[];
12
- privateWmtsGetCapabilities: (serviceUrl: string, headers?: import("./lib").Header[], forceReload?: boolean) => Promise<string>;
13
- QUERYWMS_GETCAPABILITIES: string;
14
- };
15
- export { privateWebMapUtils };
16
- export { WMImageStore };
@@ -1,17 +0,0 @@
1
- export declare enum WMImageStoreLoadType {
2
- 'PREFETCH' = "A",
3
- 'GETMAP' = "B"
4
- }
5
- export default class LoadDurationCounter {
6
- constructor();
7
- private _loadingListForIds;
8
- private _loadingDurationForIds;
9
- setLoadingStatusForId(type: WMImageStoreLoadType, identifier: string, doneLoading: number, totalLoading: number, resetDuration?: boolean): void;
10
- setLoadDurationForId(identifier: string, duration: number | undefined): void;
11
- getLoadDurationForId(identifier: string): number | undefined;
12
- getTotalLoadingPercentageForIds(identifierList: string[]): {
13
- percentage: number;
14
- doneLoading: number;
15
- totalLoading: number;
16
- };
17
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,32 +0,0 @@
1
- export interface Bbox {
2
- left: number;
3
- right: number;
4
- top: number;
5
- bottom: number;
6
- }
7
- export default class WMBBOX implements Bbox {
8
- left: number;
9
- bottom: number;
10
- right: number;
11
- top: number;
12
- constructor(left?: number | string | Bbox, bottom?: number, right?: number, top?: number);
13
- /**
14
- * Clone an existing BBOX
15
- */
16
- clone(): WMBBOX;
17
- copy(bbox: WMBBOX): void;
18
- /**
19
- * setBBOX method
20
- * Creates a WebMapJS bounding box based on 4 numeric values
21
- * Creates a WebMapJS bounding box based on 1 string with commaseparated numeric values
22
- * Creates a WebMapJS bounding box based on an exisiting WebMapJS bounding box.
23
- * When no parameters are given, a global latlon bbox is generated.
24
- */
25
- setBBOX(left?: number | string | Bbox, bottom?: number, right?: number, top?: number): void;
26
- equals(left: number | string | WMBBOX | Bbox, bottom: number, right: number, top: number): boolean;
27
- /**
28
- * Returns the current BBOX as a string, useful for generating WMS requests.
29
- */
30
- toString(): string;
31
- getExtent(): [number, number, number, number];
32
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,31 +0,0 @@
1
- export declare const WMEmptyLayerName = "empty_layer";
2
- export declare const WMEmptyLayerTitle = "empty layer";
3
- export declare const WMDateOutSideRange = "outside range";
4
- export declare const WMDateTooEarlyString = "date too early";
5
- export declare const WMDateTooLateString = "date too late";
6
- export declare const WMDateUnit = "ISO8601";
7
- export declare const WMInvalidDateValues: Set<string>;
8
- export declare const WMSVersion: {
9
- version100: string;
10
- version111: string;
11
- version130: string;
12
- };
13
- export declare const WMProj4Defs: string[][];
14
- export declare const mapImageStoreLength = 1000;
15
- export declare const bgImageStoreLength = 360;
16
- export declare const legendImageStoreLength = 500;
17
- export declare const EVENT_GETCAPABILITIES_START = "onstartgetcapabilities";
18
- export declare const EVENT_GETCAPABILITIES_READY = "onreadygetcapabilities";
19
- export declare const WMJSMAP_LONLAT_EPSGCODE: "EPSG:4326";
20
- export declare const isProjectionSupported: (srs: string, proj4Defintions?: string[][]) => boolean;
21
- export interface RefTimeDimensionMode {
22
- id: string;
23
- servicematch: string;
24
- layermatch: string;
25
- ruleset: {
26
- id: string;
27
- moduloHH: number[];
28
- relativeSteps: number[];
29
- }[];
30
- }
31
- export type RefTimeDimensionModes = RefTimeDimensionMode[];
@@ -1,111 +0,0 @@
1
- export interface WMHeader {
2
- name: string;
3
- value: string;
4
- }
5
- export interface WMImageOptions {
6
- randomizer?: boolean;
7
- headers: WMHeader[];
8
- fakeMaxAge?: number;
9
- }
10
- export interface WMGeoReference {
11
- extent: number[];
12
- resolution: number;
13
- }
14
- /**
15
- * Returns the current time in ms
16
- * @returns the current time in ms
17
- */
18
- export declare const getCurrentImageTime: () => number;
19
- /**
20
- * WMImage provides an API to the HTML image element. It is used for caching and easier access to images.
21
- */
22
- export default class WMImage {
23
- imageLife: number;
24
- randomize: boolean;
25
- _srcLoaded: string;
26
- _isLoaded: boolean;
27
- _isLoading: boolean;
28
- _hasError: boolean;
29
- srcToLoad: string;
30
- loadEventCallback?: (image: WMImage) => void;
31
- el: HTMLImageElement;
32
- headers: WMHeader[];
33
- _imageTimeStampAtError: number;
34
- _numFailedAttempts: number;
35
- _loadStartTime: number;
36
- _loadDuration?: number;
37
- _fakeMaxAge?: number | null;
38
- _resolveList: ((i: WMImage) => void)[];
39
- geoReference: WMGeoReference | null;
40
- hashUrl: string | undefined;
41
- setGeoReference(geoReference: WMGeoReference): void;
42
- /**
43
- *
44
- * @param src Optionally set the source URL to load
45
- * @param callback Optionally set the callback function to trigger once image has loaded
46
- * @param options Additional options to the image. You can set { randomizer: true } to force unique url's and prevent caching.
47
- */
48
- constructor(src: string, callback?: (image: WMImage) => void, options?: WMImageOptions);
49
- private init;
50
- /**
51
- * Returns true if the image has been loaded
52
- */
53
- isLoaded(): boolean;
54
- isLoadedWithoutErrors(): boolean;
55
- hasNotStartedLoading(): boolean;
56
- isStale(): boolean;
57
- /**
58
- * Returns true if the image is still loading
59
- */
60
- isLoading(): boolean;
61
- /**
62
- * Get the amount of milliseconds since the image experienced an image load.
63
- * @returns milliseconds since the image had an error
64
- */
65
- getLastErrorMSecondsAgo(): number;
66
- /**
67
- * @returns The number of failed attempts for this image
68
- */
69
- getNumFailedAttempts(): number;
70
- /**
71
- * Set source of image, but it will not load the image yet.
72
- * @param src URL of the image to load
73
- * @param options WMImageOptions to give to the image
74
- */
75
- setSource(src: string, options: WMImageOptions): void;
76
- /**
77
- * Re-intialize the image
78
- */
79
- clear(): void;
80
- /**
81
- * Get the URL of the image
82
- */
83
- getSrc(): string;
84
- /**
85
- * Check if the image has an error
86
- */
87
- hasError(): boolean;
88
- private _resolveAll;
89
- /**
90
- * Start loading the image
91
- */
92
- loadAwait(): Promise<WMImage>;
93
- load(): void;
94
- forceReload(randomize?: boolean): void;
95
- private _getImageWithHeaders;
96
- _load(): void;
97
- _loadEvent(hasError: boolean): void;
98
- getLoadDuration(): number | undefined;
99
- /**
100
- * Get the width of the current image
101
- */
102
- getWidth(): number;
103
- /**
104
- * Get the height of the current image
105
- */
106
- getHeight(): number;
107
- /**
108
- * Get the HTMLImageElement behind the WMImage
109
- */
110
- getElement(): HTMLImageElement;
111
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,61 +0,0 @@
1
- import LoadDurationCounter from './LoadDurationCounter';
2
- import type { WMGeoReference, WMImageOptions } from './WMImage';
3
- import WMImage from './WMImage';
4
- export declare enum WMImageEventType {
5
- Loaded = 0,
6
- Deleted = 1
7
- }
8
- export default class WMImageStore {
9
- imagesbysrc: Map<string, WMImage>;
10
- imageLife: number;
11
- _imageLifeCounter: number;
12
- _loadEventCallbackList: {
13
- id: string;
14
- callback: (image: WMImage, id: string, imageEventType: WMImageEventType) => void;
15
- }[];
16
- _maxNumberOfImages: number;
17
- _options: {
18
- id: string;
19
- };
20
- emptyImage: WMImage;
21
- imagesbyGeoRef: Map<string, WMImage[]>;
22
- loadDuration: LoadDurationCounter;
23
- /**
24
- * Constructs a new WMImageStore with given amount of image cache.
25
- * @param {*} maxNumberOfImages
26
- * @param {*} options
27
- */
28
- constructor(maxNumberOfImages: number, options: {
29
- id: string;
30
- });
31
- load(imageUrl: string): Promise<WMImage>;
32
- imageLoadEventCallback(_img: WMImage, imageEventType: WMImageEventType): void;
33
- /**
34
- * Check if we have similar images with the same source in the pipeline
35
- */
36
- getImageForSrc(src: string): WMImage | undefined;
37
- clear(): void;
38
- addImageEventCallback(callback: (image: WMImage, id: string, imageEventType: WMImageEventType) => void, id: string): void;
39
- removeAllEventCallbacks(): void;
40
- removeEventCallback(id: string): void;
41
- getNumImagesLoading(): number;
42
- /**
43
- * getAltGeoReferencedImage will return an ready and loaded image for similar query parameters as requested.
44
- * This image can be used to display something during the period when the requested image one is still loading.
45
- * The alternative image will have the same query parameters but can have a different extent and resolution.
46
- * @param srcToLoad The url of the image for which we want to find an alternative
47
- * @param _extent Extent of the requested image
48
- * @param _resolution Resolution of the request image
49
- * @returns A WMImage which is ready to display. Can have a different extent and resolution then what was asked in srcToLoad
50
- */
51
- getAltGeoReferencedImage(srcToLoad: string, _extent: number[], _resolution: number): WMImage | false;
52
- getAltGeoReferencedImages(srcToLoad: string, _extent: number[], _resolution: number): WMImage[];
53
- getImageAndSetGeoReference(src: string, geoReference: WMGeoReference): WMImage;
54
- getNumCached(): number;
55
- /**
56
- * Get an WMImage object for given URL
57
- * @param {*} src The url for the image
58
- * @returns WMImage object
59
- */
60
- getImage(src: string, loadOptions?: WMImageOptions): WMImage;
61
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,126 +0,0 @@
1
- import type { Dimension, TimeInterval } from './types';
2
- import type { RefTimeDimensionMode } from './WMConstants';
3
- import { ParseISOTimeRangeDuration } from './WMTime';
4
- import type { CustomDate } from './WMTimeTypes';
5
- /**
6
- * Re-formats isoString to the string that is expected by WMJSDimension (for time).
7
- * @param dateIn The input date to re-format, usually in the format `YYYY-MM-DDThh:mm:ss.uuuZ`
8
- * @returns The formated input date in the format `YYYY-MM-DDThh:mm:ssZ`
9
- */
10
- export declare const handleDateUtilsISOString: (dateIn: string) => string;
11
- interface WMJSDimensionConfig {
12
- name?: string;
13
- units?: string;
14
- values?: string;
15
- currentValue?: string;
16
- defaultValue?: string;
17
- linked?: boolean;
18
- unitSymbol?: string;
19
- synced?: boolean;
20
- refTimeDimensionMode?: RefTimeDimensionMode;
21
- }
22
- /**
23
- * WMJSDimension Class
24
- * Keep all information for a single dimension, like time.
25
- * Author : MaartenPlieger (plieger at knmi.nl)
26
- * Copyright KNMI
27
- */
28
- export default class WMJSDimension implements Dimension {
29
- currentValue: string;
30
- defaultValue: string;
31
- name: string;
32
- units: string;
33
- unitSymbol: string;
34
- linked: boolean;
35
- synced: boolean;
36
- used?: boolean;
37
- values?: string;
38
- refTimeDimensionMode?: RefTimeDimensionMode;
39
- private timeRangeDuration?;
40
- private _initialized;
41
- private _timeRangeDurationDate;
42
- private _allDates;
43
- private _type;
44
- private _allValues;
45
- private dimMinValue;
46
- private dimMaxValue;
47
- private dimTimeInterval;
48
- private calculatedTimeInterval;
49
- constructor(config?: WMJSDimensionConfig);
50
- generateAllValues(): string[];
51
- setTimeValuesForReferenceTimeStandardMode(referenceTimeValueToSet: string, referenceTimeDim: WMJSDimension): void;
52
- setTimeValuesForReferenceTime(referenceTimeValueToSet: string, referenceTimeDim: WMJSDimension): void;
53
- reInitializeValues(values: string, forceReferenceTimeValue?: boolean): void;
54
- initialize(forceothervalues?: string | undefined, forceReferenceTimeValue?: boolean): void;
55
- /**
56
- * Returns the current value of this dimensions.
57
- * If a ISO8601 period is set, the getValue will return a timeRange using addTimeRangeDurationToValue instead of a single value
58
- */
59
- getValue(): string;
60
- processCompressedRefTimeValues(ogcdimvalues: string): void;
61
- createTimeStepsArray(partTimeRanges: ParseISOTimeRangeDuration): string[];
62
- /**
63
- * Set current value of this dimension
64
- * @param value The new value for this dimension (string)
65
- * @param forceValue When set to false,check if the given value is outside range, and do nothing if this is the case
66
- */
67
- setValue(value: string, forceValue?: boolean): void;
68
- /**
69
- * Returns values of the dimension, according to values defined in WMS specification, e.g. 2011-01-01T00:00:00Z/2012-01-01T00:00:00Z/P1M or list of values.
70
- * @returns
71
- */
72
- getValues(): string;
73
- setClosestValue(newValue?: string | null, evenWhenOutsideRange?: boolean): void;
74
- addTimeRangeDurationToValue(value: string): string;
75
- setTimeRangeDuration(duration: string): void;
76
- getClosestValueForTime(timeStamp: number): string;
77
- getValueForSpecialString(inputValue: string, evenWhenOutsideRange?: boolean): string;
78
- getExactMatchingValue(inputValue: string): string;
79
- getClosestValue(inputValue: string, evenWhenOutsideRange?: boolean): string;
80
- /**
81
- * Get dimension value for specified index
82
- */
83
- getValueForIndex(index: number): string | CustomDate;
84
- /**
85
- * Get value for index in as epoch time in milliseconds
86
- * @param index
87
- * @returns
88
- */
89
- getValueForIndexAsTime(index: number): number;
90
- /**
91
- * Hint about the timestep size / time resolution of this dimension.
92
- * @returns The dimTimeInterval
93
- */
94
- getDimInterval(): TimeInterval | undefined;
95
- /**
96
- * Shorthand functionf or getValueForIndex
97
- */
98
- get(index: number): string;
99
- /**
100
- * Returns the first dimension value
101
- */
102
- getFirstValue(): string;
103
- getMiddleValue(): string;
104
- /**
105
- * Returns the last dimension value
106
- */
107
- getLastValue(): string;
108
- /**
109
- * Get index value for specified value. Returns the index in the store for the given time value, either a date or a iso8601 string can be passes as input.
110
- * @param value Either a JS Date object or an ISO8601 String
111
- * @return The index of the value. If outSideOfRangeFlag is false, a valid index will
112
- * always be returned. If outSideOfRangeFlag is true:
113
- * -1 if the value is not in the store, and is lower than available values,
114
- * -2 if the value is not in the store, and is higher than available values
115
- */
116
- getIndexForValue(value: string, outSideOfRangeFlag?: boolean): number;
117
- /**
118
- * Get number of values
119
- */
120
- size(): number;
121
- /**
122
- * Clone this dimension
123
- */
124
- clone(): WMJSDimension;
125
- }
126
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,15 +0,0 @@
1
- import type { LayerOptions, RefTimeDimensionMode, RefTimeDimensionModes } from '.';
2
- import type WMJSDimension from './WMJSDimension';
3
- /**
4
- * Determine if the time values have a special sequencing for certain services.
5
- * Please check https://gitlab.com/opengeoweb/geoweb-assets/-/issues/4311 for details.
6
- * @param layer
7
- * @returns
8
- */
9
- export declare const wmDetermineDimensionMode: (layer: LayerOptions, refTimeDimensionModes?: RefTimeDimensionModes) => RefTimeDimensionMode | undefined;
10
- /**
11
- * Based on https://gitlab.com/opengeoweb/geoweb-assets/-/issues/4311
12
- * @param wmDimension
13
- * @param referenceTimeValueToSet
14
- */
15
- export declare const wmDimensionHandleCustomTimeFunction: (wmDimension: WMJSDimension, referenceTimeValueToSet: string) => void;
@@ -1 +0,0 @@
1
- export {};
@@ -1,62 +0,0 @@
1
- import type { Dimension, GeographicBoundingBox, LayerProps, Style, WMSLayerFromGetCapabilities } from './types';
2
- import type WMLayer from './WMLayer';
3
- export declare const enableConsoleDebugging = false;
4
- export declare enum DebugType {
5
- Log = 0,
6
- Warning = 1,
7
- Error = 2
8
- }
9
- export declare const debugLogger: (type: DebugType, message: string, ...optionalParam: unknown[]) => void;
10
- /**
11
- * Checks if variable is defined or not
12
- * @param variable The variable to check
13
- * @returns true if variable is indeed defined, otherwise false.
14
- */
15
- export declare const isDefined: <T>(variable?: T) => variable is T;
16
- /**
17
- * Converts a variable to an array. If the variable is not an array it will be pushed as the first entry in a new array. If the variable is already an array, nothing will be done.
18
- * @param array The variable to convert
19
- * @returns Always an array
20
- */
21
- export declare const toArray: <T>(array: T | T[] | null | undefined) => T[];
22
- export declare const getMapDimURL: (layer: WMLayer, dimensionOverride?: Dimension[]) => URLSearchParams;
23
- /**
24
- * Parses url and then it it allows for setting / changing key value pairs in that URL (From https://stackoverflow.com/questions/5999118/how-can-i-add-or-update-a-query-string-parameter)
25
- * @param baseUrl
26
- * @param params
27
- * @returns
28
- */
29
- export declare const getUriWithParam: (baseUrl: string, params?: Record<string, unknown>) => string;
30
- /**
31
- * Parses url and then it it allows for setting additional key value pairs in that URL (From https://stackoverflow.com/questions/5999118/how-can-i-add-or-update-a-query-string-parameter)
32
- * @param baseUrl
33
- * @param params
34
- * @returns
35
- */
36
- export declare const getUriAddParam: (baseUrl: string, params: Record<string, unknown>) => string;
37
- /**
38
- * Helper function to figure out the styles from the WMS layer object from the WMS GetCapabilities document
39
- * @param layerObjectFromWMS The layer object from the WMS GetCapabilities JSON document
40
- * @returns Style[] Array of style objects.
41
- */
42
- export declare const addStylesForLayer: (layerObjectFromWMS: WMSLayerFromGetCapabilities) => Style[];
43
- export declare const addDimensionsForLayer: (layerObjectFromWMS: WMSLayerFromGetCapabilities) => Dimension[];
44
- export declare const addBoundingBoxForLayer: (layerObjectFromWMS: WMSLayerFromGetCapabilities) => GeographicBoundingBox | undefined;
45
- /**
46
- * Sorts an array with objects by object key.
47
- *
48
- * @param array Array of objects
49
- * @param key The key of the object to use for sorting
50
- * @returns Sorted array.
51
- */
52
- export declare function sortArrayOfObjectsByKey<T>(array: T[], key: keyof T): T[];
53
- /**
54
- * Makes a LayerProps object from the WMSLayerFromGetCapabilities and nestedLayerPath
55
- * @param layer WMSLayerFromGetCapabilities
56
- * @param path The path of the layer in the WMS GetCapabilities tree (Array of strings)
57
- * @param isleaf Is this a group layer or an actual layer
58
- * @param nestedLayerPath The path of the layer in the WMS GetCapabilities, in this case array of LayerProps
59
- * @returns
60
- */
61
- export declare const makeNodeLayerFromWMSGetCapabilityLayer: (layer: WMSLayerFromGetCapabilities, path?: string[], isleaf?: boolean, nestedLayerPath?: LayerProps[]) => LayerProps;
62
- export declare const getFirstPartOfDimensionValueSet: (inputValue: string) => string;
@@ -1 +0,0 @@
1
- export {};
@@ -1,117 +0,0 @@
1
- import type { Style, GeographicBoundingBox, OGCWMSWMTSGetCapabilities } from './types';
2
- import type { RefTimeDimensionMode } from './WMConstants';
3
- import WMJSDimension from './WMJSDimension';
4
- import type { LayerOptions } from './WMLayerTypes';
5
- import { LayerType } from './WMLayerTypes';
6
- import WMProjection from './WMProjection';
7
- export default class WMLayer {
8
- id: string;
9
- name?: string;
10
- ReactWMJSLayerId?: string;
11
- hasError?: boolean;
12
- enabled?: boolean;
13
- lastError?: string;
14
- legendGraphic?: string;
15
- title?: string;
16
- opacity?: number;
17
- service: string;
18
- layerType: LayerType;
19
- currentStyle?: string;
20
- linkedInfo: {
21
- layer: string;
22
- message: string;
23
- };
24
- headers: Headers[];
25
- autoupdate: boolean;
26
- timer: NodeJS.Timeout | number;
27
- getmapURL: string;
28
- getfeatureinfoURL: string;
29
- getlegendgraphicURL: string;
30
- keepOnTop: boolean;
31
- transparent: boolean;
32
- wms130bboxcompatibilitymode: boolean;
33
- version: string;
34
- path: string;
35
- type: string;
36
- abstract: string;
37
- dimensions: WMJSDimension[];
38
- projectionProperties: WMProjection[];
39
- queryable: boolean;
40
- styles: Style[];
41
- serviceTitle: string;
42
- sldURL: string;
43
- active: boolean;
44
- getgraphinfoURL: string;
45
- format: string;
46
- _options: LayerOptions;
47
- onReady: (param: LayerOptions) => void;
48
- optimalFormat: string;
49
- wmsextensions: {
50
- url: string;
51
- colorscalerange: Record<string, unknown>[];
52
- };
53
- isConfigured: boolean;
54
- geographicBoundingBox?: GeographicBoundingBox;
55
- geojson?: GeoJSON.FeatureCollection;
56
- currentRequestedGetMapURL?: string;
57
- olSource: object | null;
58
- refTimeDimensionMode: RefTimeDimensionMode | undefined;
59
- init(): void;
60
- constructor(options?: LayerOptions);
61
- getLayerName(): string;
62
- toggleAutoUpdate(): void;
63
- setAutoUpdate(val: boolean, interval?: number): void;
64
- setOpacity(opacityValue: number): void;
65
- getOpacity(): number;
66
- handleReferenceTime(name: string, value: string): void;
67
- getDimensions(): WMJSDimension[];
68
- setDimension(name: string, value: string): void;
69
- _setWMSGetCapabilities(getCapabilitiesJson: OGCWMSWMTSGetCapabilities): void;
70
- /** A Promise to parse the layer, it will fetch the WMS GetCapabilities document, configure the layer and resolve to a WMLayer object
71
- * @param forceReload Do not use the cache of the WMS GetCapabilities document, but instead fetch new data from the server
72
- * @returns WMLayer object
73
- */
74
- parseLayer(forceReload?: boolean): Promise<WMLayer>;
75
- cloneLayer(): WMLayer;
76
- /**
77
- * Set or change the name of this layer. This involves re-parsing the WMS GetCapabilities document and updating the affected layer properties. When done, it resolves the WMLayer
78
- * @param name The name of the layer
79
- * @returns Promise resolving to a WMLayer object
80
- */
81
- setName(name: string): Promise<WMLayer>;
82
- /**
83
- * Sets the style by its name
84
- * @param style: The name of the style (not the object)
85
- */
86
- setStyle(styleName: string): void;
87
- getStyles(): Style[];
88
- /**
89
- * Get the styleobject by name
90
- * @param styleName The name of the style
91
- * @param nextPrev, can be -1 or +1 to get the next or previous style object in circular manner.
92
- */
93
- getStyleObject(styleName: string, nextPrev: number): Style;
94
- getStyle(): string;
95
- getDimension(name: string): WMJSDimension | undefined;
96
- /**
97
- * Returns the Coordinate Reference Systems for this layer
98
- * @returns List of WMProjection objects
99
- */
100
- getCRS(): WMProjection[];
101
- /**
102
- * Get Coordinate reference system by name
103
- *
104
- * @param srsName Name of the coordinate reference system to get
105
- * @returns A WMProjection object if found, otherwise undefined.
106
- */
107
- getCRSByName(srsName: string): WMProjection;
108
- /**
109
- * Get Coordinate reference system by name. Note 2021-05-17: It is more inline with other function names to use the getCRSByName function instead.
110
- *
111
- * @param srsName Name of the coordinate reference system to get
112
- * @returns A WMProjection object if found, otherwise undefined.
113
- */
114
- getProjection(srsName: string): WMProjection;
115
- setSLDURL(url: string): void;
116
- display(displayornot: boolean): void;
117
- }
@@ -1 +0,0 @@
1
- export {};