@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
@@ -1,6 +1,6 @@
1
- import { Schema, GeoJSONTable } from '@loaders.gl/schema';
2
- import type { VectorSourceProps, VectorSourceMetadata, GetFeaturesParameters, LoaderWithParser } from '@loaders.gl/loader-utils';
3
- import { VectorSource } from '@loaders.gl/loader-utils';
1
+ import type { Schema, GeoJSONTable } from '@loaders.gl/schema';
2
+ import type { DataSourceOptions, VectorSourceMetadata, GetFeaturesParameters, VectorSource } from '@loaders.gl/loader-utils';
3
+ import { DataSource } from '@loaders.gl/loader-utils';
4
4
  export type ArcGISImageServiceQueryOptions = {
5
5
  returnGeometry: boolean;
6
6
  where: '1%3D1';
@@ -14,6 +14,9 @@ export type ArcGISImageServiceQueryOptions = {
14
14
  resultType: 'tile';
15
15
  f?: 'geojson';
16
16
  };
17
+ export type ArcGIFeatureServerSourceOptions = DataSourceOptions & {
18
+ 'arcgis-feature-server'?: {};
19
+ };
17
20
  /**
18
21
  * @ndeprecated This is a WIP, not fully implemented
19
22
  * @see https://developers.arcgis.com/rest/services-reference/enterprise/feature-service.htm
@@ -25,34 +28,24 @@ export declare const ArcGISFeatureServerSource: {
25
28
  readonly version: "0.0.0";
26
29
  readonly extensions: [];
27
30
  readonly mimeTypes: [];
28
- readonly options: {
29
- readonly url: never;
30
- readonly 'arcgis-feature-server': {
31
- /** Tabular loaders, normally the GeoJSONLoader */
32
- readonly loaders: [];
33
- };
34
- };
35
31
  readonly type: "arcgis-feature-server";
36
32
  readonly fromUrl: true;
37
33
  readonly fromBlob: false;
