@loaders.gl/wms 3.3.0-alpha.13 → 3.3.0-alpha.14

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 (89) hide show
  1. package/dist/dist.min.js +182 -1046
  2. package/dist/es5/index.js +20 -13
  3. package/dist/es5/index.js.map +1 -1
  4. package/dist/es5/lerc-loader.js +1 -1
  5. package/dist/es5/lib/data-sources/adhoc-image-service.js +4 -0
  6. package/dist/es5/lib/data-sources/adhoc-image-service.js.map +1 -1
  7. package/dist/es5/lib/data-sources/arcgis-image-service.js +180 -0
  8. package/dist/es5/lib/data-sources/arcgis-image-service.js.map +1 -0
  9. package/dist/es5/lib/data-sources/create-image-source.js +45 -0
  10. package/dist/es5/lib/data-sources/create-image-source.js.map +1 -0
  11. package/dist/es5/lib/data-sources/image-services/arcgis-image-service.js +179 -0
  12. package/dist/es5/lib/data-sources/image-services/arcgis-image-service.js.map +1 -0
  13. package/dist/es5/lib/data-sources/image-services/image-service.js +163 -0
  14. package/dist/es5/lib/data-sources/image-services/image-service.js.map +1 -0
  15. package/dist/es5/lib/data-sources/{wms-service.js → image-services/wms-service.js} +116 -75
  16. package/dist/es5/lib/data-sources/image-services/wms-service.js.map +1 -0
  17. package/dist/es5/wip/arcgis-feature-service.js +45 -0
  18. package/dist/es5/wip/arcgis-feature-service.js.map +1 -0
  19. package/dist/es5/wip/data-source.js.map +1 -1
  20. package/dist/es5/wip/gml-loader.js +1 -1
  21. package/dist/es5/wip/wcs-capabilities-loader.js +1 -1
  22. package/dist/es5/wip/wfs-capabilities-loader.js +1 -1
  23. package/dist/es5/wip/wmts-capabilities-loader.js +1 -1
  24. package/dist/es5/wms-capabilities-loader.js +1 -1
  25. package/dist/es5/wms-error-loader.js +1 -1
  26. package/dist/esm/index.js +5 -5
  27. package/dist/esm/index.js.map +1 -1
  28. package/dist/esm/lerc-loader.js +1 -1
  29. package/dist/esm/lib/data-sources/adhoc-image-service.js +2 -0
  30. package/dist/esm/lib/data-sources/adhoc-image-service.js.map +1 -1
  31. package/dist/esm/lib/data-sources/arcgis-image-service.js +62 -0
  32. package/dist/esm/lib/data-sources/arcgis-image-service.js.map +1 -0
  33. package/dist/esm/lib/data-sources/create-image-source.js +30 -0
  34. package/dist/esm/lib/data-sources/create-image-source.js.map +1 -0
  35. package/dist/esm/lib/data-sources/image-services/arcgis-image-service.js +61 -0
  36. package/dist/esm/lib/data-sources/image-services/arcgis-image-service.js.map +1 -0
  37. package/dist/esm/lib/data-sources/image-services/image-service.js +72 -0
  38. package/dist/esm/lib/data-sources/image-services/image-service.js.map +1 -0
  39. package/dist/esm/lib/data-sources/{wms-service.js → image-services/wms-service.js} +46 -32
  40. package/dist/esm/lib/data-sources/image-services/wms-service.js.map +1 -0
  41. package/dist/esm/wip/arcgis-feature-service.js +28 -0
  42. package/dist/esm/wip/arcgis-feature-service.js.map +1 -0
  43. package/dist/esm/wip/data-source.js.map +1 -1
  44. package/dist/esm/wip/gml-loader.js +1 -1
  45. package/dist/esm/wip/wcs-capabilities-loader.js +1 -1
  46. package/dist/esm/wip/wfs-capabilities-loader.js +1 -1
  47. package/dist/esm/wip/wmts-capabilities-loader.js +1 -1
  48. package/dist/esm/wms-capabilities-loader.js +1 -1
  49. package/dist/esm/wms-error-loader.js +1 -1
  50. package/dist/index.d.ts +9 -7
  51. package/dist/index.d.ts.map +1 -1
  52. package/dist/index.js +14 -8
  53. package/dist/lib/data-sources/adhoc-image-service.d.ts +2 -0
  54. package/dist/lib/data-sources/adhoc-image-service.d.ts.map +1 -1
  55. package/dist/lib/data-sources/adhoc-image-service.js +2 -0
  56. package/dist/lib/data-sources/arcgis-image-service.d.ts +79 -0
  57. package/dist/lib/data-sources/arcgis-image-service.d.ts.map +1 -0
  58. package/dist/lib/data-sources/arcgis-image-service.js +85 -0
  59. package/dist/lib/data-sources/create-image-source.d.ts +16 -0
  60. package/dist/lib/data-sources/create-image-source.d.ts.map +1 -0
  61. package/dist/lib/data-sources/create-image-source.js +39 -0
  62. package/dist/lib/data-sources/image-services/arcgis-image-service.d.ts +71 -0
  63. package/dist/lib/data-sources/image-services/arcgis-image-service.d.ts.map +1 -0
  64. package/dist/lib/data-sources/image-services/arcgis-image-service.js +85 -0
  65. package/dist/lib/data-sources/image-services/image-service.d.ts +39 -0
  66. package/dist/lib/data-sources/image-services/image-service.d.ts.map +1 -0
  67. package/dist/lib/data-sources/image-services/image-service.js +82 -0
  68. package/dist/lib/data-sources/{wms-service.d.ts → image-services/wms-service.d.ts} +33 -38
  69. package/dist/lib/data-sources/image-services/wms-service.d.ts.map +1 -0
  70. package/dist/lib/data-sources/{wms-service.js → image-services/wms-service.js} +40 -28
  71. package/dist/wip/arcgis-feature-service.d.ts +56 -0
  72. package/dist/wip/arcgis-feature-service.d.ts.map +1 -0
  73. package/dist/wip/arcgis-feature-service.js +28 -0
  74. package/dist/wip/data-source.d.ts +14 -13
  75. package/dist/wip/data-source.d.ts.map +1 -1
  76. package/dist/wip/data-source.js +15 -13
  77. package/package.json +6 -6
  78. package/src/index.ts +13 -8
  79. package/src/lib/data-sources/adhoc-image-service.ts +3 -0
  80. package/src/lib/data-sources/arcgis-image-service.ts +146 -0
  81. package/src/lib/data-sources/create-image-source.ts +46 -0
  82. package/src/lib/data-sources/image-services/arcgis-image-service.ts +136 -0
  83. package/src/lib/data-sources/image-services/image-service.ts +105 -0
  84. package/src/lib/data-sources/{wms-service.ts → image-services/wms-service.ts} +51 -47
  85. package/src/wip/arcgis-feature-service.ts +89 -0
  86. package/src/wip/data-source.ts +15 -13
  87. package/dist/es5/lib/data-sources/wms-service.js.map +0 -1
  88. package/dist/esm/lib/data-sources/wms-service.js.map +0 -1
  89. package/dist/lib/data-sources/wms-service.d.ts.map +0 -1
