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

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
@@ -2,7 +2,7 @@
2
2
  import { parseWCSCapabilities } from "./lib/wcs/parse-wcs-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.1" !== 'undefined' ? "4.4.0-alpha.1" : 'latest';
6
6
  /**
7
7
  * Loader for the response to the WCS GetCapability request
8
8
  */
@@ -3,7 +3,7 @@
3
3
  import { parseWMTSCapabilities } from "./lib/wmts/parse-wmts-capabilities.js";
4
4
  // __VERSION__ is injected by babel-plugin-version-inline
5
5
  // @ts-ignore TS2304: Cannot find name '__VERSION__'.
6
- const VERSION = typeof "4.3.1" !== 'undefined' ? "4.3.1" : 'latest';
6
+ const VERSION = typeof "4.4.0-alpha.1" !== 'undefined' ? "4.4.0-alpha.1" : 'latest';
7
7
  /**
8
8
  * Loader for the response to the WMTS GetCapability request
9
9
  */
@@ -4,7 +4,7 @@
4
4
  import { parseWMSCapabilities } from "./lib/parsers/wms/parse-wms-capabilities.js";
5
5
  // __VERSION__ is injected by babel-plugin-version-inline
6
6
  // @ts-ignore TS2304: Cannot find name '__VERSION__'.
7
- const VERSION = typeof "4.3.1" !== 'undefined' ? "4.3.1" : 'latest';
7
+ const VERSION = typeof "4.4.0-alpha.1" !== 'undefined' ? "4.4.0-alpha.1" : 'latest';
8
8
  /**
9
9
  * Loader for the response to the WMS GetCapability request
10
10
  */
@@ -4,7 +4,7 @@
4
4
  import { parseWMSError } from "./lib/parsers/wms/parse-wms-error.js";
5
5
  // __VERSION__ is injected by babel-plugin-version-inline
6
6
  // @ts-ignore TS2304: Cannot find name '__VERSION__'.
7
- const VERSION = typeof "4.3.1" !== 'undefined' ? "4.3.1" : 'latest';
7
+ const VERSION = typeof "4.4.0-alpha.1" !== 'undefined' ? "4.4.0-alpha.1" : 'latest';
8
8
  /**
9
9
  * Loader for the response to the WMS GetCapability request
10
10
  */
@@ -1,9 +1,20 @@
1
+ import type { DataSourceOptions, ImageSourceMetadata, GetImageParameters } from '@loaders.gl/loader-utils';
2
+ import { DataSource, ImageSource } from '@loaders.gl/loader-utils';
1
3
  import type { ImageType } from '@loaders.gl/images';
