@loaders.gl/wms 4.0.0-beta.6 → 4.0.0-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/LICENSE +7 -7
  2. package/dist/csw-capabilities-loader.d.ts.map +1 -1
  3. package/dist/csw-capabilities-loader.js.map +1 -1
  4. package/dist/csw-domain-loader.d.ts.map +1 -1
  5. package/dist/csw-domain-loader.js.map +1 -1
  6. package/dist/csw-records-loader.d.ts.map +1 -1
  7. package/dist/csw-records-loader.js.map +1 -1
  8. package/dist/gml-loader.d.ts.map +1 -1
  9. package/dist/gml-loader.js.map +1 -1
  10. package/dist/index.cjs +0 -24
  11. package/dist/index.d.ts +0 -2
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +0 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/lib/parsers/csw/parse-csw-capabilities.d.ts.map +1 -1
  16. package/dist/lib/parsers/csw/parse-csw-capabilities.js.map +1 -1
  17. package/dist/lib/parsers/csw/parse-csw-domain.d.ts.map +1 -1
  18. package/dist/lib/parsers/csw/parse-csw-domain.js.map +1 -1
  19. package/dist/lib/parsers/csw/parse-csw-records.d.ts.map +1 -1
  20. package/dist/lib/parsers/csw/parse-csw-records.js.map +1 -1
  21. package/dist/lib/parsers/csw/parse-exception-report.d.ts.map +1 -1
  22. package/dist/lib/parsers/csw/parse-exception-report.js.map +1 -1
  23. package/dist/lib/parsers/gml/parse-gml.d.ts.map +1 -1
  24. package/dist/lib/parsers/gml/parse-gml.js.map +1 -1
  25. package/dist/lib/parsers/wms/parse-wms-capabilities.d.ts.map +1 -1
  26. package/dist/lib/parsers/wms/parse-wms-capabilities.js.map +1 -1
  27. package/dist/lib/parsers/wms/parse-wms-error.d.ts.map +1 -1
  28. package/dist/lib/parsers/wms/parse-wms-error.js.map +1 -1
  29. package/dist/lib/parsers/wms/parse-wms-features.d.ts.map +1 -1
  30. package/dist/lib/parsers/wms/parse-wms-features.js.map +1 -1
  31. package/dist/lib/parsers/wms/parse-wms-layer-description.d.ts.map +1 -1
  32. package/dist/lib/parsers/wms/parse-wms-layer-description.js.map +1 -1
  33. package/dist/lib/parsers/xml/parse-xml-helpers.d.ts.map +1 -1
  34. package/dist/lib/parsers/xml/parse-xml-helpers.js.map +1 -1
  35. package/dist/lib/services/create-image-service.d.ts.map +1 -1
  36. package/dist/lib/services/create-image-service.js.map +1 -1
  37. package/dist/lib/services/image-service.d.ts.map +1 -1
  38. package/dist/lib/services/image-service.js.map +1 -1
  39. package/dist/services/arcgis/arcgis-image-service.d.ts.map +1 -1
  40. package/dist/services/arcgis/arcgis-image-service.js.map +1 -1
  41. package/dist/services/arcgis/arcgis-server.d.ts.map +1 -1
  42. package/dist/services/arcgis/arcgis-server.js.map +1 -1
  43. package/dist/services/create-image-source.d.ts.map +1 -1
  44. package/dist/services/create-image-source.js.map +1 -1
  45. package/dist/services/ogc/csw-service.d.ts.map +1 -1
  46. package/dist/services/ogc/csw-service.js.map +1 -1
  47. package/dist/services/ogc/wms-service.d.ts.map +1 -1
  48. package/dist/services/ogc/wms-service.js.map +1 -1
  49. package/dist/wms-capabilities-loader.d.ts.map +1 -1
  50. package/dist/wms-capabilities-loader.js.map +1 -1
  51. package/dist/wms-error-loader.d.ts.map +1 -1
  52. package/dist/wms-error-loader.js.map +1 -1
  53. package/package.json +7 -8
  54. package/src/csw-capabilities-loader.ts +1 -0
  55. package/src/csw-domain-loader.ts +1 -0
  56. package/src/csw-records-loader.ts +1 -0
  57. package/src/gml-loader.ts +1 -0
  58. package/src/index.ts +1 -4
  59. package/src/lib/parsers/csw/parse-csw-capabilities.ts +1 -0
  60. package/src/lib/parsers/csw/parse-csw-domain.ts +1 -0
  61. package/src/lib/parsers/csw/parse-csw-records.ts +1 -0
  62. package/src/lib/parsers/csw/parse-exception-report.ts +1 -0
  63. package/src/lib/parsers/gml/parse-gml.ts +1 -0
  64. package/src/lib/parsers/wms/parse-wms-capabilities.ts +1 -0
  65. package/src/lib/parsers/wms/parse-wms-error.ts +1 -0
  66. package/src/lib/parsers/wms/parse-wms-features.ts +1 -0
  67. package/src/lib/parsers/wms/parse-wms-layer-description.ts +1 -0
  68. package/src/lib/parsers/xml/parse-xml-helpers.ts +1 -0
  69. package/src/lib/services/create-image-service.ts +1 -0
  70. package/src/lib/services/image-service.ts +1 -0
  71. package/src/services/arcgis/arcgis-image-service.ts +1 -0
  72. package/src/services/arcgis/arcgis-server.ts +1 -0
  73. package/src/services/create-image-source.ts +1 -0
  74. package/src/services/ogc/csw-service.ts +1 -0
  75. package/src/services/ogc/wms-service.ts +1 -0
  76. package/src/wms-capabilities-loader.ts +1 -0
  77. package/src/wms-error-loader.ts +1 -0
  78. package/dist/lerc-loader.d.ts +0 -17
  79. package/dist/lerc-loader.d.ts.map +0 -1
  80. package/dist/lerc-loader.js +0 -21
  81. package/dist/lerc-loader.js.map +0 -1
  82. package/dist/lib/parsers/lerc/lerc-types.d.ts +0 -30
  83. package/dist/lib/parsers/lerc/lerc-types.d.ts.map +0 -1
  84. package/dist/lib/parsers/lerc/lerc-types.js +0 -2
  85. package/dist/lib/parsers/lerc/lerc-types.js.map +0 -1
  86. package/src/lerc-loader.ts +0 -48
  87. package/src/lib/parsers/lerc/lerc-types.ts +0 -43