@@ -4,18 +4,16 @@
4
4
 
5
5
  import type {ImageType} from '@loaders.gl/images';
6
6
  import {ImageLoader} from '@loaders.gl/images';
7
- import {LoaderOptions} from '@loaders.gl/loader-utils';
8
7
 
9
- import type {ImageSourceMetadata, GetImageParameters} from './image-source';
10
- import {ImageSource} from './image-source';
8
+ import type {ImageSourceMetadata, GetImageParameters} from '../image-source';
9
+ import {ImageSource} from '../image-source';
10
+ import {ImageServiceProps, getFetchFunction, mergeImageServiceProps} from './image-service';
11
11
 
12
- import type {WMSCapabilities, WMSFeatureInfo, WMSLayerDescription} from '../wms/wms-types';
13
- import {WMSCapabilitiesLoader} from '../../wms-capabilities-loader';
14
- import {WMSFeatureInfoLoader} from '../../wip/wms-feature-info-loader';
15
- import {WMSLayerDescriptionLoader} from '../../wip/wms-layer-description-loader';
16
- import {WMSErrorLoader} from '../../wms-error-loader';
17
-
18
- type FetchLike = (url: string, options?: RequestInit) => Promise<Response>;
12
+ import type {WMSCapabilities, WMSFeatureInfo, WMSLayerDescription} from '../../wms/wms-types';
13
+ import {WMSCapabilitiesLoader} from '../../../wms-capabilities-loader';
14
+ import {WMSFeatureInfoLoader} from '../../../wip/wms-feature-info-loader';
15
+ import {WMSLayerDescriptionLoader} from '../../../wip/wms-layer-description-loader';
16
+ import {WMSErrorLoader} from '../../../wms-error-loader';
19
17
 