2
- import { ImageSource } from '@loaders.gl/loader-utils';
3
- import type { ImageSourceMetadata, GetImageParameters, ImageSourceProps } from '@loaders.gl/loader-utils';
4
- import type { WMSCapabilities } from "../../wms-capabilities-loader.js";
5
- import type { WMSFeatureInfo } from "../../wip/wms-feature-info-loader.js";
6
- import type { WMSLayerDescription } from "../../wip/wms-layer-description-loader.js";
4
+ import type { WMSCapabilities } from "./wms-capabilities-loader.js";
5
+ import type { WMSFeatureInfo } from "./wip/wms-feature-info-loader.js";
6
+ import type { WMSLayerDescription } from "./wip/wms-layer-description-loader.js";
7
+ /** Properties for creating a enw WMS service */
8
+ export type WMSSourceOptions = DataSourceOptions & {
9
+ wms?: {
10
+ /** In 1.3.0, replaces references to EPSG:4326 with CRS:84 */
11
+ substituteCRS84?: boolean;
12
+ /** Default WMS parameters. If not provided here, must be provided in the various request */
13
+ wmsParameters?: WMSParameters;
14
+ /** Any additional service specific parameters */
15
+ vendorParameters?: Record<string, unknown>;
16
+ };
17
+ };
7
18
  export declare const WMSSource: {
8
19
  readonly name: "Web Map Service (OGC WMS)";
9
20
  readonly id: "wms";
@@ -11,31 +22,14 @@ export declare const WMSSource: {
11
22
  readonly version: "0.0.0";
12
23
  readonly extensions: [];
13
24
  readonly mimeTypes: [];
14
- readonly options: {
15
- readonly wms: {};
16
- };
17
25
  readonly type: "wms";
18
26
  readonly fromUrl: true;
19
27
  readonly fromBlob: false;
20
- readonly testURL: (url: string) => boolean;
21
- readonly createDataSource: (url: string | Blob, props: WMSImageSourceProps) => WMSImageSource;
22
- };
23
- /** Properties for creating a enw WMS service */
24
- export type WMSImageSourceProps = ImageSourceProps & {
25
- /** @deprecated Use props.wms.substituteCRS84 */
26
- substituteCRS84?: boolean;
27
- /** @deprecated Use props.wms.wmsParameters */
28
- wmsParameters?: WMSParameters;
29
- /** @deprecated Use props.wms.vendorParameters */
30
- vendorParameters?: Record<string, unknown>;
31
- wms?: {
32
- /** In 1.3.0, replaces references to EPSG:4326 with CRS:84 */
33
- substituteCRS84?: boolean;
34
- /** Default WMS parameters. If not provided here, must be provided in the various request */
35
- wmsParameters?: WMSParameters;
36
- /** Any additional service specific parameters */
37
- vendorParameters?: Record<string, unknown>;
28
+ readonly defaultOptions: {
29
+ readonly wms: {};
38
30
  };
31
+ readonly testURL: (url: string) => boolean;
32
+ readonly createDataSource: (url: string | Blob, options: WMSSourceOptions) => WMSImageSource;
39
33
  };
40
34
  /**
41
35
  * "Static" WMS parameters (not viewport or selected pixel dependent)
@@ -154,10 +148,7 @@ export type WMSGetLegendGraphicParameters = {
154
148
  * - implements the ImageSource interface
155
149
  * @note Only the URL parameter conversion is supported. XML posts are not supported.
156
150
  */
157
- export declare class WMSImageSource extends ImageSource<WMSImageSourceProps> {
158
- /** Base URL to the service */
159
- readonly url: string;
160
- readonly data: string;
151
+ export declare class WMSImageSource extends DataSource<string, WMSSourceOptions> implements ImageSource {
161
152
  /** In WMS 1.3.0, replaces references to EPSG:4326 with CRS:84. But not always supported. Default: false */
162
153
  substituteCRS84: boolean;
163
154
  /** In WMS 1.3.0, flips x,y (lng, lat) coordinates for the supplied coordinate systems. Default: ['ESPG:4326'] */
@@ -168,7 +159,7 @@ export declare class WMSImageSource extends ImageSource<WMSImageSourceProps> {
168
159
  vendorParameters?: Record<string, unknown>;
169
160
  capabilities: WMSCapabilities | null;
170
161
  /** Create a WMSImageSource */
171
- constructor(url: string, props: WMSImageSourceProps);
162
+ constructor(url: string, options: WMSSourceOptions);
172
163
  getMetadata(): Promise<ImageSourceMetadata>;
173
164
  getImage(parameters: GetImageParameters): Promise<ImageType>;
174
165
  normalizeMetadata(capabilities: WMSCapabilities): ImageSourceMetadata;
@@ -220,4 +211,4 @@ export declare class WMSImageSource extends ImageSource<WMSImageSourceProps> {
220
211
  /** Error situation detected */
221
212
  protected _parseError(arrayBuffer: ArrayBuffer): Error;
222
213
  }
223
- //# sourceMappingURL=wms-service.d.ts.map
214
+ //# sourceMappingURL=wms-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wms-source.d.ts","sourceRoot":"","sources":["../src/wms-source.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAEV,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAC,UAAU,EAAE,WAAW,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nF,+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,12 @@
1
1
  // loaders.gl
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
+ import { DataSource, mergeOptions } from '@loaders.gl/loader-utils';
4
5
  import { ImageLoader } from '@loaders.gl/images';
5
- import { mergeLoaderOptions, ImageSource } from '@loaders.gl/loader-utils';
6
- import { WMSCapabilitiesLoader } from "../../wms-capabilities-loader.js";
7
- import { WMSFeatureInfoLoader } from "../../wip/wms-feature-info-loader.js";
8
- import { WMSLayerDescriptionLoader } from "../../wip/wms-layer-description-loader.js";
9
- import { WMSErrorLoader } from "../../wms-error-loader.js";
6
+ import { WMSCapabilitiesLoader } from "./wms-capabilities-loader.js";
7
+ import { WMSFeatureInfoLoader } from "./wip/wms-feature-info-loader.js";
8
+ import { WMSLayerDescriptionLoader } from "./wip/wms-layer-description-loader.js";
9
+ import { WMSErrorLoader } from "./wms-error-loader.js";
10
10
  export const WMSSource = {
11
11
  name: 'Web Map Service (OGC WMS)',
12
12
  id: 'wms',
@@ -14,16 +14,16 @@ export const WMSSource = {
14
14
  version: '0.0.0',
15
15
  extensions: [],
16
16
  mimeTypes: [],
17
- options: {
17
+ type: 'wms',
18
+ fromUrl: true,
19
+ fromBlob: false,
20
+ defaultOptions: {
18
21
  wms: {
19
22
  // TODO - add options here
20
23
  }
21
24
  },
22
- type: 'wms',
23
- fromUrl: true,
24
- fromBlob: false,
25
25
  testURL: (url) => url.toLowerCase().includes('wms'),
26
- createDataSource: (url, props) => new WMSImageSource(url, props)
26
+ createDataSource: (url, options) => new WMSImageSource(url, options)
27
27
  };
28
28
  //
29
29
  /**
@@ -33,10 +33,7 @@ export const WMSSource = {
33
33
  * - implements the ImageSource interface
34
34
  * @note Only the URL parameter conversion is supported. XML posts are not supported.
35
35
  */
36
- export class WMSImageSource extends ImageSource {
37
- /** Base URL to the service */
38
- url;
39
- data;
36
+ export class WMSImageSource extends DataSource {
40
37
  /** In WMS 1.3.0, replaces references to EPSG:4326 with CRS:84. But not always supported. Default: false */
41
38
  substituteCRS84;
42
39
  /** In WMS 1.3.0, flips x,y (lng, lat) coordinates for the supplied coordinate systems. Default: ['ESPG:4326'] */
@@ -47,14 +44,12 @@ export class WMSImageSource extends ImageSource {
47
44
  vendorParameters;
48
45
  capabilities = null;
49
46
  /** Create a WMSImageSource */
50
- constructor(url, props) {
51
- super(props);
47
+ constructor(url, options) {
48
+ super(url, options, WMSSource.defaultOptions);
52
49
  // TODO - defaults such as version, layers etc could be extracted from a base URL with parameters
53
50
  // This would make pasting in any WMS URL more likely to make this class just work.
54
- // const {baseUrl, parameters} = this._parseWMSUrl(props.url);
55
- this.url = url;
56
- this.data = url;
57
- this.substituteCRS84 = props.wms?.substituteCRS84 ?? props.substituteCRS84 ?? false;
51
+ // const {baseUrl, parameters} = this._parseWMSUrl(options.url);
52
+ this.substituteCRS84 = options.wms?.substituteCRS84 ?? false;
58
53
  this.flipCRS = ['EPSG:4326'];
59
54
  this.wmsParameters = {
60
55
  layers: undefined,
@@ -67,10 +62,10 @@ export class WMSImageSource extends ImageSource {
67
62
  transparent: undefined,
68
63
  time: undefined,
69
64
  elevation: undefined,
70
- ...props.wmsParameters, // deprecated
71
- ...props.wms?.wmsParameters
65
+ ...options.wmsParameters, // deprecated
66
+ ...options.wms?.wmsParameters
72
67
  };
73
- this.vendorParameters = props.wms?.vendorParameters || props.vendorParameters || {};
68
+ this.vendorParameters = options.wms?.vendorParameters || options.vendorParameters || {};
74
69
  }
75
70
  // ImageSource implementation
76
71
  async getMetadata() {
@@ -345,7 +340,7 @@ export class WMSImageSource extends ImageSource {
345
340
  const contentType = response.headers['content-type'];
346
341
  if (!response.ok || WMSErrorLoader.mimeTypes.includes(contentType)) {
347
342
  // We want error responses to throw exceptions, the WMSErrorLoader can do this
348
- const loadOptions = mergeLoaderOptions(this.loadOptions, {
343
+ const loadOptions = mergeOptions(this.loadOptions, {
349
344
  wms: { throwOnError: true }
350
345
  });
351
346
  const error = WMSErrorLoader.parseSync?.(arrayBuffer, loadOptions);
@@ -354,7 +349,7 @@ export class WMSImageSource extends ImageSource {
354
349
  }
355
350
  /** Error situation detected */
356
351
  _parseError(arrayBuffer) {
357
- const error = WMSErrorLoader.parseSync?.(arrayBuffer, this.loadOptions);
352
+ const error = WMSErrorLoader.parseSync?.(arrayBuffer, this.options.core?.loadOptions);
358
353
  return new Error(error);
359
354
  }
360
355
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/wms",
3
- "version": "4.3.2",
3
+ "version": "4.4.0-alpha.2",
4
4
  "description": "Framework-independent loaders for the WMS (Web Map Service) standard",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -50,15 +50,15 @@
50
50
  "path": false
51
51
  },
52
52
  "dependencies": {
53
- "@loaders.gl/images": "4.3.2",
54
- "@loaders.gl/loader-utils": "4.3.2",
55
- "@loaders.gl/schema": "4.3.2",
56
- "@loaders.gl/xml": "4.3.2",
53
+ "@loaders.gl/images": "4.4.0-alpha.2",
54
+ "@loaders.gl/loader-utils": "4.4.0-alpha.2",
55
+ "@loaders.gl/schema": "4.4.0-alpha.2",
56
+ "@loaders.gl/xml": "4.4.0-alpha.2",
57
57
  "@turf/rewind": "^5.1.5",
58
58
  "deep-strict-equal": "^0.2.0"
59
59
  },
60
60
  "peerDependencies": {
61
- "@loaders.gl/core": "^4.3.0"
61
+ "@loaders.gl/core": "4.4.0-alpha.1"
62
62
  },
63
- "gitHead": "b4203b8703f64a38d6f79a3113bc7bb51d45c93a"
63
+ "gitHead": "3d9fed050eabdc0812ddf2f4d5fb9914a34ee0c2"
64
64
  }
@@ -2,14 +2,15 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
- import {Schema, GeoJSONTable} from '@loaders.gl/schema';
5
+ import type {Schema, GeoJSONTable} from '@loaders.gl/schema';
6
6
  import type {
7
- VectorSourceProps,
7
+ DataSourceOptions,
8
8
  VectorSourceMetadata,
9
9
  GetFeaturesParameters,
10
+ VectorSource,
10
11
  LoaderWithParser
11
12
  } from '@loaders.gl/loader-utils';
12
- import {Source, VectorSource} from '@loaders.gl/loader-utils';
13
+ import {Source, DataSource} from '@loaders.gl/loader-utils';
13
14
 
14
15
  const TEST_SERVICE =
15
16
  'https://services2.arcgis.com/CcI36Pduqd0OR4W9/ArcGIS/rest/services/Bicycle_Routes_Public/FeatureServer/0';
@@ -34,74 +35,9 @@ export type ArcGISImageServiceQueryOptions = {
34
35
  f?: 'geojson'; // TODO - look up valid values in Esri docs
35
36
  };
36
37
 
37
- // const DEFAULT_QUERY_OPTIONS: Required<ArcGISImageServiceQueryOptions> = {
38
- // returnGeometry:true,
39
- // where: '1%3D1',
40
- // outSR: 4326,
41
- // outFields: '*',
42
- // inSR: 4326,
43
- // geometry: `${-90}%2C+${30}%2C+${-70}%2C+${50}`,
44
- // geometryType: 'esriGeometryEnvelope',
45
- // spatialRel: 'esriSpatialRelIntersects',
46
- // geometryPrecision: 6,
47
- // resultType: 'tile',
48
- // f: 'geojson'
49
- // };
50
-
51
- // export type ArcGISFeatureServiceProps = ArcGISImageServiceQueryOptions & {
52
- // url: string;
53
- // loadOptions?: LoaderOptions;
54
- // fetch?: typeof fetch | FetchLike;
55
- // };
56
-
57
- // export class ArcGISFeatureService {
58
- // url: string;
59
- // loadOptions: LoaderOptions;
60
- // fetch: typeof fetch | FetchLike;
61
-
62
- // constructor(props: ArcGISFeatureServiceProps) {
63
- // this.url = props.url;
64
- // this.loadOptions = props.loadOptions || {};
65
- // this.fetch = props.fetch || fetch;
66
- // }
67
-
68
- // // URL creators
69
-
70
- // metadataURL(options: {parameters?: Record<string, unknown>}): string {
71
- // return this.getUrl({...options});
72
- // }
73
-
74
- // /**
75
- // * Form a URL to an ESRI FeatureServer
76
- // // https://services2.arcgis.com/CcI36Pduqd0OR4W9/ArcGIS/rest/services/Bicycle_Routes_Public/FeatureServer/0/query?
77
- // // returnGeometry=true&where=1%3D1&outSR=4326&outFields=*&inSR=4326&geometry=${-90}%2C+${30}%2C+${-70}%2C+${50}&
78
- // // geometryType=esriGeometryEnvelope&spatialRel=esriSpatialRelIntersects&geometryPrecision=6&resultType=tile&f=geojson`
79
- // */
80
- // exportImageURL(options: {
81
- // boundingBox: [number, number, number, number];
82
- // boundingBoxSR?: string;
83
- // width: number;
84
- // height: number;
85
- // imageSR?: string;
86
- // time?: never;
87
- // f?: 'geojson';
88
- // resultType?: 'tile';
89
- // noData?: never;
90
- // noDataInterpretation?: 'esriNoDataMatchAny';
91
- // interpolation?: '+RSP_NearestNeighbor';
92
- // compression?: never
93
- // compressionQuality?: never;
94
- // bandIds?: never;
95
- // mosaicRule?: never;
96
- // renderingRule?: never;
97
- // f?: 'image';
98
- // }): string {
99
- // const {boundingBox} = options;
100
- // // const bbox = `bbox=${boundingBox[0]},${boundingBox[1]},${boundingBox[2]},${boundingBox[3]}`;
101
- // // const size = `size=${width},${height}`
102
- // return this.getUrl({path: 'exportImage', });
103
- // }
104
- // }
38
+ export type ArcGIFeatureServerSourceOptions = DataSourceOptions & {
39
+ 'arcgis-feature-server'?: {};
40
+ };
105
41
 
106
42
  /**
107
43
  * @ndeprecated This is a WIP, not fully implemented
@@ -114,42 +50,33 @@ export const ArcGISFeatureServerSource = {
114
50
  version: '0.0.0',
115
51
  extensions: [],
116
52
  mimeTypes: [],
117
- options: {
118
- url: undefined!,
119
- 'arcgis-feature-server': {
120
- /** Tabular loaders, normally the GeoJSONLoader */
121
- loaders: []
122
- }
123
- },
124
-
125
53
  type: 'arcgis-feature-server',
126
54
  fromUrl: true,
127
55
  fromBlob: false,
128
56
 
57
+ defaultOptions: {
58
+ url: undefined!,
59
+ 'arcgis-feature-server': {}
60
+ },
61
+
129
62
  testURL: (url: string): boolean => url.toLowerCase().includes('FeatureServer'),
130
- createDataSource: (url, props: ArcGISVectorSourceProps): ArcGISVectorSource =>
131
- new ArcGISVectorSource(props)
132
- } as const satisfies Source<ArcGISVectorSource, ArcGISVectorSourceProps>;
133
-
134
- export type ArcGISVectorSourceProps = VectorSourceProps & {
135
- url: string;
136
- 'arcgis-feature-server'?: {
137
- loaders: LoaderWithParser[];
138
- };
139
- };
63
+ createDataSource: (url: string, options: ArcGIFeatureServerSourceOptions): ArcGISVectorSource =>
64
+ new ArcGISVectorSource(url, options)
65
+ } as const satisfies Source<ArcGISVectorSource>;
140
66
 
141
67
  /**
142
68
  * ArcGIS ImageServer
143
69
  * Note - exports a big API, that could be exposed here if there is a use case
144
70
  * @see https://developers.arcgis.com/rest/services-reference/enterprise/feature-service.htm
145
71
  */
146
- export class ArcGISVectorSource extends VectorSource<ArcGISVectorSourceProps> {
147
- data: string;
72
+ export class ArcGISVectorSource
73
+ extends DataSource<string, ArcGIFeatureServerSourceOptions>
74
+ implements VectorSource
75
+ {
148
76
  protected formatSpecificMetadata: Promise<any>;
149
77
 
150
- constructor(props: ArcGISVectorSourceProps) {
151
- super(props);
152
- this.data = props.url;
78
+ constructor(url: string, options: ArcGIFeatureServerSourceOptions) {
79
+ super(url, options, ArcGISFeatureServerSource.defaultOptions);
153
80
  this.formatSpecificMetadata = this._getFormatSpecificMetadata();
154
81
  }
155
82
 
@@ -177,7 +104,7 @@ export class ArcGISVectorSource extends VectorSource<ArcGISVectorSourceProps> {
177
104
  const response = await this.fetch(url);
178
105
  const arrayBuffer = await response.arrayBuffer();
179
106
  // TODO - hack - done to avoid pulling in selectLoader from core
180
- const loader = this.props['arcgis-feature-server']?.loaders?.[0];
107
+ const loader = this.options.core?.loaders?.[0] as LoaderWithParser;
181
108
  const table = loader?.parse(arrayBuffer);
182
109
  return table;
183
110
  }
@@ -241,7 +168,7 @@ export class ArcGISVectorSource extends VectorSource<ArcGISVectorSourceProps> {
241
168
  // URL creators
242
169
 
243
170
  metadataURL(options: {parameters?: Record<string, unknown>}): string {
244
- return `${this.props.url}?f=pjson`;
171
+ return `${this.options.url}?f=pjson`;
245
172
  }
246
173
 
247
174
  /**
@@ -293,7 +220,7 @@ export class ArcGISVectorSource extends VectorSource<ArcGISVectorSourceProps> {
293
220
  options: Record<string, unknown>,
294
221
  extra?: Record<string, unknown>
295
222
  ): string {
296
- let url = `${this.props.url}/${path}`;
223
+ let url = `${this.options.url}/${path}`;
297
224
  let first = true;
298
225
  for (const [key, value] of Object.entries(options)) {
299
226
  url += first ? '?' : '&';
@@ -329,6 +256,75 @@ function parseArcGISFeatureServerMetadata(json: any): VectorSourceMetadata {
329
256
  };
330
257
  }
331
258
 
259
+ // const DEFAULT_QUERY_OPTIONS: Required<ArcGISImageServiceQueryOptions> = {
260
+ // returnGeometry:true,
261
+ // where: '1%3D1',
262
+ // outSR: 4326,
263
+ // outFields: '*',
264
+ // inSR: 4326,
265
+ // geometry: `${-90}%2C+${30}%2C+${-70}%2C+${50}`,
266
+ // geometryType: 'esriGeometryEnvelope',
267
+ // spatialRel: 'esriSpatialRelIntersects',
268
+ // geometryPrecision: 6,
269
+ // resultType: 'tile',
270
+ // f: 'geojson'
271
+ // };
272
+
273
+ // export type ArcGISFeatureServiceProps = ArcGISImageServiceQueryOptions & {
274
+ // url: string;
275
+ // loadOptions?: LoaderOptions;
276
+ // fetch?: typeof fetch | FetchLike;
277
+ // };
278
+
279
+ // export class ArcGISFeatureService {
280
+ // url: string;
281
+ // loadOptions: LoaderOptions;
282
+ // fetch: typeof fetch | FetchLike;
283
+
284
+ // constructor(options: ArcGISFeatureServiceProps) {
285
+ // this.url = options.url;
286
+ // this.loadOptions = options.loadOptions || {};
287
+ // this.fetch = options.fetch || fetch;
288
+ // }
289
+
290
+ // // URL creators
291
+
292
+ // metadataURL(options: {parameters?: Record<string, unknown>}): string {
293
+ // return this.getUrl({...options});
294
+ // }
295
+
296
+ // /**
297
+ // * Form a URL to an ESRI FeatureServer
298
+ // // https://services2.arcgis.com/CcI36Pduqd0OR4W9/ArcGIS/rest/services/Bicycle_Routes_Public/FeatureServer/0/query?
299
+ // // returnGeometry=true&where=1%3D1&outSR=4326&outFields=*&inSR=4326&geometry=${-90}%2C+${30}%2C+${-70}%2C+${50}&
300
+ // // geometryType=esriGeometryEnvelope&spatialRel=esriSpatialRelIntersects&geometryPrecision=6&resultType=tile&f=geojson`
301
+ // */
302
+ // exportImageURL(options: {
303
+ // boundingBox: [number, number, number, number];
304
+ // boundingBoxSR?: string;
305
+ // width: number;
306
+ // height: number;
307
+ // imageSR?: string;
308
+ // time?: never;
309
+ // f?: 'geojson';
310
+ // resultType?: 'tile';
311
+ // noData?: never;
312
+ // noDataInterpretation?: 'esriNoDataMatchAny';
313
+ // interpolation?: '+RSP_NearestNeighbor';
314
+ // compression?: never
315
+ // compressionQuality?: never;
316
+ // bandIds?: never;
317
+ // mosaicRule?: never;
318
+ // renderingRule?: never;
319
+ // f?: 'image';
320
+ // }): string {
321
+ // const {boundingBox} = options;
322
+ // // const bbox = `bbox=${boundingBox[0]},${boundingBox[1]},${boundingBox[2]},${boundingBox[3]}`;
323
+ // // const size = `size=${width},${height}`
324
+ // return this.getUrl({path: 'exportImage', });
325
+ // }
326
+ // }
327
+
332
328
  /** Sample metadata
333
329
  * @see https://developers.arcgis.com/rest/services-reference/enterprise/feature-service.htm
334
330
  */
@@ -5,14 +5,17 @@
5
5
  import type {ImageType} from '@loaders.gl/images';
6
6
  import type {
7
7
  Source,
8
- ImageSourceProps,
8
+ DataSourceOptions,
9
9
  ImageSourceMetadata,
10
10
  GetImageParameters
11
11
  } from '@loaders.gl/loader-utils';
12
- import {ImageSource} from '@loaders.gl/loader-utils';
12
+ import {DataSource, ImageSource} from '@loaders.gl/loader-utils';
13
13
 
14
- // import type {ImageSourceProps} from '@loaders.gl/loader-utils';
15
- // import {ImageSource} from '@loaders.gl/loader-utils';
14
+ export type ArcGISImageSourceProps = DataSourceOptions & {
15
+ 'arcgis-image-server'?: {
16
+ // TODO - add options here
17
+ };
18
+ };
16
19
 
17
20
  export const ArcGISImageServerSource = {
18
21
  name: 'ArcGISImageServer',
@@ -21,40 +24,32 @@ export const ArcGISImageServerSource = {
21
24
  version: '0.0.0',
22
25
  extensions: [],
23
26
  mimeTypes: [],
24
- options: {
27
+ type: 'arcgis-image-server',
28
+ fromUrl: true,
29
+ fromBlob: false,
30
+
31
+ defaultOptions: {
25
32
  'arcgis-image-server': {
26
33
  // TODO - add options here
27
34
  }
28
35
  },
29
36
 
30
- type: 'arcgis-image-server',
31
- fromUrl: true,
32
- fromBlob: false,
33
-
34
37
  testURL: (url: string): boolean => url.toLowerCase().includes('ImageServer'),
35
38
  createDataSource: (url, props: ArcGISImageSourceProps): ArcGISImageSource =>
36
39
  new ArcGISImageSource(url as string, props)
37
- } as const satisfies Source<ArcGISImageSource, ArcGISImageSourceProps>;
38
-
39
- export type ArcGISImageSourceProps = ImageSourceProps & {
40
- 'arcgis-image-server'?: {
41
- // TODO - add options here
42
- };
43
- };
40
+ } as const satisfies Source<ArcGISImageSource>;
44
41
 
45
42
  /**
46
43
  * ArcGIS ImageServer
47
44
  * Note - exports a big API, that could be exposed here if there is a use case
48
45
  * @see https://developers.arcgis.com/rest/services-reference/enterprise/image-service.htm
49
46
  */
50
- export class ArcGISImageSource extends ImageSource<ArcGISImageSourceProps> {
51
- url: string;
52
- data: string;
53
-
47
+ export class ArcGISImageSource
48
+ extends DataSource<string, ArcGISImageSourceProps>
49
+ implements ImageSource
50
+ {
54
51
  constructor(url: string, props: ArcGISImageSourceProps) {
55
- super(props);
56
- this.url = url;
57
- this.data = url;
52
+ super(url, props, ArcGISImageServerSource.defaultOptions);
58
53
  }
59
54
 
60
55
  // ImageSource (normalized endpoints)