@loaders.gl/wms 4.3.0-alpha.1 → 4.3.0-alpha.3

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 (70) hide show
  1. package/dist/csw-capabilities-loader.js +1 -1
  2. package/dist/csw-domain-loader.js +1 -1
  3. package/dist/csw-records-loader.js +1 -1
  4. package/dist/gml-loader.js +1 -1
  5. package/dist/index.cjs +125 -300
  6. package/dist/index.cjs.map +4 -4
  7. package/dist/index.d.ts +7 -13
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +8 -10
  10. package/dist/lib/deprecated/create-image-source.d.ts +21 -0
  11. package/dist/lib/deprecated/create-image-source.d.ts.map +1 -0
  12. package/dist/lib/deprecated/create-image-source.js +44 -0
  13. package/dist/lib/parsers/wfs/parse-wfs-capabilities.d.ts.map +1 -0
  14. package/dist/{wip/lib → lib/parsers}/wfs/parse-wfs-capabilities.js +5 -2
  15. package/dist/lib/parsers/wfs/parse-wfs.d.ts.map +1 -0
  16. package/dist/services/arcgis/arcgis-feature-server.d.ts +67 -0
  17. package/dist/services/arcgis/arcgis-feature-server.d.ts.map +1 -0
  18. package/dist/services/arcgis/arcgis-feature-server.js +446 -0
  19. package/dist/services/arcgis/{arcgis-image-service.d.ts → arcgis-image-server.d.ts} +25 -10
  20. package/dist/services/arcgis/arcgis-image-server.d.ts.map +1 -0
  21. package/dist/services/arcgis/{arcgis-image-service.js → arcgis-image-server.js} +28 -11
  22. package/dist/services/ogc/csw-service.d.ts +13 -13
  23. package/dist/services/ogc/csw-service.d.ts.map +1 -1
  24. package/dist/services/ogc/wfs-service.d.ts +279 -0
  25. package/dist/services/ogc/wfs-service.d.ts.map +1 -0
  26. package/dist/services/ogc/wfs-service.js +388 -0
  27. package/dist/services/ogc/wms-service.d.ts +42 -21
  28. package/dist/services/ogc/wms-service.d.ts.map +1 -1
  29. package/dist/services/ogc/wms-service.js +29 -14
  30. package/dist/{wip/wfs-capabilities-loader.d.ts → wfs-capabilities-loader.d.ts} +2 -1
  31. package/dist/wfs-capabilities-loader.d.ts.map +1 -0
  32. package/dist/{wip/wfs-capabilities-loader.js → wfs-capabilities-loader.js} +3 -2
  33. package/dist/wip/wcs-capabilities-loader.js +1 -1
  34. package/dist/wip/wmts-capabilities-loader.js +1 -1
  35. package/dist/wms-capabilities-loader.js +1 -1
  36. package/dist/wms-error-loader.js +1 -1
  37. package/package.json +6 -6
  38. package/src/index.ts +12 -24
  39. package/src/lib/{services/create-image-service.ts → deprecated/create-image-service.ts.disabled} +4 -4
  40. package/src/lib/deprecated/create-image-source.ts +70 -0
  41. package/src/{wip/lib → lib/parsers}/wfs/parse-wfs-capabilities.ts +8 -5
  42. package/src/services/arcgis/arcgis-feature-server.ts +506 -0
  43. package/src/services/arcgis/{arcgis-image-service.ts → arcgis-image-server.ts} +41 -18
  44. package/src/services/ogc/csw-service.ts +17 -15
  45. package/src/services/ogc/wfs-service.ts +624 -0
  46. package/src/services/ogc/wms-service.ts +54 -30
  47. package/src/{wip/wfs-capabilities-loader.ts → wfs-capabilities-loader.ts} +3 -2
  48. package/dist/lib/services/create-image-service.d.ts +0 -14
  49. package/dist/lib/services/create-image-service.d.ts.map +0 -1
  50. package/dist/lib/services/create-image-service.js +0 -39
  51. package/dist/lib/services/image-service.d.ts +0 -28
  52. package/dist/lib/services/image-service.d.ts.map +0 -1
  53. package/dist/lib/services/image-service.js +0 -45
  54. package/dist/services/arcgis/arcgis-image-service.d.ts.map +0 -1
  55. package/dist/services/create-image-source.d.ts +0 -18
  56. package/dist/services/create-image-source.d.ts.map +0 -1
  57. package/dist/services/create-image-source.js +0 -17
  58. package/dist/wip/lib/wfs/parse-wfs-capabilities.d.ts.map +0 -1
  59. package/dist/wip/lib/wfs/parse-wfs.d.ts.map +0 -1
  60. package/dist/wip/services/arcgis-feature-service.d.ts +0 -56
  61. package/dist/wip/services/arcgis-feature-service.d.ts.map +0 -1
  62. package/dist/wip/services/arcgis-feature-service.js +0 -27
  63. package/dist/wip/wfs-capabilities-loader.d.ts.map +0 -1
  64. package/src/services/create-image-source.ts +0 -33
  65. package/src/wip/services/arcgis-feature-service.ts +0 -89
  66. /package/dist/{wip/lib → lib/parsers}/wfs/parse-wfs-capabilities.d.ts +0 -0
  67. /package/dist/{wip/lib → lib/parsers}/wfs/parse-wfs.d.ts +0 -0
  68. /package/dist/{wip/lib → lib/parsers}/wfs/parse-wfs.js +0 -0
  69. /package/src/lib/{services/image-service.ts → deprecated/template-image-service.ts.disabled} +0 -0
  70. /package/src/{wip/lib → lib/parsers}/wfs/parse-wfs.ts +0 -0
