@opengeoweb/webmap 14.4.0 → 14.5.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 (29) hide show
  1. package/index.esm.js +4040 -3416
  2. package/package.json +2 -2
  3. package/src/index.d.ts +3 -3
  4. package/src/lib/components/WMImageStore.d.ts +2 -1
  5. package/src/lib/components/WMJSDimension.d.ts +2 -2
  6. package/src/lib/components/WMLayer.d.ts +4 -3
  7. package/src/lib/components/WMLayerTypes.d.ts +3 -1
  8. package/src/lib/components/WMLayerUtils.d.ts +1 -1
  9. package/src/lib/components/WMLegend.d.ts +1 -1
  10. package/src/lib/components/WMProjection.d.ts +2 -1
  11. package/src/lib/components/WMTime.d.ts +2 -2
  12. package/src/lib/components/index.d.ts +7 -7
  13. package/src/lib/components/types.d.ts +54 -4
  14. package/src/lib/index.d.ts +1 -0
  15. package/src/lib/query/fakeApiWmtsQueries.d.ts +208 -0
  16. package/src/lib/query/queryConstants.d.ts +1 -0
  17. package/src/lib/query/queryWMS.d.ts +22 -4
  18. package/src/lib/query/queryWMS.spec.d.ts +1 -0
  19. package/src/lib/specs/getCapabilitySpecs/WMS130GetCapabilitiesHarmN25.d.ts +2 -2
  20. package/src/lib/specs/getCapabilitySpecs/WMS130GetCapabilitiesRadarTestWithInheritAndReplaceLayerprops.d.ts +2 -2
  21. package/src/lib/specs/getCapabilitySpecs/WMS130GetCapabilitiesRadarTestWithInheritLayerprops.d.ts +2 -2
  22. package/src/lib/specs/getCapabilitySpecs/WMS130GetCapabilitiesRadarTestWithoutInheritLayerprops.d.ts +2 -2
  23. package/src/lib/specs/getCapabilitySpecs/WMSSmartMet.d.ts +2 -2
  24. package/src/lib/specs/index.d.ts +1 -1
  25. package/src/lib/specs/layerSpecs.d.ts +2 -1
  26. package/src/lib/specs/mockGetCapabilities.d.ts +2 -2
  27. package/src/lib/utils/getCapabilities/utils.d.ts +25 -11
  28. package/src/lib/utils/i18n.d.ts +2 -1
  29. package/src/lib/utils/tilesettings.d.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/webmap",
3
- "version": "14.4.0",
3
+ "version": "14.5.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": "14.4.0",
11
+ "@opengeoweb/shared": "14.5.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 CHANGED
@@ -5,9 +5,9 @@ export * as webmapUtils from './lib/utils/utils';
5
5
  export * as webmapTestSettings from './lib/specs';
6
6
  export { mockGetCapabilities };
