@loaders.gl/wms 4.0.0-alpha.8 → 4.0.0-beta.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.
- package/dist/csw-capabilities-loader.d.ts +1 -17
- package/dist/csw-capabilities-loader.d.ts.map +1 -1
- package/dist/csw-domain-loader.d.ts +1 -17
- package/dist/csw-domain-loader.d.ts.map +1 -1
- package/dist/csw-records-loader.d.ts +1 -1
- package/dist/csw-records-loader.d.ts.map +1 -1
- package/dist/dist.min.js +187 -161
- package/dist/es5/csw-capabilities-loader.js +2 -4
- package/dist/es5/csw-capabilities-loader.js.map +1 -1
- package/dist/es5/csw-domain-loader.js +2 -4
- package/dist/es5/csw-domain-loader.js.map +1 -1
- package/dist/es5/csw-records-loader.js +2 -2
- package/dist/es5/csw-records-loader.js.map +1 -1
- package/dist/es5/gml-loader.js +2 -4
- package/dist/es5/gml-loader.js.map +1 -1
- package/dist/es5/index.js +23 -10
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lerc-loader.js +2 -4
- package/dist/es5/lerc-loader.js.map +1 -1
- package/dist/es5/lib/parsers/gml/parse-gml.js.map +1 -1
- package/dist/es5/lib/{create-image-source.js → services/create-image-service.js} +30 -21
- package/dist/es5/lib/services/create-image-service.js.map +1 -0
- package/dist/es5/lib/services/{generic/image-service.js → image-service.js} +2 -2
- package/dist/es5/lib/services/image-service.js.map +1 -0
- package/dist/es5/{lib/services → services}/arcgis/arcgis-image-service.js +22 -16
- package/dist/es5/services/arcgis/arcgis-image-service.js.map +1 -0
- package/dist/es5/services/arcgis/arcgis-server.js.map +1 -0
- package/dist/es5/services/create-image-source.js +14 -0
- package/dist/es5/services/create-image-source.js.map +1 -0
- package/dist/es5/{lib/services → services}/ogc/csw-service.js +10 -8
- package/dist/es5/services/ogc/csw-service.js.map +1 -0
- package/dist/es5/{lib/services → services}/ogc/wms-service.js +28 -22
- package/dist/es5/services/ogc/wms-service.js.map +1 -0
- package/dist/es5/wip/lib/wfs/parse-wfs.js.map +1 -0
- package/dist/es5/wip/lib/wmts/parse-wmts.js.map +1 -0
- package/dist/es5/wip/services/arcgis-feature-service.js.map +1 -0
- package/dist/es5/wip/wcs-capabilities-loader.js +1 -1
- package/dist/es5/wip/wcs-capabilities-loader.js.map +1 -1
- package/dist/es5/wip/wfs-capabilities-loader.js +2 -2
- package/dist/es5/wip/wfs-capabilities-loader.js.map +1 -1
- package/dist/es5/wip/wms-feature-info-loader.js.map +1 -1
- package/dist/es5/wip/wmts-capabilities-loader.js +1 -1
- package/dist/es5/wip/wmts-capabilities-loader.js.map +1 -1
- package/dist/es5/wms-capabilities-loader.js +2 -4
- package/dist/es5/wms-capabilities-loader.js.map +1 -1
- package/dist/es5/wms-error-loader.js +2 -4
- package/dist/es5/wms-error-loader.js.map +1 -1
- package/dist/esm/csw-capabilities-loader.js +1 -2
- package/dist/esm/csw-capabilities-loader.js.map +1 -1
- package/dist/esm/csw-domain-loader.js +1 -2
- package/dist/esm/csw-domain-loader.js.map +1 -1
- package/dist/esm/csw-records-loader.js +2 -2
- package/dist/esm/csw-records-loader.js.map +1 -1
- package/dist/esm/gml-loader.js +1 -2
- package/dist/esm/gml-loader.js.map +1 -1
- package/dist/esm/index.js +8 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lerc-loader.js +1 -2
- package/dist/esm/lerc-loader.js.map +1 -1
- package/dist/esm/lib/parsers/gml/parse-gml.js.map +1 -1
- package/dist/esm/lib/services/create-image-service.js +27 -0
- package/dist/esm/lib/services/create-image-service.js.map +1 -0
- package/dist/esm/lib/services/{generic/image-service.js → image-service.js} +1 -1
- package/dist/esm/lib/services/image-service.js.map +1 -0
- package/dist/esm/{lib/services → services}/arcgis/arcgis-image-service.js +7 -5
- package/dist/esm/services/arcgis/arcgis-image-service.js.map +1 -0
- package/dist/esm/services/arcgis/arcgis-server.js.map +1 -0
- package/dist/esm/services/create-image-source.js +8 -0
- package/dist/esm/services/create-image-source.js.map +1 -0
- package/dist/esm/{lib/services → services}/ogc/csw-service.js +9 -7
- package/dist/esm/services/ogc/csw-service.js.map +1 -0
- package/dist/esm/{lib/services → services}/ogc/wms-service.js +15 -11
- package/dist/esm/services/ogc/wms-service.js.map +1 -0
- package/dist/esm/wip/lib/wfs/parse-wfs.js.map +1 -0
- package/dist/esm/wip/lib/wmts/parse-wmts.js.map +1 -0
- package/dist/esm/wip/services/arcgis-feature-service.js.map +1 -0
- package/dist/esm/wip/wcs-capabilities-loader.js +1 -1
- package/dist/esm/wip/wcs-capabilities-loader.js.map +1 -1
- package/dist/esm/wip/wfs-capabilities-loader.js +2 -2
- package/dist/esm/wip/wfs-capabilities-loader.js.map +1 -1
- package/dist/esm/wip/wms-feature-info-loader.js.map +1 -1
- package/dist/esm/wip/wmts-capabilities-loader.js +1 -1
- package/dist/esm/wip/wmts-capabilities-loader.js.map +1 -1
- package/dist/esm/wms-capabilities-loader.js +1 -2
- package/dist/esm/wms-capabilities-loader.js.map +1 -1
- package/dist/esm/wms-error-loader.js +1 -2
- package/dist/esm/wms-error-loader.js.map +1 -1
- package/dist/gml-loader.d.ts +2 -18
- package/dist/gml-loader.d.ts.map +1 -1
- package/dist/index.d.ts +11 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/lerc-loader.d.ts +1 -14
- package/dist/lerc-loader.d.ts.map +1 -1
- package/dist/lib/parsers/gml/parse-gml.d.ts +1 -0
- package/dist/lib/parsers/gml/parse-gml.d.ts.map +1 -1
- package/dist/lib/services/create-image-service.d.ts +14 -0
- package/dist/lib/services/create-image-service.d.ts.map +1 -0
- package/dist/lib/services/{generic/image-service.d.ts → image-service.d.ts} +4 -4
- package/dist/lib/services/image-service.d.ts.map +1 -0
- package/dist/{lib/services → services}/arcgis/arcgis-image-service.d.ts +6 -7
- package/dist/services/arcgis/arcgis-image-service.d.ts.map +1 -0
- package/dist/services/arcgis/arcgis-server.d.ts.map +1 -0
- package/dist/services/create-image-source.d.ts +18 -0
- package/dist/services/create-image-source.d.ts.map +1 -0
- package/dist/{lib/services → services}/ogc/csw-service.d.ts +6 -38
- package/dist/services/ogc/csw-service.d.ts.map +1 -0
- package/dist/{lib/services → services}/ogc/wms-service.d.ts +14 -80
- package/dist/services/ogc/wms-service.d.ts.map +1 -0
- package/dist/wip/lib/wfs/parse-wfs.d.ts.map +1 -0
- package/dist/wip/lib/wmts/parse-wmts.d.ts.map +1 -0
- package/dist/wip/services/arcgis-feature-service.d.ts.map +1 -0
- package/dist/wip/wfs-capabilities-loader.d.ts +1 -16
- package/dist/wip/wfs-capabilities-loader.d.ts.map +1 -1
- package/dist/wip/wms-feature-info-loader.d.ts +1 -15
- package/dist/wip/wms-feature-info-loader.d.ts.map +1 -1
- package/dist/wip/wms-layer-description-loader.d.ts +20 -6
- package/dist/wip/wms-layer-description-loader.d.ts.map +1 -1
- package/dist/wms-capabilities-loader.d.ts +2 -17
- package/dist/wms-capabilities-loader.d.ts.map +1 -1
- package/dist/wms-error-loader.d.ts +1 -21
- package/dist/wms-error-loader.d.ts.map +1 -1
- package/package.json +6 -9
- package/src/csw-capabilities-loader.ts +1 -4
- package/src/csw-domain-loader.ts +1 -3
- package/src/csw-records-loader.ts +2 -3
- package/src/gml-loader.ts +2 -3
- package/src/index.ts +14 -10
- package/src/lerc-loader.ts +1 -3
- package/src/lib/parsers/gml/parse-gml.ts +2 -0
- package/src/lib/services/create-image-service.ts +55 -0
- package/src/lib/services/{generic/image-service.ts → image-service.ts} +6 -4
- package/src/{lib/services → services}/arcgis/arcgis-image-service.ts +15 -8
- package/src/services/create-image-source.ts +31 -0
- package/src/{lib/services → services}/ogc/csw-service.ts +11 -11
- package/src/{lib/services → services}/ogc/wms-service.ts +27 -34
- package/src/wip/wfs-capabilities-loader.ts +2 -2
- package/src/wip/wms-feature-info-loader.ts +2 -1
- package/src/wms-capabilities-loader.ts +6 -4
- package/src/wms-error-loader.ts +1 -3
- package/dist/bundle.js +0 -6
- package/dist/csw-capabilities-loader.js +0 -31
- package/dist/csw-domain-loader.js +0 -31
- package/dist/csw-records-loader.js +0 -30
- package/dist/es5/lib/create-image-source.js.map +0 -1
- package/dist/es5/lib/services/arcgis/arcgis-image-service.js.map +0 -1
- package/dist/es5/lib/services/arcgis/arcgis-server.js.map +0 -1
- package/dist/es5/lib/services/generic/image-service.js.map +0 -1
- package/dist/es5/lib/services/ogc/csw-service.js.map +0 -1
- package/dist/es5/lib/services/ogc/wms-service.js.map +0 -1
- package/dist/es5/lib/sources/data-source.js +0 -67
- package/dist/es5/lib/sources/data-source.js.map +0 -1
- package/dist/es5/lib/sources/image-source.js +0 -26
- package/dist/es5/lib/sources/image-source.js.map +0 -1
- package/dist/es5/lib/sources/tile-source.js +0 -26
- package/dist/es5/lib/sources/tile-source.js.map +0 -1
- package/dist/es5/lib/sources/utils/utils.js +0 -36
- package/dist/es5/lib/sources/utils/utils.js.map +0 -1
- package/dist/es5/lib/wfs/parse-wfs.js.map +0 -1
- package/dist/es5/lib/wmts/parse-wmts.js.map +0 -1
- package/dist/es5/wip/arcgis-feature-service.js.map +0 -1
- package/dist/esm/lib/create-image-source.js +0 -27
- package/dist/esm/lib/create-image-source.js.map +0 -1
- package/dist/esm/lib/services/arcgis/arcgis-image-service.js.map +0 -1
- package/dist/esm/lib/services/arcgis/arcgis-server.js.map +0 -1
- package/dist/esm/lib/services/generic/image-service.js.map +0 -1
- package/dist/esm/lib/services/ogc/csw-service.js.map +0 -1
- package/dist/esm/lib/services/ogc/wms-service.js.map +0 -1
- package/dist/esm/lib/sources/data-source.js +0 -43
- package/dist/esm/lib/sources/data-source.js.map +0 -1
- package/dist/esm/lib/sources/image-source.js +0 -3
- package/dist/esm/lib/sources/image-source.js.map +0 -1
- package/dist/esm/lib/sources/tile-source.js +0 -3
- package/dist/esm/lib/sources/tile-source.js.map +0 -1
- package/dist/esm/lib/sources/utils/utils.js +0 -21
- package/dist/esm/lib/sources/utils/utils.js.map +0 -1
- package/dist/esm/lib/wfs/parse-wfs.js.map +0 -1
- package/dist/esm/lib/wmts/parse-wmts.js.map +0 -1
- package/dist/esm/wip/arcgis-feature-service.js.map +0 -1
- package/dist/gml-loader.js +0 -31
- package/dist/index.js +0 -39
- package/dist/lerc-loader.js +0 -56
- package/dist/lib/create-image-source.d.ts +0 -17
- package/dist/lib/create-image-source.d.ts.map +0 -1
- package/dist/lib/create-image-source.js +0 -39
- package/dist/lib/parsers/csw/parse-csw-capabilities.js +0 -24
- package/dist/lib/parsers/csw/parse-csw-domain.js +0 -33
- package/dist/lib/parsers/csw/parse-csw-records.js +0 -58
- package/dist/lib/parsers/csw/parse-exception-report.js +0 -30
- package/dist/lib/parsers/gml/deep-strict-equal.js +0 -119
- package/dist/lib/parsers/gml/parse-gml.js +0 -371
- package/dist/lib/parsers/lerc/lerc-types.js +0 -3
- package/dist/lib/parsers/wms/parse-wms-capabilities.js +0 -233
- package/dist/lib/parsers/wms/parse-wms-error.js +0 -22
- package/dist/lib/parsers/wms/parse-wms-features.js +0 -27
- package/dist/lib/parsers/wms/parse-wms-layer-description.js +0 -15
- package/dist/lib/parsers/xml/parse-xml-helpers.js +0 -68
- package/dist/lib/services/arcgis/arcgis-image-service.d.ts.map +0 -1
- package/dist/lib/services/arcgis/arcgis-image-service.js +0 -94
- package/dist/lib/services/arcgis/arcgis-server.d.ts.map +0 -1
- package/dist/lib/services/arcgis/arcgis-server.js +0 -42
- package/dist/lib/services/generic/image-service.d.ts.map +0 -1
- package/dist/lib/services/generic/image-service.js +0 -47
- package/dist/lib/services/ogc/csw-service.d.ts.map +0 -1
- package/dist/lib/services/ogc/csw-service.js +0 -168
- package/dist/lib/services/ogc/wms-service.d.ts.map +0 -1
- package/dist/lib/services/ogc/wms-service.js +0 -317
- package/dist/lib/sources/data-source.d.ts +0 -32
- package/dist/lib/sources/data-source.d.ts.map +0 -1
- package/dist/lib/sources/data-source.js +0 -56
- package/dist/lib/sources/image-source.d.ts +0 -79
- package/dist/lib/sources/image-source.d.ts.map +0 -1
- package/dist/lib/sources/image-source.js +0 -13
- package/dist/lib/sources/tile-source.d.ts +0 -56
- package/dist/lib/sources/tile-source.d.ts.map +0 -1
- package/dist/lib/sources/tile-source.js +0 -13
- package/dist/lib/sources/utils/utils.d.ts +0 -13
- package/dist/lib/sources/utils/utils.d.ts.map +0 -1
- package/dist/lib/sources/utils/utils.js +0 -38
- package/dist/lib/wfs/parse-wfs.d.ts.map +0 -1
- package/dist/lib/wfs/parse-wfs.js +0 -32
- package/dist/lib/wmts/parse-wmts.d.ts.map +0 -1
- package/dist/lib/wmts/parse-wmts.js +0 -35
- package/dist/wip/arcgis-feature-service.d.ts.map +0 -1
- package/dist/wip/arcgis-feature-service.js +0 -28
- package/dist/wip/data-source.js +0 -59
- package/dist/wip/lib/wcs/parse-wcs-capabilities.js +0 -15
- package/dist/wip/lib/wfs/parse-wfs-capabilities.js +0 -19
- package/dist/wip/lib/wmts/parse-wmts-capabilities.js +0 -77
- package/dist/wip/wcs-capabilities-loader.js +0 -31
- package/dist/wip/wfs-capabilities-loader.js +0 -31
- package/dist/wip/wms-feature-info-loader.js +0 -17
- package/dist/wip/wms-layer-description-loader.js +0 -17
- package/dist/wip/wmts-capabilities-loader.js +0 -32
- package/dist/wms-capabilities-loader.js +0 -35
- package/dist/wms-error-loader.js +0 -43
- package/src/lib/create-image-source.ts +0 -48
- package/src/lib/sources/data-source.ts +0 -73
- package/src/lib/sources/image-source.ts +0 -92
- package/src/lib/sources/tile-source.ts +0 -61
- package/src/lib/sources/utils/utils.ts +0 -42
- /package/dist/es5/{lib/services → services}/arcgis/arcgis-server.js +0 -0
- /package/dist/es5/{lib → wip/lib}/wfs/parse-wfs.js +0 -0
- /package/dist/es5/{lib → wip/lib}/wmts/parse-wmts.js +0 -0
- /package/dist/es5/wip/{arcgis-feature-service.js → services/arcgis-feature-service.js} +0 -0
- /package/dist/es5/{lib/services/ogc → wip/services}/wmts-service.ts.disabled +0 -0
- /package/dist/esm/{lib/services → services}/arcgis/arcgis-server.js +0 -0
- /package/dist/esm/{lib → wip/lib}/wfs/parse-wfs.js +0 -0
- /package/dist/esm/{lib → wip/lib}/wmts/parse-wmts.js +0 -0
- /package/dist/esm/wip/{arcgis-feature-service.js → services/arcgis-feature-service.js} +0 -0
- /package/dist/esm/{lib/services/ogc → wip/services}/wmts-service.ts.disabled +0 -0
- /package/dist/{lib/services → services}/arcgis/arcgis-server.d.ts +0 -0
- /package/dist/{lib → wip/lib}/wfs/parse-wfs.d.ts +0 -0
- /package/dist/{lib → wip/lib}/wmts/parse-wmts.d.ts +0 -0
- /package/dist/wip/{arcgis-feature-service.d.ts → services/arcgis-feature-service.d.ts} +0 -0
- /package/src/{lib/services → services}/arcgis/arcgis-server.ts +0 -0
- /package/src/{lib → wip/lib}/wfs/parse-wfs.ts +0 -0
- /package/src/{lib → wip/lib}/wmts/parse-wmts.ts +0 -0
- /package/src/wip/{arcgis-feature-service.ts → services/arcgis-feature-service.ts} +0 -0
- /package/src/{lib/services/ogc → wip/services}/wmts-service.ts.disabled +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export class ArcGISImageServer extends ImageSource {
|
|
1
|
+
import { ImageService } from '../../lib/services/image-service';
|
|
2
|
+
export class ArcGISImageSource extends ImageService {
|
|
4
3
|
constructor(props) {
|
|
5
4
|
super(props);
|
|
6
5
|
}
|
|
@@ -51,6 +50,9 @@ export class ArcGISImageServer extends ImageSource {
|
|
|
51
50
|
}
|
|
52
51
|
}
|
|
53
52
|
}
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
export const ArcGISImageService = {
|
|
54
|
+
type: 'arcgis-image-server',
|
|
55
|
+
testURL: url => url.toLowerCase().includes('ImageServer'),
|
|
56
|
+
create: props => new ArcGISImageSource(props)
|
|
57
|
+
};
|
|
56
58
|
//# sourceMappingURL=arcgis-image-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arcgis-image-service.js","names":["ImageService","ArcGISImageSource","constructor","props","getMetadata","metadata","getImage","parameters","Error","exportImage","options","metadataURL","concat","url","exportImageURL","bbox","size","width","height","arcgisOptions","getUrl","path","extra","first","key","value","Object","entries","Array","isArray","toUpperCase","join","String","checkResponse","response","ok","ArcGISImageService","type","testURL","toLowerCase","includes","create"],"sources":["../../../../src/services/arcgis/arcgis-image-service.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {ImageType} from '@loaders.gl/images';\nimport type {Service, ImageSourceMetadata, GetImageParameters} from '@loaders.gl/loader-utils';\n\nimport type {ImageServiceProps} from '../../lib/services/image-service';\nimport {ImageService} from '../../lib/services/image-service';\n\n// import type {ImageSourceProps} from '@loaders.gl/loader-utils';\n// import {ImageSource} from '@loaders.gl/loader-utils';\n\nexport type ArcGISImageServerProps = ImageServiceProps & {\n url: string;\n};\n\n/**\n * ArcGIS ImageServer\n * Note - exports a big API, that could be exposed here if there is a use case\n * @see https://developers.arcgis.com/rest/services-reference/enterprise/image-service.htm\n */\nexport class ArcGISImageSource extends ImageService<ArcGISImageServerProps> {\n constructor(props: ArcGISImageServerProps) {\n super(props);\n }\n\n // ImageSource (normalized endpoints)\n\n async getMetadata(): Promise<ImageSourceMetadata> {\n return (await this.metadata()) as ImageSourceMetadata;\n // TODO - normalize metadata\n }\n\n async getImage(parameters: GetImageParameters): Promise<ImageType> {\n throw new Error('not implemented');\n // TODO - Map generic parameters to ArcGIS specific parameters\n // return await this.exportImage(parameters);\n }\n\n // ImageServer endpoints\n\n async metadata(): Promise<unknown> {\n // We just need a JSON parsing...\n // return this.getUrl({path: '', ...options});\n throw new Error('not implemented');\n }\n\n /** \n * Form a URL to an ESRI ImageServer\n // https://sampleserver6.arcgisonline.com/arcgis/rest/services/NLCDLandCover2001/ImageServer/exportImage?bbox=${bounds[0]},${bounds[1]},${bounds[2]},${bounds[3]}&bboxSR=4326&size=${width},${height}&imageSR=102100&time=&format=jpgpng&pixelType=U8&noData=&noDataInterpretation=esriNoDataMatchAny&interpolation=+RSP_NearestNeighbor&compression=&compressionQuality=&bandIds=&mosaicRule=&renderingRule=&f=image`,\n */\n exportImage(options: {\n boundingBox: [number, number, number, number];\n boundingBoxSR?: string;\n width: number;\n height: number;\n imageSR?: string;\n time?: never;\n format?: 'jpgpng';\n pixelType?: 'U8';\n noData?: never;\n noDataInterpretation?: 'esriNoDataMatchAny';\n interpolation?: '+RSP_NearestNeighbor';\n compression?: never;\n compressionQuality?: never;\n bandIds?: never;\n mosaicRule?: never;\n renderingRule?: never;\n f?: 'image';\n }): Promise<ImageType> {\n // See WMSService.getMap()\n throw new Error('not implemented');\n }\n\n // URL creators\n\n metadataURL(options: {parameters?: Record<string, unknown>}): string {\n return `${this.props.url}?f=pjson`;\n }\n\n /** \n * Form a URL to an ESRI ImageServer\n // https://sampleserver6.arcgisonline.com/arcgis/rest/services/NLCDLandCover2001/ImageServer/exportImage?\n // bbox=${bounds[0]},${bounds[1]},${bounds[2]},${bounds[3]}&bboxSR=4326&\n // size=${width},${height}&imageSR=102100&time=&format=jpgpng&pixelType=U8&\n // noData=&noDataInterpretation=esriNoDataMatchAny&interpolation=+RSP_NearestNeighbor&compression=&\n // compressionQuality=&bandIds=&mosaicRule=&renderingRule=&\n // f=image\n */\n exportImageURL(options: {\n bbox: [number, number, number, number];\n boxSR?: string;\n width: number;\n height: number;\n imageSR?: string;\n time?: never;\n format?: 'jpgpng';\n pixelType?: 'U8';\n noData?: never;\n noDataInterpretation?: 'esriNoDataMatchAny';\n interpolation?: '+RSP_NearestNeighbor';\n compression?: never;\n compressionQuality?: never;\n bandIds?: never;\n mosaicRule?: never;\n renderingRule?: never;\n f?: 'image';\n }): string {\n const bbox = `bbox=${options.bbox[0]},${options.bbox[1]},${options.bbox[2]},${options.bbox[3]}`;\n const size = `size=${options.width},${options.height}`;\n const arcgisOptions = {...options, bbox, size};\n // @ts-expect-error\n delete arcgisOptions.width;\n // @ts-expect-error\n delete arcgisOptions.height;\n return this.getUrl('exportImage', arcgisOptions);\n }\n\n // INTERNAL METHODS\n\n /**\n * @note protected, since perhaps getWMSUrl may need to be overridden to handle certain backends?\n * @note if override is common, maybe add a callback prop?\n * */\n protected getUrl(\n path: string,\n options: Record<string, unknown>,\n extra?: Record<string, unknown>\n ): string {\n let url = `${this.props.url}/${path}`;\n let first = true;\n for (const [key, value] of Object.entries(options)) {\n url += first ? '?' : '&';\n first = false;\n if (Array.isArray(value)) {\n url += `${key.toUpperCase()}=${value.join(',')}`;\n } else {\n url += `${key.toUpperCase()}=${value ? String(value) : ''}`;\n }\n }\n return url;\n }\n\n /** Checks for and parses a WMS XML formatted ServiceError and throws an exception */\n protected async checkResponse(response: Response) {\n if (!response.ok) {\n // } || response.headers['content-type'] === WMSErrorLoader.mimeTypes[0]) {\n // const arrayBuffer = await response.arrayBuffer();\n // const error = await WMSErrorLoader.parse(arrayBuffer, this.loadOptions);\n throw new Error('error');\n }\n }\n}\n\nexport const ArcGISImageService: Service = {\n type: 'arcgis-image-server',\n testURL: (url: string): boolean => url.toLowerCase().includes('ImageServer'),\n create: (props: ArcGISImageServerProps): ArcGISImageSource => new ArcGISImageSource(props)\n};\n"],"mappings":"AAMA,SAAQA,YAAY,QAAO,kCAAkC;AAc7D,OAAO,MAAMC,iBAAiB,SAASD,YAAY,CAAyB;EAC1EE,WAAWA,CAACC,KAA6B,EAAE;IACzC,KAAK,CAACA,KAAK,CAAC;EACd;EAIA,MAAMC,WAAWA,CAAA,EAAiC;IAChD,OAAQ,MAAM,IAAI,CAACC,QAAQ,CAAC,CAAC;EAE/B;EAEA,MAAMC,QAAQA,CAACC,UAA8B,EAAsB;IACjE,MAAM,IAAIC,KAAK,CAAC,iBAAiB,CAAC;EAGpC;EAIA,MAAMH,QAAQA,CAAA,EAAqB;IAGjC,MAAM,IAAIG,KAAK,CAAC,iBAAiB,CAAC;EACpC;EAMAC,WAAWA,CAACC,OAkBX,EAAsB;IAErB,MAAM,IAAIF,KAAK,CAAC,iBAAiB,CAAC;EACpC;EAIAG,WAAWA,CAACD,OAA+C,EAAU;IACnE,UAAAE,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OAAAD,MAAA,CAAOY,GAAG,CAACM,WAAW,CAAC,CAAC,OAAAlB,MAAA,CAAIa,KAAK,GAAGO,MAAM,CAACP,KAAK,CAAC,GAAG,EAAE,CAAE;MAC7D;IACF;IACA,OAAOZ,GAAG;EACZ;EAGA,MAAgBoB,aAAaA,CAACC,QAAkB,EAAE;IAChD,IAAI,CAACA,QAAQ,CAACC,EAAE,EAAE;MAIhB,MAAM,IAAI3B,KAAK,CAAC,OAAO,CAAC;IAC1B;EACF;AACF;AAEA,OAAO,MAAM4B,kBAA2B,GAAG;EACzCC,IAAI,EAAE,qBAAqB;EAC3BC,OAAO,EAAGzB,GAAW,IAAcA,GAAG,CAAC0B,WAAW,CAAC,CAAC,CAACC,QAAQ,CAAC,aAAa,CAAC;EAC5EC,MAAM,EAAGtC,KAA6B,IAAwB,IAAIF,iBAAiB,CAACE,KAAK;AAC3F,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arcgis-server.js","names":["getArcGISServices","url","fetchFile","arguments","length","undefined","fetch","includes","serverUrl","replace","loadServiceDirectory","path","serviceUrl","concat","join","response","directory","json","services","extractServices","folders","promises","map","folder","folderServices","Promise","all","push","arcgisServices","service","name","type","toLocaleLowerCase"],"sources":["../../../../src/services/arcgis/arcgis-server.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nexport type Service = {name: string; type: string; url: string};\n\ntype FetchLike = typeof fetch;\n\n/**\n * (Recursively) load the service directory from an ArcGIS Server URL\n * @param url\n * @param fetchFile= Optional fetch function override\n * @returns\n */\nexport async function getArcGISServices(\n url: string,\n fetchFile: FetchLike = fetch\n): Promise<Service[] | null> {\n if (url.includes('rest/services')) {\n const serverUrl = url.replace(/rest\\/services.*$/i, 'rest/services');\n return loadServiceDirectory(serverUrl, fetchFile, []);\n }\n return null;\n}\n\nasync function loadServiceDirectory(\n serverUrl: string,\n fetch: FetchLike,\n path: string[]\n): Promise<Service[]> {\n const serviceUrl = `${serverUrl}/${path.join('/')}`;\n\n const response = await fetch(`${serviceUrl}?f=pjson`);\n const directory = await response.json();\n\n const services = extractServices(directory, serviceUrl);\n\n const folders = (directory.folders || []) as string[];\n const promises = folders.map((folder) =>\n loadServiceDirectory(`${serverUrl}`, fetch, [...path, folder])\n );\n\n for (const folderServices of await Promise.all(promises)) {\n services.push(...folderServices);\n }\n\n return services;\n}\n\nfunction extractServices(directory: unknown, url: string): Service[] {\n const arcgisServices = ((directory as any).services || []) as {name: string; type: string}[];\n const services: Service[] = [];\n for (const service of arcgisServices) {\n services.push({\n name: service.name,\n type: `arcgis-${service.type.toLocaleLowerCase().replace('server', '-server')}`,\n url: `${url}${service.name}/${service.type}`\n });\n }\n return services;\n}\n"],"mappings":"AAYA,OAAO,eAAeA,iBAAiBA,CACrCC,GAAW,EAEgB;EAAA,IAD3BC,SAAoB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGG,KAAK;EAE5B,IAAIL,GAAG,CAACM,QAAQ,CAAC,eAAe,CAAC,EAAE;IACjC,MAAMC,SAAS,GAAGP,GAAG,CAACQ,OAAO,CAAC,oBAAoB,EAAE,eAAe,CAAC;IACpE,OAAOC,oBAAoB,CAACF,SAAS,EAAEN,SAAS,EAAE,EAAE,CAAC;EACvD;EACA,OAAO,IAAI;AACb;AAEA,eAAeQ,oBAAoBA,CACjCF,SAAiB,EACjBF,KAAgB,EAChBK,IAAc,EACM;EACpB,MAAMC,UAAU,MAAAC,MAAA,CAAML,SAAS,OAAAK,MAAA,CAAIF,IAAI,CAACG,IAAI,CAAC,GAAG,CAAC,CAAE;EAEnD,MAAMC,QAAQ,GAAG,MAAMT,KAAK,IAAAO,MAAA,CAAID,UAAU,aAAU,CAAC;EACrD,MAAMI,SAAS,GAAG,MAAMD,QAAQ,CAACE,IAAI,CAAC,CAAC;EAEvC,MAAMC,QAAQ,GAAGC,eAAe,CAACH,SAAS,EAAEJ,UAAU,CAAC;EAEvD,MAAMQ,OAAO,GAAIJ,SAAS,CAACI,OAAO,IAAI,EAAe;EACrD,MAAMC,QAAQ,GAAGD,OAAO,CAACE,GAAG,CAAEC,MAAM,IAClCb,oBAAoB,IAAAG,MAAA,CAAIL,SAAS,GAAIF,KAAK,EAAE,CAAC,GAAGK,IAAI,EAAEY,MAAM,CAAC,CAC/D,CAAC;EAED,KAAK,MAAMC,cAAc,IAAI,MAAMC,OAAO,CAACC,GAAG,CAACL,QAAQ,CAAC,EAAE;IACxDH,QAAQ,CAACS,IAAI,CAAC,GAAGH,cAAc,CAAC;EAClC;EAEA,OAAON,QAAQ;AACjB;AAEA,SAASC,eAAeA,CAACH,SAAkB,EAAEf,GAAW,EAAa;EACnE,MAAM2B,cAAc,GAAKZ,SAAS,CAASE,QAAQ,IAAI,EAAqC;EAC5F,MAAMA,QAAmB,GAAG,EAAE;EAC9B,KAAK,MAAMW,OAAO,IAAID,cAAc,EAAE;IACpCV,QAAQ,CAACS,IAAI,CAAC;MACZG,IAAI,EAAED,OAAO,CAACC,IAAI;MAClBC,IAAI,YAAAlB,MAAA,CAAYgB,OAAO,CAACE,IAAI,CAACC,iBAAiB,CAAC,CAAC,CAACvB,OAAO,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAE;MAC/ER,GAAG,KAAAY,MAAA,CAAKZ,GAAG,EAAAY,MAAA,CAAGgB,OAAO,CAACC,IAAI,OAAAjB,MAAA,CAAIgB,OAAO,CAACE,IAAI;IAC5C,CAAC,CAAC;EACJ;EACA,OAAOb,QAAQ;AACjB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createImageService } from '../lib/services/create-image-service';
|
|
2
|
+
import { WMSService } from './ogc/wms-service';
|
|
3
|
+
import { ArcGISImageService } from './arcgis/arcgis-image-service';
|
|
4
|
+
const SERVICES = [WMSService, ArcGISImageService];
|
|
5
|
+
export function createImageSource(props) {
|
|
6
|
+
return createImageService(props, SERVICES);
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=create-image-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-image-source.js","names":["createImageService","WMSService","ArcGISImageService","SERVICES","createImageSource","props"],"sources":["../../../src/services/create-image-source.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {Service, ImageSource} from '@loaders.gl/loader-utils';\n// import {ImageService} from '../lib/services/image-service';\nimport {ImageServiceProps} from '../lib/services/image-service';\nimport {createImageService, CreateImageServiceProps} from '../lib/services/create-image-service';\n\nimport type {WMSSourceProps} from './ogc/wms-service';\nimport {WMSService} from './ogc/wms-service';\nimport {ArcGISImageService} from './arcgis/arcgis-image-service';\n\nexport type ImageServiceType = 'wms' | 'arcgis-image-server' | 'template';\n\nconst SERVICES: Service[] = [WMSService, ArcGISImageService];\n\ntype CreateImageSourceProps = CreateImageServiceProps &\n ImageServiceProps &\n WMSSourceProps & {\n type?: ImageServiceType | 'auto';\n };\n\n/**\n * Creates an image source\n * If type is not supplied, will try to automatically detect the the\n * @param url URL to the image source\n * @param type type of source. if not known, set to 'auto'\n * @returns an ImageSource instance\n */\nexport function createImageSource(props: CreateImageSourceProps): ImageSource {\n return createImageService(props, SERVICES);\n}\n"],"mappings":"AAKA,SAAQA,kBAAkB,QAAgC,sCAAsC;AAGhG,SAAQC,UAAU,QAAO,mBAAmB;AAC5C,SAAQC,kBAAkB,QAAO,+BAA+B;AAIhE,MAAMC,QAAmB,GAAG,CAACF,UAAU,EAAEC,kBAAkB,CAAC;AAe5D,OAAO,SAASE,iBAAiBA,CAACC,KAA6B,EAAe;EAC5E,OAAOL,kBAAkB,CAACK,KAAK,EAAEF,QAAQ,CAAC;AAC5C"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
import { DataSource } from '
|
|
3
|
-
import { CSWCapabilitiesLoader } from '
|
|
4
|
-
import { CSWRecordsLoader } from '
|
|
5
|
-
import { CSWDomainLoader } from '
|
|
6
|
-
import { WMSErrorLoader as CSWErrorLoader } from '
|
|
2
|
+
import { DataSource } from '@loaders.gl/loader-utils';
|
|
3
|
+
import { CSWCapabilitiesLoader } from '../../csw-capabilities-loader';
|
|
4
|
+
import { CSWRecordsLoader } from '../../csw-records-loader';
|
|
5
|
+
import { CSWDomainLoader } from '../../csw-domain-loader';
|
|
6
|
+
import { WMSErrorLoader as CSWErrorLoader } from '../../wms-error-loader';
|
|
7
7
|
export class CSWService extends DataSource {
|
|
8
8
|
constructor(props) {
|
|
9
9
|
super(props);
|
|
@@ -135,12 +135,14 @@ export class CSWService extends DataSource {
|
|
|
135
135
|
_checkResponse(response, arrayBuffer) {
|
|
136
136
|
const contentType = response.headers['content-type'];
|
|
137
137
|
if (!response.ok || CSWErrorLoader.mimeTypes.includes(contentType)) {
|
|
138
|
-
|
|
138
|
+
var _CSWErrorLoader$parse;
|
|
139
|
+
const error = (_CSWErrorLoader$parse = CSWErrorLoader.parseSync) === null || _CSWErrorLoader$parse === void 0 ? void 0 : _CSWErrorLoader$parse.call(CSWErrorLoader, arrayBuffer, this.props.loadOptions);
|
|
139
140
|
throw new Error(error);
|
|
140
141
|
}
|
|
141
142
|
}
|
|
142
143
|
_parseError(arrayBuffer) {
|
|
143
|
-
|
|
144
|
+
var _CSWErrorLoader$parse2;
|
|
145
|
+
const error = (_CSWErrorLoader$parse2 = CSWErrorLoader.parseSync) === null || _CSWErrorLoader$parse2 === void 0 ? void 0 : _CSWErrorLoader$parse2.call(CSWErrorLoader, arrayBuffer, this.props.loadOptions);
|
|
144
146
|
return new Error(error);
|
|
145
147
|
}
|
|
146
148
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"csw-service.js","names":["DataSource","CSWCapabilitiesLoader","CSWRecordsLoader","CSWDomainLoader","WMSErrorLoader","CSWErrorLoader","CSWService","constructor","props","_defineProperty","getMetadata","capabilities","getCapabilities","normalizeMetadata","getServiceDirectory","options","services","unknownServices","records","getRecords","record","reference","references","url","value","scheme","push","name","title","type","_parseOGCUrl","includeUnknown","concat","parts","split","params","wmsParameters","vendorParameters","getCapabilitiesURL","response","fetch","arrayBuffer","_checkResponse","parse","loadOptions","getRecordsURL","getDomain","getDomainURL","version","service","request","_getCSWUrl","typenames","first","key","Object","entries","Array","isArray","toUpperCase","join","String","encodeURI","contentType","headers","ok","mimeTypes","includes","_CSWErrorLoader$parse","error","parseSync","call","Error","_parseError","_CSWErrorLoader$parse2","toLowerCase"],"sources":["../../../../src/services/ogc/csw-service.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n/* eslint-disable camelcase */\n\nimport type {DataSourceProps} from '@loaders.gl/loader-utils';\nimport {DataSource} from '@loaders.gl/loader-utils';\n\nimport type {CSWCapabilities} from '../../csw-capabilities-loader';\nimport {CSWCapabilitiesLoader} from '../../csw-capabilities-loader';\n\nimport type {CSWRecords} from '../../csw-records-loader';\nimport {CSWRecordsLoader} from '../../csw-records-loader';\n\nimport type {CSWDomain} from '../../csw-domain-loader';\nimport {CSWDomainLoader} from '../../csw-domain-loader';\n\nimport {WMSErrorLoader as CSWErrorLoader} from '../../wms-error-loader';\n\ntype CSWCommonParameters = {\n /** In case the endpoint supports multiple services */\n service?: 'CSW';\n /** In case the endpoint supports multiple CSW versions */\n version?: '1.1.1' | '2.0.0' | '2.0.1' | '3.0.0';\n};\n\nexport type CSWGetCapabilitiesParameters = CSWCommonParameters & {\n /** Request type */\n request?: 'GetCapabilities';\n};\n\nexport type CSWGetRecordsParameters = CSWCommonParameters & {\n /** Request type */\n request?: 'GetRecords';\n /** type of records */\n typenames: 'csw:Record';\n};\n\nexport type CSWGetDomainParameters = CSWCommonParameters & {\n /** Request type */\n request?: 'GetDomain';\n // TBA\n};\n\n/** Describes a service or resource exposed by the catalog */\nexport type Service = {\n /** name of service or resource */\n name: string;\n /** type of service or resource */\n type: string;\n url: string;\n params?: string;\n scheme?: string;\n};\n\nexport type CSWServiceProps = DataSourceProps & {\n url: string;\n};\n\n/**\n * The CSWService class\n * - provides type safe methods to form URLs to a CSW service\n * - provides type safe methods to query and parse results (and errors) from a CSW service\n * @note Only the URL parameter conversion is supported. XML posts are not supported.\n */\nexport class CSWService extends DataSource<CSWServiceProps> {\n static type: 'csw' = 'csw';\n static testURL = (url: string): boolean => url.toLowerCase().includes('csw');\n\n capabilities: CSWCapabilities | null = null;\n\n /** A list of loaders used by the CSWService methods */\n readonly loaders = [CSWErrorLoader, CSWCapabilitiesLoader];\n\n /** Create a CSWService */\n constructor(props: CSWServiceProps) {\n super(props);\n }\n\n async getMetadata(): Promise<CSWCapabilities> {\n const capabilities = await this.getCapabilities();\n return this.normalizeMetadata(capabilities);\n }\n\n normalizeMetadata(capabilities: CSWCapabilities): CSWCapabilities {\n return capabilities;\n }\n\n async getServiceDirectory(options?: {includeUnknown?: boolean}): Promise<Service[]> {\n const services: Service[] = [];\n const unknownServices: Service[] = [];\n\n const records = await this.getRecords();\n for (const record of records.records) {\n for (const reference of record.references) {\n const url = reference.value;\n switch (reference.scheme) {\n case 'OGC:WMS':\n services.push({name: record.title, type: 'ogc-wms-service', ...this._parseOGCUrl(url)});\n break;\n case 'OGC:WMTS':\n services.push({\n name: record.title,\n type: 'ogc-wmts-service',\n ...this._parseOGCUrl(url)\n });\n break;\n case 'OGC:WFS':\n services.push({name: record.title, type: 'ogc-wfs-service', ...this._parseOGCUrl(url)});\n break;\n default:\n unknownServices.push({\n name: record.title,\n type: 'unknown',\n url: reference.value,\n scheme: reference.scheme\n });\n }\n }\n }\n\n return options?.includeUnknown ? services.concat(unknownServices) : services;\n }\n\n _parseOGCUrl(url: string): {url: string; params: string} {\n const parts = url.split('?');\n return {\n url: parts[0],\n params: parts[1] || ''\n };\n }\n\n // CSW Service API Stubs\n\n /** Get Capabilities */\n async getCapabilities(\n wmsParameters?: CSWGetCapabilitiesParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<CSWCapabilities> {\n const url = this.getCapabilitiesURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n const capabilities = await CSWCapabilitiesLoader.parse(arrayBuffer, this.props.loadOptions);\n return capabilities;\n }\n\n /** Get Records */\n async getRecords(\n wmsParameters?: CSWGetRecordsParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<CSWRecords> {\n const url = this.getRecordsURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return await CSWRecordsLoader.parse(arrayBuffer, this.props.loadOptions);\n }\n\n /** Get Domain */\n async getDomain(\n wmsParameters?: CSWGetDomainParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<CSWDomain> {\n const url = this.getDomainURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return await CSWDomainLoader.parse(arrayBuffer, this.props.loadOptions);\n }\n\n // Typed URL creators\n // For applications that want full control of fetching and parsing\n\n /** Generate a URL for the GetCapabilities request */\n getCapabilitiesURL(\n wmsParameters?: CSWGetCapabilitiesParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<CSWGetCapabilitiesParameters> = {\n version: '3.0.0',\n ...wmsParameters,\n ...vendorParameters,\n service: 'CSW',\n request: 'GetCapabilities'\n };\n return this._getCSWUrl(options, vendorParameters);\n }\n\n /** Generate a URL for the GetCapabilities request */\n getRecordsURL(\n wmsParameters?: CSWGetRecordsParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<CSWGetRecordsParameters> = {\n version: '3.0.0',\n typenames: 'csw:Record',\n ...wmsParameters,\n ...vendorParameters,\n service: 'CSW',\n request: 'GetRecords'\n };\n return this._getCSWUrl(options, vendorParameters);\n }\n\n /** Generate a URL for the GetCapabilities request */\n getDomainURL(\n wmsParameters?: CSWGetDomainParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<CSWGetDomainParameters> = {\n version: '3.0.0',\n ...wmsParameters,\n ...vendorParameters,\n service: 'CSW',\n request: 'GetDomain'\n };\n return this._getCSWUrl(options, vendorParameters);\n }\n\n // INTERNAL METHODS\n\n /**\n * @note case _getCSWUrl may need to be overridden to handle certain backends?\n * */\n protected _getCSWUrl(\n options: Record<string, unknown>,\n vendorParameters?: Record<string, unknown>\n ): string {\n let url = this.props.url;\n let first = true;\n for (const [key, value] of Object.entries(options)) {\n url += first ? '?' : '&';\n first = false;\n if (Array.isArray(value)) {\n url += `${key.toUpperCase()}=${value.join(',')}`;\n } else {\n url += `${key.toUpperCase()}=${value ? String(value) : ''}`;\n }\n }\n return encodeURI(url);\n }\n\n /** Checks for and parses a CSW XML formatted ServiceError and throws an exception */\n protected _checkResponse(response: Response, arrayBuffer: ArrayBuffer): void {\n const contentType = response.headers['content-type'];\n if (!response.ok || CSWErrorLoader.mimeTypes.includes(contentType)) {\n const error = CSWErrorLoader.parseSync?.(arrayBuffer, this.props.loadOptions);\n throw new Error(error);\n }\n }\n\n /** Error situation detected */\n protected _parseError(arrayBuffer: ArrayBuffer): Error {\n const error = CSWErrorLoader.parseSync?.(arrayBuffer, this.props.loadOptions);\n return new Error(error);\n }\n}\n"],"mappings":";AAKA,SAAQA,UAAU,QAAO,0BAA0B;AAGnD,SAAQC,qBAAqB,QAAO,+BAA+B;AAGnE,SAAQC,gBAAgB,QAAO,0BAA0B;AAGzD,SAAQC,eAAe,QAAO,yBAAyB;AAEvD,SAAQC,cAAc,IAAIC,cAAc,QAAO,wBAAwB;AAgDvE,OAAO,MAAMC,UAAU,SAASN,UAAU,CAAkB;EAU1DO,WAAWA,CAACC,KAAsB,EAAE;IAClC,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,uBAPwB,IAAI;IAAAA,eAAA,kBAGxB,CAACJ,cAAc,EAAEJ,qBAAqB,CAAC;EAK1D;EAEA,MAAMS,WAAWA,CAAA,EAA6B;IAC5C,MAAMC,YAAY,GAAG,MAAM,IAAI,CAACC,eA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4B,KAAK,CAACH,KAAK,CAAC;IACxB;EACF;EAGUI,WAAWA,CAAChC,WAAwB,EAAS;IAAA,IAAAiC,sBAAA;IACrD,MAAML,KAAK,IAAAK,sBAAA,GAAGrE,cAAc,CAACiE,SAAS,cAAAI,sBAAA,uBAAxBA,sBAAA,CAAAH,IAAA,CAAAlE,cAAc,EAAaoC,WAAW,EAAE,IAAI,CAACjC,KAAK,CAACoC,WAAW,CAAC;IAC7E,OAAO,IAAI4B,KAAK,CAACH,KAAK,CAAC;EACzB;AACF;AAAC5D,eAAA,CAhMYH,UAAU,UACA,KAAK;AAAAG,eAAA,CADfH,UAAU,aAEHiB,GAAW,IAAcA,GAAG,CAACoD,WAAW,CAAC,CAAC,CAACR,QAAQ,CAAC,KAAK,CAAC"}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import { ImageLoader } from '@loaders.gl/images';
|
|
3
3
|
import { mergeLoaderOptions } from '@loaders.gl/loader-utils';
|
|
4
|
-
import { ImageSource } from '
|
|
5
|
-
import { WMSCapabilitiesLoader } from '
|
|
6
|
-
import { WMSFeatureInfoLoader } from '
|
|
7
|
-
import { WMSLayerDescriptionLoader } from '
|
|
8
|
-
import { WMSErrorLoader } from '
|
|
9
|
-
export
|
|
4
|
+
import { ImageSource } from '@loaders.gl/loader-utils';
|
|
5
|
+
import { WMSCapabilitiesLoader } from '../../wms-capabilities-loader';
|
|
6
|
+
import { WMSFeatureInfoLoader } from '../../wip/wms-feature-info-loader';
|
|
7
|
+
import { WMSLayerDescriptionLoader } from '../../wip/wms-layer-description-loader';
|
|
8
|
+
import { WMSErrorLoader } from '../../wms-error-loader';
|
|
9
|
+
export const WMSService = {
|
|
10
|
+
type: 'wms',
|
|
11
|
+
testURL: url => url.toLowerCase().includes('wms'),
|
|
12
|
+
create: props => new WMSSource(props)
|
|
13
|
+
};
|
|
14
|
+
export class WMSSource extends ImageSource {
|
|
10
15
|
constructor(props) {
|
|
11
16
|
var _props$substituteCRS;
|
|
12
17
|
super(props);
|
|
@@ -16,7 +21,6 @@ export class WMSService extends ImageSource {
|
|
|
16
21
|
_defineProperty(this, "wmsParameters", void 0);
|
|
17
22
|
_defineProperty(this, "vendorParameters", void 0);
|
|
18
23
|
_defineProperty(this, "capabilities", null);
|
|
19
|
-
_defineProperty(this, "loaders", [ImageLoader, WMSErrorLoader, WMSCapabilitiesLoader, WMSFeatureInfoLoader, WMSLayerDescriptionLoader]);
|
|
20
24
|
this.url = props.url;
|
|
21
25
|
this.substituteCRS84 = (_props$substituteCRS = props.substituteCRS84) !== null && _props$substituteCRS !== void 0 ? _props$substituteCRS : false;
|
|
22
26
|
this.flipCRS = ['EPSG:4326'];
|
|
@@ -231,20 +235,20 @@ export class WMSService extends ImageSource {
|
|
|
231
235
|
_checkResponse(response, arrayBuffer) {
|
|
232
236
|
const contentType = response.headers['content-type'];
|
|
233
237
|
if (!response.ok || WMSErrorLoader.mimeTypes.includes(contentType)) {
|
|
238
|
+
var _WMSErrorLoader$parse;
|
|
234
239
|
const loadOptions = mergeLoaderOptions(this.loadOptions, {
|
|
235
240
|
wms: {
|
|
236
241
|
throwOnError: true
|
|
237
242
|
}
|
|
238
243
|
});
|
|
239
|
-
const error = WMSErrorLoader.parseSync(arrayBuffer, loadOptions);
|
|
244
|
+
const error = (_WMSErrorLoader$parse = WMSErrorLoader.parseSync) === null || _WMSErrorLoader$parse === void 0 ? void 0 : _WMSErrorLoader$parse.call(WMSErrorLoader, arrayBuffer, loadOptions);
|
|
240
245
|
throw new Error(error);
|
|
241
246
|
}
|
|
242
247
|
}
|
|
243
248
|
_parseError(arrayBuffer) {
|
|
244
|
-
|
|
249
|
+
var _WMSErrorLoader$parse2;
|
|
250
|
+
const error = (_WMSErrorLoader$parse2 = WMSErrorLoader.parseSync) === null || _WMSErrorLoader$parse2 === void 0 ? void 0 : _WMSErrorLoader$parse2.call(WMSErrorLoader, arrayBuffer, this.loadOptions);
|
|
245
251
|
return new Error(error);
|
|
246
252
|
}
|
|
247
253
|
}
|
|
248
|
-
_defineProperty(WMSService, "type", 'wms');
|
|
249
|
-
_defineProperty(WMSService, "testURL", url => url.toLowerCase().includes('wms'));
|
|
250
254
|
//# sourceMappingURL=wms-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wms-service.js","names":["ImageLoader","mergeLoaderOptions","ImageSource","WMSCapabilitiesLoader","WMSFeatureInfoLoader","WMSLayerDescriptionLoader","WMSErrorLoader","WMSService","type","testURL","url","toLowerCase","includes","create","props","WMSSource","constructor","_props$substituteCRS","_defineProperty","substituteCRS84","flipCRS","wmsParameters","layers","undefined","query_layers","styles","version","crs","format","info_format","transparent","time","elevation","vendorParameters","getMetadata","capabilities","getCapabilities","normalizeMetadata","getImage","parameters","getMap","getCapabilitiesURL","response","fetch","arrayBuffer","_checkResponse","parse","loadOptions","getMapURL","_parseError","getFeatureInfo","getFeatureInfoURL","getFeatureInfoText","TextDecoder","decode","describeLayer","describeLayerURL","getLegendGraphic","getLegendGraphicURL","options","_getWMSUrl","_getWMS130Parameters","_parseWMSUrl","baseUrl","search","split","searchParams","parameter","key","value","request","first","allParameters","service","IGNORE_EMPTY_KEYS","Object","entries","_getURLParameter","encodeURI","newParameters","srs","bbox","_flipBoundingBox","toUpperCase","Array","isArray","concat","join","String","bboxValue","length","flipCoordinates","_fetchArrayBuffer","contentType","headers","ok","mimeTypes","_WMSErrorLoader$parse","wms","throwOnError","error","parseSync","call","Error","_WMSErrorLoader$parse2"],"sources":["../../../../src/services/ogc/wms-service.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n/* eslint-disable camelcase */\nimport type {ImageType} from '@loaders.gl/images';\nimport {ImageLoader} from '@loaders.gl/images';\nimport {mergeLoaderOptions} from '@loaders.gl/loader-utils';\n\nimport type {Service, ImageSourceMetadata, GetImageParameters} from '@loaders.gl/loader-utils';\nimport {ImageSource} from '@loaders.gl/loader-utils';\nimport type {ImageServiceProps} from '../../lib/services/image-service';\n\nimport type {WMSCapabilities} from '../../wms-capabilities-loader';\nimport type {WMSFeatureInfo} from '../../wip/wms-feature-info-loader';\nimport type {WMSLayerDescription} from '../../wip/wms-layer-description-loader';\n\nimport {WMSCapabilitiesLoader} from '../../wms-capabilities-loader';\nimport {WMSFeatureInfoLoader} from '../../wip/wms-feature-info-loader';\nimport {WMSLayerDescriptionLoader} from '../../wip/wms-layer-description-loader';\n\nimport type {WMSLoaderOptions} from '../../wms-error-loader';\nimport {WMSErrorLoader} from '../../wms-error-loader';\n\nexport const WMSService: Service<WMSSource, WMSSourceProps> = {\n type: 'wms',\n testURL: (url: string): boolean => url.toLowerCase().includes('wms'),\n create: (props: WMSSourceProps) => new WMSSource(props)\n};\n\n/**\n * \"Static\" WMS parameters (not viewport or selected pixel dependent)\n * These can be provided as defaults in the WMSSource constructor\n */\nexport type WMSParameters = {\n /** WMS version (all requests) */\n version?: '1.3.0' | '1.1.1';\n /** Layers to render (GetMap, GetFeatureInfo) */\n layers?: string[];\n /** list of layers to query.. (GetFeatureInfo) */\n query_layers?: string[];\n\n /** Coordinate Reference System (CRS) for the image (not the bounding box) */\n crs?: string;\n /** Requested format for the return image (GetMap, GetLegendGraphic) */\n format?: 'image/png';\n /** Requested MIME type of returned feature info (GetFeatureInfo) */\n info_format?: 'text/plain' | 'application/geojson' | 'application/vnd.ogc.gml';\n /** Styling - Not yet supported */\n styles?: unknown;\n /** Any additional parameters specific to this WMSSource (GetMap) */\n transparent?: boolean;\n /** If layer supports time dimension */\n time?: string;\n /** If layer supports elevation dimension */\n elevation?: string;\n};\n\n/** Parameters for GetCapabilities */\nexport type WMSGetCapabilitiesParameters = {\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.3.0' | '1.1.1';\n};\n\n/** Parameters for GetMap */\nexport type WMSGetMapParameters = {\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.3.0' | '1.1.1';\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** requested format for the return image. can be provided in service constructor */\n format?: 'image/png';\n /** Layers to render - can be provided in service constructor */\n layers?: string | string[];\n /** Coordinate Reference System for the image (not bounding box). can be provided in service constructor. */\n crs?: string;\n /** Styling. can be provided in service constructor */\n styles?: unknown;\n /** Don't render background when no data. can be provided in service constructor */\n transparent?: boolean;\n /** If layer supports time dimension */\n time?: string;\n /** If layer supports elevation dimension */\n elevation?: string;\n};\n\n/** GetMap parameters that are specific to the current view */\nexport type WMSGetMapViewParameters = {\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n /** Coordinate Reference System for the image (not bounding box). can be provided in service constructor. */\n crs?: string;\n};\n\n/**\n * Parameters for GetFeatureInfo\n * @see https://imagery.pasda.psu.edu/arcgis/services/pasda/UrbanTreeCanopy_Landcover/MapServer/WmsServer?SERVICE=WMS&\n */\nexport type WMSGetFeatureInfoParameters = {\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.3.0' | '1.1.1';\n /** x coordinate for the feature info request */\n x: number;\n /** y coordinate for the feature info request */\n y: number;\n /** MIME type of returned feature info. Can be specified in service constructor */\n info_format?: 'text/plain' | 'application/geojson' | 'application/vnd.ogc.gml';\n /** list of layers to query. Required but can be specified in service constructor. */\n query_layers?: string[];\n /** Layers to render. Required, but can be specified in service constructor */\n layers?: string[];\n /** Styling */\n styles?: unknown;\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** srs for the image (not the bounding box) */\n crs?: string;\n};\n\n/** GetMap parameters that are specific to the current view */\nexport type WMSGetFeatureInfoViewParameters = {\n /** x coordinate for the feature info request */\n x: number;\n /** y coordinate for the feature info request */\n y: number;\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n /** srs for the image (not the bounding box) */\n crs?: string;\n};\n\n/** Parameters for DescribeLayer */\nexport type WMSDescribeLayerParameters = {\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.3.0' | '1.1.1';\n};\n\n/** Parameters for GetLegendGraphic */\nexport type WMSGetLegendGraphicParameters = {\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.3.0' | '1.1.1';\n};\n\n//\n\n/** Properties for creating a enw WMS service */\nexport type WMSSourceProps = ImageServiceProps & {\n /** Base URL to the service */\n url: string;\n /** In 1.3.0, replaces references to EPSG:4326 with CRS:84 */\n substituteCRS84?: boolean;\n /** Default WMS parameters. If not provided here, must be provided in the various request */\n wmsParameters?: WMSParameters;\n /** Any additional service specific parameters */\n vendorParameters?: Record<string, unknown>;\n};\n\n/**\n * The WMSSource class provides\n * - provides type safe methods to form URLs to a WMS service\n * - provides type safe methods to query and parse results (and errors) from a WMS service\n * - implements the ImageService interface\n * @note Only the URL parameter conversion is supported. XML posts are not supported.\n */\nexport class WMSSource extends ImageSource<WMSSourceProps> {\n /** Base URL to the service */\n readonly url: string;\n\n /** In WMS 1.3.0, replaces references to EPSG:4326 with CRS:84. But not always supported. Default: false */\n substituteCRS84: boolean;\n /** In WMS 1.3.0, flips x,y (lng, lat) coordinates for the supplied coordinate systems. Default: ['ESPG:4326'] */\n flipCRS: string[];\n\n /** Default static WMS parameters */\n wmsParameters: Required<WMSParameters>;\n /** Default static vendor parameters */\n vendorParameters?: Record<string, unknown>;\n\n capabilities: WMSCapabilities | null = null;\n\n /** Create a WMSSource */\n constructor(props: WMSSourceProps) {\n super(props);\n\n // TODO - defaults such as version, layers etc could be extracted from a base URL with parameters\n // This would make pasting in any WMS URL more likely to make this class just work.\n // const {baseUrl, parameters} = this._parseWMSUrl(props.url);\n\n this.url = props.url;\n\n this.substituteCRS84 = props.substituteCRS84 ?? false;\n this.flipCRS = ['EPSG:4326'];\n\n this.wmsParameters = {\n layers: undefined!,\n query_layers: undefined!,\n styles: undefined,\n version: '1.3.0',\n crs: 'EPSG:4326',\n format: 'image/png',\n info_format: 'text/plain',\n transparent: undefined!,\n time: undefined!,\n elevation: undefined!,\n ...props.wmsParameters\n };\n\n this.vendorParameters = props.vendorParameters || {};\n }\n\n // ImageService implementation\n async getMetadata(): Promise<ImageSourceMetadata> {\n const capabilities = await this.getCapabilities();\n return this.normalizeMetadata(capabilities);\n }\n\n async getImage(parameters: GetImageParameters): Promise<ImageType> {\n return await this.getMap(parameters);\n }\n\n normalizeMetadata(capabilities: WMSCapabilities): ImageSourceMetadata {\n return capabilities;\n }\n\n // WMS Service API Stubs\n\n /** Get Capabilities */\n async getCapabilities(\n wmsParameters?: WMSGetCapabilitiesParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<WMSCapabilities> {\n const url = this.getCapabilitiesURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n const capabilities = await WMSCapabilitiesLoader.parse(arrayBuffer, this.loadOptions);\n this.capabilities = capabilities;\n return capabilities;\n }\n\n /** Get a map image */\n async getMap(\n wmsParameters: WMSGetMapParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<ImageType> {\n const url = this.getMapURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n try {\n return await ImageLoader.parse(arrayBuffer, this.loadOptions);\n } catch {\n throw this._parseError(arrayBuffer);\n }\n }\n\n /** Get Feature Info for a coordinate */\n async getFeatureInfo(\n wmsParameters: WMSGetFeatureInfoParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<WMSFeatureInfo> {\n const url = this.getFeatureInfoURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return await WMSFeatureInfoLoader.parse(arrayBuffer, this.loadOptions);\n }\n\n /** Get Feature Info for a coordinate */\n async getFeatureInfoText(\n wmsParameters: WMSGetFeatureInfoParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<string> {\n const url = this.getFeatureInfoURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return new TextDecoder().decode(arrayBuffer);\n }\n\n /** Get more information about a layer */\n async describeLayer(\n wmsParameters: WMSDescribeLayerParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<WMSLayerDescription> {\n const url = this.describeLayerURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return await WMSLayerDescriptionLoader.parse(arrayBuffer, this.loadOptions);\n }\n\n /** Get an image with a semantic legend */\n async getLegendGraphic(\n wmsParameters: WMSGetLegendGraphicParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<ImageType> {\n const url = this.getLegendGraphicURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n try {\n return await ImageLoader.parse(arrayBuffer, this.loadOptions);\n } catch {\n throw this._parseError(arrayBuffer);\n }\n }\n\n // Typed URL creators\n // For applications that want full control of fetching and parsing\n\n /** Generate a URL for the GetCapabilities request */\n getCapabilitiesURL(\n wmsParameters?: WMSGetCapabilitiesParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSGetCapabilitiesParameters> = {\n version: this.wmsParameters.version,\n ...wmsParameters\n };\n return this._getWMSUrl('GetCapabilities', options, vendorParameters);\n }\n\n /** Generate a URL for the GetMap request */\n getMapURL(\n wmsParameters: WMSGetMapParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n wmsParameters = this._getWMS130Parameters(wmsParameters);\n const options: Required<WMSGetMapParameters> = {\n version: this.wmsParameters.version,\n format: this.wmsParameters.format,\n transparent: this.wmsParameters.transparent,\n time: this.wmsParameters.time,\n elevation: this.wmsParameters.elevation,\n layers: this.wmsParameters.layers,\n styles: this.wmsParameters.styles,\n crs: this.wmsParameters.crs,\n // bbox: [-77.87304, 40.78975, -77.85828, 40.80228],\n // width: 1200,\n // height: 900,\n ...wmsParameters\n };\n return this._getWMSUrl('GetMap', options, vendorParameters);\n }\n\n /** Generate a URL for the GetFeatureInfo request */\n getFeatureInfoURL(\n wmsParameters: WMSGetFeatureInfoParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSGetFeatureInfoParameters> = {\n version: this.wmsParameters.version,\n // query_layers: [],\n // format: this.wmsParameters.format,\n info_format: this.wmsParameters.info_format,\n layers: this.wmsParameters.layers,\n query_layers: this.wmsParameters.query_layers,\n styles: this.wmsParameters.styles,\n crs: this.wmsParameters.crs,\n // bbox: [-77.87304, 40.78975, -77.85828, 40.80228],\n // width: 1200,\n // height: 900,\n // x: undefined!,\n // y: undefined!,\n ...wmsParameters\n };\n return this._getWMSUrl('GetFeatureInfo', options, vendorParameters);\n }\n\n /** Generate a URL for the GetFeatureInfo request */\n describeLayerURL(\n wmsParameters: WMSDescribeLayerParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSDescribeLayerParameters> = {\n version: this.wmsParameters.version,\n ...wmsParameters\n };\n return this._getWMSUrl('DescribeLayer', options, vendorParameters);\n }\n\n getLegendGraphicURL(\n wmsParameters: WMSGetLegendGraphicParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSGetLegendGraphicParameters> = {\n version: this.wmsParameters.version,\n // format?\n ...wmsParameters\n };\n return this._getWMSUrl('GetLegendGraphic', options, vendorParameters);\n }\n\n // INTERNAL METHODS\n\n _parseWMSUrl(url: string): {url: string; parameters: Record<string, unknown>} {\n const [baseUrl, search] = url.split('?');\n const searchParams = search.split('&');\n\n const parameters: Record<string, unknown> = {};\n for (const parameter of searchParams) {\n const [key, value] = parameter.split('=');\n parameters[key] = value;\n }\n\n return {url: baseUrl, parameters};\n }\n\n /**\n * Generate a URL with parameters\n * @note case _getWMSUrl may need to be overridden to handle certain backends?\n * @note at the moment, only URLs with parameters are supported (no XML payloads)\n * */\n protected _getWMSUrl(\n request: string,\n wmsParameters: {version?: '1.3.0' | '1.1.1'; [key: string]: unknown},\n vendorParameters?: Record<string, unknown>\n ): string {\n let url = this.url;\n let first = true;\n\n // Add any vendor searchParams\n const allParameters = {\n service: 'WMS',\n version: wmsParameters.version,\n request,\n ...wmsParameters,\n ...this.vendorParameters,\n ...vendorParameters\n };\n\n // Encode the keys\n const IGNORE_EMPTY_KEYS = ['transparent', 'time', 'elevation'];\n for (const [key, value] of Object.entries(allParameters)) {\n // hack to preserve test cases. Not super clear if keys should be included when values are undefined\n if (!IGNORE_EMPTY_KEYS.includes(key) || value) {\n url += first ? '?' : '&';\n first = false;\n url += this._getURLParameter(key, value, wmsParameters);\n }\n }\n\n return encodeURI(url);\n }\n\n _getWMS130Parameters<ParametersT extends {crs?: string; srs?: string}>(\n wmsParameters: ParametersT\n ): ParametersT {\n const newParameters = {...wmsParameters};\n if (newParameters.srs) {\n newParameters.crs = newParameters.crs || newParameters.srs;\n delete newParameters.srs;\n }\n return newParameters;\n }\n\n // eslint-disable-complexity\n _getURLParameter(key: string, value: unknown, wmsParameters: WMSParameters): string {\n // Substitute by key\n switch (key) {\n case 'crs':\n // CRS was called SRS before WMS 1.3.0\n if (wmsParameters.version !== '1.3.0') {\n key = 'srs';\n } else if (this.substituteCRS84 && value === 'EPSG:4326') {\n /** In 1.3.0, replaces references to 'EPSG:4326' with the new backwards compatible CRS:84 */\n // Substitute by value\n value = 'CRS:84';\n }\n break;\n\n case 'srs':\n // CRS was called SRS before WMS 1.3.0\n if (wmsParameters.version === '1.3.0') {\n key = 'crs';\n }\n break;\n\n case 'bbox':\n // Coordinate order is flipped for certain CRS in WMS 1.3.0\n const bbox = this._flipBoundingBox(value, wmsParameters);\n if (bbox) {\n value = bbox;\n }\n break;\n\n default:\n // do nothing\n }\n\n key = key.toUpperCase();\n\n return Array.isArray(value)\n ? `${key}=${value.join(',')}`\n : `${key}=${value ? String(value) : ''}`;\n }\n\n /** Coordinate order is flipped for certain CRS in WMS 1.3.0 */\n _flipBoundingBox(\n bboxValue: unknown,\n wmsParameters: WMSParameters\n ): [number, number, number, number] | null {\n // Sanity checks\n if (!Array.isArray(bboxValue) || bboxValue.length !== 4) {\n return null;\n }\n\n const flipCoordinates =\n // Only affects WMS 1.3.0\n wmsParameters.version === '1.3.0' &&\n // Flip if we are dealing with a CRS that was flipped in 1.3.0\n this.flipCRS.includes(wmsParameters.crs || '') &&\n // Don't flip if we are subsituting EPSG:4326 with CRS:84\n !(this.substituteCRS84 && wmsParameters.crs === 'EPSG:4326');\n\n const bbox = bboxValue as [number, number, number, number];\n return flipCoordinates ? [bbox[1], bbox[0], bbox[3], bbox[2]] : bbox;\n }\n\n /** Fetches an array buffer and checks the response (boilerplate reduction) */\n protected async _fetchArrayBuffer(url: string): Promise<ArrayBuffer> {\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return arrayBuffer;\n }\n\n /** Checks for and parses a WMS XML formatted ServiceError and throws an exception */\n protected _checkResponse(response: Response, arrayBuffer: ArrayBuffer): void {\n const contentType = response.headers['content-type'];\n if (!response.ok || WMSErrorLoader.mimeTypes.includes(contentType)) {\n // We want error responses to throw exceptions, the WMSErrorLoader can do this\n const loadOptions = mergeLoaderOptions<WMSLoaderOptions>(this.loadOptions, {\n wms: {throwOnError: true}\n });\n const error = WMSErrorLoader.parseSync?.(arrayBuffer, loadOptions);\n throw new Error(error);\n }\n }\n\n /** Error situation detected */\n protected _parseError(arrayBuffer: ArrayBuffer): Error {\n const error = WMSErrorLoader.parseSync?.(arrayBuffer, this.loadOptions);\n return new Error(error);\n }\n}\n"],"mappings":";AAIA,SAAQA,WAAW,QAAO,oBAAoB;AAC9C,SAAQC,kBAAkB,QAAO,0BAA0B;AAG3D,SAAQC,WAAW,QAAO,0BAA0B;AAOpD,SAAQC,qBAAqB,QAAO,+BAA+B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c,CAAC+F,SAAS,cAAAJ,qBAAA,uBAAxBA,qBAAA,CAAAK,IAAA,CAAAhG,cAAc,EAAasC,WAAW,EAAEG,WAAW,CAAC;MAClE,MAAM,IAAIwD,KAAK,CAACH,KAAK,CAAC;IACxB;EACF;EAGUnD,WAAWA,CAACL,WAAwB,EAAS;IAAA,IAAA4D,sBAAA;IACrD,MAAMJ,KAAK,IAAAI,sBAAA,GAAGlG,cAAc,CAAC+F,SAAS,cAAAG,sBAAA,uBAAxBA,sBAAA,CAAAF,IAAA,CAAAhG,cAAc,EAAasC,WAAW,EAAE,IAAI,CAACG,WAAW,CAAC;IACvE,OAAO,IAAIwD,KAAK,CAACH,KAAK,CAAC;EACzB;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-wfs.js","names":["XMLLoader","parseWFSCapabilities","text","options","_options","_XMLLoader$parseTextS","xml","removeNSPrefix","parsedXML","parseTextSync","call","xmlCapabilities","Capabilities","uncapitalizeKeys","object","newObject","key","value","Object","entries","uncapitalize","str","charAt","toLowerCase","slice"],"sources":["../../../../../src/wip/lib/wfs/parse-wfs.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\nexport type WFSCapabilities = {};\n\n/**\n * Parses a typed data structure from raw XML for `GetCapabilities` response\n * @note Error handlings is fairly weak\n */\nexport function parseWFSCapabilities(text: string, options): WFSCapabilities {\n // Remove namespaces in XML\n options = {...options, xml: {...options?.xml, removeNSPrefix: true}};\n const parsedXML = XMLLoader.parseTextSync?.(text, options);\n const xmlCapabilities: any = parsedXML.Capabilities || parsedXML;\n return uncapitalizeKeys(xmlCapabilities);\n}\n\n/** Uncapitalize all keys of an object */\nfunction uncapitalizeKeys(object: any): any {\n if (object && typeof object === 'object') {\n const newObject = {};\n for (const [key, value] of Object.entries(object)) {\n newObject[uncapitalize(key)] = uncapitalizeKeys(value);\n }\n return newObject;\n }\n return object;\n}\n\n/** Uncapitalize first letter of a string */\nfunction uncapitalize(str: string): string {\n return typeof str === 'string' ? str.charAt(0).toLowerCase() + str.slice(1) : str;\n}\n"],"mappings":"AAEA,SAAQA,SAAS,QAAO,iBAAiB;AAQzC,OAAO,SAASC,oBAAoBA,CAACC,IAAY,EAAEC,OAAO,EAAmB;EAAA,IAAAC,QAAA,EAAAC,qBAAA;EAE3EF,OAAO,GAAG;IAAC,GAAGA,OAAO;IAAEG,GAAG,EAAE;MAAC,KAAAF,QAAA,GAAGD,OAAO,cAAAC,QAAA,uBAAPA,QAAA,CAASE,GAAG;MAAEC,cAAc,EAAE;IAAI;EAAC,CAAC;EACpE,MAAMC,SAAS,IAAAH,qBAAA,GAAGL,SAAS,CAACS,aAAa,cAAAJ,qBAAA,uBAAvBA,qBAAA,CAAAK,IAAA,CAAAV,SAAS,EAAiBE,IAAI,EAAEC,OAAO,CAAC;EAC1D,MAAMQ,eAAoB,GAAGH,SAAS,CAACI,YAAY,IAAIJ,SAAS;EAChE,OAAOK,gBAAgB,CAACF,eAAe,CAAC;AAC1C;AAGA,SAASE,gBAAgBA,CAACC,MAAW,EAAO;EAC1C,IAAIA,MAAM,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;IACxC,MAAMC,SAAS,GAAG,CAAC,CAAC;IACpB,KAAK,MAAM,CAACC,GAAG,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACL,MAAM,CAAC,EAAE;MACjDC,SAAS,CAACK,YAAY,CAACJ,GAAG,CAAC,CAAC,GAAGH,gBAAgB,CAACI,KAAK,CAAC;IACxD;IACA,OAAOF,SAAS;EAClB;EACA,OAAOD,MAAM;AACf;AAGA,SAASM,YAAYA,CAACC,GAAW,EAAU;EACzC,OAAO,OAAOA,GAAG,KAAK,QAAQ,GAAGA,GAAG,CAACC,MAAM,CAAC,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC,GAAGF,GAAG,CAACG,KAAK,CAAC,CAAC,CAAC,GAAGH,GAAG;AACnF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-wmts.js","names":["XMLLoader","parseWMTSCapabilities","text","options","_options","_XMLLoader$parseTextS","xml","removeNSPrefix","parsedXML","parseTextSync","call","xmlCapabilities","Capabilities","uncapitalizeKeys","object","newObject","key","value","Object","entries","uncapitalize","str","charAt","toLowerCase","slice"],"sources":["../../../../../src/wip/lib/wmts/parse-wmts.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\nexport type WMTSCapabilities = {};\n\n/**\n * Parses a typed data structure from raw XML for `GetCapabilities` response\n * @note Error handlings is fairly weak\n */\nexport function parseWMTSCapabilities(text: string, options): WMTSCapabilities {\n // Remove namespaces in XML\n options = {...options, xml: {...options?.xml, removeNSPrefix: true}};\n const parsedXML = XMLLoader.parseTextSync?.(text, options);\n const xmlCapabilities: any = parsedXML.Capabilities || parsedXML;\n return uncapitalizeKeys(xmlCapabilities);\n}\n\nfunction uncapitalizeKeys(object: any): any {\n if (object && typeof object === 'object') {\n const newObject = {};\n for (const [key, value] of Object.entries(object)) {\n newObject[uncapitalize(key)] = uncapitalizeKeys(value);\n }\n return newObject;\n }\n return object;\n}\n\n/**\n * Uncapitalize first letter of a string\n * @param {string} str\n * @returns {string}\n */\nfunction uncapitalize(str: string): string {\n return typeof str === 'string' ? str.charAt(0).toLowerCase() + str.slice(1) : str;\n}\n"],"mappings":"AAEA,SAAQA,SAAS,QAAO,iBAAiB;AAQzC,OAAO,SAASC,qBAAqBA,CAACC,IAAY,EAAEC,OAAO,EAAoB;EAAA,IAAAC,QAAA,EAAAC,qBAAA;EAE7EF,OAAO,GAAG;IAAC,GAAGA,OAAO;IAAEG,GAAG,EAAE;MAAC,KAAAF,QAAA,GAAGD,OAAO,cAAAC,QAAA,uBAAPA,QAAA,CAASE,GAAG;MAAEC,cAAc,EAAE;IAAI;EAAC,CAAC;EACpE,MAAMC,SAAS,IAAAH,qBAAA,GAAGL,SAAS,CAACS,aAAa,cAAAJ,qBAAA,uBAAvBA,qBAAA,CAAAK,IAAA,CAAAV,SAAS,EAAiBE,IAAI,EAAEC,OAAO,CAAC;EAC1D,MAAMQ,eAAoB,GAAGH,SAAS,CAACI,YAAY,IAAIJ,SAAS;EAChE,OAAOK,gBAAgB,CAACF,eAAe,CAAC;AAC1C;AAEA,SAASE,gBAAgBA,CAACC,MAAW,EAAO;EAC1C,IAAIA,MAAM,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;IACxC,MAAMC,SAAS,GAAG,CAAC,CAAC;IACpB,KAAK,MAAM,CAACC,GAAG,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACL,MAAM,CAAC,EAAE;MACjDC,SAAS,CAACK,YAAY,CAACJ,GAAG,CAAC,CAAC,GAAGH,gBAAgB,CAACI,KAAK,CAAC;IACxD;IACA,OAAOF,SAAS;EAClB;EACA,OAAOD,MAAM;AACf;AAOA,SAASM,YAAYA,CAACC,GAAW,EAAU;EACzC,OAAO,OAAOA,GAAG,KAAK,QAAQ,GAAGA,GAAG,CAACC,MAAM,CAAC,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC,GAAGF,GAAG,CAACG,KAAK,CAAC,CAAC,CAAC,GAAGH,GAAG;AACnF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arcgis-feature-service.js","names":["ArcGISFeatureService","constructor","props","_defineProperty","url","loadOptions","fetch","metadataURL","options","getUrl","exportImageURL","boundingBox","path"],"sources":["../../../../src/wip/services/arcgis-feature-service.ts"],"sourcesContent":["// @ts-nocheck\n\nimport {LoaderOptions} from '@loaders.gl/loader-utils';\n// import {GeoJSONLoader} from '@loaders.gl/geojson';\n\ntype FetchLike = (url: string, options?: RequestInit) => Promise<Response>;\n\nexport type ArcGISImageServiceQueryOptions = {\n returnGeometry: boolean;\n where: '1%3D1';\n outSR: 4326;\n outFields: string | '*';\n inSR: 4326;\n geometry: `${-90}%2C+${30}%2C+${-70}%2C+${50}`;\n geometryType: 'esriGeometryEnvelope'; // TODO - look up valid values in Esri docs\n spatialRel: 'esriSpatialRelIntersects'; // TODO - look up valid values in Esri docs\n geometryPrecision: number; // TODO - look up valid values in Esri docs\n resultType: 'tile'; // TODO - look up valid values in Esri docs\n f?: 'geojson'; // TODO - look up valid values in Esri docs\n}\n\n// const DEFAULT_QUERY_OPTIONS: Required<ArcGISImageServiceQueryOptions> = {\n// returnGeometry:true,\n// where: '1%3D1',\n// outSR: 4326,\n// outFields: '*',\n// inSR: 4326,\n// geometry: `${-90}%2C+${30}%2C+${-70}%2C+${50}`,\n// geometryType: 'esriGeometryEnvelope',\n// spatialRel: 'esriSpatialRelIntersects',\n// geometryPrecision: 6,\n// resultType: 'tile',\n// f: 'geojson'\n// };\n\nexport type ArcGISFeatureServiceProps = ArcGISImageServiceQueryOptions & {\n url: string;\n loadOptions?: LoaderOptions;\n fetch?: typeof fetch | FetchLike;\n};\n\nexport class ArcGISFeatureService {\n url: string;\n loadOptions: LoaderOptions;\n fetch: typeof fetch | FetchLike;\n\n constructor(props: ArcGISFeatureServiceProps) {\n this.url = props.url;\n this.loadOptions = props.loadOptions || {};\n this.fetch = props.fetch || fetch;\n }\n\n // URL creators\n\n metadataURL(options: {parameters?: Record<string, unknown>}): string {\n return this.getUrl({...options});\n }\n\n /** \n * Form a URL to an ESRI FeatureServer\n// https://services2.arcgis.com/CcI36Pduqd0OR4W9/ArcGIS/rest/services/Bicycle_Routes_Public/FeatureServer/0/query?\n// returnGeometry=true&where=1%3D1&outSR=4326&outFields=*&inSR=4326&geometry=${-90}%2C+${30}%2C+${-70}%2C+${50}&\n// geometryType=esriGeometryEnvelope&spatialRel=esriSpatialRelIntersects&geometryPrecision=6&resultType=tile&f=geojson`\n */\n exportImageURL(options: {\n boundingBox: [number, number, number, number];\n boundingBoxSR?: string;\n width: number;\n height: number;\n imageSR?: string;\n time?: never;\n f?: 'geojson';\n resultType?: 'tile';\n noData?: never;\n noDataInterpretation?: 'esriNoDataMatchAny';\n interpolation?: '+RSP_NearestNeighbor';\n compression?: never\n compressionQuality?: never;\n bandIds?: never;\n mosaicRule?: never;\n renderingRule?: never;\n f?: 'image';\n }): string {\n const {boundingBox} = options;\n // const bbox = `bbox=${boundingBox[0]},${boundingBox[1]},${boundingBox[2]},${boundingBox[3]}`;\n // const size = `size=${width},${height}`\n return this.getUrl({path: 'exportImage', });\n }\n}\n"],"mappings":";AAyCA,OAAO,MAAMA,oBAAoB,CAAC;EAKhCC,WAAWA,CAACC,KAAgC,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAC5C,IAAI,CAACC,GAAG,GAAGF,KAAK,CAACE,GAAG;IACpB,IAAI,CAACC,WAAW,GAAGH,KAAK,CAACG,WAAW,IAAI,CAAC,CAAC;IAC1C,IAAI,CAACC,KAAK,GAAGJ,KAAK,CAACI,KAAK,IAAIA,KAAK;EACnC;EAIAC,WAAWA,CAACC,OAA+C,EAAU;IACnE,OAAO,IAAI,CAACC,MAAM,CAAC;MAAC,GAAGD;IAAO,CAAC,CAAC;EAClC;EAQAE,cAAcA,CAACF,OAkBd,EAAU;IACT,MAAM;MAACG;IAAW,CAAC,GAAGH,OAAO;IAG7B,OAAO,IAAI,CAACC,MAAM,CAAC;MAACG,IAAI,EAAE;IAAe,CAAC,CAAC;EAC7C;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseWCSCapabilities } from './lib/wcs/parse-wcs-capabilities';
|
|
2
|
-
const VERSION = typeof "4.0.0-
|
|
2
|
+
const VERSION = typeof "4.0.0-beta.1" !== 'undefined' ? "4.0.0-beta.1" : 'latest';
|
|
3
3
|
export const WCSCapabilitiesLoader = {
|
|
4
4
|
id: 'wcs-capabilities',
|
|
5
5
|
name: 'WFS Capabilities',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wcs-capabilities-loader.js","names":["parseWCSCapabilities","VERSION","WCSCapabilitiesLoader","id","name","module","version","worker","extensions","mimeTypes","testText","testXMLFile","options","wms","parse","arrayBuffer","TextDecoder","decode","parseTextSync","text","startsWith","_typecheckWFSCapabilitiesLoader"],"sources":["../../../src/wip/wcs-capabilities-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {WCSCapabilities} from './lib/wcs/parse-wcs-capabilities';\nimport {parseWCSCapabilities} from './lib/wcs/parse-wcs-capabilities';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport {WCSCapabilities};\n\nexport type WCSLoaderOptions = LoaderOptions & {\n wcs?: {};\n};\n\n/**\n * Loader for the response to the WCS GetCapability request\n */\nexport const WCSCapabilitiesLoader = {\n id: 'wcs-capabilities',\n name: 'WFS Capabilities',\n\n module: 'wms',\n version: VERSION,\n worker: false,\n extensions: ['xml'],\n mimeTypes: ['application/vnd.ogc.wcs_xml', 'application/xml', 'text/xml'],\n testText: testXMLFile,\n options: {\n wms: {}\n },\n parse: async (arrayBuffer: ArrayBuffer, options?: WCSLoaderOptions) =>\n parseWCSCapabilities(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: WCSLoaderOptions) => parseWCSCapabilities(text, options)\n};\n\nfunction testXMLFile(text: string): boolean {\n // TODO - There could be space first.\n return text.startsWith('<?xml');\n}\n\nexport const _typecheckWFSCapabilitiesLoader: LoaderWithParser = WCSCapabilitiesLoader;\n"],"mappings":"AAIA,SAAQA,oBAAoB,QAAO,kCAAkC;AAIrE,MAAMC,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"wcs-capabilities-loader.js","names":["parseWCSCapabilities","VERSION","WCSCapabilitiesLoader","id","name","module","version","worker","extensions","mimeTypes","testText","testXMLFile","options","wms","parse","arrayBuffer","TextDecoder","decode","parseTextSync","text","startsWith","_typecheckWFSCapabilitiesLoader"],"sources":["../../../src/wip/wcs-capabilities-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {WCSCapabilities} from './lib/wcs/parse-wcs-capabilities';\nimport {parseWCSCapabilities} from './lib/wcs/parse-wcs-capabilities';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport {WCSCapabilities};\n\nexport type WCSLoaderOptions = LoaderOptions & {\n wcs?: {};\n};\n\n/**\n * Loader for the response to the WCS GetCapability request\n */\nexport const WCSCapabilitiesLoader = {\n id: 'wcs-capabilities',\n name: 'WFS Capabilities',\n\n module: 'wms',\n version: VERSION,\n worker: false,\n extensions: ['xml'],\n mimeTypes: ['application/vnd.ogc.wcs_xml', 'application/xml', 'text/xml'],\n testText: testXMLFile,\n options: {\n wms: {}\n },\n parse: async (arrayBuffer: ArrayBuffer, options?: WCSLoaderOptions) =>\n parseWCSCapabilities(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: WCSLoaderOptions) => parseWCSCapabilities(text, options)\n};\n\nfunction testXMLFile(text: string): boolean {\n // TODO - There could be space first.\n return text.startsWith('<?xml');\n}\n\nexport const _typecheckWFSCapabilitiesLoader: LoaderWithParser = WCSCapabilitiesLoader;\n"],"mappings":"AAIA,SAAQA,oBAAoB,QAAO,kCAAkC;AAIrE,MAAMC,OAAO,GAAG,qBAAkB,KAAK,WAAW,oBAAiB,QAAQ;AAW3E,OAAO,MAAMC,qBAAqB,GAAG;EACnCC,EAAE,EAAE,kBAAkB;EACtBC,IAAI,EAAE,kBAAkB;EAExBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEL,OAAO;EAChBM,MAAM,EAAE,KAAK;EACbC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,SAAS,EAAE,CAAC,6BAA6B,EAAE,iBAAiB,EAAE,UAAU,CAAC;EACzEC,QAAQ,EAAEC,WAAW;EACrBC,OAAO,EAAE;IACPC,GAAG,EAAE,CAAC;EACR,CAAC;EACDC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEH,OAA0B,KAChEZ,oBAAoB,CAAC,IAAIgB,WAAW,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,EAAEH,OAAO,CAAC;EACtEM,aAAa,EAAEA,CAACC,IAAY,EAAEP,OAA0B,KAAKZ,oBAAoB,CAACmB,IAAI,EAAEP,OAAO;AACjG,CAAC;AAED,SAASD,WAAWA,CAACQ,IAAY,EAAW;EAE1C,OAAOA,IAAI,CAACC,UAAU,CAAC,OAAO,CAAC;AACjC;AAEA,OAAO,MAAMC,+BAAiD,GAAGnB,qBAAqB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseWFSCapabilities } from './lib/wfs/parse-wfs-capabilities';
|
|
2
|
-
const VERSION = typeof "4.0.0-
|
|
2
|
+
const VERSION = typeof "4.0.0-beta.1" !== 'undefined' ? "4.0.0-beta.1" : 'latest';
|
|
3
3
|
export const WFSCapabilitiesLoader = {
|
|
4
4
|
id: 'wfs-capabilities',
|
|
5
5
|
name: 'WFS Capabilities',
|
|
@@ -10,7 +10,7 @@ export const WFSCapabilitiesLoader = {
|
|
|
10
10
|
mimeTypes: ['application/vnd.ogc.wfs_xml', 'application/xml', 'text/xml'],
|
|
11
11
|
testText: testXMLFile,
|
|
12
12
|
options: {
|
|
13
|
-
|
|
13
|
+
wfs: {}
|
|
14
14
|
},
|
|
15
15
|
parse: async (arrayBuffer, options) => parseWFSCapabilities(new TextDecoder().decode(arrayBuffer), options),
|
|
16
16
|
parseTextSync: (text, options) => parseWFSCapabilities(text, options)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wfs-capabilities-loader.js","names":["parseWFSCapabilities","VERSION","WFSCapabilitiesLoader","id","name","module","version","worker","extensions","mimeTypes","testText","testXMLFile","options","
|
|
1
|
+
{"version":3,"file":"wfs-capabilities-loader.js","names":["parseWFSCapabilities","VERSION","WFSCapabilitiesLoader","id","name","module","version","worker","extensions","mimeTypes","testText","testXMLFile","options","wfs","parse","arrayBuffer","TextDecoder","decode","parseTextSync","text","startsWith","_typecheckWFSCapabilitiesLoader"],"sources":["../../../src/wip/wfs-capabilities-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {WFSCapabilities} from './lib/wfs/parse-wfs-capabilities';\nimport {parseWFSCapabilities} from './lib/wfs/parse-wfs-capabilities';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type {WFSCapabilities};\n\nexport type WFSLoaderOptions = LoaderOptions & {\n wfs?: {};\n};\n\n/**\n * Loader for the response to the WFS GetCapability request\n */\nexport const WFSCapabilitiesLoader: LoaderWithParser<WFSCapabilities, never, WFSLoaderOptions> = {\n id: 'wfs-capabilities',\n name: 'WFS Capabilities',\n\n module: 'wms',\n version: VERSION,\n worker: false,\n extensions: ['xml'],\n mimeTypes: ['application/vnd.ogc.wfs_xml', 'application/xml', 'text/xml'],\n testText: testXMLFile,\n options: {\n wfs: {}\n },\n parse: async (arrayBuffer: ArrayBuffer, options?: WFSLoaderOptions) =>\n parseWFSCapabilities(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: WFSLoaderOptions) => parseWFSCapabilities(text, options)\n};\n\nfunction testXMLFile(text: string): boolean {\n // TODO - There could be space first.\n return text.startsWith('<?xml');\n}\n\nexport const _typecheckWFSCapabilitiesLoader: LoaderWithParser = WFSCapabilitiesLoader;\n"],"mappings":"AAIA,SAAQA,oBAAoB,QAAO,kCAAkC;AAIrE,MAAMC,OAAO,GAAG,qBAAkB,KAAK,WAAW,oBAAiB,QAAQ;AAW3E,OAAO,MAAMC,qBAAiF,GAAG;EAC/FC,EAAE,EAAE,kBAAkB;EACtBC,IAAI,EAAE,kBAAkB;EAExBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEL,OAAO;EAChBM,MAAM,EAAE,KAAK;EACbC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,SAAS,EAAE,CAAC,6BAA6B,EAAE,iBAAiB,EAAE,UAAU,CAAC;EACzEC,QAAQ,EAAEC,WAAW;EACrBC,OAAO,EAAE;IACPC,GAAG,EAAE,CAAC;EACR,CAAC;EACDC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEH,OAA0B,KAChEZ,oBAAoB,CAAC,IAAIgB,WAAW,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,EAAEH,OAAO,CAAC;EACtEM,aAAa,EAAEA,CAACC,IAAY,EAAEP,OAA0B,KAAKZ,oBAAoB,CAACmB,IAAI,EAAEP,OAAO;AACjG,CAAC;AAED,SAASD,WAAWA,CAACQ,IAAY,EAAW;EAE1C,OAAOA,IAAI,CAACC,UAAU,CAAC,OAAO,CAAC;AACjC;AAEA,OAAO,MAAMC,+BAAiD,GAAGnB,qBAAqB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wms-feature-info-loader.js","names":["WMSCapabilitiesLoader","parseWMSFeatureInfo","WMSFeatureInfoLoader","id","name","parse","arrayBuffer","options","TextDecoder","decode","parseTextSync","text","_typecheckWMSFeatureInfoLoader"],"sources":["../../../src/wip/wms-feature-info-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {XMLLoaderOptions} from '@loaders.gl/xml';\nimport {WMSCapabilitiesLoader} from '../wms-capabilities-loader';\n\nimport type {WMSFeatureInfo} from '../lib/parsers/wms/parse-wms-features';\nimport {parseWMSFeatureInfo} from '../lib/parsers/wms/parse-wms-features';\n\nexport {WMSFeatureInfo};\n\n/**\n * Loader for the response to the WMS GetFeatureInfo request\n */\nexport const WMSFeatureInfoLoader = {\n ...WMSCapabilitiesLoader,\n\n id: 'wms-feature-info',\n name: 'WMS FeatureInfo',\n\n parse: async (arrayBuffer: ArrayBuffer, options?: XMLLoaderOptions) =>\n parseWMSFeatureInfo(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: XMLLoaderOptions) => parseWMSFeatureInfo(text, options)\n};\n\nexport const _typecheckWMSFeatureInfoLoader: LoaderWithParser = WMSFeatureInfoLoader;\n"],"mappings":"AAIA,SAAQA,qBAAqB,QAAO,4BAA4B;AAGhE,SAAQC,mBAAmB,QAAO,uCAAuC;
|
|
1
|
+
{"version":3,"file":"wms-feature-info-loader.js","names":["WMSCapabilitiesLoader","parseWMSFeatureInfo","WMSFeatureInfoLoader","id","name","parse","arrayBuffer","options","TextDecoder","decode","parseTextSync","text","_typecheckWMSFeatureInfoLoader"],"sources":["../../../src/wip/wms-feature-info-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {XMLLoaderOptions} from '@loaders.gl/xml';\nimport {WMSCapabilitiesLoader} from '../wms-capabilities-loader';\n\nimport type {WMSFeatureInfo} from '../lib/parsers/wms/parse-wms-features';\nimport {parseWMSFeatureInfo} from '../lib/parsers/wms/parse-wms-features';\n\nexport {WMSFeatureInfo};\n\n/**\n * Loader for the response to the WMS GetFeatureInfo request\n */\n// @ts-expect-error\nexport const WMSFeatureInfoLoader: LoaderWithParser<WMSFeatureInfo, never, XMLLoaderOptions> = {\n ...WMSCapabilitiesLoader,\n\n id: 'wms-feature-info',\n name: 'WMS FeatureInfo',\n\n parse: async (arrayBuffer: ArrayBuffer, options?: XMLLoaderOptions) =>\n parseWMSFeatureInfo(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: XMLLoaderOptions) => parseWMSFeatureInfo(text, options)\n};\n\nexport const _typecheckWMSFeatureInfoLoader: LoaderWithParser = WMSFeatureInfoLoader;\n"],"mappings":"AAIA,SAAQA,qBAAqB,QAAO,4BAA4B;AAGhE,SAAQC,mBAAmB,QAAO,uCAAuC;AAQzE,OAAO,MAAMC,oBAA+E,GAAG;EAC7F,GAAGF,qBAAqB;EAExBG,EAAE,EAAE,kBAAkB;EACtBC,IAAI,EAAE,iBAAiB;EAEvBC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEC,OAA0B,KAChEN,mBAAmB,CAAC,IAAIO,WAAW,CAAC,CAAC,CAACC,MAAM,CAACH,WAAW,CAAC,EAAEC,OAAO,CAAC;EACrEG,aAAa,EAAEA,CAACC,IAAY,EAAEJ,OAA0B,KAAKN,mBAAmB,CAACU,IAAI,EAAEJ,OAAO;AAChG,CAAC;AAED,OAAO,MAAMK,8BAAgD,GAAGV,oBAAoB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseWMTSCapabilities } from './lib/wmts/parse-wmts-capabilities';
|
|
2
|
-
const VERSION = typeof "4.0.0-
|
|
2
|
+
const VERSION = typeof "4.0.0-beta.1" !== 'undefined' ? "4.0.0-beta.1" : 'latest';
|
|
3
3
|
export const WMTSCapabilitiesLoader = {
|
|
4
4
|
id: 'wmts-capabilities',
|
|
5
5
|
name: 'WMTS Capabilities',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wmts-capabilities-loader.js","names":["parseWMTSCapabilities","VERSION","WMTSCapabilitiesLoader","id","name","module","version","worker","extensions","mimeTypes","testText","testXMLFile","options","wms","parse","arrayBuffer","TextDecoder","decode","parseTextSync","text","startsWith","_typecheckWMTSCapabilitiesLoader"],"sources":["../../../src/wip/wmts-capabilities-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {XMLLoaderOptions} from '@loaders.gl/xml';\n// import type {WMTSCapabilities} from './lib/wmts/parse-wmts-capabilities';\nimport {parseWMTSCapabilities} from './lib/wmts/parse-wmts-capabilities';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n// export type {WMTSCapabilities};\n\nexport type WMTSLoaderOptions = XMLLoaderOptions & {\n wmts?: {};\n};\n\n/**\n * Loader for the response to the WMTS GetCapability request\n */\nexport const WMTSCapabilitiesLoader = {\n id: 'wmts-capabilities',\n name: 'WMTS Capabilities',\n\n module: 'wms',\n version: VERSION,\n worker: false,\n extensions: ['xml'],\n mimeTypes: ['application/vnd.ogc.wmts_xml', 'application/xml', 'text/xml'],\n testText: testXMLFile,\n options: {\n wms: {}\n },\n parse: async (arrayBuffer: ArrayBuffer, options?: WMTSLoaderOptions) =>\n parseWMTSCapabilities(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: WMTSLoaderOptions) => parseWMTSCapabilities(text, options)\n};\n\nfunction testXMLFile(text: string): boolean {\n // TODO - There could be space first.\n return text.startsWith('<?xml');\n}\n\nexport const _typecheckWMTSCapabilitiesLoader: LoaderWithParser = WMTSCapabilitiesLoader;\n"],"mappings":"AAKA,SAAQA,qBAAqB,QAAO,oCAAoC;AAIxE,MAAMC,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"wmts-capabilities-loader.js","names":["parseWMTSCapabilities","VERSION","WMTSCapabilitiesLoader","id","name","module","version","worker","extensions","mimeTypes","testText","testXMLFile","options","wms","parse","arrayBuffer","TextDecoder","decode","parseTextSync","text","startsWith","_typecheckWMTSCapabilitiesLoader"],"sources":["../../../src/wip/wmts-capabilities-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {XMLLoaderOptions} from '@loaders.gl/xml';\n// import type {WMTSCapabilities} from './lib/wmts/parse-wmts-capabilities';\nimport {parseWMTSCapabilities} from './lib/wmts/parse-wmts-capabilities';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n// export type {WMTSCapabilities};\n\nexport type WMTSLoaderOptions = XMLLoaderOptions & {\n wmts?: {};\n};\n\n/**\n * Loader for the response to the WMTS GetCapability request\n */\nexport const WMTSCapabilitiesLoader = {\n id: 'wmts-capabilities',\n name: 'WMTS Capabilities',\n\n module: 'wms',\n version: VERSION,\n worker: false,\n extensions: ['xml'],\n mimeTypes: ['application/vnd.ogc.wmts_xml', 'application/xml', 'text/xml'],\n testText: testXMLFile,\n options: {\n wms: {}\n },\n parse: async (arrayBuffer: ArrayBuffer, options?: WMTSLoaderOptions) =>\n parseWMTSCapabilities(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: WMTSLoaderOptions) => parseWMTSCapabilities(text, options)\n};\n\nfunction testXMLFile(text: string): boolean {\n // TODO - There could be space first.\n return text.startsWith('<?xml');\n}\n\nexport const _typecheckWMTSCapabilitiesLoader: LoaderWithParser = WMTSCapabilitiesLoader;\n"],"mappings":"AAKA,SAAQA,qBAAqB,QAAO,oCAAoC;AAIxE,MAAMC,OAAO,GAAG,qBAAkB,KAAK,WAAW,oBAAiB,QAAQ;AAW3E,OAAO,MAAMC,sBAAsB,GAAG;EACpCC,EAAE,EAAE,mBAAmB;EACvBC,IAAI,EAAE,mBAAmB;EAEzBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEL,OAAO;EAChBM,MAAM,EAAE,KAAK;EACbC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,SAAS,EAAE,CAAC,8BAA8B,EAAE,iBAAiB,EAAE,UAAU,CAAC;EAC1EC,QAAQ,EAAEC,WAAW;EACrBC,OAAO,EAAE;IACPC,GAAG,EAAE,CAAC;EACR,CAAC;EACDC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEH,OAA2B,KACjEZ,qBAAqB,CAAC,IAAIgB,WAAW,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,EAAEH,OAAO,CAAC;EACvEM,aAAa,EAAEA,CAACC,IAAY,EAAEP,OAA2B,KAAKZ,qBAAqB,CAACmB,IAAI,EAAEP,OAAO;AACnG,CAAC;AAED,SAASD,WAAWA,CAACQ,IAAY,EAAW;EAE1C,OAAOA,IAAI,CAACC,UAAU,CAAC,OAAO,CAAC;AACjC;AAEA,OAAO,MAAMC,gCAAkD,GAAGnB,sBAAsB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseWMSCapabilities } from './lib/parsers/wms/parse-wms-capabilities';
|
|
2
|
-
const VERSION = typeof "4.0.0-
|
|
2
|
+
const VERSION = typeof "4.0.0-beta.1" !== 'undefined' ? "4.0.0-beta.1" : 'latest';
|
|
3
3
|
export const WMSCapabilitiesLoader = {
|
|
4
4
|
id: 'wms-capabilities',
|
|
5
5
|
name: 'WMS Capabilities',
|
|
@@ -18,5 +18,4 @@ export const WMSCapabilitiesLoader = {
|
|
|
18
18
|
function testXMLFile(text) {
|
|
19
19
|
return text.startsWith('<?xml');
|
|
20
20
|
}
|
|
21
|
-
export const _typecheckWMSCapabilitiesLoader = WMSCapabilitiesLoader;
|
|
22
21
|
//# sourceMappingURL=wms-capabilities-loader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wms-capabilities-loader.js","names":["parseWMSCapabilities","VERSION","WMSCapabilitiesLoader","id","name","module","version","worker","extensions","mimeTypes","testText","testXMLFile","options","wms","parse","arrayBuffer","TextDecoder","decode","parseTextSync","text","startsWith"
|
|
1
|
+
{"version":3,"file":"wms-capabilities-loader.js","names":["parseWMSCapabilities","VERSION","WMSCapabilitiesLoader","id","name","module","version","worker","extensions","mimeTypes","testText","testXMLFile","options","wms","parse","arrayBuffer","TextDecoder","decode","parseTextSync","text","startsWith"],"sources":["../../src/wms-capabilities-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {XMLLoaderOptions} from '@loaders.gl/xml';\nimport {WMSCapabilities, parseWMSCapabilities} from './lib/parsers/wms/parse-wms-capabilities';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n// Parsed data types\nexport type {\n WMSCapabilities,\n WMSLayer,\n WMSBoundingBox,\n WMSDimension,\n WMSRequest,\n WMSExceptions\n} from './lib/parsers/wms/parse-wms-capabilities';\n\nexport type WMSCapabilitiesLoaderOptions = XMLLoaderOptions & {\n wms?: {\n /** Add inherited layer information to sub layers */\n inheritedLayerProps?: boolean;\n /** Include the \"raw\" JSON (parsed but untyped, unprocessed XML). May contain additional fields */\n includeRawData?: boolean;\n /** Include the original XML document text. May contain additional information. */\n includeXMLText?: boolean;\n /** @deprecated Use options.includeRawData` */\n raw?: boolean;\n };\n};\n\n/**\n * Loader for the response to the WMS GetCapability request\n */\nexport const WMSCapabilitiesLoader: LoaderWithParser<\n WMSCapabilities,\n never,\n WMSCapabilitiesLoaderOptions\n> = {\n id: 'wms-capabilities',\n name: 'WMS Capabilities',\n\n module: 'wms',\n version: VERSION,\n worker: false,\n extensions: ['xml'],\n mimeTypes: ['application/vnd.ogc.wms_xml', 'application/xml', 'text/xml'],\n testText: testXMLFile,\n options: {\n wms: {}\n },\n parse: async (arrayBuffer: ArrayBuffer, options?: WMSCapabilitiesLoaderOptions) =>\n // TODO pass in XML options\n parseWMSCapabilities(new TextDecoder().decode(arrayBuffer), options?.wms),\n parseTextSync: (text: string, options?: WMSCapabilitiesLoaderOptions) =>\n // TODO pass in XML options\n parseWMSCapabilities(text, options?.wms)\n};\n\nfunction testXMLFile(text: string): boolean {\n // TODO - There could be space first.\n return text.startsWith('<?xml');\n}\n"],"mappings":"AAIA,SAAyBA,oBAAoB,QAAO,0CAA0C;AAI9F,MAAMC,OAAO,GAAG,qBAAkB,KAAK,WAAW,oBAAiB,QAAQ;AA4B3E,OAAO,MAAMC,qBAIZ,GAAG;EACFC,EAAE,EAAE,kBAAkB;EACtBC,IAAI,EAAE,kBAAkB;EAExBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEL,OAAO;EAChBM,MAAM,EAAE,KAAK;EACbC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,SAAS,EAAE,CAAC,6BAA6B,EAAE,iBAAiB,EAAE,UAAU,CAAC;EACzEC,QAAQ,EAAEC,WAAW;EACrBC,OAAO,EAAE;IACPC,GAAG,EAAE,CAAC;EACR,CAAC;EACDC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEH,OAAsC,KAE5EZ,oBAAoB,CAAC,IAAIgB,WAAW,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,EAAEH,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,GAAG,CAAC;EAC3EK,aAAa,EAAEA,CAACC,IAAY,EAAEP,OAAsC,KAElEZ,oBAAoB,CAACmB,IAAI,EAAEP,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,GAAG;AAC3C,CAAC;AAED,SAASF,WAAWA,CAACQ,IAAY,EAAW;EAE1C,OAAOA,IAAI,CAACC,UAAU,CAAC,OAAO,CAAC;AACjC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseWMSError } from './lib/parsers/wms/parse-wms-error';
|
|
2
|
-
const VERSION = typeof "4.0.0-
|
|
2
|
+
const VERSION = typeof "4.0.0-beta.1" !== 'undefined' ? "4.0.0-beta.1" : 'latest';
|
|
3
3
|
export const WMSErrorLoader = {
|
|
4
4
|
id: 'wms-error',
|
|
5
5
|
name: 'WMS Error',
|
|
@@ -33,5 +33,4 @@ function parseTextSync(text, options) {
|
|
|
33
33
|
}
|
|
34
34
|
return message;
|
|
35
35
|
}
|
|
36
|
-
export const _typecheckWMSErrorLoader = WMSErrorLoader;
|
|
37
36
|
//# sourceMappingURL=wms-error-loader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wms-error-loader.js","names":["parseWMSError","VERSION","WMSErrorLoader","id","name","module","version","worker","extensions","mimeTypes","testText","testXMLFile","options","wms","throwOnError","parse","arrayBuffer","parseTextSync","TextDecoder","decode","parseSync","text","startsWith","wmsOptions","error","message","minimalErrors","concat","Error"
|
|
1
|
+
{"version":3,"file":"wms-error-loader.js","names":["parseWMSError","VERSION","WMSErrorLoader","id","name","module","version","worker","extensions","mimeTypes","testText","testXMLFile","options","wms","throwOnError","parse","arrayBuffer","parseTextSync","TextDecoder","decode","parseSync","text","startsWith","wmsOptions","error","message","minimalErrors","concat","Error"],"sources":["../../src/wms-error-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport {parseWMSError} from './lib/parsers/wms/parse-wms-error';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type WMSLoaderOptions = LoaderOptions & {\n wms?: {\n /** By default the error loader will throw an error with the parsed error message */\n throwOnError?: boolean;\n /** Do not add any text to errors */\n minimalErrors?: boolean;\n };\n};\n\n/**\n * Loader for the response to the WMS GetCapability request\n */\nexport const WMSErrorLoader: LoaderWithParser<string, never, WMSLoaderOptions> = {\n id: 'wms-error',\n name: 'WMS Error',\n\n module: 'wms',\n version: VERSION,\n worker: false,\n extensions: ['xml'],\n mimeTypes: ['application/vnd.ogc.se_xml', 'application/xml', 'text/xml'],\n testText: testXMLFile,\n options: {\n wms: {\n throwOnError: false\n }\n },\n parse: async (arrayBuffer: ArrayBuffer, options?: WMSLoaderOptions): Promise<string> =>\n parseTextSync(new TextDecoder().decode(arrayBuffer), options),\n parseSync: (arrayBuffer: ArrayBuffer, options?: WMSLoaderOptions): string =>\n parseTextSync(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: WMSLoaderOptions): string => parseTextSync(text, options)\n};\n\nfunction testXMLFile(text: string): boolean {\n // TODO - There could be space first.\n return text.startsWith('<?xml');\n}\n\nfunction parseTextSync(text: string, options?: WMSLoaderOptions): string {\n const wmsOptions: WMSLoaderOptions['wms'] = {...WMSErrorLoader.options.wms, ...options?.wms};\n const error = parseWMSError(text, wmsOptions);\n const message = wmsOptions.minimalErrors ? error : `WMS Service error: ${error}`;\n if (wmsOptions.throwOnError) {\n throw new Error(message);\n }\n return message;\n}\n"],"mappings":"AAGA,SAAQA,aAAa,QAAO,mCAAmC;AAI/D,MAAMC,OAAO,GAAG,qBAAkB,KAAK,WAAW,oBAAiB,QAAQ;AAc3E,OAAO,MAAMC,cAAiE,GAAG;EAC/EC,EAAE,EAAE,WAAW;EACfC,IAAI,EAAE,WAAW;EAEjBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEL,OAAO;EAChBM,MAAM,EAAE,KAAK;EACbC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,SAAS,EAAE,CAAC,4BAA4B,EAAE,iBAAiB,EAAE,UAAU,CAAC;EACxEC,QAAQ,EAAEC,WAAW;EACrBC,OAAO,EAAE;IACPC,GAAG,EAAE;MACHC,YAAY,EAAE;IAChB;EACF,CAAC;EACDC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEJ,OAA0B,KAChEK,aAAa,CAAC,IAAIC,WAAW,CAAC,CAAC,CAACC,MAAM,CAACH,WAAW,CAAC,EAAEJ,OAAO,CAAC;EAC/DQ,SAAS,EAAEA,CAACJ,WAAwB,EAAEJ,OAA0B,KAC9DK,aAAa,CAAC,IAAIC,WAAW,CAAC,CAAC,CAACC,MAAM,CAACH,WAAW,CAAC,EAAEJ,OAAO,CAAC;EAC/DK,aAAa,EAAEA,CAACI,IAAY,EAAET,OAA0B,KAAaK,aAAa,CAACI,IAAI,EAAET,OAAO;AAClG,CAAC;AAED,SAASD,WAAWA,CAACU,IAAY,EAAW;EAE1C,OAAOA,IAAI,CAACC,UAAU,CAAC,OAAO,CAAC;AACjC;AAEA,SAASL,aAAaA,CAACI,IAAY,EAAET,OAA0B,EAAU;EACvE,MAAMW,UAAmC,GAAG;IAAC,GAAGrB,cAAc,CAACU,OAAO,CAACC,GAAG;IAAE,IAAGD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,GAAG;EAAA,CAAC;EAC5F,MAAMW,KAAK,GAAGxB,aAAa,CAACqB,IAAI,EAAEE,UAAU,CAAC;EAC7C,MAAME,OAAO,GAAGF,UAAU,CAACG,aAAa,GAAGF,KAAK,yBAAAG,MAAA,CAAyBH,KAAK,CAAE;EAChF,IAAID,UAAU,CAACT,YAAY,EAAE;IAC3B,MAAM,IAAIc,KAAK,CAACH,OAAO,CAAC;EAC1B;EACA,OAAOA,OAAO;AAChB"}
|
package/dist/gml-loader.d.ts
CHANGED
|
@@ -1,26 +1,10 @@
|
|
|
1
1
|
import type { LoaderWithParser, LoaderOptions } from '@loaders.gl/loader-utils';
|
|
2
|
+
import type { Geometry } from './lib/parsers/gml/parse-gml';
|
|
2
3
|
export type GMLLoaderOptions = LoaderOptions & {
|
|
3
4
|
gml?: {};
|
|
4
5
|
};
|
|
5
6
|
/**
|
|
6
7
|
* Loader for the response to the GML GetCapability request
|
|
7
8
|
*/
|
|
8
|
-
export declare const GMLLoader:
|
|
9
|
-
name: string;
|
|
10
|
-
id: string;
|
|
11
|
-
module: string;
|
|
12
|
-
version: any;
|
|
13
|
-
worker: boolean;
|
|
14
|
-
extensions: string[];
|
|
15
|
-
mimeTypes: string[];
|
|
16
|
-
testText: typeof testXMLFile;
|
|
17
|
-
options: {
|
|
18
|
-
gml: {};
|
|
19
|
-
};
|
|
20
|
-
parse: (arrayBuffer: ArrayBuffer, options?: GMLLoaderOptions) => Promise<import("geojson").Geometry | null>;
|
|
21
|
-
parseTextSync: (text: string, options?: GMLLoaderOptions) => import("geojson").Geometry | null;
|
|
22
|
-
};
|
|
23
|
-
declare function testXMLFile(text: string): boolean;
|
|
24
|
-
export declare const _typecheckGMLLoader: LoaderWithParser;
|
|
25
|
-
export {};
|
|
9
|
+
export declare const GMLLoader: LoaderWithParser<Geometry | null, never, GMLLoaderOptions>;
|
|
26
10
|
//# sourceMappingURL=gml-loader.d.ts.map
|
package/dist/gml-loader.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gml-loader.d.ts","sourceRoot":"","sources":["../src/gml-loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,gBAAgB,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"gml-loader.d.ts","sourceRoot":"","sources":["../src/gml-loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,gBAAgB,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAC9E,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAO1D,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,GAAG,CAAC,EAAE,EAAE,CAAC;CACV,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,gBAAgB,CAAC,QAAQ,GAAG,IAAI,EAAE,KAAK,EAAE,gBAAgB,CAgBhF,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -20,16 +20,17 @@ export type { GeoJSON as _GeoJSON } from '@loaders.gl/schema';
|
|
|
20
20
|
export type { GMLLoaderOptions as _GMLLoaderOptions } from './gml-loader';
|
|
21
21
|
export { GMLLoader as _GMLLoader } from './gml-loader';
|
|
22
22
|
export type { ImageType } from '@loaders.gl/images';
|
|
23
|
-
export type {
|
|
24
|
-
export {
|
|
25
|
-
export type { ImageServiceType } from './
|
|
26
|
-
export { createImageSource } from './
|
|
27
|
-
export type { ImageServiceProps } from './lib/services/
|
|
28
|
-
export { ImageService } from './lib/services/
|
|
29
|
-
export { CSWService } from './
|
|
30
|
-
export { WMSService } from './
|
|
31
|
-
export { getArcGISServices as _getArcGISServices } from './
|
|
32
|
-
export {
|
|
23
|
+
export type { CreateImageServiceProps } from './lib/services/create-image-service';
|
|
24
|
+
export { createImageService } from './lib/services/create-image-service';
|
|
25
|
+
export type { ImageServiceType } from './services/create-image-source';
|
|
26
|
+
export { createImageSource } from './services/create-image-source';
|
|
27
|
+
export type { ImageServiceProps } from './lib/services/image-service';
|
|
28
|
+
export { ImageService } from './lib/services/image-service';
|
|
29
|
+
export { CSWService } from './services/ogc/csw-service';
|
|
30
|
+
export { WMSSource, WMSService } from './services/ogc/wms-service';
|
|
31
|
+
export { getArcGISServices as _getArcGISServices } from './services/arcgis/arcgis-server';
|
|
32
|
+
export { ArcGISImageService as _ArcGISImageService } from './services/arcgis/arcgis-image-service';
|
|
33
33
|
/** @deprecated Use WMSCapabilitiesLoaderOptions */
|
|
34
34
|
export type { WMSCapabilitiesLoaderOptions as WMSLoaderOptions } from './wms-capabilities-loader';
|
|
35
|
+
export { ImageSource } from '@loaders.gl/loader-utils';
|
|
35
36
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,YAAY,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAEhE,YAAY,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAC,qBAAqB,EAAC,MAAM,2BAA2B,CAAC;AAEhE,YAAY,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAC,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAEpD,YAAY,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AAItD,OAAO,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAElD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,iBAAiB,EAAC,MAAM,gCAAgC,CAAC;AAIjE,YAAY,EAAC,iBAAiB,EAAC,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC;AAI1D,OAAO,EAAC,UAAU,EAAC,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAC,SAAS,EAAE,UAAU,EAAC,MAAM,4BAA4B,CAAC;AAIjE,OAAO,EAAC,iBAAiB,IAAI,kBAAkB,EAAC,MAAM,iCAAiC,CAAC;AACxF,OAAO,EAAC,kBAAkB,IAAI,mBAAmB,EAAC,MAAM,wCAAwC,CAAC;AAOjG,mDAAmD;AACnD,YAAY,EAAC,4BAA4B,IAAI,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAGhG,OAAO,EAAC,WAAW,EAAC,MAAM,0BAA0B,CAAC"}
|
package/dist/lerc-loader.d.ts
CHANGED
|
@@ -13,18 +13,5 @@ export type LERCLoaderOptions = LoaderOptions & {
|
|
|
13
13
|
/**
|
|
14
14
|
* Loader for the LERC raster format
|
|
15
15
|
*/
|
|
16
|
-
export declare const LERCLoader:
|
|
17
|
-
id: string;
|
|
18
|
-
name: string;
|
|
19
|
-
module: string;
|
|
20
|
-
version: any;
|
|
21
|
-
worker: boolean;
|
|
22
|
-
extensions: string[];
|
|
23
|
-
mimeTypes: string[];
|
|
24
|
-
options: {
|
|
25
|
-
wms: {};
|
|
26
|
-
};
|
|
27
|
-
parse: (arrayBuffer: ArrayBuffer, options?: LERCLoaderOptions) => Promise<LERCData>;
|
|
28
|
-
};
|
|
29
|
-
export declare const _typecheckLERCLoader: LoaderWithParser;
|
|
16
|
+
export declare const LERCLoader: LoaderWithParser<LERCData, never, LERCLoaderOptions>;
|
|
30
17
|
//# sourceMappingURL=lerc-loader.d.ts.map
|