@@ -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.2.0" !== 'undefined' ? "4.2.0" : 'latest';
7
+ const VERSION = typeof "4.3.0-alpha.2" !== 'undefined' ? "4.3.0-alpha.2" : 'latest';
8
8
  /**
9
9
  * Loader for the response to the WMS GetCapability request
10
10
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/wms",
3
- "version": "4.3.0-alpha.1",
3
+ "version": "4.3.0-alpha.3",
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.0-alpha.1",
54
- "@loaders.gl/loader-utils": "4.3.0-alpha.1",
55
- "@loaders.gl/schema": "4.3.0-alpha.1",
56
- "@loaders.gl/xml": "4.3.0-alpha.1",
53
+ "@loaders.gl/images": "4.3.0-alpha.3",
54
+ "@loaders.gl/loader-utils": "4.3.0-alpha.3",
55
+ "@loaders.gl/schema": "4.3.0-alpha.3",
56
+ "@loaders.gl/xml": "4.3.0-alpha.3",
57
57
  "@turf/rewind": "^5.1.5",
58
58
  "deep-strict-equal": "^0.2.0"
59
59
  },
60
60
  "peerDependencies": {
61
61
  "@loaders.gl/core": "^4.0.0"
62
62
  },
63
- "gitHead": "568446ea69eb590f0c42d965459b636216cda74e"
63
+ "gitHead": "3213679d79e6ff2814d48fd3337acfa446c74099"
64
64
  }
package/src/index.ts CHANGED
@@ -42,10 +42,9 @@ export {WMSLayerDescriptionLoader as _WMSLayerDescriptionLoader} from './wip/wms
42
42
 
43
43
  // WFS - Web Feature Service
44
44
 
45
- export type {WFSLoaderOptions as _WFSLoaderOptions} from './wip/wfs-capabilities-loader';
46
-
47
- export type {WFSCapabilities as _WFSCapabilities} from './wip/wfs-capabilities-loader';
48
- export {WFSCapabilitiesLoader as _WFSCapabilitiesLoader} from './wip/wfs-capabilities-loader';
45
+ export type {WFSLoaderOptions as _WFSLoaderOptions} from './wfs-capabilities-loader';
46
+ export type {WFSCapabilities as _WFSCapabilities} from './wfs-capabilities-loader';
47
+ export {WFSCapabilitiesLoader as _WFSCapabilitiesLoader} from './wfs-capabilities-loader';
49
48
 
50
49
  // GML - Geographic Markup Language
51
50
 
@@ -55,28 +54,17 @@ export {GMLLoader as _GMLLoader} from './gml-loader';
55
54
 
56
55
  // EXPERIMENTAL: DATA SOURCES
57
56
 
58
- // TODO - restore once deck.gl has been udpated
59
- export {ImageSource} from '@loaders.gl/loader-utils';
60
-
61
- export type {ImageType} from '@loaders.gl/images';
62
-
63
- export type {CreateImageServiceProps} from './lib/services/create-image-service';
64
- export {createImageService} from './lib/services/create-image-service';
65
-
66
- export type {ImageServiceType} from './services/create-image-source';
67
- export {createImageSource} from './services/create-image-source';
68
-
69
- // Generic (Template URL) Services
70
-
71
- export type {ImageServiceProps} from './lib/services/image-service';
72
- export {ImageService} from './lib/services/image-service';
73
-
74
57
  // OGC Services
75
58
 
76
- export {CSWService} from './services/ogc/csw-service';
77
- export {WMSSource, WMSService} from './services/ogc/wms-service';
59
+ // export {CSWSource} from './services/ogc/csw-service';
60
+ export {WMSSource, WMSImageSource} from './services/ogc/wms-service';
78
61
 
79
- // ArcGIS Services
62
+ // ArcGIS SourceLoaders
80
63
 
81
64
  export {getArcGISServices as _getArcGISServices} from './services/arcgis/arcgis-server';
82
- export {ArcGISImageService as _ArcGISImageService} from './services/arcgis/arcgis-image-service';
65
+ export {ArcGISImageServerSource as _ArcGISImageServerSource} from './services/arcgis/arcgis-image-server';
66
+
67
+ // DEPRECATED: TODO - remove once deck.gl has been udpated
68
+ export {ImageSource} from '@loaders.gl/loader-utils';
69
+ export type {ImageType} from '@loaders.gl/images';
70
+ export {createImageSource} from './lib/deprecated/create-image-source';
@@ -3,7 +3,7 @@
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
5
  import {ImageSource, Service} from '@loaders.gl/loader-utils';
6
- import {ImageServiceProps} from './image-service';
6
+ import {ImageService, ImageServiceProps} from './image-service';
7
7
 
8
8
  export type CreateImageServiceProps = ImageServiceProps & {
9
9
  type?: string | 'auto';
@@ -18,7 +18,7 @@ export type CreateImageServiceProps = ImageServiceProps & {
18
18
  */