7
7
  declare const privateWebMapUtils: {
8
- privateWmsGetCapabilities: (serviceUrl: string, headers?: import("./lib").Header[], forceReload?: boolean) => Promise<import("./lib").GetCapabilitiesJson>;
9
- privateGetWMSServiceInfo: (getCapabilitiesJson: import("./lib").GetCapabilitiesJson, serviceUrl: string) => import("./lib").WMSServiceInfo;
10
- privateWmsGetLayerTree: (jsonData: import("./lib").GetCapabilitiesJson) => import("./lib").LayerTree;
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;
11
11
  privateWmsFlattenLayerTree: (layerTree: import("./lib").LayerTree) => import("./lib").LayerProps[];
12
12
  privateWmtsGetCapabilities: (serviceUrl: string, headers?: import("./lib").Header[], forceReload?: boolean) => Promise<string>;
13
13
  QUERYWMS_GETCAPABILITIES: string;
@@ -1,5 +1,6 @@
1
1
  import LoadDurationCounter from './LoadDurationCounter';
2
- import WMImage, { WMGeoReference, WMImageOptions } from './WMImage';
2
+ import type { WMGeoReference, WMImageOptions } from './WMImage';
3
+ import WMImage from './WMImage';
3
4
  export declare enum WMImageEventType {
4
5
  Loaded = 0,
5
6
  Deleted = 1
@@ -1,6 +1,6 @@
1
- import { Dimension, TimeInterval } from './types';
1
+ import type { Dimension, TimeInterval } from './types';
2
2
  import { ParseISOTimeRangeDuration } from './WMTime';
3
- import { CustomDate } from './WMTimeTypes';
3
+ import type { CustomDate } from './WMTimeTypes';
4
4
  /**
5
5
  * Re-formats isoString to the string that is expected by WMJSDimension (for time).
6
6
  * @param dateIn The input date to re-format, usually in the format `YYYY-MM-DDThh:mm:ss.uuuZ`
@@ -1,7 +1,8 @@
1
+ import type { Style, GeographicBoundingBox, OGCWMSWMTSGetCapabilities } from './types';
1
2
  import WMJSDimension from './WMJSDimension';
3
+ import type { LayerOptions } from './WMLayerTypes';
4
+ import { LayerType } from './WMLayerTypes';
2
5
  import WMProjection from './WMProjection';
3
- import { Style, GeographicBoundingBox, GetCapabilitiesJson } from './types';
4
- import { LayerOptions, LayerType } from './WMLayerTypes';
5
6
  export default class WMLayer {
6
7
  id: string;
7
8
  name?: string;
@@ -63,7 +64,7 @@ export default class WMLayer {
63
64
  handleReferenceTime(name: string, value: string): void;
64
65
  getDimensions(): WMJSDimension[];
65
66
  setDimension(name: string, value: string): void;
66
- _setWMSGetCapabilities(getCapabilitiesJson: GetCapabilitiesJson): void;
67
+ _setWMSGetCapabilities(getCapabilitiesJson: OGCWMSWMTSGetCapabilities): void;
67
68
  /** A Promise to parse the layer, it will fetch the WMS GetCapabilities document, configure the layer and resolve to a WMLayer object
68
69
  * @param forceReload Do not use the cache of the WMS GetCapabilities document, but instead fetch new data from the server
69
70
  * @returns WMLayer object
@@ -4,10 +4,12 @@ import type { Dimension } from './types';
4
4
  import type WMLayer from './WMLayer';
5
5
  export declare enum LayerType {
6
6
  mapLayer = "mapLayer",
7
+ wmtsMapLayer = "wmtsMapLayer",
7
8
  baseLayer = "baseLayer",
8
9
  overLayer = "overLayer",
9
10
  featureLayer = "featureLayer",
10
- edrFeatureLayer = "edrFeatureLayer"
11
+ edrFeatureLayer = "edrFeatureLayer",
12
+ stacGeoTIFFLayer = "stacGeoTIFFLayer"
11
13
  }
12
14
  export interface TiledLayerFoundation {
13
15
  tileServer?: TileServerSettings;
@@ -1,4 +1,4 @@
1
- import { LayerProps } from './types';
1
+ import type { LayerProps } from './types';
2
2
  import type WMLayer from './WMLayer';
3
3
  /**
4
4
  * Helper function to figure out the dimensions from the WMS layer object (From WMS GetCapabilities). Parses both WMS 1.1.1 and WMS 1.3.0.
@@ -1,5 +1,5 @@
1
1
  import WMImageStore from './WMImageStore';
2
- import WMLayer from './WMLayer';
2
+ import type WMLayer from './WMLayer';
3
3
  export declare const legendImageStore: WMImageStore;
4
4
  export declare const getLegendGraphicURLForLayer: (layer: WMLayer, width?: number, height?: number) => string;
5
5
  export declare const getLegendImageStore: () => WMImageStore;
@@ -1,4 +1,5 @@
1
- import WMBBOX, { Bbox } from './WMBBOX';
1
+ import type { Bbox } from './WMBBOX';
2
+ import WMBBOX from './WMBBOX';
2
3
  /**
3
4
  * WMProjection Class
4
5
  * Keep all projection information, by a bbox and an srs value.
@@ -1,5 +1,5 @@
1
- import { CustomDate } from './WMTimeTypes';
2
- import { TimeInterval } from './types';
1
+ import type { TimeInterval } from './types';
2
+ import type { CustomDate } from './WMTimeTypes';
3
3
  /** ************************************************ */
4
4
  /** ************************************************ */
5
5
  export declare class DateInterval implements TimeInterval {
@@ -1,13 +1,13 @@
1
- import { isDefined, toArray, debugLogger, DebugType, getUriWithParam, getMapDimURL } from './WMJSTools';
2
- import { parseISO8601DateToDate, DateInterval, parseISO8601IntervalToDateInterval, ParseISOTimeRangeDuration } from './WMTime';
1
+ import { WMImageStoreLoadType } from './LoadDurationCounter';
3
2
  import WMImage from './WMImage';
4
- import { getLegendGraphicURLForLayer, legendImageStore } from './WMLegend';
5
3
  import { WMImageEventType } from './WMImageStore';
4
+ import { isDefined, toArray, debugLogger, DebugType, getUriWithParam, getMapDimURL } from './WMJSTools';
5
+ import { LayerType } from './WMLayerTypes';
6
+ import { getLegendGraphicURLForLayer, legendImageStore } from './WMLegend';
6
7
  import WMListener from './WMListener';
7
8
  import WMProjection from './WMProjection';
8
- import { LayerType } from './WMLayerTypes';
9
+ import { parseISO8601DateToDate, DateInterval, parseISO8601IntervalToDateInterval, ParseISOTimeRangeDuration } from './WMTime';
9
10
  import { WMXMLStringToJson } from './WMXMLParser';
10
- import { WMImageStoreLoadType } from './LoadDurationCounter';
11
11
  export { default as WMJSDimension, handleDateUtilsISOString, } from './WMJSDimension';
12
12
  export { default as WMLayer } from './WMLayer';
13
13
  export type { LayerOptions, LayerFoundation, EDRFeatureLayerOptions, } from './WMLayerTypes';
@@ -17,8 +17,8 @@ export type { Bbox } from './WMBBOX';
17
17
  export type { WMProjectionWH } from './WMProjection';
18
18
  export { WMProjection };
19
19
  export { DateInterval, parseISO8601IntervalToDateInterval, ParseISOTimeRangeDuration, isDefined, parseISO8601DateToDate, toArray, getLegendGraphicURLForLayer, legendImageStore, WMImage, debugLogger, DebugType, WMImageEventType, getUriWithParam, getMapDimURL, WMListener, WMXMLStringToJson, WMImageStoreLoadType, };
20
- export * from './types';
21
- export * from './WMTimeTypes';
20
+ export type * from './types';
21
+ export type * from './WMTimeTypes';
22
22
  export * from './WMConstants';
23
23
  declare const wmServiceListener: WMListener;
24
24
  export { wmServiceListener };
@@ -1,7 +1,7 @@
1
+ import type { Bbox } from './WMBBOX';
2
+ import type WMImage from './WMImage';
1
3
  import type WMJSDimension from './WMJSDimension';
2
4
  import type WMLayer from './WMLayer';
3
- import { Bbox } from './WMBBOX';
4
- import type WMImage from './WMImage';
5
5
  export interface AnimationStep {
6
6
  name: string;
7
7
  value: string;
@@ -78,6 +78,7 @@ export interface LayerProps {
78
78
  geographicBoundingBox?: GeographicBoundingBox | undefined;
79
79
  queryable?: boolean;
80
80
  crs?: CoordinateReferenceSystem[];
81
+ ogctype?: OGCTYPE;
81
82
  }
82
83
  /**
83
84
  * Represents the layers as advertised in the WMS GetCapabilities document
@@ -154,7 +155,7 @@ export interface WMSLayerFromGetCapabilities {
154
155
  value: string;
155
156
  }[];
156
157
  }
157
- export interface GetCapabilitiesJson {
158
+ export interface WMSGetCapabilities {
158
159
  WMS_Capabilities?: any;
159
160
  WMT_MS_Capabilities?: any;
160
161
  ServiceExceptionReport?: any;
@@ -166,7 +167,7 @@ export interface WMSServiceInfo {
166
167
  title: string;
167
168
  onlineresource: string;
168
169
  getmapURL: string;
169
- getCapabilitiesJson: GetCapabilitiesJson;
170
+ getCapabilitiesJson: OGCWMSWMTSGetCapabilities;
170
171
  }
171
172
  export interface Capability {
172
173
  Layer: WMSLayerFromGetCapabilities;
@@ -179,3 +180,52 @@ export interface Header {
179
180
  name: string;
180
181
  value: string;
181
182
  }
183
+ export interface WMTDimension {
184
+ Identifier?: {
185
+ value: string;
186
+ };
187
+ Default?: {
188
+ value: string;
189
+ };
190
+ Value?: {
191
+ value: string;
192
+ } | {
193
+ value: string;
194
+ }[];
195
+ }
196
+ export interface WMTLayer {
197
+ Abstract: {
198
+ value: string;
199
+ };
200
+ Dimension?: WMTDimension[];
201
+ Identifier: {
202
+ value: string;
203
+ };
204
+ Title: {
205
+ value: string;
206
+ };
207
+ }
208
+ export interface WMTSGetCapabilities {
209
+ Capabilities?: {
210
+ ServiceIdentification?: {
211
+ Title?: {
212
+ value: string;
213
+ };
214
+ Abstract?: {
215
+ value: string;
216
+ };
217
+ ServiceType?: {
218
+ value: string;
219
+ };
220
+ };
221
+ Contents?: {
222
+ Layer?: WMTLayer | WMTLayer[];
223
+ };
224
+ };
225
+ }
226
+ export declare enum OGCTYPE {
227
+ WMTS = "WMTS",
228
+ WMS = "WMS"
229
+ }
230
+ export interface OGCWMSWMTSGetCapabilities extends WMSGetCapabilities, WMTSGetCapabilities {
231
+ }
@@ -1,5 +1,6 @@
1
1
  import webmapTranslations from '../../locales/webmap.json';
2
2
  export * from './components';
3
3
  export * from './utils';
4
+ export * from './query/fakeApiWmtsQueries';
4
5
  export { webmapTranslations };
5
6
  export { WEBMAP_NAMESPACE } from './utils/i18n';
@@ -0,0 +1,208 @@
1
+ export declare const wmtsResponseGetCapabilities: {
2
+ Capabilities: {
3
+ attr: {
4
+ xmlns: string;
5
+ 'xmlns:ows': string;
6
+ 'xmlns:xlink': string;
7
+ 'xmlns:xsi': string;
8
+ 'xmlns:gml': string;
9
+ 'xsi:schemaLocation': string;
10
+ version: string;
11
+ };
12
+ ServiceIdentification: {
13
+ attr: {};
14
+ Title: {
15
+ attr: {};
16
+ };
17
+ Abstract: {
18
+ attr: {};
19
+ };
20
+ ServiceType: {
21
+ attr: {};
22
+ value: string;
23
+ };
24
+ ServiceTypeVersion: {
25
+ attr: {};
26
+ value: string;
27
+ };
28
+ Fees: {
29
+ attr: {};
30
+ value: string;
31
+ };
32
+ AccessConstraints: {
33
+ attr: {};
34
+ value: string;
35
+ };
36
+ };
37
+ OperationsMetadata: {
38
+ attr: {};
39
+ Operation: {
40
+ attr: {
41
+ name: string;
42
+ };
43
+ DCP: {
44
+ attr: {};
45
+ HTTP: {
46
+ attr: {};
47
+ Get: {
48
+ attr: {
49
+ 'xlink:href': string;
50
+ };
51
+ Constraint: {
52
+ attr: {
53
+ name: string;
54
+ };
55
+ AllowedValues: {
56
+ attr: {};
57
+ Value: {
58
+ attr: {};
59
+ value: string;
60
+ };
61
+ };
62
+ };
63
+ };
64
+ };
65
+ };
66
+ }[];
67
+ };
68
+ Contents: {
69
+ attr: {};
70
+ Layer: {
71
+ attr: {};
72
+ Title: {
73
+ attr: {};
74
+ value: string;
75
+ };
76
+ Abstract: {
77
+ attr: {};
78
+ };
79
+ WGS84BoundingBox: {
80
+ attr: {};
81
+ LowerCorner: {
82
+ attr: {};
83
+ value: string;
84
+ };
85
+ UpperCorner: {
86
+ attr: {};
87
+ value: string;
88
+ };
89
+ };
90
+ Identifier: {
91
+ attr: {};
92
+ value: string;
93
+ };
94
+ Style: {
95
+ attr: {
96
+ isDefault: string;
97
+ };
98
+ Identifier: {
99
+ attr: {};
100
+ value: string;
101
+ };
102
+ };
103
+ Format: {
104
+ attr: {};
105
+ value: string;
106
+ };
107
+ Dimension: {
108
+ attr: {};
109
+ Identifier: {
110
+ attr: {};
111
+ value: string;
112
+ };
113
+ Default: {
114
+ attr: {};
115
+ value: string;
116
+ };
117
+ Value: {
118
+ attr: {};
119
+ value: string;
120
+ }[];
121
+ };
122
+ TileMatrixSetLink: {
123
+ attr: {};
124
+ TileMatrixSet: {
125
+ attr: {};
126
+ value: string;
127
+ };
128
+ };
129
+ ResourceURL: {
130
+ attr: {
131
+ format: string;
132
+ resourceType: string;
133
+ template: string;
134
+ };
135
+ };
136
+ };
137
+ TileMatrixSet: {
138
+ attr: {};
139
+ Identifier: {
140
+ attr: {};
141
+ value: string;
142
+ };
143
+ SupportedCRS: {
144
+ attr: {};
145
+ value: string;
146
+ };
147
+ TileMatrix: {
148
+ attr: {};
149
+ Identifier: {
150
+ attr: {};
151
+ value: string;
152
+ };
153
+ ScaleDenominator: {
154
+ attr: {};
155
+ value: string;
156
+ };
157
+ TopLeftCorner: {
158
+ attr: {};
159
+ value: string;
160
+ };
161
+ TileWidth: {
162
+ attr: {};
163
+ value: string;
164
+ };
165
+ TileHeight: {
166
+ attr: {};
167
+ value: string;
168
+ };
169
+ MatrixWidth: {
170
+ attr: {};
171
+ value: string;
172
+ };
173
+ MatrixHeight: {
174
+ attr: {};
175
+ value: string;
176
+ };
177
+ }[];
178
+ };
179
+ };
180
+ ServiceMetadataURL: {
181
+ attr: {
182
+ 'xlink:href': string;
183
+ };
184
+ };
185
+ };
186
+ };
187
+ export declare const wmtsResponseLayerList: {
188
+ abstract: string;
189
+ dimensions: {
190
+ currentValue: string;
191
+ defaultValue: string;
192
+ name: string;
193
+ units: string;
194
+ values: string;
195
+ }[];
196
+ leaf: boolean;
197
+ name: string;
198
+ path: never[];
199
+ ogctype: string;
200
+ styles: {
201
+ abstract: string;
202
+ legendURL: string;
203
+ name: string;
204
+ title: string;
205
+ }[];
206
+ title: string;
207
+ }[];
208
+ export declare const fakeWMTSLayerApiHandlers: import("msw").HttpHandler[];
@@ -3,4 +3,5 @@ export declare const QUERYWMS_LAYERSTREE = "QUERYWMS_LAYERSTREE";
3
3
  export declare const QUERYWMS_SERVICEINFO = "QUERYWMS_SERVICEINFO";
4
4
  export declare const QUERYWMS_LAYERS = "QUERYWMS_LAYERS";
5
5
  export declare const QUERYWMS_LAYER = "QUERYWMS_LAYER";
6
+ export declare const QUERYWMS_OGCTYPE = "QUERYWMS_OGCTYPE";
6
7
  export declare const queryWMSKeys: string[];
@@ -1,4 +1,5 @@
1
- import { GetCapabilitiesJson, LayerProps, LayerTree, WMSServiceInfo } from '../components/types';
1
+ import type { OGCWMSWMTSGetCapabilities, LayerProps, LayerTree, WMSServiceInfo, WMTSGetCapabilities } from '../components/types';
2
+ import { OGCTYPE } from '../components/types';
2
3
  /**
3
4
  * Invalidates the tanstack store for this getcapabilities service. Used to force refetch.
4
5
  *
@@ -7,14 +8,23 @@ import { GetCapabilitiesJson, LayerProps, LayerTree, WMSServiceInfo } from '../c
7
8
  * @returns {Promise<void>}
8
9
  */
9
10
  export declare const invalidateWMSGetCapabilities: (serviceUrl: string) => Promise<void>;
11
+ export declare const invalidateWMTSGetCapabilities: (serviceUrl: string) => Promise<void>;
12
+ /**
13
+ * Determines whether the service is WMS or WMTS
14
+ *
15
+ * @async
16
+ * @param {string} serviceUrl
17
+ * @returns {Promise<string>}
18
+ */
19
+ export declare const queryOGCTypeWMSorWMTS: (serviceUrl: string) => Promise<OGCTYPE>;
10
20
  /**
11
21
  * Fetches the WMS GetCapabilities document and converts it to a json object. It is cached by TanStack.
12
22
  *
13
23
  * @async
14
24
  * @param {string} serviceUrl
15
- * @returns {Promise<GetCapabilitiesJson>}
25
+ * @returns {Promise<OGCWMSWMTSGetCapabilities>}
16
26
  */
17
- export declare const queryWMSGetCapabilities: (serviceUrl: string) => Promise<GetCapabilitiesJson>;
27
+ export declare const queryWMSGetCapabilities: (serviceUrl: string) => Promise<OGCWMSWMTSGetCapabilities>;
18
28
  /**
19
29
  * Gets the layer tree in hierarchical order for a WMS service. Cached by TanStack. Uses the same store as in queryWMSGetCapabilities.
20
30
  *
@@ -48,4 +58,12 @@ export declare const queryWMSLayers: (serviceUrl: string, forceReload?: boolean)
48
58
  * @param {string} name
49
59
  * @returns {Promise<LayerProps>}
50
60
  */
51
- export declare const queryWMSLayer: (serviceUrl: string, name: string) => Promise<LayerProps>;
61
+ export declare const queryWMSLayer: (serviceUrl: string, name: string, forceReload?: boolean) => Promise<LayerProps>;
62
+ /**
63
+ * Fetches the WMTS GetCapabilities document and converts it to a json object. It is cached by TanStack.
64
+ *
65
+ * @async
66
+ * @param {string} serviceUrl
67
+ * @returns {Promise<WMTSGetCapabilities>}
68
+ */
69
+ export declare const queryWMTSGetCapabilities: (serviceUrl: string) => Promise<WMTSGetCapabilities>;
@@ -0,0 +1 @@
1
+ export {};