@loaders.gl/wms 4.3.2 → 4.4.0-alpha.1

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 (50) hide show
  1. package/dist/{services/arcgis/arcgis-feature-server.d.ts → arcgis/arcgis-feature-source.d.ts} +14 -21
  2. package/dist/arcgis/arcgis-feature-source.d.ts.map +1 -0
  3. package/dist/{services/arcgis/arcgis-feature-server.js → arcgis/arcgis-feature-source.js} +74 -79
  4. package/dist/{services/arcgis/arcgis-image-server.d.ts → arcgis/arcgis-image-source.d.ts} +10 -12
  5. package/dist/arcgis/arcgis-image-source.d.ts.map +1 -0
  6. package/dist/{services/arcgis/arcgis-image-server.js → arcgis/arcgis-image-source.js} +7 -13
  7. package/dist/arcgis/arcgis-server.d.ts.map +1 -0
  8. package/dist/csw-capabilities-loader.js +1 -1
  9. package/dist/csw-domain-loader.js +1 -1
  10. package/dist/csw-records-loader.js +1 -1
  11. package/dist/{services/ogc/csw-service.d.ts → csw-source.d.ts} +40 -26
  12. package/dist/csw-source.d.ts.map +1 -0
  13. package/dist/{services/ogc/csw-service.js → csw-source.js} +44 -32
  14. package/dist/gml-loader.js +1 -1
  15. package/dist/index.cjs +36 -45
  16. package/dist/index.cjs.map +3 -3
  17. package/dist/index.d.ts +3 -4
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +4 -5
  20. package/dist/lib/deprecated/create-image-source.d.ts +12 -8
  21. package/dist/lib/deprecated/create-image-source.d.ts.map +1 -1
  22. package/dist/lib/deprecated/create-image-source.js +6 -6
  23. package/dist/wfs-capabilities-loader.js +1 -1
  24. package/dist/{services/ogc/wfs-service.d.ts → wfs-source.d.ts} +43 -52
  25. package/dist/wfs-source.d.ts.map +1 -0
  26. package/dist/{services/ogc/wfs-service.js → wfs-source.js} +74 -106
  27. package/dist/wip/wcs-capabilities-loader.js +1 -1
  28. package/dist/wip/wmts-capabilities-loader.js +1 -1
  29. package/dist/wms-capabilities-loader.js +1 -1
  30. package/dist/wms-error-loader.js +1 -1
  31. package/dist/{services/ogc/wms-service.d.ts → wms-source.d.ts} +23 -32
  32. package/dist/wms-source.d.ts.map +1 -0
  33. package/dist/{services/ogc/wms-service.js → wms-source.js} +20 -25
  34. package/package.json +7 -7
  35. package/src/{services/arcgis/arcgis-feature-server.ts → arcgis/arcgis-feature-source.ts} +93 -97
  36. package/src/{services/arcgis/arcgis-image-server.ts → arcgis/arcgis-image-source.ts} +18 -23
  37. package/src/{services/ogc/csw-service.ts → csw-source.ts} +56 -41
  38. package/src/index.ts +4 -6
  39. package/src/lib/deprecated/create-image-source.ts +22 -18
  40. package/src/{services/ogc/wfs-service.ts → wfs-source.ts} +93 -133
  41. package/src/{services/ogc/wms-service.ts → wms-source.ts} +44 -56
  42. package/dist/services/arcgis/arcgis-feature-server.d.ts.map +0 -1
  43. package/dist/services/arcgis/arcgis-image-server.d.ts.map +0 -1
  44. package/dist/services/arcgis/arcgis-server.d.ts.map +0 -1
  45. package/dist/services/ogc/csw-service.d.ts.map +0 -1
  46. package/dist/services/ogc/wfs-service.d.ts.map +0 -1
  47. package/dist/services/ogc/wms-service.d.ts.map +0 -1
  48. /package/dist/{services/arcgis → arcgis}/arcgis-server.d.ts +0 -0
  49. /package/dist/{services/arcgis → arcgis}/arcgis-server.js +0 -0
  50. /package/src/{services/arcgis → arcgis}/arcgis-server.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"create-image-source.d.ts","sourceRoot":"","sources":["../../../src/lib/deprecated/create-image-source.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAE,WAAW,EAAE,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AACpF,OAAO,KAAK,EAAC,mBAAmB,EAAC,0CAAuC;AAIxE,kBAAkB;AAClB,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,qBAAqB,GAAG,UAAU,CAAC;AAI1E;;GAEG;AACH,KAAK,sBAAsB,GAAG,gBAAgB,GAC5C,mBAAmB,GAAG;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAAC;CAClC,CAAC;AAEJ;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,EAAE,OAAO,mHAAU,GAAG,WAAW,CAS/F"}