@@ -1 +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","substituteCRS84","flipCRS","wmsParameters","vendorParameters","capabilities","layers","undefined","query_layers","styles","version","crs","format","info_format","transparent","time","elevation","getMetadata","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","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 wmsParameters = this._getWMS130Parameters(wmsParameters);\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;AAAC,SAO7CC,qBAAqB;AAAA,SACrBC,oBAAoB;AAAA,SACpBC,yBAAyB;AAAA,SAGzBC,cAAc;AAEtB,OAAO,MAAMC,UAA8C,GAAG;EAC5DC,IAAI,EAAE,KAAK;EACXC,OAAO,EAAGC,GAAW,IAAcA,GAAG,CAACC,WAAW,CAAC,CAAC,CAACC,QAAQ,CAAC,KAAK,CAAC;EACpEC,MAAM,EAAGC,KAAqB,IAAK,IAAIC,SAAS,CAACD,KAAK;AACxD,CAAC;AAwJD,OAAO,MAAMC,SAAS,SAASb,WAAW,CAAiB;EAiBzDc,WAAWA,CAACF,KAAqB,EAAE;IAAA,IAAAG,oBAAA;IACjC,KAAK,CAACH,KAAK,CAAC;IAAC,KAhBNJ,GAAG;IAAA,KAGZQ,eAAe;IAAA,KAEfC,OAAO;IAAA,KAGPC,aAAa;IAAA,KAEbC,gBAAgB;IAAA,KAEhBC,YAAY,GAA2B,IAAI;IAUzC,IAAI,CAACZ,GAAG,GAAGI,KAAK,CAACJ,GAAG;IAEpB,IAAI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,GAAG,MAAM,IAAI,CAACC,KAAK,CAAChC,GAAG,CAAC;IACtC,MAAMiC,WAAW,GAAG,MAAMF,QAAQ,CAACE,WAAW,CAAC,CAAC;IAChD,IAAI,CAACC,cAAc,CAACH,QAAQ,EAAEE,WAAW,CAAC;IAC1C,OAAOA,WAAW;EACpB;EAGUC,cAAcA,CAACH,QAAkB,EAAEE,WAAwB,EAAQ;IAC3E,MAAMgD,WAAW,GAAGlD,QAAQ,CAACmD,OAAO,CAAC,cAAc,CAAC;IACpD,IAAI,CAACnD,QAAQ,CAACoD,EAAE,IAAIvF,cAAc,CAACwF,SAAS,CAAClF,QAAQ,CAAC+E,WAAW,CAAC,EAAE;MAAA,IAAAI,qBAAA;MAElE,MAAMjD,WAAW,GAAG7C,kBAAkB,CAAmB,IAAI,CAAC6C,WAAW,EAAE;QACzEkD,GAAG,EAAE;UAACC,YAAY,EAAE;QAAI;MAC1B,CAAC,CAAC;MACF,MAAMC,KAAK,IAAAH,qBAAA,GAAGzF,cAAc,CAAC6F,SAAS,cAAAJ,qBAAA,uBAAxBA,qBAAA,CAAAK,IAAA,CAAA9F,cAAc,EAAaqC,WAAW,EAAEG,WAAW,CAAC;MAClE,MAAM,IAAIuD,KAAK,CAACH,KAAK,CAAC;IACxB;EACF;EAGUlD,WAAWA,CAACL,WAAwB,EAAS;IAAA,IAAA2D,sBAAA;IACrD,MAAMJ,KAAK,IAAAI,sBAAA,GAAGhG,cAAc,CAAC6F,SAAS,cAAAG,sBAAA,uBAAxBA,sBAAA,CAAAF,IAAA,CAAA9F,cAAc,EAAaqC,WAAW,EAAE,IAAI,CAACG,WAAW,CAAC;IACvE,OAAO,IAAIuD,KAAK,CAACH,KAAK,CAAC;EACzB;AACF"}
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","substituteCRS84","flipCRS","wmsParameters","vendorParameters","capabilities","layers","undefined","query_layers","styles","version","crs","format","info_format","transparent","time","elevation","getMetadata","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","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// Copyright (c) vis.gl contributors\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 wmsParameters = this._getWMS130Parameters(wmsParameters);\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":"AAKA,SAAQA,WAAW,QAAO,oBAAoB;AAC9C,SAAQC,kBAAkB,QAAO,0BAA0B;AAG3D,SAAQC,WAAW,QAAO,0BAA0B;AAAC,SAO7CC,qBAAqB;AAAA,SACrBC,oBAAoB;AAAA,SACpBC,yBAAyB;AAAA,SAGzBC,cAAc;AAEtB,OAAO,MAAMC,UAA8C,GAAG;EAC5DC,IAAI,EAAE,KAAK;EACXC,OAAO,EAAGC,GAAW,IAAcA,GAAG,CAACC,WAAW,CAAC,CAAC,CAACC,QAAQ,CAAC,KAAK,CAAC;EACpEC,MAAM,EAAGC,KAAqB,IAAK,IAAIC,SAAS,CAACD,KAAK;AACxD,CAAC;AAwJD,OAAO,MAAMC,SAAS,SAASb,WAAW,CAAiB;EAiBzD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AAA,CAAA9F,cAAc,EAAaqC,WAAW,EAAE,IAAI,CAACG,WAAW,CAAC;IACvE,OAAO,IAAIuD,KAAK,CAACH,KAAK,CAAC;EACzB;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"wms-capabilities-loader.d.ts","sourceRoot":"","sources":["../src/wms-capabilities-loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAC,eAAe,EAAuB,MAAM,0CAA0C,CAAC;AAO/F,YAAY,EACV,eAAe,EACf,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,UAAU,EACV,aAAa,EACd,MAAM,0CAA0C,CAAC;AAElD,MAAM,MAAM,4BAA4B,GAAG,gBAAgB,GAAG;IAC5D,GAAG,CAAC,EAAE;QACJ,oDAAoD;QACpD,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,kGAAkG;QAClG,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,kFAAkF;QAClF,cAAc,CAAC,EAAE,OAAO,CAAC;KAC1B,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,gBAAgB,CAClD,eAAe,EACf,KAAK,EACL,4BAA4B,CAoB7B,CAAC"}
1
+ {"version":3,"file":"wms-capabilities-loader.d.ts","sourceRoot":"","sources":["../src/wms-capabilities-loader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAC,eAAe,EAAuB,MAAM,0CAA0C,CAAC;AAO/F,YAAY,EACV,eAAe,EACf,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,UAAU,EACV,aAAa,EACd,MAAM,0CAA0C,CAAC;AAElD,MAAM,MAAM,4BAA4B,GAAG,gBAAgB,GAAG;IAC5D,GAAG,CAAC,EAAE;QACJ,oDAAoD;QACpD,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,kGAAkG;QAClG,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,kFAAkF;QAClF,cAAc,CAAC,EAAE,OAAO,CAAC;KAC1B,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,gBAAgB,CAClD,eAAe,EACf,KAAK,EACL,4BAA4B,CAoB7B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"wms-capabilities-loader.js","names":["parseWMSCapabilities","VERSION","__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 includeRawJSON?: boolean;\n /** Include the original XML document text. May contain additional information. */\n includeXMLText?: 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":"SAIyBA,oBAAoB;AAI7C,MAAMC,OAAO,GAAG,OAAOC,WAAW,KAAK,WAAW,GAAGA,WAAW,GAAG,QAAQ;AA0B3E,OAAO,MAAMC,qBAIZ,GAAG;EACFC,EAAE,EAAE,kBAAkB;EACtBC,IAAI,EAAE,kBAAkB;EAExBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEN,OAAO;EAChBO,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,KAE5Eb,oBAAoB,CAAC,IAAIiB,WAAW,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,EAAEH,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,GAAG,CAAC;EAC3EK,aAAa,EAAEA,CAACC,IAAY,EAAEP,OAAsC,KAElEb,oBAAoB,CAACoB,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
+ {"version":3,"file":"wms-capabilities-loader.js","names":["parseWMSCapabilities","VERSION","__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// Copyright (c) vis.gl contributors\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 includeRawJSON?: boolean;\n /** Include the original XML document text. May contain additional information. */\n includeXMLText?: 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":"SAKyBA,oBAAoB;AAI7C,MAAMC,OAAO,GAAG,OAAOC,WAAW,KAAK,WAAW,GAAGA,WAAW,GAAG,QAAQ;AA0B3E,OAAO,MAAMC,qBAIZ,GAAG;EACFC,EAAE,EAAE,kBAAkB;EACtBC,IAAI,EAAE,kBAAkB;EAExBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEN,OAAO;EAChBO,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,KAE5Eb,oBAAoB,CAAC,IAAIiB,WAAW,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,EAAEH,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,GAAG,CAAC;EAC3EK,aAAa,EAAEA,CAACC,IAAY,EAAEP,OAAsC,KAElEb,oBAAoB,CAACoB,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 +1 @@
1
- {"version":3,"file":"wms-error-loader.d.ts","sourceRoot":"","sources":["../src/wms-error-loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,gBAAgB,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAO9E,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,GAAG,CAAC,EAAE;QACJ,oFAAoF;QACpF,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,oCAAoC;QACpC,aAAa,CAAC,EAAE,OAAO,CAAC;KACzB,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,gBAAgB,CAAC,MAAM,EAAE,KAAK,EAAE,gBAAgB,CAoB5E,CAAC"}
1
+ {"version":3,"file":"wms-error-loader.d.ts","sourceRoot":"","sources":["../src/wms-error-loader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,gBAAgB,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAO9E,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,GAAG,CAAC,EAAE;QACJ,oFAAoF;QACpF,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,oCAAoC;QACpC,aAAa,CAAC,EAAE,OAAO,CAAC;KACzB,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,gBAAgB,CAAC,MAAM,EAAE,KAAK,EAAE,gBAAgB,CAoB5E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"wms-error-loader.js","names":["parseWMSError","VERSION","__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","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":"SAGQA,aAAa;AAIrB,MAAMC,OAAO,GAAG,OAAOC,WAAW,KAAK,WAAW,GAAGA,WAAW,GAAG,QAAQ;AAc3E,OAAO,MAAMC,cAAiE,GAAG;EAC/EC,EAAE,EAAE,WAAW;EACfC,IAAI,EAAE,WAAW;EAEjBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEN,OAAO;EACh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ErrorLoader","id","name","module","version","worker","extensions","mimeTypes","testText","testXMLFile","options","wms","throwOnError","parse","arrayBuffer","parseTextSync","TextDecoder","decode","parseSync","text","startsWith","wmsOptions","error","message","minimalErrors","Error"],"sources":["../src/wms-error-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\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":"SAIQA,aAAa;AAIrB,MAAMC,OAAO,GAAG,OAAOC,WAAW,KAAK,WAAW,GAAGA,WAAW,GAAG,QAAQ;AAc3E,OAAO,MAAMC,cAAiE,GAAG;EAC/EC,EAAE,EAAE,WAAW;EACfC,IAAI,EAAE,WAAW;EAEjBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEN,OAAO;EAChBO,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,GAAGzB,aAAa,CAACsB,IAAI,EAAEE,UAAU,CAAC;EAC7C,MAAME,OAAO,GAAGF,UAAU,CAACG,aAAa,GAAGF,KAAK,GAAI,sBAAqBA,KAAM,EAAC;EAChF,IAAID,UAAU,CAACT,YAAY,EAAE;IAC3B,MAAM,IAAIa,KAAK,CAACF,OAAO,CAAC;EAC1B;EACA,OAAOA,OAAO;AAChB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/wms",
3
- "version": "4.0.0-beta.6",
3
+ "version": "4.0.0-beta.8",
4
4
  "description": "Framework-independent loaders for the WMS (Web Map Service) standard",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -51,13 +51,12 @@
51
51
  },
52
52
  "dependencies": {
53
53
  "@babel/runtime": "^7.3.1",
54
- "@loaders.gl/images": "4.0.0-beta.6",
55
- "@loaders.gl/loader-utils": "4.0.0-beta.6",
56
- "@loaders.gl/schema": "4.0.0-beta.6",
57
- "@loaders.gl/xml": "4.0.0-beta.6",
54
+ "@loaders.gl/images": "4.0.0-beta.8",
55
+ "@loaders.gl/loader-utils": "4.0.0-beta.8",
56
+ "@loaders.gl/schema": "4.0.0-beta.8",
57
+ "@loaders.gl/xml": "4.0.0-beta.8",
58
58
  "@turf/rewind": "^5.1.5",
59
- "deep-strict-equal": "^0.2.0",
60
- "lerc": "^4.0.1"
59
+ "deep-strict-equal": "^0.2.0"
61
60
  },
62
- "gitHead": "2840f605b7a551e2ffef5f960231d989a0414c50"
61
+ "gitHead": "ec3d1747b4c01c52a235455d6462680e711b4e19"
63
62
  }
@@ -1,4 +1,5 @@
1
1
  // loaders.gl, MIT license
2
+ // Copyright (c) vis.gl contributors
2
3
 
3
4
  import type {LoaderWithParser} from '@loaders.gl/loader-utils';
4
5
  import type {XMLLoaderOptions} from '@loaders.gl/xml';
@@ -1,4 +1,5 @@
1
1
  // loaders.gl, MIT license
2
+ // Copyright (c) vis.gl contributors
2
3
 
3
4
  import type {LoaderWithParser} from '@loaders.gl/loader-utils';
4
5
  import type {XMLLoaderOptions} from '@loaders.gl/xml';
@@ -1,4 +1,5 @@
1
1
  // loaders.gl, MIT license
2
+ // Copyright (c) vis.gl contributors
2
3
 
3
4
  import type {LoaderWithParser} from '@loaders.gl/loader-utils';
4
5
  import type {XMLLoaderOptions} from '@loaders.gl/xml';
package/src/gml-loader.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  // loaders.gl, MIT license
2
+ // Copyright (c) vis.gl contributors
2
3
 
3
4
  import type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';
4
5
  import type {Geometry} from './lib/parsers/gml/parse-gml';
package/src/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  // loaders.gl, MIT license
2
+ // Copyright (c) vis.gl contributors
2
3
 
3
4
  // CSW - Catalog Service for the Web
4
5
 
@@ -78,7 +79,3 @@ export {WMSSource, WMSService} from './services/ogc/wms-service';
78
79
 
79
80
  export {getArcGISServices as _getArcGISServices} from './services/arcgis/arcgis-server';
80
81
  export {ArcGISImageService as _ArcGISImageService} from './services/arcgis/arcgis-image-service';
81
-
82
- // LERC - Limited Error Raster Compression
83
- export type {LERCData} from './lib/parsers/lerc/lerc-types';
84
- export {LERCLoader} from './lerc-loader';
@@ -1,4 +1,5 @@
1
1
  // loaders.gl, MIT license
2
+ // Copyright (c) vis.gl contributors
2
3
 
3
4
  import type {XMLLoaderOptions} from '@loaders.gl/xml';
4
5
  import {XMLLoader} from '@loaders.gl/xml';
@@ -1,4 +1,5 @@
1
1
  // loaders.gl, MIT license
2
+ // Copyright (c) vis.gl contributors
2
3
 
3
4
  import type {XMLLoaderOptions} from '@loaders.gl/xml';
4
5
  import {XMLLoader} from '@loaders.gl/xml';
@@ -1,4 +1,5 @@
1
1
  // loaders.gl, MIT license
2
+ // Copyright (c) vis.gl contributors
2
3
 
3
4
  import {XMLLoaderOptions, convertXMLFieldToArrayInPlace} from '@loaders.gl/xml';
4
5
  import {XMLLoader} from '@loaders.gl/xml';
@@ -1,4 +1,5 @@
1
1
  // loaders.gl, MIT license
2
+ // Copyright (c) vis.gl contributors
2
3
 
3
4
  // import type {XMLLoaderOptions} from '@loaders.gl/xml';
4
5
  // import {XMLLoader} from '@loaders.gl/xml';
@@ -1,4 +1,5 @@
1
1
  // loaders.gl, MIT license
2
+ // Copyright (c) vis.gl contributors
2
3
 
3
4
  // Forked from https://github.com/derhuerst/parse-gml-polygon/blob/master/index.js
4
5
  // under ISC license
@@ -1,4 +1,5 @@
1
1
  // loaders.gl, MIT license
2
+ // Copyright (c) vis.gl contributors
2
3
 
3
4
  import {XMLLoader} from '@loaders.gl/xml';
4
5
  import {
@@ -1,4 +1,5 @@
1
1
  // loaders.gl, MIT license
2
+ // Copyright (c) vis.gl contributors
2
3
 
3
4
  import {XMLLoader} from '@loaders.gl/xml';
4
5
 
@@ -1,4 +1,5 @@
1
1
  // loaders.gl, MIT license
2
+ // Copyright (c) vis.gl contributors
2
3
 
3
4
  import {XMLLoader} from '@loaders.gl/xml';
4
5
 
@@ -1,4 +1,5 @@
1
1
  // loaders.gl, MIT license
2
+ // Copyright (c) vis.gl contributors
2
3
 
3
4
  import type {XMLLoaderOptions} from '@loaders.gl/xml';
4
5
  import {XMLLoader} from '@loaders.gl/xml';
@@ -1,4 +1,5 @@
1
1
  // loaders.gl, MIT license
2
+ // Copyright (c) vis.gl contributors
2
3
 
3
4
  /** A single element of an array is not represented as an array in XML */
4
5
  export function getXMLArray(xmlValue: any): any[] {
@@ -1,4 +1,5 @@
1
1
  // loaders.gl, MIT license
2
+ // Copyright (c) vis.gl contributors
2
3
 
3
4
  import {ImageSource, Service} from '@loaders.gl/loader-utils';
4
5
  import {ImageServiceProps} from './image-service';
@@ -1,4 +1,5 @@
1
1
  // loaders.gl, MIT license
2
+ // Copyright (c) vis.gl contributors
2
3
 
3
4
  import {LoaderOptions} from '@loaders.gl/loader-utils';
4
5
  import type {ImageType} from '@loaders.gl/images';
@@ -1,4 +1,5 @@
1
1
  // loaders.gl, MIT license
2
+ // Copyright (c) vis.gl contributors
2
3
 
3
4
  import {ImageType} from '@loaders.gl/images';
4
5
  import type {Service, ImageSourceMetadata, GetImageParameters} from '@loaders.gl/loader-utils';
@@ -1,4 +1,5 @@
1
1
  // loaders.gl, MIT license
2
+ // Copyright (c) vis.gl contributors
2
3
 
3
4
  export type Service = {name: string; type: string; url: string};
4
5
 
@@ -1,4 +1,5 @@
1
1
  // loaders.gl, MIT license
2
+ // Copyright (c) vis.gl contributors
2
3
 
3
4
  import type {Service, ImageSource} from '@loaders.gl/loader-utils';
4
5
  // import {ImageService} from '../lib/services/image-service';
@@ -1,4 +1,5 @@
1
1
  // loaders.gl, MIT license
2
+ // Copyright (c) vis.gl contributors
2
3
 
3
4
  /* eslint-disable camelcase */
4
5
 
@@ -1,4 +1,5 @@
1
1
  // loaders.gl, MIT license
2
+ // Copyright (c) vis.gl contributors
2
3
 
3
4
  /* eslint-disable camelcase */
4
5
  import type {ImageType} from '@loaders.gl/images';
@@ -1,4 +1,5 @@
1
1
  // loaders.gl, MIT license
2
+ // Copyright (c) vis.gl contributors
2
3
 
3
4
  import type {LoaderWithParser} from '@loaders.gl/loader-utils';
4
5
  import type {XMLLoaderOptions} from '@loaders.gl/xml';
@@ -1,4 +1,5 @@
1
1
  // loaders.gl, MIT license
2
+ // Copyright (c) vis.gl contributors
2
3
 
3
4
  import type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';
4
5
  import {parseWMSError} from './lib/parsers/wms/parse-wms-error';
@@ -1,17 +0,0 @@
1
- import type { LoaderWithParser, LoaderOptions } from '@loaders.gl/loader-utils';
2
- import type { LERCData } from './lib/parsers/lerc/lerc-types';
3
- export type LERCLoaderOptions = LoaderOptions & {
4
- lerc?: {
5
- /** The number of bytes to skip in the input byte stream. A valid Lerc file is expected at that position. */
6
- inputOffset?: number;
7
- /** It is recommended to use the returned mask instead of setting this value. */
8
- noDataValue?: number;
9
- /** (ndepth LERC2 only) If true, returned depth values are pixel-interleaved. */
10
- returnInterleaved?: boolean;
11
- };
12
- };
13
- /**
14
- * Loader for the LERC raster format
15
- */
16
- export declare const LERCLoader: LoaderWithParser<LERCData, never, LERCLoaderOptions>;
17
- //# sourceMappingURL=lerc-loader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lerc-loader.d.ts","sourceRoot":"","sources":["../src/lerc-loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,gBAAgB,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAC9E,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,+BAA+B,CAAC;AAO5D,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG;IAC9C,IAAI,CAAC,EAAE;QACL,4GAA4G;QAC5G,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,gFAAgF;QAChF,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,gFAAgF;QAChF,iBAAiB,CAAC,EAAE,OAAO,CAAC;KAC7B,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,gBAAgB,CAAC,QAAQ,EAAE,KAAK,EAAE,iBAAiB,CAe3E,CAAC"}
@@ -1,21 +0,0 @@
1
- import * as Lerc from 'lerc';
2
- const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
3
- export const LERCLoader = {
4
- id: 'lerc',
5
- name: 'LERC',
6
- module: 'wms',
7
- version: VERSION,
8
- worker: false,
9
- extensions: ['lrc', 'lerc', 'lerc2', 'lerc1'],
10
- mimeTypes: ['application/octet-stream'],
11
- options: {
12
- wms: {}
13
- },
14
- parse: async (arrayBuffer, options) => parseLERC(arrayBuffer, options)
15
- };
16
- async function parseLERC(arrayBuffer, options) {
17
- await Lerc.load();
18
- const pixelBlock = Lerc.decode(arrayBuffer, options === null || options === void 0 ? void 0 : options.lerc);
19
- return pixelBlock;
20
- }
21
- //# sourceMappingURL=lerc-loader.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lerc-loader.js","names":["Lerc","VERSION","__VERSION__","LERCLoader","id","name","module","version","worker","extensions","mimeTypes","options","wms","parse","arrayBuffer","parseLERC","load","pixelBlock","decode","lerc"],"sources":["../src/lerc-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {LERCData} from './lib/parsers/lerc/lerc-types';\nimport * as Lerc from 'lerc';\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 LERCLoaderOptions = LoaderOptions & {\n lerc?: {\n /**\tThe number of bytes to skip in the input byte stream. A valid Lerc file is expected at that position. */\n inputOffset?: number;\n /**\tIt is recommended to use the returned mask instead of setting this value. */\n noDataValue?: number;\n /**\t(ndepth LERC2 only) If true, returned depth values are pixel-interleaved. */\n returnInterleaved?: boolean;\n };\n};\n\n/**\n * Loader for the LERC raster format\n */\nexport const LERCLoader: LoaderWithParser<LERCData, never, LERCLoaderOptions> = {\n id: 'lerc',\n name: 'LERC',\n\n module: 'wms',\n version: VERSION,\n worker: false,\n extensions: ['lrc', 'lerc', 'lerc2', 'lerc1'],\n mimeTypes: ['application/octet-stream'],\n // test: ?,\n options: {\n wms: {}\n },\n parse: async (arrayBuffer: ArrayBuffer, options?: LERCLoaderOptions) =>\n parseLERC(arrayBuffer, options)\n};\n\nasync function parseLERC(arrayBuffer: ArrayBuffer, options?: LERCLoaderOptions): Promise<LERCData> {\n // Load the WASM library\n await Lerc.load();\n // Perform the decode\n const pixelBlock = Lerc.decode(arrayBuffer, options?.lerc);\n return pixelBlock;\n}\n"],"mappings":"AAIA,OAAO,KAAKA,IAAI,MAAM,MAAM;AAI5B,MAAMC,OAAO,GAAG,OAAOC,WAAW,KAAK,WAAW,GAAGA,WAAW,GAAG,QAAQ;AAgB3E,OAAO,MAAMC,UAAgE,GAAG;EAC9EC,EAAE,EAAE,MAAM;EACVC,IAAI,EAAE,MAAM;EAEZC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEN,OAAO;EAChBO,MAAM,EAAE,KAAK;EACbC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC;EAC7CC,SAAS,EAAE,CAAC,0BAA0B,CAAC;EAEvCC,OAAO,EAAE;IACPC,GAAG,EAAE,CAAC;EACR,CAAC;EACDC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEH,OAA2B,KACjEI,SAAS,CAACD,WAAW,EAAEH,OAAO;AAClC,CAAC;AAED,eAAeI,SAASA,CAACD,WAAwB,EAAEH,OAA2B,EAAqB;EAEjG,MAAMX,IAAI,CAACgB,IAAI,CAAC,CAAC;EAEjB,MAAMC,UAAU,GAAGjB,IAAI,CAACkB,MAAM,CAACJ,WAAW,EAAEH,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEQ,IAAI,CAAC;EAC1D,OAAOF,UAAU;AACnB"}
@@ -1,30 +0,0 @@
1
- /** Data returned by LERC loader */
2
- export type LERCData = {
3
- /** Width of decoded image */
4
- width: number;
5
- /** Height of decoded image */
6
- height: number;
7
- /** The type of pixels represented in the output */
8
- pixelType: LercPixelType;
9
- /** [statistics_band1, statistics_band2, …] Each element is a statistics object representing min and max values */
10
- statistics: BandStats[];
11
- /** [band1, band2, …] Each band is a typed array of width * height * depthCount */
12
- pixels: TypedArray[];
13
- /** Typed array with a size of width*height, or null if all pixels are valid */
14
- mask: Uint8Array;
15
- /** Depth count */
16
- depthCount: number;
17
- /** array [band1_mask, band2_mask, …] Each band is a Uint8Array of width * height * depthCount */
18
- bandMasks?: Uint8Array[];
19
- };
20
- export type LercPixelType = 'S8' | 'U8' | 'S16' | 'U16' | 'S32' | 'U32' | 'F32' | 'F64';
21
- export interface BandStats {
22
- minValue: number;
23
- maxValue: number;
24
- depthStats?: {
25
- minValues: Float64Array;
26
- maxValues: Float64Array;
27
- };
28
- }
29
- export type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
30
- //# sourceMappingURL=lerc-types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lerc-types.d.ts","sourceRoot":"","sources":["../../../../src/lib/parsers/lerc/lerc-types.ts"],"names":[],"mappings":"AAEA,mCAAmC;AACnC,MAAM,MAAM,QAAQ,GAAG;IACrB,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,SAAS,EAAE,aAAa,CAAC;IACzB,mHAAmH;IACnH,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,kFAAkF;IAClF,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,+EAA+E;IAC/E,IAAI,EAAE,UAAU,CAAC;IACjB,mBAAmB;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,iGAAiG;IACjG,SAAS,CAAC,EAAE,UAAU,EAAE,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAExF,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE;QACX,SAAS,EAAE,YAAY,CAAC;QACxB,SAAS,EAAE,YAAY,CAAC;KACzB,CAAC;CACH;AAED,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,UAAU,GACV,iBAAiB,GACjB,UAAU,GACV,WAAW,GACX,UAAU,GACV,WAAW,GACX,YAAY,GACZ,YAAY,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=lerc-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lerc-types.js","names":[],"sources":["../../../../src/lib/parsers/lerc/lerc-types.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n/** Data returned by LERC loader */\nexport type LERCData = {\n /**\tWidth of decoded image */\n width: number;\n /**\tHeight of decoded image */\n height: number;\n /**\tThe type of pixels represented in the output */\n pixelType: LercPixelType;\n /**\t[statistics_band1, statistics_band2, …] Each element is a statistics object representing min and max values */\n statistics: BandStats[];\n /**\t[band1, band2, …] Each band is a typed array of width * height * depthCount */\n pixels: TypedArray[];\n /**\tTyped array with a size of width*height, or null if all pixels are valid */\n mask: Uint8Array;\n /**\tDepth count */\n depthCount: number;\n /**\tarray\t[band1_mask, band2_mask, …] Each band is a Uint8Array of width * height * depthCount */\n bandMasks?: Uint8Array[];\n};\n\nexport type LercPixelType = 'S8' | 'U8' | 'S16' | 'U16' | 'S32' | 'U32' | 'F32' | 'F64';\n\nexport interface BandStats {\n minValue: number;\n maxValue: number;\n depthStats?: {\n minValues: Float64Array;\n maxValues: Float64Array;\n };\n}\n\nexport type TypedArray =\n | Int8Array\n | Uint8Array\n | Uint8ClampedArray\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Float32Array\n | Float64Array;\n"],"mappings":""}
@@ -1,48 +0,0 @@
1
- // loaders.gl, MIT license
2
-
3
- import type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';
4
- import type {LERCData} from './lib/parsers/lerc/lerc-types';
5
- import * as Lerc from 'lerc';
6
-
7
- // __VERSION__ is injected by babel-plugin-version-inline
8
- // @ts-ignore TS2304: Cannot find name '__VERSION__'.
9
- const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
10
-
11
- export type LERCLoaderOptions = LoaderOptions & {
12
- lerc?: {
13
- /** The number of bytes to skip in the input byte stream. A valid Lerc file is expected at that position. */
14
- inputOffset?: number;
15
- /** It is recommended to use the returned mask instead of setting this value. */
16
- noDataValue?: number;
17
- /** (ndepth LERC2 only) If true, returned depth values are pixel-interleaved. */
18
- returnInterleaved?: boolean;
19
- };
20
- };
21
-
22
- /**
23
- * Loader for the LERC raster format
24
- */
25
- export const LERCLoader: LoaderWithParser<LERCData, never, LERCLoaderOptions> = {
26
- id: 'lerc',
27
- name: 'LERC',
28
-
29
- module: 'wms',
30
- version: VERSION,
31
- worker: false,
32
- extensions: ['lrc', 'lerc', 'lerc2', 'lerc1'],
33
- mimeTypes: ['application/octet-stream'],
34
- // test: ?,
35
- options: {
36
- wms: {}
37
- },
38
- parse: async (arrayBuffer: ArrayBuffer, options?: LERCLoaderOptions) =>
39
- parseLERC(arrayBuffer, options)
40
- };
41
-
42
- async function parseLERC(arrayBuffer: ArrayBuffer, options?: LERCLoaderOptions): Promise<LERCData> {
43
- // Load the WASM library
44
- await Lerc.load();
45
- // Perform the decode
46
- const pixelBlock = Lerc.decode(arrayBuffer, options?.lerc);
47
- return pixelBlock;
48
- }