19
19
  export function createImageService(
20
20
  props: CreateImageServiceProps,
21
- services: Service[]
21
+ services: ImageService[]
22
22
  ): ImageSource {
23
23
  const {type = 'auto'} = props;
24
24
  const service: Service | null =
@@ -27,11 +27,11 @@ export function createImageService(
27
27
  if (!service) {
28
28
  throw new Error('Not a valid image source type');
29
29
  }
30
- return service.create(props);
30
+ return service.createSource(props) as ImageService;
31
31
  }
32
32
 
33
33
  /** Guess service type from URL */
34
- function getServiceOfType(type: string, services: Service[]): Service | null {
34
+ function getServiceOfType(type: string, services: ImageService[]): ImageService | null {
35
35
  // if (type === 'template') {
36
36
  // return ImageService;
37
37
  // }
@@ -0,0 +1,70 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
5
+ import type {Source, ImageSource, ImageSourceProps} from '@loaders.gl/loader-utils';
6
+ import type {WMSImageSourceProps} from '../../services/ogc/wms-service';
7
+ import {WMSSource} from '../../services/ogc/wms-service';
8
+ import {ArcGISImageServerSource} from '../../services/arcgis/arcgis-image-server';
9
+
10
+ export type ImageSourceType = 'wms' | 'arcgis-image-server' | 'template';
11
+
12
+ const SOURCES: Source[] = [WMSSource, ArcGISImageServerSource];
13
+
14
+ /**
15
+ * * @deprecated Use createDataSource from @loaders.gl/core
16
+ */
17
+ type CreateImageSourceProps = ImageSourceProps &
18
+ WMSImageSourceProps & {
19
+ type?: ImageSourceType | 'auto';
20
+ };
21
+
22
+ /**
23
+ * Creates an image source
24
+ * If type is not supplied, will try to automatically detect the the
25
+ * @param url URL to the image source
26
+ * @param type type of source. if not known, set to 'auto'
27
+ * @returns an ImageSource instance
28
+ *
29
+ * @deprecated Use createDataSource from @loaders.gl/core
30
+ */
31
+ export function createImageSource(
32
+ url: string,
33
+ props: CreateImageSourceProps,
34
+ sources = SOURCES
35
+ ): ImageSource {
36
+ const {type = 'auto'} = props;
37
+ const source: Source | null =
38
+ type === 'auto' ? guessSourceType(url, sources) : getSourceOfType(type, sources);
39
+
40
+ if (!source) {
41
+ throw new Error('Not a valid image source type');
42
+ }
43
+ return source.createDataSource(url, props) as ImageSource;
44
+ }
45
+
46
+ /** Guess service type from URL */
47
+ function getSourceOfType(type: string, sources: Source[]): Source | null {
48
+ // if (type === 'template') {
49
+ // return ImageSource;
50
+ // }
51
+
52
+ for (const source of sources) {
53
+ if (source.type === type) {
54
+ return source;
55
+ }
56
+ }
57
+
58
+ return null;
59
+ }
60
+
61
+ /** Guess source type from URL */
62
+ function guessSourceType(url: string, sources: Source[]): Source | null {
63
+ for (const source of sources) {
64
+ if (source.testURL && source.testURL(url)) {
65
+ return source;
66
+ }
67
+ }
68
+
69
+ return null;
70
+ }
@@ -83,11 +83,14 @@ export type WFSCapabilities = {
83
83
  * @note Error handlings is fairly weak
84
84
  */
85
85
  export function parseWFSCapabilities(text: string, options): WFSCapabilities {
86
- const parsedXML = XMLLoader.parseTextSync?.(text, {...options, xml: {
87
- ...options?.xml,
88
- removeNSPrefix: true,
89
- uncapitalizeKeys: true
90
- }});
86
+ const parsedXML = XMLLoader.parseTextSync?.(text, {
87
+ ...options,
88
+ xml: {
89
+ ...options?.xml,
90
+ removeNSPrefix: true,
91
+ uncapitalizeKeys: true
92
+ }
93
+ });
91
94
 
92
95
  const xmlCapabilities: any = parsedXML.Capabilities || parsedXML;
93
96
  return xmlCapabilities;