20
18
  type WMSCommonParameters = {
21
19
  /** In case the endpoint supports multiple services */
@@ -60,7 +58,7 @@ export type WMSGetFeatureInfoParameters = WMSCommonParameters & {
60
58
  /** list of layers to query (could be different from rendered layers) */
61
59
  query_layers: string[];
62
60
  /** MIME type of returned feature info */
63
- info_format?: 'text/plain';
61
+ info_format?: 'text/plain' | 'application/vnd.ogc.gml';
64
62
 
65
63
  /** Layers to render */
66
64
  layers: string[];
@@ -88,16 +86,6 @@ export type WMSGetLegendGraphicParameters = WMSCommonParameters & {
88
86
  request?: 'GetLegendGraphic';
89
87
  };
90
88
 
91
- /** Properties that can be specified when creating a new WMS service */
92
- export type WMSServiceProps = {
93
- /** Base URL to the service */
94
- serviceUrl: string;
95
- /** Any load options to the loaders.gl Loaders used by the WMSService methods */
96
- loadOptions?: LoaderOptions;
97
- /** Override the fetch function if required */
98
- fetch?: typeof fetch | FetchLike;
99
- };
100
-
101
89
  /**
102
90
  * The WMSService class provides
103
91
  * - provides type safe methods to form URLs to a WMS service
@@ -106,12 +94,12 @@ export type WMSServiceProps = {
106
94
  * @note Only the URL parameter conversion is supported. XML posts are not supported.
107
95
  */
108
96
  export class WMSService extends ImageSource {
109
- serviceUrl: string;
110
- loadOptions: LoaderOptions = {
111
- // We want error responses to throw exceptions, the WMSErrorLoader can do this
112
- wms: {throwOnError: true}
113
- };
114
- fetch: typeof fetch | FetchLike;
97
+ static type: 'wms' = 'wms';
98
+ static testURL = (url: string): boolean => url.toLowerCase().includes('wms');
99
+
100
+ props: Required<ImageServiceProps>;
101
+ fetch: (url: string, options?: RequestInit) => Promise<Response>;
102
+ capabilities: WMSCapabilities | null = null;
115
103
 
116
104
  /** A list of loaders used by the WMSService methods */
117
105
  readonly loaders = [
@@ -123,12 +111,15 @@ export class WMSService extends ImageSource {
123
111
  ];
124
112
 
125
113
  /** Create a WMSService */
126
- constructor(props: WMSServiceProps) {
114
+ constructor(props: ImageServiceProps) {
127
115
  super();
128
- this.serviceUrl = props.serviceUrl;
129
- // TODO Need an options merge function from loaders.gl to merge subobjects
130
- Object.assign(this.loadOptions, props.loadOptions);
131
- this.fetch = props.fetch || fetch;
116
+ this.props = mergeImageServiceProps(props);
117
+ this.fetch = getFetchFunction(this.props);
118
+ this.props.loadOptions = {
119
+ ...this.props.loadOptions,
120
+ // We want error responses to throw exceptions, the WMSErrorLoader can do this
121
+ wms: {...this.props.loadOptions?.wms, throwOnError: true}
122
+ };
132
123
  }
133
124
 
134
125
  // ImageSource implementation
@@ -148,11 +139,12 @@ export class WMSService extends ImageSource {
148
139
  vendorParameters?: Record<string, unknown>
149
140
  ): Promise<WMSCapabilities> {
150
141
  const url = this.getCapabilitiesURL(wmsParameters, vendorParameters);
151
- const {fetch} = this;
152
- const response = await fetch(url, this.loadOptions);
142
+ const response = await this.fetch(url);
153
143
  const arrayBuffer = await response.arrayBuffer();
154
144
  this._checkResponse(response, arrayBuffer);
155
- return await WMSCapabilitiesLoader.parse(arrayBuffer, this.loadOptions);
145
+ const capabilities = await WMSCapabilitiesLoader.parse(arrayBuffer, this.props.loadOptions);
146
+ this.capabilities = capabilities;
147
+ return capabilities;
156
148
  }
157
149
 
158
150
  /** Get a map image */
@@ -161,12 +153,11 @@ export class WMSService extends ImageSource {
161
153
  vendorParameters?: Record<string, unknown>
162
154
  ): Promise<ImageType> {
163
155
  const url = this.getMapURL(options, vendorParameters);
164
- const {fetch} = this;
165
- const response = await fetch(url, this.loadOptions);
156
+ const response = await this.fetch(url);
166
157
  const arrayBuffer = await response.arrayBuffer();
167
158
  this._checkResponse(response, arrayBuffer);
168
159
  try {
169
- return await ImageLoader.parse(arrayBuffer, this.loadOptions);
160
+ return await ImageLoader.parse(arrayBuffer, this.props.loadOptions);
170
161
  } catch {
171
162
  throw this._parseError(arrayBuffer);
172
163
  }
@@ -178,10 +169,23 @@ export class WMSService extends ImageSource {
178
169
  vendorParameters?: Record<string, unknown>
179
170
  ): Promise<WMSFeatureInfo> {
180
171
  const url = this.getFeatureInfoURL(options, vendorParameters);
181
- const response = await this.fetch(url, this.loadOptions);
172
+ const response = await this.fetch(url);
173
+ const arrayBuffer = await response.arrayBuffer();
174
+ this._checkResponse(response, arrayBuffer);
175
+ return await WMSFeatureInfoLoader.parse(arrayBuffer, this.props.loadOptions);
176
+ }
177
+
178
+ /** Get Feature Info for a coordinate */
179
+ async getFeatureInfoText(
180
+ options: WMSGetFeatureInfoParameters,
181
+ vendorParameters?: Record<string, unknown>
182
+ ): Promise<string> {
183
+ options = {...options, info_format: 'text/plain'};
184
+ const url = this.getFeatureInfoURL(options, vendorParameters);
185
+ const response = await this.fetch(url);
182
186
  const arrayBuffer = await response.arrayBuffer();
183
187
  this._checkResponse(response, arrayBuffer);
184
- return await WMSFeatureInfoLoader.parse(arrayBuffer, this.loadOptions);
188
+ return new TextDecoder().decode(arrayBuffer);
185
189
  }
186
190
 
187
191
  /** Get more information about a layer */
@@ -190,10 +194,10 @@ export class WMSService extends ImageSource {
190
194
  vendorParameters?: Record<string, unknown>
191
195
  ): Promise<WMSLayerDescription> {
192
196
  const url = this.describeLayerURL(options, vendorParameters);
193
- const response = await this.fetch(url, this.loadOptions);
197
+ const response = await this.fetch(url);
194
198
  const arrayBuffer = await response.arrayBuffer();
195
199
  this._checkResponse(response, arrayBuffer);
196
- return await WMSLayerDescriptionLoader.parse(arrayBuffer, this.loadOptions);
200
+ return await WMSLayerDescriptionLoader.parse(arrayBuffer, this.props.loadOptions);
197
201
  }
198
202
 
199
203
  /** Get an image with a semantic legend */
@@ -202,11 +206,11 @@ export class WMSService extends ImageSource {
202
206
  vendorParameters?: Record<string, unknown>
203
207
  ): Promise<ImageType> {
204
208
  const url = this.getLegendGraphicURL(options, vendorParameters);
205
- const response = await this.fetch(url, this.loadOptions);
209
+ const response = await this.fetch(url);
206
210
  const arrayBuffer = await response.arrayBuffer();
207
211
  this._checkResponse(response, arrayBuffer);
208
212
  try {
209
- return await ImageLoader.parse(arrayBuffer, this.loadOptions);
213
+ return await ImageLoader.parse(arrayBuffer, this.props.loadOptions);
210
214
  } catch {
211
215
  throw this._parseError(arrayBuffer);
212
216
  }
@@ -316,7 +320,7 @@ export class WMSService extends ImageSource {
316
320
  options: Record<string, unknown>,
317
321
  vendorParameters?: Record<string, unknown>
318
322
  ): string {
319
- let url = `${this.serviceUrl}`;
323
+ let url = this.props.url;
320
324
  let first = true;
321
325
  for (const [key, value] of Object.entries(options)) {
322
326
  url += first ? '?' : '&';
@@ -334,14 +338,14 @@ export class WMSService extends ImageSource {
334
338
  protected _checkResponse(response: Response, arrayBuffer: ArrayBuffer): void {
335
339
  const contentType = response.headers['content-type'];
336
340
  if (!response.ok || WMSErrorLoader.mimeTypes.includes(contentType)) {
337
- const error = WMSErrorLoader.parseSync(arrayBuffer, this.loadOptions);
341
+ const error = WMSErrorLoader.parseSync(arrayBuffer, this.props.loadOptions);
338
342
  throw new Error(error);
339
343
  }
340
344
  }
341
345
 
342
346
  /** Error situation detected */
343
347
  protected _parseError(arrayBuffer: ArrayBuffer): Error {
344
- const error = WMSErrorLoader.parseSync(arrayBuffer, this.loadOptions);
348
+ const error = WMSErrorLoader.parseSync(arrayBuffer, this.props.loadOptions);
345
349
  return new Error(error);
346
350
  }
347
351
  }
@@ -0,0 +1,89 @@
1
+ // @ts-nocheck
2
+
3
+ import {LoaderOptions} from '@loaders.gl/loader-utils';
4
+ // import {GeoJSONLoader} from '@loaders.gl/geojson';
5
+
6
+ type FetchLike = (url: string, options?: RequestInit) => Promise<Response>;
7
+
8
+ export type ArcGISImageServiceQueryOptions = {
9
+ returnGeometry: boolean;
10
+ where: '1%3D1';
11
+ outSR: 4326;
12
+ outFields: string | '*';
13
+ inSR: 4326;
14
+ geometry: `${-90}%2C+${30}%2C+${-70}%2C+${50}`;
15
+ geometryType: 'esriGeometryEnvelope'; // TODO - look up valid values in Esri docs
16
+ spatialRel: 'esriSpatialRelIntersects'; // TODO - look up valid values in Esri docs
17
+ geometryPrecision: number; // TODO - look up valid values in Esri docs
18
+ resultType: 'tile'; // TODO - look up valid values in Esri docs
19
+ f?: 'geojson'; // TODO - look up valid values in Esri docs
20
+ }
21
+
22
+ // const DEFAULT_QUERY_OPTIONS: Required<ArcGISImageServiceQueryOptions> = {
23
+ // returnGeometry:true,
24
+ // where: '1%3D1',
25
+ // outSR: 4326,
26
+ // outFields: '*',
27
+ // inSR: 4326,
28
+ // geometry: `${-90}%2C+${30}%2C+${-70}%2C+${50}`,
29
+ // geometryType: 'esriGeometryEnvelope',
30
+ // spatialRel: 'esriSpatialRelIntersects',
31
+ // geometryPrecision: 6,
32
+ // resultType: 'tile',
33
+ // f: 'geojson'
34
+ // };
35
+
36
+ export type ArcGISFeatureServiceProps = ArcGISImageServiceQueryOptions & {
37
+ url: string;
38
+ loadOptions?: LoaderOptions;
39
+ fetch?: typeof fetch | FetchLike;
40
+ };
41
+
42
+ export class ArcGISFeatureService {
43
+ url: string;
44
+ loadOptions: LoaderOptions;
45
+ fetch: typeof fetch | FetchLike;
46
+
47
+ constructor(props: ArcGISFeatureServiceProps) {
48
+ this.url = props.url;
49
+ this.loadOptions = props.loadOptions || {};
50
+ this.fetch = props.fetch || fetch;
51
+ }
52
+
53
+ // URL creators
54
+
55
+ metadataURL(options: {parameters?: Record<string, unknown>}): string {
56
+ return this.getUrl({...options});
57
+ }
58
+
59
+ /**
60
+ * Form a URL to an ESRI FeatureServer
61
+ // https://services2.arcgis.com/CcI36Pduqd0OR4W9/ArcGIS/rest/services/Bicycle_Routes_Public/FeatureServer/0/query?
62
+ // returnGeometry=true&where=1%3D1&outSR=4326&outFields=*&inSR=4326&geometry=${-90}%2C+${30}%2C+${-70}%2C+${50}&
63
+ // geometryType=esriGeometryEnvelope&spatialRel=esriSpatialRelIntersects&geometryPrecision=6&resultType=tile&f=geojson`
64
+ */
65
+ exportImageURL(options: {
66
+ boundingBox: [number, number, number, number];
67
+ boundingBoxSR?: string;
68
+ width: number;
69
+ height: number;
70
+ imageSR?: string;
71
+ time?: never;
72
+ f?: 'geojson';
73
+ resultType?: 'tile';
74
+ noData?: never;
75
+ noDataInterpretation?: 'esriNoDataMatchAny';
76
+ interpolation?: '+RSP_NearestNeighbor';
77
+ compression?: never
78
+ compressionQuality?: never;
79
+ bandIds?: never;
80
+ mosaicRule?: never;
81
+ renderingRule?: never;
82
+ f?: 'image';
83
+ }): string {
84
+ const {boundingBox} = options;
85
+ // const bbox = `bbox=${boundingBox[0]},${boundingBox[1]},${boundingBox[2]},${boundingBox[3]}`;
86
+ // const size = `size=${width},${height}`
87
+ return this.getUrl({path: 'exportImage', });
88
+ }
89
+ }
@@ -6,23 +6,11 @@
6
6
 
7
7
  // ImageSource
8
8
 
9
+ // Tile Source
9
10
 
10
11
  /** Data source that serves data by tile index *
11
12
  export abstract class TileDataSource extends DataSource {};
12
13
 
13
- // Vector Tile Source
14
-
15
- export type VectorTileDataSourceCapabilities = {
16
- // check tile.json
17
- }
18
-
19
- export type VectorTile = Record<string, any>;
20
-
21
- export abstract class VectorTileDataSource extends TileDataSource {
22
- abstract getCapabilities(): Promise<VectorTileDataSourceCapabilities>;
23
- abstract getTile({x, y, z, width, height, layers, parameters}): Promise<VectorTile>;
24
- }
25
-
26
14
  // Image Tile Data Source
27
15
 
28
16
  export type ImageTileDataSourceCapabilities = {
@@ -57,4 +45,18 @@ export abstract class ImageTileDataSource extends TileDataSource {
57
45
  return [0, 0, 1, 1];
58
46
  }
59
47
  }
48
+
49
+ // Vector Tile Source
50
+
51
+ export type VectorTileDataSourceCapabilities = {
52
+ // check tile.json
53
+ }
54
+
55
+ export type VectorTile = Record<string, any>;
56
+
57
+ export abstract class VectorTileDataSource extends TileDataSource {
58
+ abstract getCapabilities(): Promise<VectorTileDataSourceCapabilities>;
59
+ abstract getTile({x, y, z, width, height, layers, parameters}): Promise<VectorTile>;
60
+ }
61
+
60
62
  */
@@ -1 +0,0 @@
1
- {"version":3,"file":"wms-service.js","names":["WMSService","props","wms","throwOnError","ImageLoader","WMSErrorLoader","WMSCapabilitiesLoader","WMSFeatureInfoLoader","WMSLayerDescriptionLoader","serviceUrl","Object","assign","loadOptions","fetch","getCapabilities","parameters","getMap","wmsParameters","vendorParameters","url","getCapabilitiesURL","response","arrayBuffer","_checkResponse","parse","options","getMapURL","_parseError","getFeatureInfoURL","describeLayerURL","getLegendGraphicURL","service","version","request","_getWMSUrl","styles","undefined","srs","format","info_format","first","entries","key","value","Array","isArray","toUpperCase","join","String","encodeURI","contentType","headers","ok","mimeTypes","includes","error","parseSync","Error","ImageSource"],"sources":["../../../../src/lib/data-sources/wms-service.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n/* eslint-disable camelcase */\n\nimport type {ImageType} from '@loaders.gl/images';\nimport {ImageLoader} from '@loaders.gl/images';\nimport {LoaderOptions} from '@loaders.gl/loader-utils';\n\nimport type {ImageSourceMetadata, GetImageParameters} from './image-source';\nimport {ImageSource} from './image-source';\n\nimport type {WMSCapabilities, WMSFeatureInfo, WMSLayerDescription} from '../wms/wms-types';\nimport {WMSCapabilitiesLoader} from '../../wms-capabilities-loader';\nimport {WMSFeatureInfoLoader} from '../../wip/wms-feature-info-loader';\nimport {WMSLayerDescriptionLoader} from '../../wip/wms-layer-description-loader';\nimport {WMSErrorLoader} from '../../wms-error-loader';\n\ntype FetchLike = (url: string, options?: RequestInit) => Promise<Response>;\n\ntype WMSCommonParameters = {\n /** In case the endpoint supports multiple services */\n service?: 'WMS';\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.1.1' | '1.3.0';\n};\n\nexport type WMSGetCapabilitiesParameters = WMSCommonParameters & {\n /** Request type */\n request?: 'GetCapabilities';\n};\n\nexport type WMSGetMapParameters = WMSCommonParameters & {\n /** Request type */\n request?: 'GetMap';\n /** Layers to render */\n layers: string | string[];\n /** Styling */\n styles?: unknown;\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** srs for the image (not the bounding box) */\n srs?: string;\n /** requested format for the return image */\n format?: 'image/png';\n};\n\n// https://imagery.pasda.psu.edu/arcgis/services/pasda/UrbanTreeCanopy_Landcover/MapServer/WmsServer?SERVICE=WMS&\nexport type WMSGetFeatureInfoParameters = WMSCommonParameters & {\n /** Request type */\n request?: 'GetFeatureInfo';\n\n /** x coordinate for the feature info request */\n x: number;\n /** y coordinate for the feature info request */\n y: number;\n /** list of layers to query (could be different from rendered layers) */\n query_layers: string[];\n /** MIME type of returned feature info */\n info_format?: 'text/plain';\n\n /** Layers to render */\n layers: string[];\n /** Styling */\n styles?: unknown;\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** srs for the image (not the bounding box) */\n srs?: string;\n /** requested format for the return image */\n format?: 'image/png';\n};\n\nexport type WMSDescribeLayerParameters = WMSCommonParameters & {\n /** Request type */\n request?: 'DescribeLayer';\n};\n\nexport type WMSGetLegendGraphicParameters = WMSCommonParameters & {\n /** Request type */\n request?: 'GetLegendGraphic';\n};\n\n/** Properties that can be specified when creating a new WMS service */\nexport type WMSServiceProps = {\n /** Base URL to the service */\n serviceUrl: string;\n /** Any load options to the loaders.gl Loaders used by the WMSService methods */\n loadOptions?: LoaderOptions;\n /** Override the fetch function if required */\n fetch?: typeof fetch | FetchLike;\n};\n\n/**\n * The WMSService class provides\n * - provides type safe methods to form URLs to a WMS service\n * - provides type safe methods to query and parse results (and errors) from a WMS service\n * - implements the ImageService interface\n * @note Only the URL parameter conversion is supported. XML posts are not supported.\n */\nexport class WMSService extends ImageSource {\n serviceUrl: string;\n loadOptions: LoaderOptions = {\n // We want error responses to throw exceptions, the WMSErrorLoader can do this\n wms: {throwOnError: true}\n };\n fetch: typeof fetch | FetchLike;\n\n /** A list of loaders used by the WMSService methods */\n readonly loaders = [\n ImageLoader,\n WMSErrorLoader,\n WMSCapabilitiesLoader,\n WMSFeatureInfoLoader,\n WMSLayerDescriptionLoader\n ];\n\n /** Create a WMSService */\n constructor(props: WMSServiceProps) {\n super();\n this.serviceUrl = props.serviceUrl;\n // TODO Need an options merge function from loaders.gl to merge subobjects\n Object.assign(this.loadOptions, props.loadOptions);\n this.fetch = props.fetch || fetch;\n }\n\n // ImageSource implementation\n getMetadata(): Promise<ImageSourceMetadata> {\n return this.getCapabilities();\n }\n\n getImage(parameters: GetImageParameters): Promise<ImageType> {\n return this.getMap(parameters);\n }\n\n // WMS Service API Stubs\n\n /** Get Capabilities */\n async getCapabilities(\n wmsParameters?: WMSGetCapabilitiesParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<WMSCapabilities> {\n const url = this.getCapabilitiesURL(wmsParameters, vendorParameters);\n const {fetch} = this;\n const response = await fetch(url, this.loadOptions);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return await WMSCapabilitiesLoader.parse(arrayBuffer, this.loadOptions);\n }\n\n /** Get a map image */\n async getMap(\n options: WMSGetMapParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<ImageType> {\n const url = this.getMapURL(options, vendorParameters);\n const {fetch} = this;\n const response = await fetch(url, this.loadOptions);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n try {\n return await ImageLoader.parse(arrayBuffer, this.loadOptions);\n } catch {\n throw this._parseError(arrayBuffer);\n }\n }\n\n /** Get Feature Info for a coordinate */\n async getFeatureInfo(\n options: WMSGetFeatureInfoParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<WMSFeatureInfo> {\n const url = this.getFeatureInfoURL(options, vendorParameters);\n const response = await this.fetch(url, this.loadOptions);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return await WMSFeatureInfoLoader.parse(arrayBuffer, this.loadOptions);\n }\n\n /** Get more information about a layer */\n async describeLayer(\n options: WMSDescribeLayerParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<WMSLayerDescription> {\n const url = this.describeLayerURL(options, vendorParameters);\n const response = await this.fetch(url, this.loadOptions);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return await WMSLayerDescriptionLoader.parse(arrayBuffer, this.loadOptions);\n }\n\n /** Get an image with a semantic legend */\n async getLegendGraphic(\n options: WMSGetLegendGraphicParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<ImageType> {\n const url = this.getLegendGraphicURL(options, vendorParameters);\n const response = await this.fetch(url, this.loadOptions);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n try {\n return await ImageLoader.parse(arrayBuffer, this.loadOptions);\n } catch {\n throw this._parseError(arrayBuffer);\n }\n }\n\n // Typed URL creators\n // For applications that want full control of fetching and parsing\n\n /** Generate a URL for the GetCapabilities request */\n getCapabilitiesURL(\n wmsParameters?: WMSGetCapabilitiesParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSGetCapabilitiesParameters> = {\n service: 'WMS',\n version: '1.1.1',\n request: 'GetCapabilities',\n ...wmsParameters,\n ...vendorParameters\n };\n return this._getWMSUrl(options, vendorParameters);\n }\n\n /** Generate a URL for the GetMap request */\n getMapURL(\n wmsParameters: WMSGetMapParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSGetMapParameters> = {\n service: 'WMS',\n version: '1.1.1',\n request: 'GetMap',\n // layers: [],\n // bbox: [-77.87304, 40.78975, -77.85828, 40.80228],\n // width: 1200,\n // height: 900,\n styles: undefined,\n srs: 'EPSG:4326',\n format: 'image/png',\n ...wmsParameters,\n ...vendorParameters\n };\n return this._getWMSUrl(options, vendorParameters);\n }\n\n /** Generate a URL for the GetFeatureInfo request */\n getFeatureInfoURL(\n wmsParameters: WMSGetFeatureInfoParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSGetFeatureInfoParameters> = {\n service: 'WMS',\n version: '1.1.1',\n request: 'GetFeatureInfo',\n // layers: [],\n // bbox: [-77.87304, 40.78975, -77.85828, 40.80228],\n // width: 1200,\n // height: 900,\n // x: undefined!,\n // y: undefined!,\n // query_layers: [],\n srs: 'EPSG:4326',\n format: 'image/png',\n info_format: 'text/plain',\n styles: undefined,\n ...wmsParameters,\n ...vendorParameters\n };\n return this._getWMSUrl(options, vendorParameters);\n }\n\n /** Generate a URL for the GetFeatureInfo request */\n describeLayerURL(\n wmsParameters: WMSDescribeLayerParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSDescribeLayerParameters> = {\n service: 'WMS',\n version: '1.1.1',\n request: 'DescribeLayer',\n ...wmsParameters,\n ...vendorParameters\n };\n return this._getWMSUrl(options, vendorParameters);\n }\n\n getLegendGraphicURL(\n wmsParameters: WMSGetLegendGraphicParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSGetLegendGraphicParameters> = {\n service: 'WMS',\n version: '1.1.1',\n request: 'GetLegendGraphic',\n ...wmsParameters,\n ...vendorParameters\n };\n return this._getWMSUrl(options, vendorParameters);\n }\n\n // INTERNAL METHODS\n\n /**\n * @note case _getWMSUrl may need to be overridden to handle certain backends?\n * */\n protected _getWMSUrl(\n options: Record<string, unknown>,\n vendorParameters?: Record<string, unknown>\n ): string {\n let url = `${this.serviceUrl}`;\n let first = true;\n for (const [key, value] of Object.entries(options)) {\n url += first ? '?' : '&';\n first = false;\n if (Array.isArray(value)) {\n url += `${key.toUpperCase()}=${value.join(',')}`;\n } else {\n url += `${key.toUpperCase()}=${value ? String(value) : ''}`;\n }\n }\n return encodeURI(url);\n }\n\n /** Checks for and parses a WMS XML formatted ServiceError and throws an exception */\n protected _checkResponse(response: Response, arrayBuffer: ArrayBuffer): void {\n const contentType = response.headers['content-type'];\n if (!response.ok || WMSErrorLoader.mimeTypes.includes(contentType)) {\n const error = WMSErrorLoader.parseSync(arrayBuffer, this.loadOptions);\n throw new Error(error);\n }\n }\n\n /** Error situation detected */\n protected _parseError(arrayBuffer: ArrayBuffer): Error {\n const error = WMSErrorLoader.parseSync(arrayBuffer, this.loadOptions);\n return new Error(error);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAKA;AAIA;AAGA;AACA;AACA;AACA;AAAsD;AAAA;AAAA;AAAA;AAAA,IA4FzCA,UAAU;EAAA;EAAA;;EAkBrB,oBAAYC,KAAsB,EAAE;IAAA;IAAA;IAClC;IAAQ;IAAA,0FAjBmB;MAE3BC,GAAG,EAAE;QAACC,YAAY,EAAE;MAAI;IAC1B,CAAC;IAAA;IAAA,sFAIkB,CACjBC,mBAAW,EACXC,8BAAc,EACdC,4CAAqB,EACrBC,0CAAoB,EACpBC,oDAAyB,CAC1B;IAKC,MAAKC,UAAU,GAAGR,KAAK,CAACQ,UAAU;IAElCC,MAAM,CAACC,MAAM,CAAC,MAAKC,WAAW,EAAEX,KAAK,CAACW,WAAW,CAAC;IAClD,MAAKC,KAAK,GAAGZ,KAAK,CAACY,KAAK,IAAIA,KAAK;IAAC;EACpC;;EAAC;IAAA;IAAA;IAGD,uBAA4C;MA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CAAE;QAA/C;UAAOiB,GAAG;UAAEC,KAAK;QACpBxB,GAAG,IAAIqB,KAAK,GAAG,GAAG,GAAG,GAAG;QACxBA,KAAK,GAAG,KAAK;QACb,IAAII,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;UACxBxB,GAAG,cAAOuB,GAAG,CAACI,WAAW,EAAE,cAAIH,KAAK,CAACI,IAAI,CAAC,GAAG,CAAC,CAAE;QAClD,CAAC,MAAM;UACL5B,GAAG,cAAOuB,GAAG,CAACI,WAAW,EAAE,cAAIH,KAAK,GAAGK,MAAM,CAACL,KAAK,CAAC,GAAG,EAAE,CAAE;QAC7D;MACF;MACA,OAAOM,SAAS,CAAC9B,GAAG,CAAC;IACvB;;EAAC;IAAA;IAAA;IAGD,wBAAyBE,QAAkB,EAAEC,WAAwB,EAAQ;MAC3E,IAAM4B,WAAW,GAAG7B,QAAQ,CAAC8B,OAAO,CAAC,cAAc,CAAC;MACpD,IAAI,CAAC9B,QAAQ,CAAC+B,EAAE,IAAI/C,8BAAc,CAACgD,SAAS,CAACC,QAAQ,CAACJ,WAAW,CAAC,EAAE;QAClE,IAAMK,KAAK,GAAGlD,8BAAc,CAACmD,SAAS,CAAClC,WAAW,EAAE,IAAI,CAACV,WAAW,CAAC;QACrE,MAAM,IAAI6C,KAAK,CAACF,KAAK,CAAC;MACxB;IACF;;EAAC;IAAA;IAAA;IAGD,qBAAsBjC,WAAwB,EAAS;MACrD,IAAMiC,KAAK,GAAGlD,8BAAc,CAACmD,SAAS,CAAClC,WAAW,EAAE,IAAI,CAACV,WAAW,CAAC;MACrE,OAAO,IAAI6C,KAAK,CAACF,KAAK,CAAC;IACzB;EAAC;EAAA;AAAA,EA9O6BG,wBAAW;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"wms-service.js","names":["ImageLoader","ImageSource","WMSCapabilitiesLoader","WMSFeatureInfoLoader","WMSLayerDescriptionLoader","WMSErrorLoader","WMSService","constructor","props","wms","throwOnError","serviceUrl","Object","assign","loadOptions","fetch","getMetadata","getCapabilities","getImage","parameters","getMap","wmsParameters","vendorParameters","url","getCapabilitiesURL","response","arrayBuffer","_checkResponse","parse","options","getMapURL","_parseError","getFeatureInfo","getFeatureInfoURL","describeLayer","describeLayerURL","getLegendGraphic","getLegendGraphicURL","service","version","request","_getWMSUrl","styles","undefined","srs","format","info_format","first","key","value","entries","Array","isArray","toUpperCase","join","String","encodeURI","contentType","headers","ok","mimeTypes","includes","error","parseSync","Error"],"sources":["../../../../src/lib/data-sources/wms-service.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n/* eslint-disable camelcase */\n\nimport type {ImageType} from '@loaders.gl/images';\nimport {ImageLoader} from '@loaders.gl/images';\nimport {LoaderOptions} from '@loaders.gl/loader-utils';\n\nimport type {ImageSourceMetadata, GetImageParameters} from './image-source';\nimport {ImageSource} from './image-source';\n\nimport type {WMSCapabilities, WMSFeatureInfo, WMSLayerDescription} from '../wms/wms-types';\nimport {WMSCapabilitiesLoader} from '../../wms-capabilities-loader';\nimport {WMSFeatureInfoLoader} from '../../wip/wms-feature-info-loader';\nimport {WMSLayerDescriptionLoader} from '../../wip/wms-layer-description-loader';\nimport {WMSErrorLoader} from '../../wms-error-loader';\n\ntype FetchLike = (url: string, options?: RequestInit) => Promise<Response>;\n\ntype WMSCommonParameters = {\n /** In case the endpoint supports multiple services */\n service?: 'WMS';\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.1.1' | '1.3.0';\n};\n\nexport type WMSGetCapabilitiesParameters = WMSCommonParameters & {\n /** Request type */\n request?: 'GetCapabilities';\n};\n\nexport type WMSGetMapParameters = WMSCommonParameters & {\n /** Request type */\n request?: 'GetMap';\n /** Layers to render */\n layers: string | string[];\n /** Styling */\n styles?: unknown;\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** srs for the image (not the bounding box) */\n srs?: string;\n /** requested format for the return image */\n format?: 'image/png';\n};\n\n// https://imagery.pasda.psu.edu/arcgis/services/pasda/UrbanTreeCanopy_Landcover/MapServer/WmsServer?SERVICE=WMS&\nexport type WMSGetFeatureInfoParameters = WMSCommonParameters & {\n /** Request type */\n request?: 'GetFeatureInfo';\n\n /** x coordinate for the feature info request */\n x: number;\n /** y coordinate for the feature info request */\n y: number;\n /** list of layers to query (could be different from rendered layers) */\n query_layers: string[];\n /** MIME type of returned feature info */\n info_format?: 'text/plain';\n\n /** Layers to render */\n layers: string[];\n /** Styling */\n styles?: unknown;\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** srs for the image (not the bounding box) */\n srs?: string;\n /** requested format for the return image */\n format?: 'image/png';\n};\n\nexport type WMSDescribeLayerParameters = WMSCommonParameters & {\n /** Request type */\n request?: 'DescribeLayer';\n};\n\nexport type WMSGetLegendGraphicParameters = WMSCommonParameters & {\n /** Request type */\n request?: 'GetLegendGraphic';\n};\n\n/** Properties that can be specified when creating a new WMS service */\nexport type WMSServiceProps = {\n /** Base URL to the service */\n serviceUrl: string;\n /** Any load options to the loaders.gl Loaders used by the WMSService methods */\n loadOptions?: LoaderOptions;\n /** Override the fetch function if required */\n fetch?: typeof fetch | FetchLike;\n};\n\n/**\n * The WMSService class provides\n * - provides type safe methods to form URLs to a WMS service\n * - provides type safe methods to query and parse results (and errors) from a WMS service\n * - implements the ImageService interface\n * @note Only the URL parameter conversion is supported. XML posts are not supported.\n */\nexport class WMSService extends ImageSource {\n serviceUrl: string;\n loadOptions: LoaderOptions = {\n // We want error responses to throw exceptions, the WMSErrorLoader can do this\n wms: {throwOnError: true}\n };\n fetch: typeof fetch | FetchLike;\n\n /** A list of loaders used by the WMSService methods */\n readonly loaders = [\n ImageLoader,\n WMSErrorLoader,\n WMSCapabilitiesLoader,\n WMSFeatureInfoLoader,\n WMSLayerDescriptionLoader\n ];\n\n /** Create a WMSService */\n constructor(props: WMSServiceProps) {\n super();\n this.serviceUrl = props.serviceUrl;\n // TODO Need an options merge function from loaders.gl to merge subobjects\n Object.assign(this.loadOptions, props.loadOptions);\n this.fetch = props.fetch || fetch;\n }\n\n // ImageSource implementation\n getMetadata(): Promise<ImageSourceMetadata> {\n return this.getCapabilities();\n }\n\n getImage(parameters: GetImageParameters): Promise<ImageType> {\n return this.getMap(parameters);\n }\n\n // WMS Service API Stubs\n\n /** Get Capabilities */\n async getCapabilities(\n wmsParameters?: WMSGetCapabilitiesParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<WMSCapabilities> {\n const url = this.getCapabilitiesURL(wmsParameters, vendorParameters);\n const {fetch} = this;\n const response = await fetch(url, this.loadOptions);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return await WMSCapabilitiesLoader.parse(arrayBuffer, this.loadOptions);\n }\n\n /** Get a map image */\n async getMap(\n options: WMSGetMapParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<ImageType> {\n const url = this.getMapURL(options, vendorParameters);\n const {fetch} = this;\n const response = await fetch(url, this.loadOptions);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n try {\n return await ImageLoader.parse(arrayBuffer, this.loadOptions);\n } catch {\n throw this._parseError(arrayBuffer);\n }\n }\n\n /** Get Feature Info for a coordinate */\n async getFeatureInfo(\n options: WMSGetFeatureInfoParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<WMSFeatureInfo> {\n const url = this.getFeatureInfoURL(options, vendorParameters);\n const response = await this.fetch(url, this.loadOptions);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return await WMSFeatureInfoLoader.parse(arrayBuffer, this.loadOptions);\n }\n\n /** Get more information about a layer */\n async describeLayer(\n options: WMSDescribeLayerParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<WMSLayerDescription> {\n const url = this.describeLayerURL(options, vendorParameters);\n const response = await this.fetch(url, this.loadOptions);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return await WMSLayerDescriptionLoader.parse(arrayBuffer, this.loadOptions);\n }\n\n /** Get an image with a semantic legend */\n async getLegendGraphic(\n options: WMSGetLegendGraphicParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<ImageType> {\n const url = this.getLegendGraphicURL(options, vendorParameters);\n const response = await this.fetch(url, this.loadOptions);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n try {\n return await ImageLoader.parse(arrayBuffer, this.loadOptions);\n } catch {\n throw this._parseError(arrayBuffer);\n }\n }\n\n // Typed URL creators\n // For applications that want full control of fetching and parsing\n\n /** Generate a URL for the GetCapabilities request */\n getCapabilitiesURL(\n wmsParameters?: WMSGetCapabilitiesParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSGetCapabilitiesParameters> = {\n service: 'WMS',\n version: '1.1.1',\n request: 'GetCapabilities',\n ...wmsParameters,\n ...vendorParameters\n };\n return this._getWMSUrl(options, vendorParameters);\n }\n\n /** Generate a URL for the GetMap request */\n getMapURL(\n wmsParameters: WMSGetMapParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSGetMapParameters> = {\n service: 'WMS',\n version: '1.1.1',\n request: 'GetMap',\n // layers: [],\n // bbox: [-77.87304, 40.78975, -77.85828, 40.80228],\n // width: 1200,\n // height: 900,\n styles: undefined,\n srs: 'EPSG:4326',\n format: 'image/png',\n ...wmsParameters,\n ...vendorParameters\n };\n return this._getWMSUrl(options, vendorParameters);\n }\n\n /** Generate a URL for the GetFeatureInfo request */\n getFeatureInfoURL(\n wmsParameters: WMSGetFeatureInfoParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSGetFeatureInfoParameters> = {\n service: 'WMS',\n version: '1.1.1',\n request: 'GetFeatureInfo',\n // layers: [],\n // bbox: [-77.87304, 40.78975, -77.85828, 40.80228],\n // width: 1200,\n // height: 900,\n // x: undefined!,\n // y: undefined!,\n // query_layers: [],\n srs: 'EPSG:4326',\n format: 'image/png',\n info_format: 'text/plain',\n styles: undefined,\n ...wmsParameters,\n ...vendorParameters\n };\n return this._getWMSUrl(options, vendorParameters);\n }\n\n /** Generate a URL for the GetFeatureInfo request */\n describeLayerURL(\n wmsParameters: WMSDescribeLayerParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSDescribeLayerParameters> = {\n service: 'WMS',\n version: '1.1.1',\n request: 'DescribeLayer',\n ...wmsParameters,\n ...vendorParameters\n };\n return this._getWMSUrl(options, vendorParameters);\n }\n\n getLegendGraphicURL(\n wmsParameters: WMSGetLegendGraphicParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSGetLegendGraphicParameters> = {\n service: 'WMS',\n version: '1.1.1',\n request: 'GetLegendGraphic',\n ...wmsParameters,\n ...vendorParameters\n };\n return this._getWMSUrl(options, vendorParameters);\n }\n\n // INTERNAL METHODS\n\n /**\n * @note case _getWMSUrl may need to be overridden to handle certain backends?\n * */\n protected _getWMSUrl(\n options: Record<string, unknown>,\n vendorParameters?: Record<string, unknown>\n ): string {\n let url = `${this.serviceUrl}`;\n let first = true;\n for (const [key, value] of Object.entries(options)) {\n url += first ? '?' : '&';\n first = false;\n if (Array.isArray(value)) {\n url += `${key.toUpperCase()}=${value.join(',')}`;\n } else {\n url += `${key.toUpperCase()}=${value ? String(value) : ''}`;\n }\n }\n return encodeURI(url);\n }\n\n /** Checks for and parses a WMS XML formatted ServiceError and throws an exception */\n protected _checkResponse(response: Response, arrayBuffer: ArrayBuffer): void {\n const contentType = response.headers['content-type'];\n if (!response.ok || WMSErrorLoader.mimeTypes.includes(contentType)) {\n const error = WMSErrorLoader.parseSync(arrayBuffer, this.loadOptions);\n throw new Error(error);\n }\n }\n\n /** Error situation detected */\n protected _parseError(arrayBuffer: ArrayBuffer): Error {\n const error = WMSErrorLoader.parseSync(arrayBuffer, this.loadOptions);\n return new Error(error);\n }\n}\n"],"mappings":";;AAKA,SAAQA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GAAG,IAAI;IAChB,KAAK,MAAM,CAACC,GAAG,EAAEC,KAAK,CAAC,IAAIrC,MAAM,CAACsC,OAAO,CAACrB,OAAO,CAAC,EAAE;MAClDN,GAAG,IAAIwB,KAAK,GAAG,GAAG,GAAG,GAAG;MACxBA,KAAK,GAAG,KAAK;MACb,IAAII,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC,EAAE;QACxB1B,GAAG,cAAOyB,GAAG,CAACK,WAAW,EAAE,cAAIJ,KAAK,CAACK,IAAI,CAAC,GAAG,CAAC,CAAE;MAClD,CAAC,MAAM;QACL/B,GAAG,cAAOyB,GAAG,CAACK,WAAW,EAAE,cAAIJ,KAAK,GAAGM,MAAM,CAACN,KAAK,CAAC,GAAG,EAAE,CAAE;MAC7D;IACF;IACA,OAAOO,SAAS,CAACjC,GAAG,CAAC;EACvB;;EAGUI,cAAc,CAACF,QAAkB,EAAEC,WAAwB,EAAQ;IAC3E,MAAM+B,WAAW,GAAGhC,QAAQ,CAACiC,OAAO,CAAC,cAAc,CAAC;IACpD,IAAI,CAACjC,QAAQ,CAACkC,EAAE,IAAItD,cAAc,CAACuD,SAAS,CAACC,QAAQ,CAACJ,WAAW,CAAC,EAAE;MAClE,MAAMK,KAAK,GAAGzD,cAAc,CAAC0D,SAAS,CAACrC,WAAW,EAAE,IAAI,CAACZ,WAAW,CAAC;MACrE,MAAM,IAAIkD,KAAK,CAACF,KAAK,CAAC;IACxB;EACF;;EAGU/B,WAAW,CAACL,WAAwB,EAAS;IACrD,MAAMoC,KAAK,GAAGzD,cAAc,CAAC0D,SAAS,CAACrC,WAAW,EAAE,IAAI,CAACZ,WAAW,CAAC;IACrE,OAAO,IAAIkD,KAAK,CAACF,KAAK,CAAC;EACzB;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"wms-service.d.ts","sourceRoot":"","sources":["../../../src/lib/data-sources/wms-service.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,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