1
+ {"version":3,"file":"create-image-source.d.ts","sourceRoot":"","sources":["../../../src/lib/deprecated/create-image-source.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAE,yBAAyB,EAAE,iBAAiB,EAAC,MAAM,0BAA0B,CAAC;AACnG,OAAO,KAAK,EAAC,gBAAgB,EAAC,4BAAyB;AAIvD,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,qBAAqB,GAAG,UAAU,CAAC;AAIzE;;GAEG;AACH,KAAK,wBAAwB,GAAG,iBAAiB,GAC/C,gBAAgB,GAAG;IACjB,IAAI,CAAC,EAAE,eAAe,GAAG,MAAM,CAAC;CACjC,CAAC;AAEJ;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,SAAS,MAAM,EAAE,EAAE,OAAO,EAAE;IACxE,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,GAAG,CAAC;IACjB,OAAO,EAAE,QAAQ,CAAC,wBAAwB,CAAC,CAAC;IAC5C,OAAO,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;CAC7B,GAAG,yBAAyB,CAAC,YAAY,CAAC,CAS1C"}
@@ -1,8 +1,8 @@
1
1
  // loaders.gl
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
- import { WMSSource } from "../../services/ogc/wms-service.js";
5
- import { ArcGISImageServerSource } from "../../services/arcgis/arcgis-image-server.js";
4
+ import { WMSSource } from "../../wms-source.js";
5
+ import { ArcGISImageServerSource } from "../../arcgis/arcgis-image-source.js";
6
6
  const SOURCES = [WMSSource, ArcGISImageServerSource];
7
7
  /**
8
8
  * Creates an image source
@@ -13,13 +13,13 @@ const SOURCES = [WMSSource, ArcGISImageServerSource];
13
13
  *
14
14
  * @deprecated Use createDataSource from @loaders.gl/core
15
15
  */
16
- export function createImageSource(props, sources = SOURCES) {
17
- const { type = 'auto' } = props;
18
- const source = type === 'auto' ? guessSourceType(props.url, sources) : getSourceOfType(type, sources);
16
+ export function createImageSource(options) {
17
+ const { type = 'auto', url, sources = SOURCES, loadOptions } = options;
18
+ const source = type === 'auto' ? guessSourceType(url, sources) : getSourceOfType(type, sources);
19
19
  if (!source) {
20
20
  throw new Error('Not a valid image source type');
21
21
  }
22
- return source.createDataSource(props.url, props);
22
+ return source.createDataSource(url, { core: { loadOptions } });
23
23
  }
24
24
  /** Guess service type from URL */
25
25
  function getSourceOfType(type, sources) {
@@ -2,7 +2,7 @@
2
2
  import { parseWFSCapabilities } from "./lib/parsers/wfs/parse-wfs-capabilities.js";
3
3
  // __VERSION__ is injected by babel-plugin-version-inline
4
4
  // @ts-ignore TS2304: Cannot find name '__VERSION__'.
5
- const VERSION = typeof "4.3.1" !== 'undefined' ? "4.3.1" : 'latest';
5
+ const VERSION = typeof "4.4.0-alpha.0" !== 'undefined' ? "4.4.0-alpha.0" : 'latest';
6
6
  /**
7
7
  * Loader for the response to the WFS GetCapability request
8
8
  * @deprecated Warning: this loader is still experimental and incomplete
@@ -1,9 +1,20 @@
1
- import { Schema, GeoJSONTable } from '@loaders.gl/schema';
2
- import type { VectorSourceProps, VectorSourceMetadata, LoaderWithParser, GetFeaturesParameters } from '@loaders.gl/loader-utils';
3
- import { VectorSource } from '@loaders.gl/loader-utils';
4
- import type { WFSCapabilities } from "../../wfs-capabilities-loader.js";
1
+ import type { Schema, GeoJSONTable } from '@loaders.gl/schema';
2
+ import type { DataSourceOptions, VectorSourceMetadata, GetFeaturesParameters } from '@loaders.gl/loader-utils';
3
+ import { DataSource, VectorSource } from '@loaders.gl/loader-utils';
4
+ import type { WFSCapabilities } from "./wfs-capabilities-loader.js";
5
+ /** Properties for creating a enw WFS service */
6
+ export type WFSourceOptions = DataSourceOptions & {
7
+ wfs?: {
8
+ /** In 1.3.0, replaces references to EPSG:4326 with CRS:84 */
9
+ substituteCRS84?: boolean;
10
+ /** Default WFS parameters. If not provided here, must be provided in the various request */
11
+ wfsParameters?: WFSParameters;
12
+ /** Any additional service specific parameters */
13
+ vendorParameters?: Record<string, unknown>;
14
+ };
15
+ };
5
16
  /**
6
- * @ndeprecated This is a WIP, not fully implemented
17
+ * @deprecated This is a WIP, not fully implemented
7
18
  * @see https://developers.arcgis.com/rest/services-reference/enterprise/feature-service.htm
8
19
  */
9
20
  export declare const WFSSource: {
@@ -13,31 +24,14 @@ export declare const WFSSource: {
13
24
  readonly version: "0.0.0";
14
25
  readonly extensions: [];
15
26
  readonly mimeTypes: [];
16
- readonly options: {
17
- readonly url: never;
18
- readonly wfs: {
19
- /** Tabular loaders, normally the GeoJSONLoader */
20
- readonly loaders: [];
21
- };
22
- };
23
27
  readonly type: "wfs";
24
28
  readonly fromUrl: true;
25
29
  readonly fromBlob: false;
26
- readonly testURL: (url: string) => boolean;
27
- readonly createDataSource: (url: string | Blob, props: WFSVectorSourceProps) => WFSVectorSource;
28
- };
29
- /** Properties for creating a enw WFS service */
30
- export type WFSVectorSourceProps = VectorSourceProps & {
31
- url: string;
32
- wfs?: {
33
- loaders: LoaderWithParser[];
34
- /** In 1.3.0, replaces references to EPSG:4326 with CRS:84 */
35
- substituteCRS84?: boolean;
36
- /** Default WFS parameters. If not provided here, must be provided in the various request */
37
- wmsParameters?: WFSParameters;
38
- /** Any additional service specific parameters */
39
- vendorParameters?: Record<string, unknown>;
30
+ readonly defaultOptions: {
31
+ readonly wfs: {};
40
32
  };
33
+ readonly testURL: (url: string) => boolean;
34
+ readonly createDataSource: (url: string, options: WFSourceOptions) => WFSVectorSource;
41
35
  };
42
36
  /**
43
37
  * "Static" WFS parameters (not viewport or selected pixel dependent)
@@ -156,27 +150,24 @@ export type WFSGetLegendGraphicParameters = {
156
150
  * - implements the VectorSource interface
157
151
  * @note Only the URL parameter conversion is supported. XML posts are not supported.
158
152
  */
159
- export declare class WFSVectorSource extends VectorSource<WFSVectorSourceProps> {
160
- /** Base URL to the service */
161
- readonly url: string;
162
- readonly data: string;
153
+ export declare class WFSVectorSource extends DataSource<string, WFSourceOptions> implements VectorSource {
163
154
  /** Default static vendor parameters */
164
155
  vendorParameters?: Record<string, unknown>;
165
156
  capabilities: WFSCapabilities | null;
166
157
  /** Create a WFSVectorSource */
167
- constructor(props: WFSVectorSourceProps);
158
+ constructor(data: string, options: WFSourceOptions);
168
159
  getSchema(): Promise<Schema>;
169
160
  getMetadata(): Promise<VectorSourceMetadata>;
170
161
  getFeatures(parameters: GetFeaturesParameters): Promise<GeoJSONTable>;
171
162
  normalizeMetadata(capabilities: WFSCapabilities): VectorSourceMetadata;
172
163
  /** Get Capabilities */
173
- getCapabilities(wmsParameters?: WFSGetCapabilitiesParameters, vendorParameters?: Record<string, unknown>): Promise<WFSCapabilities>;
164
+ getCapabilities(wfsParameters?: WFSGetCapabilitiesParameters, vendorParameters?: Record<string, unknown>): Promise<WFSCapabilities>;
174
165
  /** Get a map image *
175
166
  async getMap(
176
- wmsParameters: WFSGetMapParameters,
167
+ wfsParameters: WFSGetMapParameters,
177
168
  vendorParameters?: Record<string, unknown>
178
169
  ): Promise<ImageType> {
179
- const url = this.getMapURL(wmsParameters, vendorParameters);
170
+ const url = this.getMapURL(wfsParameters, vendorParameters);
180
171
  const response = await this.fetch(url);
181
172
  const arrayBuffer = await response.arrayBuffer();
182
173
  this._checkResponse(response, arrayBuffer);
@@ -189,10 +180,10 @@ export declare class WFSVectorSource extends VectorSource<WFSVectorSourceProps>
189
180
 
190
181
  /** Get Feature Info for a coordinate *
191
182
  async getFeatureInfo(
192
- wmsParameters: WFSGetFeatureInfoParameters,
183
+ wfsParameters: WFSGetFeatureInfoParameters,
193
184
  vendorParameters?: Record<string, unknown>
194
185
  ): Promise<WFSFeatureInfo> {
195
- const url = this.getFeatureInfoURL(wmsParameters, vendorParameters);
186
+ const url = this.getFeatureInfoURL(wfsParameters, vendorParameters);
196
187
  const response = await this.fetch(url);
197
188
  const arrayBuffer = await response.arrayBuffer();
198
189
  this._checkResponse(response, arrayBuffer);
@@ -201,10 +192,10 @@ export declare class WFSVectorSource extends VectorSource<WFSVectorSourceProps>
201
192
 
202
193
  /** Get Feature Info for a coordinate *
203
194
  async getFeatureInfoText(
204
- wmsParameters: WFSGetFeatureInfoParameters,
195
+ wfsParameters: WFSGetFeatureInfoParameters,
205
196
  vendorParameters?: Record<string, unknown>
206
197
  ): Promise<string> {
207
- const url = this.getFeatureInfoURL(wmsParameters, vendorParameters);
198
+ const url = this.getFeatureInfoURL(wfsParameters, vendorParameters);
208
199
  const response = await this.fetch(url);
209
200
  const arrayBuffer = await response.arrayBuffer();
210
201
  this._checkResponse(response, arrayBuffer);
@@ -213,10 +204,10 @@ export declare class WFSVectorSource extends VectorSource<WFSVectorSourceProps>
213
204
 
214
205
  /** Get more information about a layer *
215
206
  async describeLayer(
216
- wmsParameters: WFSDescribeLayerParameters,
207
+ wfsParameters: WFSDescribeLayerParameters,
217
208
  vendorParameters?: Record<string, unknown>
218
209
  ): Promise<WFSLayerDescription> {
219
- const url = this.describeLayerURL(wmsParameters, vendorParameters);
210
+ const url = this.describeLayerURL(wfsParameters, vendorParameters);
220
211
  const response = await this.fetch(url);
221
212
  const arrayBuffer = await response.arrayBuffer();
222
213
  this._checkResponse(response, arrayBuffer);
@@ -225,10 +216,10 @@ export declare class WFSVectorSource extends VectorSource<WFSVectorSourceProps>
225
216
 
226
217
  /** Get an image with a semantic legend *
227
218
  async getLegendGraphic(
228
- wmsParameters: WFSGetLegendGraphicParameters,
219
+ wfsParameters: WFSGetLegendGraphicParameters,
229
220
  vendorParameters?: Record<string, unknown>
230
221
  ): Promise<ImageType> {
231
- const url = this.getLegendGraphicURL(wmsParameters, vendorParameters);
222
+ const url = this.getLegendGraphicURL(wfsParameters, vendorParameters);
232
223
  const response = await this.fetch(url);
233
224
  const arrayBuffer = await response.arrayBuffer();
234
225
  this._checkResponse(response, arrayBuffer);
@@ -240,14 +231,14 @@ export declare class WFSVectorSource extends VectorSource<WFSVectorSourceProps>
240
231
  }
241
232
  */
242
233
  /** Generate a URL for the GetCapabilities request */
243
- getCapabilitiesURL(wmsParameters?: WFSGetCapabilitiesParameters, vendorParameters?: Record<string, unknown>): string;
234
+ getCapabilitiesURL(wfsParameters?: WFSGetCapabilitiesParameters, vendorParameters?: Record<string, unknown>): string;
244
235
  /** Generate a URL for the GetMap request */
245
- getMapURL(wmsParameters: WFSGetMapParameters, vendorParameters?: Record<string, unknown>): string;
236
+ getMapURL(wfsParameters: WFSGetMapParameters, vendorParameters?: Record<string, unknown>): string;
246
237
  /** Generate a URL for the GetFeatureInfo request */
247
- getFeatureInfoURL(wmsParameters: WFSGetFeatureInfoParameters, vendorParameters?: Record<string, unknown>): string;
238
+ getFeatureInfoURL(wfsParameters: WFSGetFeatureInfoParameters, vendorParameters?: Record<string, unknown>): string;
248
239
  /** Generate a URL for the GetFeatureInfo request */
249
- describeLayerURL(wmsParameters: WFSDescribeLayerParameters, vendorParameters?: Record<string, unknown>): string;
250
- getLegendGraphicURL(wmsParameters: WFSGetLegendGraphicParameters, vendorParameters?: Record<string, unknown>): string;
240
+ describeLayerURL(wfsParameters: WFSDescribeLayerParameters, vendorParameters?: Record<string, unknown>): string;
241
+ getLegendGraphicURL(wfsParameters: WFSGetLegendGraphicParameters, vendorParameters?: Record<string, unknown>): string;
251
242
  _parseWFSUrl(url: string): {
252
243
  url: string;
253
244
  parameters: Record<string, unknown>;
@@ -257,17 +248,17 @@ export declare class WFSVectorSource extends VectorSource<WFSVectorSourceProps>
257
248
  * @note case _getWFSUrl may need to be overridden to handle certain backends?
258
249
  * @note at the moment, only URLs with parameters are supported (no XML payloads)
259
250
  * */
260
- protected _getWFSUrl(request: string, wmsParameters: {
251
+ protected _getWFSUrl(request: string, wfsParameters: {
261
252
  version?: '1.3.0' | '1.1.1';
262
253
  [key: string]: unknown;
263
254
  }, vendorParameters?: Record<string, unknown>): string;
264
255
  _getWFS130Parameters<ParametersT extends {
265
256
  crs?: string;
266
257
  srs?: string;
267
- }>(wmsParameters: ParametersT): ParametersT;
268
- _getURLParameter(key: string, value: unknown, wmsParameters: WFSParameters): string;
258
+ }>(wfsParameters: ParametersT): ParametersT;
259
+ _getURLParameter(key: string, value: unknown, wfsParameters: WFSParameters): string;
269
260
  /** Coordinate order is flipped for certain CRS in WFS 1.3.0 */
270
- _flipBoundingBox(bboxValue: unknown, wmsParameters: WFSParameters): [number, number, number, number] | null;
261
+ _flipBoundingBox(bboxValue: unknown, wfsParameters: WFSParameters): [number, number, number, number] | null;
271
262
  /** Fetches an array buffer and checks the response (boilerplate reduction) */
272
263
  protected _fetchArrayBuffer(url: string): Promise<ArrayBuffer>;
273
264
  /** Checks for and parses a WFS XML formatted ServiceError and throws an exception */
@@ -275,4 +266,4 @@ export declare class WFSVectorSource extends VectorSource<WFSVectorSourceProps>
275
266
  /** Error situation detected */
276
267
  protected _parseError(arrayBuffer: ArrayBuffer): Error;
277
268
  }
278
- //# sourceMappingURL=wfs-service.d.ts.map
269
+ //# sourceMappingURL=wfs-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wfs-source.d.ts","sourceRoot":"","sources":["../src/wfs-source.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAE,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EACV,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAS,UAAU,EAAE,YAAY,EAAe,MAAM,0BAA0B,CAAC;AAExF,OAAO,KAAK,EAAC,eAAe,EAAC,qCAAkC;AAQ/D,gDAAgD;AAChD,MAAM,MAAM,eAAe,GAAG,iBAAiB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C,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAC,EACnE,aAAa,EAAE,WAAW,GACzB,WAAW;IAUd,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,GAAG,MAAM;IAwDnF,+DAA+D;IAC/D,gBAAgB,CACd,SAAS,EAAE,OAAO,EAClB,aAAa,EAAE,aAAa,GAC3B,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IAkB1C,8EAA8E;cAC9D,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAOpE,qFAAqF;IACrF,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,GAAG,IAAI;IAY5E,+BAA+B;IAC/B,SAAS,CAAC,WAAW,CAAC,WAAW,EAAE,WAAW,GAAG,KAAK;CAIvD"}
@@ -1,12 +1,11 @@
1
1
  // loaders.gl
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
- import { VectorSource, mergeLoaderOptions } from '@loaders.gl/loader-utils';
5
- import { WFSCapabilitiesLoader } from "../../wfs-capabilities-loader.js";
6
- import { WMSErrorLoader } from "../../wms-error-loader.js";
7
- /* eslint-disable camelcase */ // WFS XML parameters use snake_case
4
+ import { DataSource, mergeOptions } from '@loaders.gl/loader-utils';
5
+ import { WFSCapabilitiesLoader } from "./wfs-capabilities-loader.js";
6
+ import { WMSErrorLoader } from "./wms-error-loader.js";
8
7
  /**
9
- * @ndeprecated This is a WIP, not fully implemented
8
+ * @deprecated This is a WIP, not fully implemented
10
9
  * @see https://developers.arcgis.com/rest/services-reference/enterprise/feature-service.htm
11
10
  */
12
11
  export const WFSSource = {
@@ -16,18 +15,14 @@ export const WFSSource = {
16
15
  version: '0.0.0',
17
16
  extensions: [],
18
17
  mimeTypes: [],
19
- options: {
20
- url: undefined,
21
- wfs: {
22
- /** Tabular loaders, normally the GeoJSONLoader */
23
- loaders: []
24
- }
25
- },
26
18
  type: 'wfs',
27
19
  fromUrl: true,
28
20
  fromBlob: false,
21
+ defaultOptions: {
22
+ wfs: {}
23
+ },
29
24
  testURL: (url) => url.toLowerCase().includes('wfs'),
30
- createDataSource: (url, props) => new WFSVectorSource(props)
25
+ createDataSource: (url, options) => new WFSVectorSource(url, options)
31
26
  };
32
27
  //
33
28
  /**
@@ -37,43 +32,16 @@ export const WFSSource = {
37
32
  * - implements the VectorSource interface
38
33
  * @note Only the URL parameter conversion is supported. XML posts are not supported.
39
34
  */
40
- export class WFSVectorSource extends VectorSource {
41
- /** Base URL to the service */
42
- url;
43
- data;
44
- // /** In WFS 1.3.0, replaces references to EPSG:4326 with CRS:84. But not always supported. Default: false */
45
- // substituteCRS84: boolean;
46
- // /** In WFS 1.3.0, flips x,y (lng, lat) coordinates for the supplied coordinate systems. Default: ['ESPG:4326'] */
47
- // flipCRS: string[];
48
- // /** Default static WFS parameters */
49
- // wmsParameters: Required<WFSParameters>;
35
+ export class WFSVectorSource extends DataSource {
50
36
  /** Default static vendor parameters */
51
37
  vendorParameters;
52
38
  capabilities = null;
53
39
  /** Create a WFSVectorSource */
54
- constructor(props) {
55
- super(props);
40
+ constructor(data, options) {
41
+ super(data, options, WFSSource.defaultOptions);
56
42
  // TODO - defaults such as version, layers etc could be extracted from a base URL with parameters
57
43
  // This would make pasting in any WFS URL more likely to make this class just work.
58
- // const {baseUrl, parameters} = this._parseWFSUrl(props.url);
59
- this.url = props.url;
60
- this.data = props.url;
61
- // this.substituteCRS84 = props.substituteCRS84 ?? false;
62
- // this.flipCRS = ['EPSG:4326'];
63
- // this.wmsParameters = {
64
- // layers: undefined!,
65
- // query_layers: undefined!,
66
- // styles: undefined,
67
- // version: '1.3.0',
68
- // crs: 'EPSG:4326',
69
- // format: 'image/png',
70
- // info_format: 'text/plain',
71
- // transparent: undefined!,
72
- // time: undefined!,
73
- // elevation: undefined!,
74
- // ...props.wmsParameters
75
- // };
76
- // this.vendorParameters = props.vendorParameters || {};
44
+ // const {baseUrl, parameters} = this._parseWFSUrl(options.url);
77
45
  }
78
46
  async getSchema() {
79
47
  return { metadata: {}, fields: [] };
@@ -86,7 +54,7 @@ export class WFSVectorSource extends VectorSource {
86
54
  async getFeatures(parameters) {
87
55
  // Replace the GetImage `boundingBox` parameter with the WFS flat `bbox` parameter.
88
56
  // const {boundingBox, bbox, ...rest} = parameters;
89
- // const wmsParameters: WFSGetMapParameters = {
57
+ // const wfsParameters: WFSGetMapParameters = {
90
58
  // bbox: boundingBox ? [...boundingBox[0], ...boundingBox[1]] : bbox!,
91
59
  // ...rest
92
60
  // };
@@ -97,8 +65,8 @@ export class WFSVectorSource extends VectorSource {
97
65
  }
98
66
  // WFS Service API Stubs
99
67
  /** Get Capabilities */
100
- async getCapabilities(wmsParameters, vendorParameters) {
101
- const url = this.getCapabilitiesURL(wmsParameters, vendorParameters);
68
+ async getCapabilities(wfsParameters, vendorParameters) {
69
+ const url = this.getCapabilitiesURL(wfsParameters, vendorParameters);
102
70
  const response = await this.fetch(url);
103
71
  const arrayBuffer = await response.arrayBuffer();
104
72
  this._checkResponse(response, arrayBuffer);
@@ -108,10 +76,10 @@ export class WFSVectorSource extends VectorSource {
108
76
  }
109
77
  /** Get a map image *
110
78
  async getMap(
111
- wmsParameters: WFSGetMapParameters,
79
+ wfsParameters: WFSGetMapParameters,
112
80
  vendorParameters?: Record<string, unknown>
113
81
  ): Promise<ImageType> {
114
- const url = this.getMapURL(wmsParameters, vendorParameters);
82
+ const url = this.getMapURL(wfsParameters, vendorParameters);
115
83
  const response = await this.fetch(url);
116
84
  const arrayBuffer = await response.arrayBuffer();
117
85
  this._checkResponse(response, arrayBuffer);
@@ -124,10 +92,10 @@ export class WFSVectorSource extends VectorSource {
124
92
 
125
93
  /** Get Feature Info for a coordinate *
126
94
  async getFeatureInfo(
127
- wmsParameters: WFSGetFeatureInfoParameters,
95
+ wfsParameters: WFSGetFeatureInfoParameters,
128
96
  vendorParameters?: Record<string, unknown>
129
97
  ): Promise<WFSFeatureInfo> {
130
- const url = this.getFeatureInfoURL(wmsParameters, vendorParameters);
98
+ const url = this.getFeatureInfoURL(wfsParameters, vendorParameters);
131
99
  const response = await this.fetch(url);
132
100
  const arrayBuffer = await response.arrayBuffer();
133
101
  this._checkResponse(response, arrayBuffer);
@@ -136,10 +104,10 @@ export class WFSVectorSource extends VectorSource {
136
104
 
137
105
  /** Get Feature Info for a coordinate *
138
106
  async getFeatureInfoText(
139
- wmsParameters: WFSGetFeatureInfoParameters,
107
+ wfsParameters: WFSGetFeatureInfoParameters,
140
108
  vendorParameters?: Record<string, unknown>
141
109
  ): Promise<string> {
142
- const url = this.getFeatureInfoURL(wmsParameters, vendorParameters);
110
+ const url = this.getFeatureInfoURL(wfsParameters, vendorParameters);
143
111
  const response = await this.fetch(url);
144
112
  const arrayBuffer = await response.arrayBuffer();
145
113
  this._checkResponse(response, arrayBuffer);
@@ -148,10 +116,10 @@ export class WFSVectorSource extends VectorSource {
148
116
 
149
117
  /** Get more information about a layer *
150
118
  async describeLayer(
151
- wmsParameters: WFSDescribeLayerParameters,
119
+ wfsParameters: WFSDescribeLayerParameters,
152
120
  vendorParameters?: Record<string, unknown>
153
121
  ): Promise<WFSLayerDescription> {
154
- const url = this.describeLayerURL(wmsParameters, vendorParameters);
122
+ const url = this.describeLayerURL(wfsParameters, vendorParameters);
155
123
  const response = await this.fetch(url);
156
124
  const arrayBuffer = await response.arrayBuffer();
157
125
  this._checkResponse(response, arrayBuffer);
@@ -160,10 +128,10 @@ export class WFSVectorSource extends VectorSource {
160
128
 
161
129
  /** Get an image with a semantic legend *
162
130
  async getLegendGraphic(
163
- wmsParameters: WFSGetLegendGraphicParameters,
131
+ wfsParameters: WFSGetLegendGraphicParameters,
164
132
  vendorParameters?: Record<string, unknown>
165
133
  ): Promise<ImageType> {
166
- const url = this.getLegendGraphicURL(wmsParameters, vendorParameters);
134
+ const url = this.getLegendGraphicURL(wfsParameters, vendorParameters);
167
135
  const response = await this.fetch(url);
168
136
  const arrayBuffer = await response.arrayBuffer();
169
137
  this._checkResponse(response, arrayBuffer);
@@ -177,74 +145,74 @@ export class WFSVectorSource extends VectorSource {
177
145
  // Typed URL creators
178
146
  // For applications that want full control of fetching and parsing
179
147
  /** Generate a URL for the GetCapabilities request */
180
- getCapabilitiesURL(wmsParameters, vendorParameters) {
148
+ getCapabilitiesURL(wfsParameters, vendorParameters) {
181
149
  // @ts-expect-error
182
150
  const options = {
183
- // version: this.wmsParameters.version,
184
- ...wmsParameters
151
+ // version: this.wfsParameters.version,
152
+ ...wfsParameters
185
153
  };
186
154
  return this._getWFSUrl('GetCapabilities', options, vendorParameters);
187
155
  }
188
156
  /** Generate a URL for the GetMap request */
189
- getMapURL(wmsParameters, vendorParameters) {
190
- wmsParameters = this._getWFS130Parameters(wmsParameters);
157
+ getMapURL(wfsParameters, vendorParameters) {
158
+ wfsParameters = this._getWFS130Parameters(wfsParameters);
191
159
  // @ts-expect-error
192
160
  const options = {
193
- // version: this.wmsParameters.version,
194
- // format: this.wmsParameters.format,
195
- // transparent: this.wmsParameters.transparent,
196
- // time: this.wmsParameters.time,
197
- // elevation: this.wmsParameters.elevation,
198
- // layers: this.wmsParameters.layers,
199
- // styles: this.wmsParameters.styles,
200
- // crs: this.wmsParameters.crs,
161
+ // version: this.wfsParameters.version,
162
+ // format: this.wfsParameters.format,
163
+ // transparent: this.wfsParameters.transparent,
164
+ // time: this.wfsParameters.time,
165
+ // elevation: this.wfsParameters.elevation,
166
+ // layers: this.wfsParameters.layers,
167
+ // styles: this.wfsParameters.styles,
168
+ // crs: this.wfsParameters.crs,
201
169
  // bbox: [-77.87304, 40.78975, -77.85828, 40.80228],
202
170
  // width: 1200,
203
171
  // height: 900,
204
- ...wmsParameters
172
+ ...wfsParameters
205
173
  };
206
174
  return this._getWFSUrl('GetMap', options, vendorParameters);
207
175
  }
208
176
  /** Generate a URL for the GetFeatureInfo request */
209
- getFeatureInfoURL(wmsParameters, vendorParameters) {
210
- wmsParameters = this._getWFS130Parameters(wmsParameters);
177
+ getFeatureInfoURL(wfsParameters, vendorParameters) {
178
+ wfsParameters = this._getWFS130Parameters(wfsParameters);
211
179
  // Replace the GetImage `boundingBox` parameter with the WFS flat `bbox` parameter.
212
- const { boundingBox, bbox } = wmsParameters;
213
- wmsParameters.bbox = boundingBox ? [...boundingBox[0], ...boundingBox[1]] : bbox;
180
+ const { boundingBox, bbox } = wfsParameters;
181
+ wfsParameters.bbox = boundingBox ? [...boundingBox[0], ...boundingBox[1]] : bbox;
214
182
  // @ts-expect-error
215
183
  const options = {
216
- // version: this.wmsParameters.version,
184
+ // version: this.wfsParameters.version,
217
185
  // // query_layers: [],
218
- // // format: this.wmsParameters.format,
219
- // info_format: this.wmsParameters.info_format,
220
- // layers: this.wmsParameters.layers,
221
- // query_layers: this.wmsParameters.query_layers,
222
- // styles: this.wmsParameters.styles,
223
- // crs: this.wmsParameters.crs,
186
+ // // format: this.wfsParameters.format,
187
+ // info_format: this.wfsParameters.info_format,
188
+ // layers: this.wfsParameters.layers,
189
+ // query_layers: this.wfsParameters.query_layers,
190
+ // styles: this.wfsParameters.styles,
191
+ // crs: this.wfsParameters.crs,
224
192
  // bbox: [-77.87304, 40.78975, -77.85828, 40.80228],
225
193
  // width: 1200,
226
194
  // height: 900,
227
195
  // x: undefined!,
228
196
  // y: undefined!,
229
- ...wmsParameters
197
+ ...wfsParameters
230
198
  };
231
199
  return this._getWFSUrl('GetFeatureInfo', options, vendorParameters);
232
200
  }
233
201
  /** Generate a URL for the GetFeatureInfo request */
234
- describeLayerURL(wmsParameters, vendorParameters) {
202
+ describeLayerURL(wfsParameters, vendorParameters) {
235
203
  // @ts-expect-error
236
204
  const options = {
237
- // version: this.wmsParameters.version,
238
- ...wmsParameters
205
+ // version: this.wfsParameters.version,
206
+ ...wfsParameters
239
207
  };
240
208
  return this._getWFSUrl('DescribeLayer', options, vendorParameters);
241
209
  }
242
- getLegendGraphicURL(wmsParameters, vendorParameters) {
210
+ getLegendGraphicURL(wfsParameters, vendorParameters) {
243
211
  // @ts-expect-error
244
212
  const options = {
245
- // version: this.wmsParameters.version,
213
+ // version: this.wfsParameters.version,
246
214
  // format?
247
- ...wmsParameters
215
+ ...wfsParameters
248
216
  };
249
217
  return this._getWFSUrl('GetLegendGraphic', options, vendorParameters);
250
218
  }
@@ -264,15 +232,15 @@ export class WFSVectorSource extends VectorSource {
264
232
  * @note case _getWFSUrl may need to be overridden to handle certain backends?
265
233
  * @note at the moment, only URLs with parameters are supported (no XML payloads)
266
234
  * */
267
- _getWFSUrl(request, wmsParameters, vendorParameters) {
235
+ _getWFSUrl(request, wfsParameters, vendorParameters) {
268
236
  let url = this.url;
269
237
  let first = true;
270
238
  // Add any vendor searchParams
271
239
  const allParameters = {
272
240
  service: 'WFS',
273
- version: wmsParameters.version,
241
+ version: wfsParameters.version,
274
242
  request,
275
- ...wmsParameters,
243
+ ...wfsParameters,
276
244
  ...this.vendorParameters,
277
245
  ...vendorParameters
278
246
  };
@@ -283,13 +251,13 @@ export class WFSVectorSource extends VectorSource {
283
251
  if (!IGNORE_EMPTY_KEYS.includes(key) || value) {
284
252
  url += first ? '?' : '&';
285
253
  first = false;
286
- url += this._getURLParameter(key, value, wmsParameters);
254
+ url += this._getURLParameter(key, value, wfsParameters);
287
255
  }
288
256
  }
289
257
  return encodeURI(url);
290
258
  }
291
- _getWFS130Parameters(wmsParameters) {
292
- const newParameters = { ...wmsParameters };
259
+ _getWFS130Parameters(wfsParameters) {
260
+ const newParameters = { ...wfsParameters };
293
261
  if (newParameters.srs) {
294
262
  newParameters.crs = newParameters.crs || newParameters.srs;
295
263
  delete newParameters.srs;
@@ -297,12 +265,12 @@ export class WFSVectorSource extends VectorSource {
297
265
  return newParameters;
298
266
  }
299
267
  // eslint-disable-next-line complexity
300
- _getURLParameter(key, value, wmsParameters) {
268
+ _getURLParameter(key, value, wfsParameters) {
301
269
  // Substitute by key
302
270
  switch (key) {
303
271
  case 'crs':
304
272
  // CRS was called SRS before WFS 1.3.0
305
- if (wmsParameters.version !== '1.3.0') {
273
+ if (wfsParameters.version !== '1.3.0') {
306
274
  key = 'srs';
307
275
  // } else if (this.substituteCRS84 && value === 'EPSG:4326') {
308
276
  // /** In 1.3.0, replaces references to 'EPSG:4326' with the new backwards compatible CRS:84 */
@@ -312,13 +280,13 @@ export class WFSVectorSource extends VectorSource {
312
280
  break;
313
281
  case 'srs':
314
282
  // CRS was called SRS before WFS 1.3.0
315
- if (wmsParameters.version === '1.3.0') {
283
+ if (wfsParameters.version === '1.3.0') {
316
284
  key = 'crs';
317
285
  }
318
286
  break;
319
287
  case 'bbox':
320
288
  // Coordinate order is flipped for certain CRS in WFS 1.3.0
321
- const bbox = this._flipBoundingBox(value, wmsParameters);
289
+ const bbox = this._flipBoundingBox(value, wfsParameters);
322
290
  if (bbox) {
323
291
  value = bbox;
324
292
  }
@@ -326,14 +294,14 @@ export class WFSVectorSource extends VectorSource {
326
294
  case 'x':
327
295
  // i is the parameter used in WFS 1.3
328
296
  // TODO - change parameter to `i` and convert to `x` if not 1.3
329
- if (wmsParameters.version === '1.3.0') {
297
+ if (wfsParameters.version === '1.3.0') {
330
298
  key = 'i';
331
299
  }
332
300
  break;
333
301
  case 'y':
334
302
  // j is the parameter used in WFS 1.3
335
303
  // TODO - change parameter to `j` and convert to `y` if not 1.3
336
- if (wmsParameters.version === '1.3.0') {
304
+ if (wfsParameters.version === '1.3.0') {
337
305
  key = 'j';
338
306
  }
339
307
  break;
@@ -346,18 +314,18 @@ export class WFSVectorSource extends VectorSource {
346
314
  : `${key}=${value ? String(value) : ''}`;
347
315
  }
348
316
  /** Coordinate order is flipped for certain CRS in WFS 1.3.0 */
349
- _flipBoundingBox(bboxValue, wmsParameters) {
317
+ _flipBoundingBox(bboxValue, wfsParameters) {
350
318
  // Sanity checks
351
319
  if (!Array.isArray(bboxValue) || bboxValue.length !== 4) {
352
320
  return null;
353
321
  }
354
322
  const flipCoordinates = false;
355
323
  // // Only affects WFS 1.3.0
356
- // wmsParameters.version === '1.3.0' &&
324
+ // wfsParameters.version === '1.3.0' &&
357
325
  // // Flip if we are dealing with a CRS that was flipped in 1.3.0
358
- // this.flipCRS.includes(wmsParameters.crs || '') &&
326
+ // this.flipCRS.includes(wfsParameters.crs || '') &&
359
327
  // // Don't flip if we are substituting EPSG:4326 with CRS:84
360
- // !(this.substituteCRS84 && wmsParameters.crs === 'EPSG:4326');
328
+ // !(this.substituteCRS84 && wfsParameters.crs === 'EPSG:4326');
361
329
  const bbox = bboxValue;
362
330
  return flipCoordinates ? [bbox[1], bbox[0], bbox[3], bbox[2]] : bbox;
363
331
  }
@@ -373,7 +341,7 @@ export class WFSVectorSource extends VectorSource {
373
341
  const contentType = response.headers['content-type'];
374
342
  if (!response.ok || WMSErrorLoader.mimeTypes.includes(contentType)) {
375
343
  // We want error responses to throw exceptions, the WMSErrorLoader can do this
376
- const loadOptions = mergeLoaderOptions(this.loadOptions, {
344
+ const loadOptions = mergeOptions(this.loadOptions, {
377
345
  wms: { throwOnError: true }
378
346
  });
379
347
  const error = WMSErrorLoader.parseSync?.(arrayBuffer, loadOptions);