38
- readonly testURL: (url: string) => boolean;
39
- readonly createDataSource: (url: string | Blob, props: ArcGISVectorSourceProps) => ArcGISVectorSource;
40
- };
41
- export type ArcGISVectorSourceProps = VectorSourceProps & {
42
- url: string;
43
- 'arcgis-feature-server'?: {
44
- loaders: LoaderWithParser[];
34
+ readonly defaultOptions: {
35
+ readonly url: never;
36
+ readonly 'arcgis-feature-server': {};
45
37
  };
38
+ readonly testURL: (url: string) => boolean;
39
+ readonly createDataSource: (url: string, options: ArcGIFeatureServerSourceOptions) => ArcGISVectorSource;
46
40
  };
47
41
  /**
48
42
  * ArcGIS ImageServer
49
43
  * Note - exports a big API, that could be exposed here if there is a use case
50
44
  * @see https://developers.arcgis.com/rest/services-reference/enterprise/feature-service.htm
51
45
  */
52
- export declare class ArcGISVectorSource extends VectorSource<ArcGISVectorSourceProps> {
53
- data: string;
46
+ export declare class ArcGISVectorSource extends DataSource<string, ArcGIFeatureServerSourceOptions> implements VectorSource {
54
47
  protected formatSpecificMetadata: Promise<any>;
55
- constructor(props: ArcGISVectorSourceProps);
48
+ constructor(url: string, options: ArcGIFeatureServerSourceOptions);
56
49
  /** TODO - not yet clear if we can find schema information in the FeatureServer metadata or if we need to request a feature */
57
50
  getSchema(): Promise<Schema>;
58
51
  getMetadata(options: {
@@ -64,4 +57,4 @@ export declare class ArcGISVectorSource extends VectorSource<ArcGISVectorSourceP
64
57
  /** Sample metadata
65
58
  * @see https://developers.arcgis.com/rest/services-reference/enterprise/feature-service.htm
66
59
  */
67
- //# sourceMappingURL=arcgis-feature-server.d.ts.map
60
+ //# sourceMappingURL=arcgis-feature-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arcgis-feature-source.d.ts","sourceRoot":"","sources":["../../src/arcgis/arcgis-feature-source.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAE,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EACV,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,YAAY,EAEb,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAS,UAAU,EAAC,MAAM,0BAA0B,CAAC;AAW5D,MAAM,MAAM,8BAA8B,GAAG;IAC3C,cAAc,EAAE,OAAO,CAAC;IACxB,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,IAAI,CAAC;IACZ,SAAS,EAAE,MAAM,GAAG,GAAG,CAAC;IACxB,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC;IAC/C,YAAY,EAAE,sBAAsB,CAAC;IACrC,UAAU,EAAE,0BAA0B,CAAC;IACvC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,CAAC,CAAC,EAAE,SAAS,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,iBAAiB,GAAG;IAChE,uBAAuB,CAAC,EAAE,EAAE,CAAC;CAC9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;4BAgBrB,MAAM,KAAG,OAAO;qCACP,MAAM,WAAW,+BAA+B,KAAG,kBAAkB;CAEhD,CAAC;AAEhD;;;;GAIG;AACH,qBAAa,kBACX,SAAQ,UAAU,CAAC,MAAM,EAAE,+BAA+B,CAC1D,YAAW,YAAY;IAEvB,SAAS,CAAC,sBAAsB,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;gBAEnC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,+BAA+B;IAKjE,8HAA8H;IACxH,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;IAK5B,WAAW,CAAC,OAAO,EAAE;QAAC,sBAAsB,MAAA;KAAC,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAa7E,WAAW,CAAC,UAAU,EAAE,qBAAqB,GAAG,OAAO,CAAC,YAAY,CAAC;cAY3D,0BAA0B;CAM3C;AAgND;;GAEG"}
@@ -1,73 +1,11 @@
1
1
  // loaders.gl
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
- import { VectorSource } from '@loaders.gl/loader-utils';
4
+ import { DataSource } from '@loaders.gl/loader-utils';
5
5
  const TEST_SERVICE = 'https://services2.arcgis.com/CcI36Pduqd0OR4W9/ArcGIS/rest/services/Bicycle_Routes_Public/FeatureServer/0';
6
6
  const TEST_QUERY =
7
7
  // eslint-disable-next-line no-template-curly-in-string
8
8
  'query?returnGeometry=true&where=1%3D1&outSR=4326&outFields=*&inSR=4326&geometry=${-90}%2C+${30}%2C+${-70}%2C+${50}&geometryType=esriGeometryEnvelope&spatialRel=esriSpatialRelIntersects&geometryPrecision=6&resultType=tile&f=geojson';
9
- // const DEFAULT_QUERY_OPTIONS: Required<ArcGISImageServiceQueryOptions> = {
10
- // returnGeometry:true,
11
- // where: '1%3D1',
12
- // outSR: 4326,
13
- // outFields: '*',
14
- // inSR: 4326,
15
- // geometry: `${-90}%2C+${30}%2C+${-70}%2C+${50}`,
16
- // geometryType: 'esriGeometryEnvelope',
17
- // spatialRel: 'esriSpatialRelIntersects',
18
- // geometryPrecision: 6,
19
- // resultType: 'tile',
20
- // f: 'geojson'
21
- // };
22
- // export type ArcGISFeatureServiceProps = ArcGISImageServiceQueryOptions & {
23
- // url: string;
24
- // loadOptions?: LoaderOptions;
25
- // fetch?: typeof fetch | FetchLike;
26
- // };
27
- // export class ArcGISFeatureService {
28
- // url: string;
29
- // loadOptions: LoaderOptions;
30
- // fetch: typeof fetch | FetchLike;
31
- // constructor(props: ArcGISFeatureServiceProps) {
32
- // this.url = props.url;
33
- // this.loadOptions = props.loadOptions || {};
34
- // this.fetch = props.fetch || fetch;
35
- // }
36
- // // URL creators
37
- // metadataURL(options: {parameters?: Record<string, unknown>}): string {
38
- // return this.getUrl({...options});
39
- // }
40
- // /**
41
- // * Form a URL to an ESRI FeatureServer
42
- // // https://services2.arcgis.com/CcI36Pduqd0OR4W9/ArcGIS/rest/services/Bicycle_Routes_Public/FeatureServer/0/query?
43
- // // returnGeometry=true&where=1%3D1&outSR=4326&outFields=*&inSR=4326&geometry=${-90}%2C+${30}%2C+${-70}%2C+${50}&
44
- // // geometryType=esriGeometryEnvelope&spatialRel=esriSpatialRelIntersects&geometryPrecision=6&resultType=tile&f=geojson`
45
- // */
46
- // exportImageURL(options: {
47
- // boundingBox: [number, number, number, number];
48
- // boundingBoxSR?: string;
49
- // width: number;
50
- // height: number;
51
- // imageSR?: string;
52
- // time?: never;
53
- // f?: 'geojson';
54
- // resultType?: 'tile';
55
- // noData?: never;
56
- // noDataInterpretation?: 'esriNoDataMatchAny';
57
- // interpolation?: '+RSP_NearestNeighbor';
58
- // compression?: never
59
- // compressionQuality?: never;
60
- // bandIds?: never;
61
- // mosaicRule?: never;
62
- // renderingRule?: never;
63
- // f?: 'image';
64
- // }): string {
65
- // const {boundingBox} = options;
66
- // // const bbox = `bbox=${boundingBox[0]},${boundingBox[1]},${boundingBox[2]},${boundingBox[3]}`;
67
- // // const size = `size=${width},${height}`
68
- // return this.getUrl({path: 'exportImage', });
69
- // }
70
- // }
71
9
  /**
72
10
  * @ndeprecated This is a WIP, not fully implemented
73
11
  * @see https://developers.arcgis.com/rest/services-reference/enterprise/feature-service.htm
@@ -79,30 +17,25 @@ export const ArcGISFeatureServerSource = {
79
17
  version: '0.0.0',
80
18
  extensions: [],
81
19
  mimeTypes: [],
82
- options: {
83
- url: undefined,
84
- 'arcgis-feature-server': {
85
- /** Tabular loaders, normally the GeoJSONLoader */
86
- loaders: []
87
- }
88
- },
89
20
  type: 'arcgis-feature-server',
90
21
  fromUrl: true,
91
22
  fromBlob: false,
23
+ defaultOptions: {
24
+ url: undefined,
25
+ 'arcgis-feature-server': {}
26
+ },
92
27
  testURL: (url) => url.toLowerCase().includes('FeatureServer'),
93
- createDataSource: (url, props) => new ArcGISVectorSource(props)
28
+ createDataSource: (url, options) => new ArcGISVectorSource(url, options)
94
29
  };
95
30
  /**
96
31
  * ArcGIS ImageServer
97
32
  * Note - exports a big API, that could be exposed here if there is a use case
98
33
  * @see https://developers.arcgis.com/rest/services-reference/enterprise/feature-service.htm
99
34
  */
100
- export class ArcGISVectorSource extends VectorSource {
101
- data;
35
+ export class ArcGISVectorSource extends DataSource {
102
36
  formatSpecificMetadata;
103
- constructor(props) {
104
- super(props);
105
- this.data = props.url;
37
+ constructor(url, options) {
38
+ super(url, options, ArcGISFeatureServerSource.defaultOptions);
106
39
  this.formatSpecificMetadata = this._getFormatSpecificMetadata();
107
40
  }
108
41
  /** TODO - not yet clear if we can find schema information in the FeatureServer metadata or if we need to request a feature */
@@ -125,7 +58,7 @@ export class ArcGISVectorSource extends VectorSource {
125
58
  const response = await this.fetch(url);
126
59
  const arrayBuffer = await response.arrayBuffer();
127
60
  // TODO - hack - done to avoid pulling in selectLoader from core
128
- const loader = this.props['arcgis-feature-server']?.loaders?.[0];
61
+ const loader = this.options.core?.loaders?.[0];
129
62
  const table = loader?.parse(arrayBuffer);
130
63
  return table;
131
64
  }
@@ -185,7 +118,7 @@ export class ArcGISVectorSource extends VectorSource {
185
118
  // URL creators
186
119
 
187
120
  metadataURL(options: {parameters?: Record<string, unknown>}): string {
188
- return `${this.props.url}?f=pjson`;
121
+ return `${this.options.url}?f=pjson`;
189
122
  }
190
123
 
191
124
  /**
@@ -237,7 +170,7 @@ export class ArcGISVectorSource extends VectorSource {
237
170
  options: Record<string, unknown>,
238
171
  extra?: Record<string, unknown>
239
172
  ): string {
240
- let url = `${this.props.url}/${path}`;
173
+ let url = `${this.options.url}/${path}`;
241
174
  let first = true;
242
175
  for (const [key, value] of Object.entries(options)) {
243
176
  url += first ? '?' : '&';
@@ -270,6 +203,68 @@ function parseArcGISFeatureServerMetadata(json) {
270
203
  layers
271
204
  };
272
205
  }
206
+ // const DEFAULT_QUERY_OPTIONS: Required<ArcGISImageServiceQueryOptions> = {
207
+ // returnGeometry:true,
208
+ // where: '1%3D1',
209
+ // outSR: 4326,
210
+ // outFields: '*',
211
+ // inSR: 4326,
212
+ // geometry: `${-90}%2C+${30}%2C+${-70}%2C+${50}`,
213
+ // geometryType: 'esriGeometryEnvelope',
214
+ // spatialRel: 'esriSpatialRelIntersects',
215
+ // geometryPrecision: 6,
216
+ // resultType: 'tile',
217
+ // f: 'geojson'
218
+ // };
219
+ // export type ArcGISFeatureServiceProps = ArcGISImageServiceQueryOptions & {
220
+ // url: string;
221
+ // loadOptions?: LoaderOptions;
222
+ // fetch?: typeof fetch | FetchLike;
223
+ // };
224
+ // export class ArcGISFeatureService {
225
+ // url: string;
226
+ // loadOptions: LoaderOptions;
227
+ // fetch: typeof fetch | FetchLike;
228
+ // constructor(options: ArcGISFeatureServiceProps) {
229
+ // this.url = options.url;
230
+ // this.loadOptions = options.loadOptions || {};
231
+ // this.fetch = options.fetch || fetch;
232
+ // }
233
+ // // URL creators
234
+ // metadataURL(options: {parameters?: Record<string, unknown>}): string {
235
+ // return this.getUrl({...options});
236
+ // }
237
+ // /**
238
+ // * Form a URL to an ESRI FeatureServer
239
+ // // https://services2.arcgis.com/CcI36Pduqd0OR4W9/ArcGIS/rest/services/Bicycle_Routes_Public/FeatureServer/0/query?
240
+ // // returnGeometry=true&where=1%3D1&outSR=4326&outFields=*&inSR=4326&geometry=${-90}%2C+${30}%2C+${-70}%2C+${50}&
241
+ // // geometryType=esriGeometryEnvelope&spatialRel=esriSpatialRelIntersects&geometryPrecision=6&resultType=tile&f=geojson`
242
+ // */
243
+ // exportImageURL(options: {
244
+ // boundingBox: [number, number, number, number];
245
+ // boundingBoxSR?: string;
246
+ // width: number;
247
+ // height: number;
248
+ // imageSR?: string;
249
+ // time?: never;
250
+ // f?: 'geojson';
251
+ // resultType?: 'tile';
252
+ // noData?: never;
253
+ // noDataInterpretation?: 'esriNoDataMatchAny';
254
+ // interpolation?: '+RSP_NearestNeighbor';
255
+ // compression?: never
256
+ // compressionQuality?: never;
257
+ // bandIds?: never;
258
+ // mosaicRule?: never;
259
+ // renderingRule?: never;
260
+ // f?: 'image';
261
+ // }): string {
262
+ // const {boundingBox} = options;
263
+ // // const bbox = `bbox=${boundingBox[0]},${boundingBox[1]},${boundingBox[2]},${boundingBox[3]}`;
264
+ // // const size = `size=${width},${height}`
265
+ // return this.getUrl({path: 'exportImage', });
266
+ // }
267
+ // }
273
268
  /** Sample metadata
274
269
  * @see https://developers.arcgis.com/rest/services-reference/enterprise/feature-service.htm
275
270
  */
@@ -1,6 +1,9 @@
1
1
  import type { ImageType } from '@loaders.gl/images';
2
- import type { ImageSourceProps, ImageSourceMetadata, GetImageParameters } from '@loaders.gl/loader-utils';
3
- import { ImageSource } from '@loaders.gl/loader-utils';
2
+ import type { DataSourceOptions, ImageSourceMetadata, GetImageParameters } from '@loaders.gl/loader-utils';
3
+ import { DataSource, ImageSource } from '@loaders.gl/loader-utils';
4
+ export type ArcGISImageSourceProps = DataSourceOptions & {
5
+ 'arcgis-image-server'?: {};
6
+ };
4
7
  export declare const ArcGISImageServerSource: {
5
8
  readonly name: "ArcGISImageServer";
6
9
  readonly id: "arcgis-image-server";
@@ -8,26 +11,21 @@ export declare const ArcGISImageServerSource: {
8
11
  readonly version: "0.0.0";
9
12
  readonly extensions: [];
10
13
  readonly mimeTypes: [];
11
- readonly options: {
12
- readonly 'arcgis-image-server': {};
13
- };
14
14
  readonly type: "arcgis-image-server";
15
15
  readonly fromUrl: true;
16
16
  readonly fromBlob: false;
17
+ readonly defaultOptions: {
18
+ readonly 'arcgis-image-server': {};
19
+ };
17
20
  readonly testURL: (url: string) => boolean;
18
21
  readonly createDataSource: (url: string | Blob, props: ArcGISImageSourceProps) => ArcGISImageSource;
19
22
  };
20
- export type ArcGISImageSourceProps = ImageSourceProps & {
21
- 'arcgis-image-server'?: {};
22
- };
23
23
  /**
24
24
  * ArcGIS ImageServer
25
25
  * Note - exports a big API, that could be exposed here if there is a use case
26
26
  * @see https://developers.arcgis.com/rest/services-reference/enterprise/image-service.htm
27
27
  */
28
- export declare class ArcGISImageSource extends ImageSource<ArcGISImageSourceProps> {
29
- url: string;
30
- data: string;
28
+ export declare class ArcGISImageSource extends DataSource<string, ArcGISImageSourceProps> implements ImageSource {
31
29
  constructor(url: string, props: ArcGISImageSourceProps);
32
30
  getMetadata(): Promise<ImageSourceMetadata>;
33
31
  getImage(parameters: GetImageParameters): Promise<ImageType>;
@@ -94,4 +92,4 @@ export declare class ArcGISImageSource extends ImageSource<ArcGISImageSourceProp
94
92
  /** Checks for and parses a WMS XML formatted ServiceError and throws an exception */
95
93
  protected checkResponse(response: Response): Promise<void>;
96
94
  }
97
- //# sourceMappingURL=arcgis-image-server.d.ts.map
95
+ //# sourceMappingURL=arcgis-image-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arcgis-image-source.d.ts","sourceRoot":"","sources":["../../src/arcgis/arcgis-image-source.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAEV,iBAAiB,EACjB,mBAAmB,EACnB,kB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
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
- import { ImageSource } from '@loaders.gl/loader-utils';
5
- // import type {ImageSourceProps} from '@loaders.gl/loader-utils';
6
- // import {ImageSource} from '@loaders.gl/loader-utils';
4
+ import { DataSource } from '@loaders.gl/loader-utils';
7
5
  export const ArcGISImageServerSource = {
8
6
  name: 'ArcGISImageServer',
9
7
  id: 'arcgis-image-server',
@@ -11,14 +9,14 @@ export const ArcGISImageServerSource = {
11
9
  version: '0.0.0',
12
10
  extensions: [],
13
11
  mimeTypes: [],
14
- options: {
12
+ type: 'arcgis-image-server',
13
+ fromUrl: true,
14
+ fromBlob: false,
15
+ defaultOptions: {
15
16
  'arcgis-image-server': {
16
17
  // TODO - add options here
17
18
  }
18
19
  },
19
- type: 'arcgis-image-server',
20
- fromUrl: true,
21
- fromBlob: false,
22
20
  testURL: (url) => url.toLowerCase().includes('ImageServer'),
23
21
  createDataSource: (url, props) => new ArcGISImageSource(url, props)
24
22
  };
@@ -27,13 +25,9 @@ export const ArcGISImageServerSource = {
27
25
  * Note - exports a big API, that could be exposed here if there is a use case
28
26
  * @see https://developers.arcgis.com/rest/services-reference/enterprise/image-service.htm
29
27
  */
30
- export class ArcGISImageSource extends ImageSource {
31
- url;
32
- data;
28
+ export class ArcGISImageSource extends DataSource {
33
29
  constructor(url, props) {
34
- super(props);
35
- this.url = url;
36
- this.data = url;
30
+ super(url, props, ArcGISImageServerSource.defaultOptions);
37
31
  }
38
32
  // ImageSource (normalized endpoints)
39
33
  async getMetadata() {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arcgis-server.d.ts","sourceRoot":"","sources":["../../src/arcgis/arcgis-server.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,OAAO,GAAG;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAC,CAAC;AAEhE,KAAK,SAAS,GAAG,OAAO,KAAK,CAAC;AAE9B;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,MAAM,EACX,SAAS,GAAE,SAAiB,GAC3B,OAAO,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAM3B"}
@@ -4,7 +4,7 @@
4
4
  import { parseCSWCapabilities } from "./lib/parsers/csw/parse-csw-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 CSW GetCapability request
10
10
  */
@@ -4,7 +4,7 @@
4
4
  import { parseCSWDomain } from "./lib/parsers/csw/parse-csw-domain.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 CSW GetCapability request
10
10
  */
@@ -4,7 +4,7 @@
4
4
  import { parseCSWRecords } from "./lib/parsers/csw/parse-csw-records.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 CSW GetCapability request
10
10
  */
@@ -1,11 +1,8 @@
1
- import type { DataSourceProps } from '@loaders.gl/loader-utils';
1
+ import type { DataSourceOptions } from '@loaders.gl/loader-utils';
2
2
  import { DataSource } from '@loaders.gl/loader-utils';
3
- import type { CSWCapabilities } from "../../csw-capabilities-loader.js";
4
- import type { CSWRecords } from "../../csw-records-loader.js";
5
- import type { CSWDomain } from "../../csw-domain-loader.js";
6
- export type CSWServiceProps = DataSourceProps & {
7
- url: string;
8
- };
3
+ import type { CSWCapabilities } from "./csw-capabilities-loader.js";
4
+ import type { CSWRecords } from "./csw-records-loader.js";
5
+ import type { CSWDomain } from "./csw-domain-loader.js";
9
6
  /** Describes a service or resource exposed by the catalog */
10
7
  export type Service = {
11
8
  /** name of service or resource */
@@ -36,19 +33,36 @@ export type CSWGetDomainParameters = CSWCommonParameters & {
36
33
  /** Request type */
37
34
  request?: 'GetDomain';
38
35
  };
36
+ export type CSWSourceOptions = DataSourceOptions & {
37
+ csw?: {};
38
+ };
39
+ export declare const CSWSource: {
40
+ readonly name: "CSW";
41
+ readonly id: "csw";
42
+ readonly module: "wms";
43
+ readonly version: "0.0.0";
44
+ readonly extensions: [];
45
+ readonly mimeTypes: [];
46
+ readonly type: "csw";
47
+ readonly fromUrl: true;
48
+ readonly fromBlob: false;
49
+ readonly defaultOptions: {
50
+ readonly wfs: {};
51
+ };
52
+ readonly testURL: (url: string) => boolean;
53
+ readonly createDataSource: (url: string, options: CSWSourceOptions) => CSWCatalogSource;
54
+ };
39
55
  /**
40
- * The CSWService class
56
+ * The CSWCatalogSource class
41
57
  * - provides type safe methods to form URLs to a CSW service
42
58
  * - provides type safe methods to query and parse results (and errors) from a CSW service
43
59
  * @note Only the URL parameter conversion is supported. XML posts are not supported.
44
60
  */
45
- export declare class CSWService extends DataSource<CSWServiceProps> {
61
+ export declare class CSWCatalogSource extends DataSource<string, CSWSourceOptions> {
46
62
  static readonly type = "csw";
47
63
  static testURL: (url: string) => boolean;
48
64
  capabilities: CSWCapabilities | null;
49
- data: string;
50
- url: string;
51
- /** A list of loaders used by the CSWService methods */
65
+ /** A list of loaders used by the CSWCatalogSource methods */
52
66
  readonly loaders: ({
53
67
  readonly dataType: CSWCapabilities;
54
68
  readonly batchType: never;
@@ -63,8 +77,8 @@ export declare class CSWService extends DataSource<CSWServiceProps> {
63
77
  readonly options: {
64
78
  readonly csw: {};
65
79
  };
66
- readonly parse: (arrayBuffer: ArrayBuffer, options?: import("../../csw-capabilities-loader").CSWLoaderOptions) => Promise<CSWCapabilities>;
67
- readonly parseTextSync: (text: string, options?: import("../../csw-capabilities-loader").CSWLoaderOptions) => CSWCapabilities;
80
+ readonly parse: (arrayBuffer: ArrayBuffer, options?: import("./csw-capabilities-loader").CSWLoaderOptions) => Promise<CSWCapabilities>;
81
+ readonly parseTextSync: (text: string, options?: import("./csw-capabilities-loader").CSWLoaderOptions) => CSWCapabilities;
68
82
  } | {
69
83
  readonly dataType: string;
70
84
  readonly batchType: never;
@@ -81,12 +95,12 @@ export declare class CSWService extends DataSource<CSWServiceProps> {
81
95
  readonly throwOnError: false;
82
96
  };
83
97
  };
84
- readonly parse: (arrayBuffer: ArrayBuffer, options?: import("../../wms-error-loader").WMSLoaderOptions) => Promise<string>;
85
- readonly parseSync: (arrayBuffer: ArrayBuffer, options?: import("../../wms-error-loader").WMSLoaderOptions) => string;
86
- readonly parseTextSync: (text: string, options?: import("../../wms-error-loader").WMSLoaderOptions) => string;
98
+ readonly parse: (arrayBuffer: ArrayBuffer, options?: import("./wms-error-loader").WMSLoaderOptions) => Promise<string>;
99
+ readonly parseSync: (arrayBuffer: ArrayBuffer, options?: import("./wms-error-loader").WMSLoaderOptions) => string;
100
+ readonly parseTextSync: (text: string, options?: import("./wms-error-loader").WMSLoaderOptions) => string;
87
101
  })[];
88
- /** Create a CSWService */
89
- constructor(props: CSWServiceProps);
102
+ /** Create a CSWCatalogSource */
103
+ constructor(url: string, options: CSWSourceOptions);
90
104
  getMetadata(): Promise<CSWCapabilities>;
91
105
  normalizeMetadata(capabilities: CSWCapabilities): CSWCapabilities;
92
106
  getServiceDirectory(options?: {
@@ -97,17 +111,17 @@ export declare class CSWService extends DataSource<CSWServiceProps> {
97
111
  params: string;
98
112
  };
99
113
  /** Get Capabilities */
100
- getCapabilities(wmsParameters?: CSWGetCapabilitiesParameters, vendorParameters?: Record<string, unknown>): Promise<CSWCapabilities>;
114
+ getCapabilities(cswParameters?: CSWGetCapabilitiesParameters, vendorParameters?: Record<string, unknown>): Promise<CSWCapabilities>;
101
115
  /** Get Records */
102
- getRecords(wmsParameters?: CSWGetRecordsParameters, vendorParameters?: Record<string, unknown>): Promise<CSWRecords>;
116
+ getRecords(cswParameters?: CSWGetRecordsParameters, vendorParameters?: Record<string, unknown>): Promise<CSWRecords>;
103
117
  /** Get Domain */
104
- getDomain(wmsParameters?: CSWGetDomainParameters, vendorParameters?: Record<string, unknown>): Promise<CSWDomain>;
118
+ getDomain(cswParameters?: CSWGetDomainParameters, vendorParameters?: Record<string, unknown>): Promise<CSWDomain>;
105
119
  /** Generate a URL for the GetCapabilities request */
106
- getCapabilitiesURL(wmsParameters?: CSWGetCapabilitiesParameters, vendorParameters?: Record<string, unknown>): string;
120
+ getCapabilitiesURL(cswParameters?: CSWGetCapabilitiesParameters, vendorParameters?: Record<string, unknown>): string;
107
121
  /** Generate a URL for the GetCapabilities request */
108
- getRecordsURL(wmsParameters?: CSWGetRecordsParameters, vendorParameters?: Record<string, unknown>): string;
122
+ getRecordsURL(cswParameters?: CSWGetRecordsParameters, vendorParameters?: Record<string, unknown>): string;
109
123
  /** Generate a URL for the GetCapabilities request */
110
- getDomainURL(wmsParameters?: CSWGetDomainParameters, vendorParameters?: Record<string, unknown>): string;
124
+ getDomainURL(cswParameters?: CSWGetDomainParameters, vendorParameters?: Record<string, unknown>): string;
111
125
  /**
112
126
  * @note case _getCSWUrl may need to be overridden to handle certain backends?
113
127
  * */
@@ -118,4 +132,4 @@ export declare class CSWService extends DataSource<CSWServiceProps> {
118
132
  protected _parseError(arrayBuffer: ArrayBuffer): Error;
119
133
  }
120
134
  export {};
121
- //# sourceMappingURL=csw-service.d.ts.map
135
+ //# sourceMappingURL=csw-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"csw-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