@loaders.gl/wms 3.4.0-alpha.2 → 3.4.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/dist/dist.min.js +359 -174
  2. package/dist/es5/csw-capabilities-loader.js +7 -11
  3. package/dist/es5/csw-capabilities-loader.js.map +1 -1
  4. package/dist/es5/csw-domain-loader.js +7 -10
  5. package/dist/es5/csw-domain-loader.js.map +1 -1
  6. package/dist/es5/csw-records-loader.js +7 -10
  7. package/dist/es5/csw-records-loader.js.map +1 -1
  8. package/dist/es5/gml-loader.js +7 -10
  9. package/dist/es5/gml-loader.js.map +1 -1
  10. package/dist/es5/index.js +0 -7
  11. package/dist/es5/index.js.map +1 -1
  12. package/dist/es5/lerc-loader.js +17 -22
  13. package/dist/es5/lerc-loader.js.map +1 -1
  14. package/dist/es5/lib/create-image-source.js +1 -2
  15. package/dist/es5/lib/create-image-source.js.map +1 -1
  16. package/dist/es5/lib/parsers/csw/parse-csw-capabilities.js.map +1 -1
  17. package/dist/es5/lib/parsers/csw/parse-csw-domain.js +1 -1
  18. package/dist/es5/lib/parsers/csw/parse-csw-domain.js.map +1 -1
  19. package/dist/es5/lib/parsers/csw/parse-csw-records.js +1 -2
  20. package/dist/es5/lib/parsers/csw/parse-csw-records.js.map +1 -1
  21. package/dist/es5/lib/parsers/csw/parse-exception-report.js +0 -2
  22. package/dist/es5/lib/parsers/csw/parse-exception-report.js.map +1 -1
  23. package/dist/es5/lib/parsers/gml/deep-strict-equal.js +0 -8
  24. package/dist/es5/lib/parsers/gml/deep-strict-equal.js.map +1 -1
  25. package/dist/es5/lib/parsers/gml/parse-gml.js +1 -13
  26. package/dist/es5/lib/parsers/gml/parse-gml.js.map +1 -1
  27. package/dist/es5/lib/parsers/wms/parse-wms-capabilities.js +197 -54
  28. package/dist/es5/lib/parsers/wms/parse-wms-capabilities.js.map +1 -1
  29. package/dist/es5/lib/parsers/wms/parse-wms-error.js +0 -1
  30. package/dist/es5/lib/parsers/wms/parse-wms-error.js.map +1 -1
  31. package/dist/es5/lib/parsers/wms/parse-wms-features.js +0 -1
  32. package/dist/es5/lib/parsers/wms/parse-wms-features.js.map +1 -1
  33. package/dist/es5/lib/parsers/wms/parse-wms-layer-description.js +0 -1
  34. package/dist/es5/lib/parsers/wms/parse-wms-layer-description.js.map +1 -1
  35. package/dist/es5/lib/parsers/xml/parse-xml-helpers.js +67 -0
  36. package/dist/es5/lib/parsers/xml/parse-xml-helpers.js.map +1 -0
  37. package/dist/es5/lib/services/arcgis/arcgis-image-service.js +35 -54
  38. package/dist/es5/lib/services/arcgis/arcgis-image-service.js.map +1 -1
  39. package/dist/es5/lib/services/arcgis/arcgis-server.js +50 -54
  40. package/dist/es5/lib/services/arcgis/arcgis-server.js.map +1 -1
  41. package/dist/es5/lib/services/generic/image-service.js +27 -36
  42. package/dist/es5/lib/services/generic/image-service.js.map +1 -1
  43. package/dist/es5/lib/services/ogc/csw-service.js +161 -186
  44. package/dist/es5/lib/services/ogc/csw-service.js.map +1 -1
  45. package/dist/es5/lib/services/ogc/wms-service.js +283 -245
  46. package/dist/es5/lib/services/ogc/wms-service.js.map +1 -1
  47. package/dist/es5/lib/sources/data-source.js +1 -6
  48. package/dist/es5/lib/sources/data-source.js.map +1 -1
  49. package/dist/es5/lib/sources/image-source.js.map +1 -1
  50. package/dist/es5/lib/sources/tile-source.js.map +1 -1
  51. package/dist/es5/lib/sources/utils/utils.js +0 -4
  52. package/dist/es5/lib/sources/utils/utils.js.map +1 -1
  53. package/dist/es5/wip/arcgis-feature-service.js +2 -7
  54. package/dist/es5/wip/arcgis-feature-service.js.map +1 -1
  55. package/dist/es5/wip/data-source.js +0 -2
  56. package/dist/es5/wip/lib/wcs/parse-wcs-capabilities.js.map +1 -1
  57. package/dist/es5/wip/lib/wfs/parse-wfs-capabilities.js.map +1 -1
  58. package/dist/es5/wip/lib/wmts/parse-wmts-capabilities.js.map +1 -1
  59. package/dist/es5/wip/wcs-capabilities-loader.js +7 -10
  60. package/dist/es5/wip/wcs-capabilities-loader.js.map +1 -1
  61. package/dist/es5/wip/wfs-capabilities-loader.js +7 -10
  62. package/dist/es5/wip/wfs-capabilities-loader.js.map +1 -1
  63. package/dist/es5/wip/wms-feature-info-loader.js +6 -8
  64. package/dist/es5/wip/wms-feature-info-loader.js.map +1 -1
  65. package/dist/es5/wip/wms-layer-description-loader.js +6 -8
  66. package/dist/es5/wip/wms-layer-description-loader.js.map +1 -1
  67. package/dist/es5/wip/wmts-capabilities-loader.js +7 -16
  68. package/dist/es5/wip/wmts-capabilities-loader.js.map +1 -1
  69. package/dist/es5/wms-capabilities-loader.js +8 -12
  70. package/dist/es5/wms-capabilities-loader.js.map +1 -1
  71. package/dist/es5/wms-error-loader.js +7 -9
  72. package/dist/es5/wms-error-loader.js.map +1 -1
  73. package/dist/esm/bundle.js +0 -2
  74. package/dist/esm/bundle.js.map +1 -1
  75. package/dist/esm/csw-capabilities-loader.js +1 -5
  76. package/dist/esm/csw-capabilities-loader.js.map +1 -1
  77. package/dist/esm/csw-domain-loader.js +1 -4
  78. package/dist/esm/csw-domain-loader.js.map +1 -1
  79. package/dist/esm/csw-records-loader.js +1 -4
  80. package/dist/esm/csw-records-loader.js.map +1 -1
  81. package/dist/esm/gml-loader.js +1 -4
  82. package/dist/esm/gml-loader.js.map +1 -1
  83. package/dist/esm/index.js +0 -11
  84. package/dist/esm/index.js.map +1 -1
  85. package/dist/esm/lerc-loader.js +1 -4
  86. package/dist/esm/lerc-loader.js.map +1 -1
  87. package/dist/esm/lib/create-image-source.js +0 -3
  88. package/dist/esm/lib/create-image-source.js.map +1 -1
  89. package/dist/esm/lib/parsers/csw/parse-csw-capabilities.js +0 -3
  90. package/dist/esm/lib/parsers/csw/parse-csw-capabilities.js.map +1 -1
  91. package/dist/esm/lib/parsers/csw/parse-csw-domain.js +0 -3
  92. package/dist/esm/lib/parsers/csw/parse-csw-domain.js.map +1 -1
  93. package/dist/esm/lib/parsers/csw/parse-csw-records.js +0 -3
  94. package/dist/esm/lib/parsers/csw/parse-csw-records.js.map +1 -1
  95. package/dist/esm/lib/parsers/csw/parse-exception-report.js +0 -3
  96. package/dist/esm/lib/parsers/csw/parse-exception-report.js.map +1 -1
  97. package/dist/esm/lib/parsers/gml/deep-strict-equal.js +0 -9
  98. package/dist/esm/lib/parsers/gml/deep-strict-equal.js.map +1 -1
  99. package/dist/esm/lib/parsers/gml/parse-gml.js +0 -14
  100. package/dist/esm/lib/parsers/gml/parse-gml.js.map +1 -1
  101. package/dist/esm/lib/parsers/wms/parse-wms-capabilities.js +151 -42
  102. package/dist/esm/lib/parsers/wms/parse-wms-capabilities.js.map +1 -1
  103. package/dist/esm/lib/parsers/wms/parse-wms-error.js +0 -3
  104. package/dist/esm/lib/parsers/wms/parse-wms-error.js.map +1 -1
  105. package/dist/esm/lib/parsers/wms/parse-wms-features.js +0 -3
  106. package/dist/esm/lib/parsers/wms/parse-wms-features.js.map +1 -1
  107. package/dist/esm/lib/parsers/wms/parse-wms-layer-description.js +0 -3
  108. package/dist/esm/lib/parsers/wms/parse-wms-layer-description.js.map +1 -1
  109. package/dist/esm/lib/parsers/xml/parse-xml-helpers.js +53 -0
  110. package/dist/esm/lib/parsers/xml/parse-xml-helpers.js.map +1 -0
  111. package/dist/esm/lib/services/arcgis/arcgis-image-service.js +0 -9
  112. package/dist/esm/lib/services/arcgis/arcgis-image-service.js.map +1 -1
  113. package/dist/esm/lib/services/arcgis/arcgis-server.js +0 -2
  114. package/dist/esm/lib/services/arcgis/arcgis-server.js.map +1 -1
  115. package/dist/esm/lib/services/generic/image-service.js +0 -5
  116. package/dist/esm/lib/services/generic/image-service.js.map +1 -1
  117. package/dist/esm/lib/services/ogc/csw-service.js +0 -11
  118. package/dist/esm/lib/services/ogc/csw-service.js.map +1 -1
  119. package/dist/esm/lib/services/ogc/wms-service.js +96 -87
  120. package/dist/esm/lib/services/ogc/wms-service.js.map +1 -1
  121. package/dist/esm/lib/sources/data-source.js +0 -6
  122. package/dist/esm/lib/sources/data-source.js.map +1 -1
  123. package/dist/esm/lib/sources/image-source.js +0 -3
  124. package/dist/esm/lib/sources/image-source.js.map +1 -1
  125. package/dist/esm/lib/sources/tile-source.js +0 -3
  126. package/dist/esm/lib/sources/tile-source.js.map +1 -1
  127. package/dist/esm/lib/sources/utils/utils.js +0 -5
  128. package/dist/esm/lib/sources/utils/utils.js.map +1 -1
  129. package/dist/esm/wip/arcgis-feature-service.js +0 -3
  130. package/dist/esm/wip/arcgis-feature-service.js.map +1 -1
  131. package/dist/esm/wip/lib/wcs/parse-wcs-capabilities.js +0 -3
  132. package/dist/esm/wip/lib/wcs/parse-wcs-capabilities.js.map +1 -1
  133. package/dist/esm/wip/lib/wfs/parse-wfs-capabilities.js +0 -3
  134. package/dist/esm/wip/lib/wfs/parse-wfs-capabilities.js.map +1 -1
  135. package/dist/esm/wip/lib/wmts/parse-wmts-capabilities.js +0 -3
  136. package/dist/esm/wip/lib/wmts/parse-wmts-capabilities.js.map +1 -1
  137. package/dist/esm/wip/wcs-capabilities-loader.js +1 -4
  138. package/dist/esm/wip/wcs-capabilities-loader.js.map +1 -1
  139. package/dist/esm/wip/wfs-capabilities-loader.js +1 -4
  140. package/dist/esm/wip/wfs-capabilities-loader.js.map +1 -1
  141. package/dist/esm/wip/wms-feature-info-loader.js +0 -2
  142. package/dist/esm/wip/wms-feature-info-loader.js.map +1 -1
  143. package/dist/esm/wip/wms-layer-description-loader.js +0 -2
  144. package/dist/esm/wip/wms-layer-description-loader.js.map +1 -1
  145. package/dist/esm/wip/wmts-capabilities-loader.js +1 -6
  146. package/dist/esm/wip/wmts-capabilities-loader.js.map +1 -1
  147. package/dist/esm/wms-capabilities-loader.js +3 -7
  148. package/dist/esm/wms-capabilities-loader.js.map +1 -1
  149. package/dist/esm/wms-error-loader.js +1 -4
  150. package/dist/esm/wms-error-loader.js.map +1 -1
  151. package/dist/index.d.ts +0 -3
  152. package/dist/index.d.ts.map +1 -1
  153. package/dist/index.js +3 -5
  154. package/dist/lib/parsers/wms/parse-wms-capabilities.d.ts +78 -62
  155. package/dist/lib/parsers/wms/parse-wms-capabilities.d.ts.map +1 -1
  156. package/dist/lib/parsers/wms/parse-wms-capabilities.js +165 -1935
  157. package/dist/lib/parsers/xml/parse-xml-helpers.d.ts +11 -0
  158. package/dist/lib/parsers/xml/parse-xml-helpers.d.ts.map +1 -0
  159. package/dist/lib/parsers/xml/parse-xml-helpers.js +68 -0
  160. package/dist/lib/services/arcgis/arcgis-image-service.js +1 -1
  161. package/dist/lib/services/generic/image-service.js +1 -1
  162. package/dist/lib/services/ogc/csw-service.d.ts +1 -1
  163. package/dist/lib/services/ogc/csw-service.d.ts.map +1 -1
  164. package/dist/lib/services/ogc/csw-service.js +1 -1
  165. package/dist/lib/services/ogc/wms-service.d.ts +63 -58
  166. package/dist/lib/services/ogc/wms-service.d.ts.map +1 -1
  167. package/dist/lib/services/ogc/wms-service.js +106 -71
  168. package/dist/lib/sources/image-source.d.ts +3 -9
  169. package/dist/lib/sources/image-source.d.ts.map +1 -1
  170. package/dist/wip/wmts-capabilities-loader.d.ts +3 -4
  171. package/dist/wip/wmts-capabilities-loader.d.ts.map +1 -1
  172. package/dist/wip/wmts-capabilities-loader.js +1 -0
  173. package/dist/wms-capabilities-loader.d.ts +6 -1
  174. package/dist/wms-capabilities-loader.d.ts.map +1 -1
  175. package/dist/wms-capabilities-loader.js +2 -2
  176. package/package.json +6 -6
  177. package/src/index.ts +3 -4
  178. package/src/lib/parsers/wms/parse-wms-capabilities.ts +293 -2004
  179. package/src/lib/parsers/xml/parse-xml-helpers.ts +65 -0
  180. package/src/lib/services/ogc/csw-service.ts +1 -1
  181. package/src/lib/services/ogc/wms-service.ts +169 -109
  182. package/src/lib/sources/image-source.ts +3 -9
  183. package/src/wip/wmts-capabilities-loader.ts +2 -2
  184. package/src/wms-capabilities-loader.ts +9 -3
@@ -1 +1 @@
1
- {"version":3,"file":"wms-service.js","names":["ImageLoader","mergeLoaderOptions","ImageSource","WMSCapabilitiesLoader","WMSFeatureInfoLoader","WMSLayerDescriptionLoader","WMSErrorLoader","WMSService","constructor","props","loadOptions","undefined","layers","styles","version","srs","format","info_format","getMetadata","capabilities","getCapabilities","normalizeMetadata","getImage","parameters","getMap","wmsParameters","vendorParameters","url","getCapabilitiesURL","response","fetch","arrayBuffer","_checkResponse","parse","options","getMapURL","_parseError","getFeatureInfo","getFeatureInfoURL","getFeatureInfoText","TextDecoder","decode","describeLayer","describeLayerURL","getLegendGraphic","getLegendGraphicURL","service","request","_getWMSUrl","first","key","value","Object","entries","Array","isArray","toUpperCase","join","String","encodeURI","contentType","headers","ok","mimeTypes","includes","wms","throwOnError","error","parseSync","Error","toLowerCase"],"sources":["../../../../../src/lib/services/ogc/wms-service.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n/* eslint-disable camelcase */\n\nimport type {ImageType} from '@loaders.gl/images';\nimport {ImageLoader} from '@loaders.gl/images';\nimport {mergeLoaderOptions} from '@loaders.gl/loader-utils';\n\nimport type {ImageSourceMetadata, GetImageParameters} from '../../sources/image-source';\nimport type {ImageSourceProps} from '../../sources/image-source';\nimport {ImageSource} from '../../sources/image-source';\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\ntype WMSCommonParameters = {\n /** In case the endpoint supports multiple services */\n service?: 'WMS';\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.1.1' | '1.3.0';\n};\n\nexport type WMSGetCapabilitiesParameters = WMSCommonParameters & {\n /** Request type */\n request?: 'GetCapabilities';\n};\n\nexport type WMSGetMapParameters = WMSCommonParameters & {\n /** Request type */\n request?: 'GetMap';\n /** Layers to render */\n layers: string | 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 srs?: string;\n /** requested format for the return image */\n format?: 'image/png';\n};\n\n// https://imagery.pasda.psu.edu/arcgis/services/pasda/UrbanTreeCanopy_Landcover/MapServer/WmsServer?SERVICE=WMS&\nexport type WMSGetFeatureInfoParameters = WMSCommonParameters & {\n /** Request type */\n request?: 'GetFeatureInfo';\n\n /** x coordinate for the feature info request */\n x: number;\n /** y coordinate for the feature info request */\n y: number;\n /** list of layers to query (could be different from rendered layers) */\n query_layers: string[];\n /** Requested MIME type of returned feature info */\n info_format?: 'text/plain' | 'application/vnd.ogc.gml';\n\n /** Layers to render */\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 srs?: string;\n /** requested format for the return image */\n format?: 'image/png';\n};\n\nexport type WMSDescribeLayerParameters = WMSCommonParameters & {\n /** Request type */\n request?: 'DescribeLayer';\n};\n\nexport type WMSGetLegendGraphicParameters = WMSCommonParameters & {\n /** Request type */\n request?: 'GetLegendGraphic';\n};\n\n/** Properties for initializing a WMS service */\nexport type WMSServiceProps = ImageSourceProps & {\n /** Base URL to the service */\n url: string;\n /** WMS version */\n version?: '1.1.1' | '1.3.0';\n /** Layers to render */\n layers?: string[];\n /** SRS for the image (not the bounding box) */\n srs?: string;\n /** Requested format for the return image */\n format?: 'image/png';\n /** Requested MIME type of returned feature info */\n info_format?: 'text/plain' | 'application/vnd.ogc.gml';\n /** Styling */\n styles?: unknown;\n};\n\n/**\n * The WMSService 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 WMSService extends ImageSource {\n static type: 'wms' = 'wms';\n static testURL = (url: string): boolean => url.toLowerCase().includes('wms');\n\n props: Required<WMSServiceProps>;\n capabilities: WMSCapabilities | null = null;\n\n /** A list of loaders used by the WMSService methods */\n readonly loaders = [\n ImageLoader,\n WMSErrorLoader,\n WMSCapabilitiesLoader,\n WMSFeatureInfoLoader,\n WMSLayerDescriptionLoader\n ];\n\n /** Create a WMSService */\n constructor(props: WMSServiceProps) {\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\n this.props = {\n loadOptions: undefined!,\n layers: undefined!,\n styles: undefined,\n version: '1.1.1',\n srs: 'EPSG:4326',\n format: 'image/png',\n info_format: 'text/plain',\n ...props\n };\n }\n\n // ImageSource 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.props.loadOptions);\n this.capabilities = capabilities;\n return capabilities;\n }\n\n /** Get a map image */\n async getMap(\n options: WMSGetMapParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<ImageType> {\n const url = this.getMapURL(options, 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.props.loadOptions);\n } catch {\n throw this._parseError(arrayBuffer);\n }\n }\n\n /** Get Feature Info for a coordinate */\n async getFeatureInfo(\n options: WMSGetFeatureInfoParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<WMSFeatureInfo> {\n const url = this.getFeatureInfoURL(options, 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.props.loadOptions);\n }\n\n /** Get Feature Info for a coordinate */\n async getFeatureInfoText(\n options: WMSGetFeatureInfoParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<string> {\n const url = this.getFeatureInfoURL(options, 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 options: WMSDescribeLayerParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<WMSLayerDescription> {\n const url = this.describeLayerURL(options, 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.props.loadOptions);\n }\n\n /** Get an image with a semantic legend */\n async getLegendGraphic(\n options: WMSGetLegendGraphicParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<ImageType> {\n const url = this.getLegendGraphicURL(options, 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.props.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 service: 'WMS',\n version: this.props.version,\n request: 'GetCapabilities',\n ...wmsParameters,\n ...vendorParameters\n };\n return this._getWMSUrl(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 const options: Required<WMSGetMapParameters> = {\n service: 'WMS',\n version: this.props.version,\n request: 'GetMap',\n // layers: [],\n // bbox: [-77.87304, 40.78975, -77.85828, 40.80228],\n // width: 1200,\n // height: 900,\n styles: this.props.styles,\n srs: this.props.srs,\n format: this.props.format,\n ...wmsParameters,\n ...vendorParameters\n };\n return this._getWMSUrl(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 service: 'WMS',\n version: this.props.version,\n request: 'GetFeatureInfo',\n // layers: this.props.layers,\n // bbox: [-77.87304, 40.78975, -77.85828, 40.80228],\n // width: 1200,\n // height: 900,\n // x: undefined!,\n // y: undefined!,\n // query_layers: [],\n srs: this.props.srs,\n format: this.props.format,\n info_format: this.props.info_format,\n styles: this.props.styles,\n ...wmsParameters,\n ...vendorParameters\n };\n return this._getWMSUrl(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 service: 'WMS',\n version: this.props.version,\n request: 'DescribeLayer',\n ...wmsParameters,\n ...vendorParameters\n };\n return this._getWMSUrl(options, vendorParameters);\n }\n\n getLegendGraphicURL(\n wmsParameters: WMSGetLegendGraphicParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSGetLegendGraphicParameters> = {\n service: 'WMS',\n version: this.props.version,\n request: 'GetLegendGraphic',\n // format?\n ...wmsParameters,\n ...vendorParameters\n };\n return this._getWMSUrl(options, vendorParameters);\n }\n\n // INTERNAL METHODS\n\n /**\n * @note case _getWMSUrl may need to be overridden to handle certain backends?\n * */\n protected _getWMSUrl(\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 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.props.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.props.loadOptions);\n return new Error(error);\n }\n}\n"],"mappings":";;AAKA,SAAQA,WAAW,QAAO,oBAAoB;AAC9C,SAAQC,kBAAkB,QAAO,0BAA0B;AAI3D,SAAQC,WAAW,QAAO,4BAA4B;AAMtD,SAAQC,qBAAqB,QAAO,kCAAkC;AACtE,SAAQC,oBAAoB,QAAO,sCAAsC;AACzE,SAAQC,yBAAyB,QAAO,2CAA2C;AAGnF,SAAQC,cAAc,QAAO,2BAA2B;AAkGxD,OAAO,MAAMC,UAAU,SAASL,WAAW,CAAC;;EAiB1CM,WAAW,CAACC,KAAsB,EAAE;IAClC,KAAK,CAACA,KAAK,CA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lD,WAAW,GAAGT,kBAAkB,CAAmB,IAAI,CAACQ,KAAK,CAACC,WAAW,EAAE;QAC/EuD,GAAG,EAAE;UAACC,YAAY,EAAE;QAAI;MAC1B,CAAC,CAAC;MACF,MAAMC,KAAK,GAAG7D,cAAc,CAAC8D,SAAS,CAACrC,WAAW,EAAErB,WAAW,CAAC;MAChE,MAAM,IAAI2D,KAAK,CAACF,KAAK,CAAC;IACxB;EACF;;EAGU/B,WAAW,CAACL,WAAwB,EAAS;IACrD,MAAMoC,KAAK,GAAG7D,cAAc,CAAC8D,SAAS,CAACrC,WAAW,EAAE,IAAI,CAACtB,KAAK,CAACC,WAAW,CAAC;IAC3E,OAAO,IAAI2D,KAAK,CAACF,KAAK,CAAC;EACzB;AACF;AAAC,gBA9QY5D,UAAU,UACA,KAAK;AAAA,gBADfA,UAAU,aAEHoB,GAAW,IAAcA,GAAG,CAAC2C,WAAW,EAAE,CAACN,QAAQ,CAAC,KAAK,CAAC"}
1
+ {"version":3,"file":"wms-service.js","names":["ImageLoader","mergeLoaderOptions","ImageSource","WMSCapabilitiesLoader","WMSFeatureInfoLoader","WMSLayerDescriptionLoader","WMSErrorLoader","WMSService","constructor","props","_defineProperty","url","wmsParameters","layers","undefined","styles","version","crs","format","info_format","transparent","vendorParameters","getMetadata","capabilities","getCapabilities","normalizeMetadata","getImage","parameters","srs","getMap","getCapabilitiesURL","response","fetch","arrayBuffer","_checkResponse","parse","loadOptions","getMapURL","_parseError","getFeatureInfo","getFeatureInfoURL","getFeatureInfoText","TextDecoder","decode","describeLayer","describeLayerURL","getLegendGraphic","getLegendGraphicURL","options","_getWMSUrl","_parseWMSUrl","baseUrl","search","split","searchParams","parameter","key","value","request","first","allParameters","service","Object","entries","_getParameterValue","encodeURI","toUpperCase","Array","isArray","concat","join","String","_fetchArrayBuffer","contentType","headers","ok","mimeTypes","includes","wms","throwOnError","error","parseSync","Error","toLowerCase"],"sources":["../../../../../src/lib/services/ogc/wms-service.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n/* eslint-disable camelcase */\n\nimport type {ImageType} from '@loaders.gl/images';\nimport {ImageLoader} from '@loaders.gl/images';\nimport {mergeLoaderOptions} from '@loaders.gl/loader-utils';\n\nimport type {ImageSourceMetadata, GetImageParameters} from '../../sources/image-source';\nimport type {ImageSourceProps} from '../../sources/image-source';\nimport {ImageSource} from '../../sources/image-source';\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\n/** Static WMS parameters (not viewport or selected pixel dependent) that can be provided as defaults */\nexport type WMSParameters = {\n /** WMS version */\n version?: '1.3.0' | '1.1.1';\n /** Layers to render */\n layers?: string[];\n /** Coordinate Reference System (CRS) for the image (not the bounding box) */\n crs?: string;\n /** Requested format for the return image */\n format?: 'image/png';\n /** Requested MIME type of returned feature info */\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 WMSService */\n transparent?: boolean;\n};\n\ntype WMSCommonParameters = {\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.3.0' | '1.1.1';\n};\n\n/** Parameters for GetCapabilities */\nexport type WMSGetCapabilitiesParameters = WMSCommonParameters;\n\n/** Parameters for GetMap */\nexport type WMSGetMapParameters = WMSCommonParameters & {\n /** Layers to render */\n layers: string | string[];\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 /** Coordinate Reference System for the image (not the bounding box). */\n crs?: string;\n /** Styling */\n styles?: unknown;\n /** Don't render background when no data */\n transparent?: boolean;\n /** requested format for the return image */\n format?: 'image/png';\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 = WMSCommonParameters & {\n /** x coordinate for the feature info request */\n x: number;\n /** y coordinate for the feature info request */\n y: number;\n /** list of layers to query (could be different from rendered layers) */\n query_layers: string[];\n /** Requested MIME type of returned feature info */\n info_format?: 'text/plain' | 'application/geojson' | 'application/vnd.ogc.gml';\n\n /** Layers to render */\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 srs?: string;\n /** requested format for the return image */\n format?: 'image/png';\n};\n\n/** Parameters for DescribeLayer */\nexport type WMSDescribeLayerParameters = WMSCommonParameters;\n\n/** Parameters for GetLegendGraphic */\nexport type WMSGetLegendGraphicParameters = WMSCommonParameters;\n\n//\n\n/** Properties for creating a enw WMS service */\nexport type WMSServiceProps = ImageSourceProps & {\n /** Base URL to the service */\n url: string;\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 WMSService 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 WMSService extends ImageSource {\n static type: 'wms' = 'wms';\n static testURL = (url: string): boolean => url.toLowerCase().includes('wms');\n\n readonly url: string;\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 /** A list of loaders used by the WMSService methods */\n readonly loaders = [\n ImageLoader,\n WMSErrorLoader,\n WMSCapabilitiesLoader,\n WMSFeatureInfoLoader,\n WMSLayerDescriptionLoader\n ];\n\n /** Create a WMSService */\n constructor(props: WMSServiceProps) {\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.wmsParameters = {\n 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 ...props.wmsParameters\n };\n\n this.vendorParameters = props.vendorParameters || {};\n }\n\n // ImageSource 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 // WMS 1.3.0 renamed SRS to CRS (sigh...)\n const wmsParameters = {...parameters, crs: parameters.srs};\n delete wmsParameters.srs;\n return await this.getMap(wmsParameters);\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 const options: Required<WMSGetMapParameters> = {\n version: this.wmsParameters.version,\n // layers: [],\n // bbox: [-77.87304, 40.78975, -77.85828, 40.80228],\n // width: 1200,\n // height: 900,\n styles: this.wmsParameters.styles,\n crs: this.wmsParameters.crs,\n format: this.wmsParameters.format,\n transparent: this.wmsParameters.transparent,\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 // layers: this.props.layers,\n // bbox: [-77.87304, 40.78975, -77.85828, 40.80228],\n // width: 1200,\n // height: 900,\n // x: undefined!,\n // y: undefined!,\n // query_layers: [],\n srs: this.wmsParameters.crs,\n format: this.wmsParameters.format,\n info_format: this.wmsParameters.info_format,\n styles: this.wmsParameters.styles,\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: WMSCommonParameters & {[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 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 (key !== 'transparent' || value) {\n url += first ? '?' : '&';\n first = false;\n url += this._getParameterValue(wmsParameters.version!, key, value);\n }\n }\n\n return encodeURI(url);\n }\n\n _getParameterValue(version: string, key: string, value: unknown): string {\n // SRS parameter changed to CRS in 1.3.0, in non-backwards compatible way (sigh...)\n if (key === 'crs' && version !== '1.3.0') {\n key = 'srs';\n }\n\n key = key.toUpperCase();\n\n // TODO - in v1.3.0 only, the order of parameters for BBOX depends on whether the CRS definition has flipped axes\n // You will see this in the GetCapabilities request at 1.3.0 - the response should show the flipped axes.\n // BBOX=xmin,ymin,xmax,ymax NON-FLIPPED\n // BBOX=ymin,xmin,ymax,xmax FLIPPED\n // / EPSG:4326 needs to have flipped axes. 4326 1 WGS 84 Latitude North Longitude East\n // In WMS 1.1.1 EPSG:4326 is wrongly defined as having long/lat coordinate axes. In WMS 1.3.0 the correct axes lat/long are used. CRS:84 is defined by OGC as having the same datum as EPSG:4326 (that is the World Geodetic System 1984 datum ~ EPSG::6326) but axis order of long/lat.\n // CRS:84 was introduced with the publication of the WMS 1.3.0 specification, to overcome this issue.\n\n return Array.isArray(value)\n ? `${key}=${value.join(',')}`\n : `${key}=${value ? String(value) : ''}`;\n }\n\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;AAI3D,SAAQC,WAAW,QAAO,4BAA4B;AAMtD,SAAQC,qBAAqB,QAAO,kCAAkC;AACtE,SAAQC,oBAAoB,QAAO,sCAAsC;AACzE,SAAQC,yBAAyB,QAAO,2CAA2C;AAGnF,SAAQC,cAAc,QAAO,2BAA2B;AAuGxD,OAAO,MAAMC,UAAU,SAASL,WAAW,CAAC;EAsB1CM,WAAWA,CAACC,KAAsB,EAAE;IAClC,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,uBAbwB,IAAI;IAAAA,eAAA,kBAGxB,CACjBV,WAAW,EACXM,cAAc,EACdH,qBAAqB,EACrBC,oBAAoB,EACpBC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AAE;UAACC,YAAY,EAAE;QAAI;MAC1B,CAAC,CAAC;MACF,MAAMC,KAAK,GAAG1E,cAAc,CAAC2E,SAAS,CAAChD,WAAW,EAAEG,WAAW,CAAC;MAChE,MAAM,IAAI8C,KAAK,CAACF,KAAK,CAAC;IACxB;EACF;EAGU1C,WAAWA,CAACL,WAAwB,EAAS;IACrD,MAAM+C,KAAK,GAAG1E,cAAc,CAAC2E,SAAS,CAAChD,WAAW,EAAE,IAAI,CAACG,WAAW,CAAC;IACrE,OAAO,IAAI8C,KAAK,CAACF,KAAK,CAAC;EACzB;AACF;AAACtE,eAAA,CArUYH,UAAU,UACA,KAAK;AAAAG,eAAA,CADfH,UAAU,aAEHI,GAAW,IAAcA,GAAG,CAACwE,WAAW,EAAE,CAACN,QAAQ,CAAC,KAAK,CAAC"}
@@ -1,7 +1,5 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
-
3
2
  export class DataSource {
4
-
5
3
  constructor(props) {
6
4
  _defineProperty(this, "fetch", void 0);
7
5
  _defineProperty(this, "loadOptions", void 0);
@@ -11,19 +9,15 @@ export class DataSource {
11
9
  this.fetch = getFetchFunction(this.loadOptions);
12
10
  }
13
11
  }
14
-
15
12
  export function getFetchFunction(options) {
16
13
  const fetchFunction = options === null || options === void 0 ? void 0 : options.fetch;
17
-
18
14
  if (fetchFunction && typeof fetchFunction === 'function') {
19
15
  return (url, fetchOptions) => fetchFunction(url, fetchOptions);
20
16
  }
21
-
22
17
  const fetchOptions = options === null || options === void 0 ? void 0 : options.fetch;
23
18
  if (fetchOptions && typeof fetchOptions !== 'function') {
24
19
  return url => fetch(url, fetchOptions);
25
20
  }
26
-
27
21
  return url => fetch(url);
28
22
  }
29
23
  //# sourceMappingURL=data-source.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"data-source.js","names":["DataSource","constructor","props","loadOptions","fetch","getFetchFunction","options","fetchFunction","url","fetchOptions"],"sources":["../../../../src/lib/sources/data-source.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderOptions} from '@loaders.gl/loader-utils';\n\nexport type DataSourceProps = {\n /** LoaderOptions provide an option to override `fetch`. Will also be passed to any sub loaders */\n loadOptions?: LoaderOptions;\n};\n\n/** base class of all data sources */\nexport abstract class DataSource {\n /** A resolved fetch function extracted from loadOptions prop */\n fetch: (url: string, options?: RequestInit) => Promise<Response>;\n /** The actual load options, if calling a loaders.gl loader */\n loadOptions: LoaderOptions;\n\n constructor(props: DataSourceProps) {\n this.loadOptions = {...props.loadOptions};\n this.fetch = getFetchFunction(this.loadOptions);\n }\n}\n\n/**\n * Gets the current fetch function from options\n * @todo - move to loader-utils module\n * @todo - use in core module counterpart\n * @param options\n * @param context\n */\nexport function getFetchFunction(options?: LoaderOptions) {\n const fetchFunction = options?.fetch;\n\n // options.fetch can be a function\n if (fetchFunction && typeof fetchFunction === 'function') {\n return (url: string, fetchOptions?: RequestInit) => fetchFunction(url, fetchOptions);\n }\n\n // options.fetch can be an options object, use global fetch with those options\n const fetchOptions = options?.fetch;\n if (fetchOptions && typeof fetchOptions !== 'function') {\n return (url) => fetch(url, fetchOptions);\n }\n\n // else return the global fetch function\n return (url) => fetch(url);\n}\n"],"mappings":";;AAUA,OAAO,MAAeA,UAAU,CAAC;;EAM/BC,WAAW,CAACC,KAAsB,EAAE;IAAA;IAAA;IAClC,IAAI,CAACC,WAAW,GAAG;MAAC,GAAGD,KAAK,CAACC;IAAW,CAAC;IACzC,IAAI,CAACC,KAAK,GAAGC,gBAAgB,CAAC,IAAI,CAACF,WAAW,CAAC;EACjD;AACF;;AASA,OAAO,SAASE,gBAAgB,CAACC,OAAuB,EAAE;EACxD,MAAMC,aAAa,GAAGD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEF,KAAK;;EAGpC,IAAIG,aAAa,IAAI,OAAOA,aAAa,KAAK,UAAU,EAAE;IACxD,OAAO,CAACC,GAAW,EAAEC,YAA0B,KAAKF,aAAa,CAACC,GAAG,EAAEC,YAAY,CAAC;EACtF;;EAGA,MAAMA,YAAY,GAAGH,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEF,KAAK;EACnC,IAAIK,YAAY,IAAI,OAAOA,YAAY,KAAK,UAAU,EAAE;IACtD,OAAQD,GAAG,IAAKJ,KAAK,CAACI,GAAG,EAAEC,YAAY,CAAC;EAC1C;;EAGA,OAAQD,GAAG,IAAKJ,KAAK,CAACI,GAAG,CAAC;AAC5B"}
1
+ {"version":3,"file":"data-source.js","names":["DataSource","constructor","props","_defineProperty","loadOptions","fetch","getFetchFunction","options","fetchFunction","url","fetchOptions"],"sources":["../../../../src/lib/sources/data-source.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderOptions} from '@loaders.gl/loader-utils';\n\nexport type DataSourceProps = {\n /** LoaderOptions provide an option to override `fetch`. Will also be passed to any sub loaders */\n loadOptions?: LoaderOptions;\n};\n\n/** base class of all data sources */\nexport abstract class DataSource {\n /** A resolved fetch function extracted from loadOptions prop */\n fetch: (url: string, options?: RequestInit) => Promise<Response>;\n /** The actual load options, if calling a loaders.gl loader */\n loadOptions: LoaderOptions;\n\n constructor(props: DataSourceProps) {\n this.loadOptions = {...props.loadOptions};\n this.fetch = getFetchFunction(this.loadOptions);\n }\n}\n\n/**\n * Gets the current fetch function from options\n * @todo - move to loader-utils module\n * @todo - use in core module counterpart\n * @param options\n * @param context\n */\nexport function getFetchFunction(options?: LoaderOptions) {\n const fetchFunction = options?.fetch;\n\n // options.fetch can be a function\n if (fetchFunction && typeof fetchFunction === 'function') {\n return (url: string, fetchOptions?: RequestInit) => fetchFunction(url, fetchOptions);\n }\n\n // options.fetch can be an options object, use global fetch with those options\n const fetchOptions = options?.fetch;\n if (fetchOptions && typeof fetchOptions !== 'function') {\n return (url) => fetch(url, fetchOptions);\n }\n\n // else return the global fetch function\n return (url) => fetch(url);\n}\n"],"mappings":";AAUA,OAAO,MAAeA,UAAU,CAAC;EAM/BC,WAAWA,CAACC,KAAsB,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAClC,IAAI,CAACC,WAAW,GAAG;MAAC,GAAGF,KAAK,CAACE;IAAW,CAAC;IACzC,IAAI,CAACC,KAAK,GAAGC,gBAAgB,CAAC,IAAI,CAACF,WAAW,CAAC;EACjD;AACF;AASA,OAAO,SAASE,gBAAgBA,CAACC,OAAuB,EAAE;EACxD,MAAMC,aAAa,GAAGD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEF,KAAK;EAGpC,IAAIG,aAAa,IAAI,OAAOA,aAAa,KAAK,UAAU,EAAE;IACxD,OAAO,CAACC,GAAW,EAAEC,YAA0B,KAAKF,aAAa,CAACC,GAAG,EAAEC,YAAY,CAAC;EACtF;EAGA,MAAMA,YAAY,GAAGH,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEF,KAAK;EACnC,IAAIK,YAAY,IAAI,OAAOA,YAAY,KAAK,UAAU,EAAE;IACtD,OAAQD,GAAG,IAAKJ,KAAK,CAACI,GAAG,EAAEC,YAAY,CAAC;EAC1C;EAGA,OAAQD,GAAG,IAAKJ,KAAK,CAACI,GAAG,CAAC;AAC5B"}
@@ -1,6 +1,3 @@
1
-
2
-
3
1
  import { DataSource } from './data-source';
4
-
5
2
  export class ImageSource extends DataSource {}
6
3
  //# sourceMappingURL=image-source.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"image-source.js","names":["DataSource","ImageSource"],"sources":["../../../../src/lib/sources/image-source.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {ImageType} from '@loaders.gl/images';\nimport type {DataSourceProps} from './data-source';\nimport {DataSource} from './data-source';\n\n/**\n * Normalized capabilities of an Image service\n * @example\n * The WMSService will normalize the response to the WMS `GetCapabilities` data structure extracted from WMS XML response\n * into an ImageSourceMetadata.\n */\nexport type ImageSourceMetadata = {\n name: string;\n title?: string;\n abstract?: string;\n keywords: string[];\n layer: {\n name: string;\n title?: string;\n srs?: string[];\n boundingBox?: [number, number, number, number];\n layers: ImageSourceLayer[];\n };\n};\n\nexport type ImageSourceLayer = {\n name: string;\n title?: string;\n srs?: string[];\n boundingBox?: [number, number, number, number];\n layers: ImageSourceLayer[];\n};\n\nexport type GetImageParameters = {\n /** Layers to render */\n layers: string | 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 srs?: string;\n /** requested format for the return image */\n format?: 'image/png';\n};\n\n// Attempt to break down GetImageParameters\nexport type ImageFilters = {\n /** Layers to render */\n layers: string | string[];\n /** Styling */\n styles?: unknown;\n};\n\nexport type ImageRegion = {\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n};\n\nexport type ImageFormat = {\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** srs for the image (not the bounding box) */\n srs?: string;\n /** requested format for the return image */\n format?: 'image/png';\n};\n\nexport type ImageSourceProps = DataSourceProps;\n\n/**\n * MapImageSource - data sources that allow data to be queried by (geospatial) extents\n * @note\n * - If geospatial, bounding box is expected to be in web mercator coordinates\n */\nexport abstract class ImageSource extends DataSource {\n abstract getMetadata(): Promise<ImageSourceMetadata>;\n abstract getImage(parameters: GetImageParameters): Promise<ImageType>;\n}\n"],"mappings":";;AAIA,SAAQA,UAAU,QAAO,eAAe;;AA8ExC,OAAO,MAAeC,WAAW,SAASD,UAAU,CAAC"}
1
+ {"version":3,"file":"image-source.js","names":["DataSource","ImageSource"],"sources":["../../../../src/lib/sources/image-source.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {ImageType} from '@loaders.gl/images';\nimport type {DataSourceProps} from './data-source';\nimport {DataSource} from './data-source';\n\n/**\n * Normalized capabilities of an Image service\n * @example\n * The WMSService will normalize the response to the WMS `GetCapabilities` data structure extracted from WMS XML response\n * into an ImageSourceMetadata.\n */\nexport type ImageSourceMetadata = {\n name: string;\n title?: string;\n abstract?: string;\n keywords: string[];\n layers: ImageSourceLayer[];\n};\n\nexport type ImageSourceLayer = {\n name?: string;\n title?: string;\n srs?: string[];\n boundingBox?: [number, number, number, number];\n layers?: ImageSourceLayer[];\n};\n\nexport type GetImageParameters = {\n /** Layers to render */\n layers: string | 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 srs?: string;\n /** requested format for the return image */\n format?: 'image/png';\n};\n\n// Attempt to break down GetImageParameters\nexport type ImageFilters = {\n /** Layers to render */\n layers: string | string[];\n /** Styling */\n styles?: unknown;\n};\n\nexport type ImageRegion = {\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n};\n\nexport type ImageFormat = {\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** srs for the image (not the bounding box) */\n srs?: string;\n /** requested format for the return image */\n format?: 'image/png';\n};\n\nexport type ImageSourceProps = DataSourceProps;\n\n/**\n * MapImageSource - data sources that allow data to be queried by (geospatial) extents\n * @note\n * - If geospatial, bounding box is expected to be in web mercator coordinates\n */\nexport abstract class ImageSource extends DataSource {\n abstract getMetadata(): Promise<ImageSourceMetadata>;\n abstract getImage(parameters: GetImageParameters): Promise<ImageType>;\n}\n"],"mappings":"AAIA,SAAQA,UAAU,QAAO,eAAe;AAwExC,OAAO,MAAeC,WAAW,SAASD,UAAU,CAAC"}
@@ -1,6 +1,3 @@
1
-
2
-
3
1
  import { DataSource } from './data-source';
4
-
5
2
  export class TileSource extends DataSource {}
6
3
  //# sourceMappingURL=tile-source.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tile-source.js","names":["DataSource","TileSource"],"sources":["../../../../src/lib/sources/tile-source.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {ImageType} from '@loaders.gl/images';\nimport {DataSource} from './data-source';\n\n/**\n * Normalized capabilities of an Image service\n * @example\n * The WMSService will normalize the response to the WMS `GetCapabilities` data structure extracted from WMS XML response\n * into an TileSourceMetadata.\n */\nexport type TileSourceMetadata = {\n name: string;\n title?: string;\n abstract?: string;\n keywords: string[];\n layer: {\n name: string;\n title?: string;\n srs?: string[];\n boundingBox?: [number, number, number, number];\n layers: TileSourceLayer[];\n };\n};\n\nexport type TileSourceLayer = {\n name: string;\n title?: string;\n srs?: string[];\n boundingBox?: [number, number, number, number];\n layers: TileSourceLayer[];\n};\n\nexport type GetTileParameters = {\n /** Layers to render */\n layers: string | string[];\n /** Styling */\n styles?: unknown;\n /** bounding box of the requested map image */\n zoom: number;\n /** tile x coordinate */\n x: number;\n /** tile y coordinate */\n y: number;\n /** srs for the image (not the bounding box) */\n srs?: string;\n /** requested format for the return image */\n format?: 'image/png';\n};\n\n/**\n * MapTileSource - data sources that allow data to be queried by (geospatial) extents\n * @note\n * - If geospatial, bounding box is expected to be in web mercator coordinates\n */\nexport abstract class TileSource extends DataSource {\n abstract getMetadata(): Promise<TileSourceMetadata>;\n abstract getTile(parameters: GetTileParameters): Promise<ImageType>;\n}\n"],"mappings":";;AAGA,SAAQA,UAAU,QAAO,eAAe;;AAoDxC,OAAO,MAAeC,UAAU,SAASD,UAAU,CAAC"}
1
+ {"version":3,"file":"tile-source.js","names":["DataSource","TileSource"],"sources":["../../../../src/lib/sources/tile-source.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {ImageType} from '@loaders.gl/images';\nimport {DataSource} from './data-source';\n\n/**\n * Normalized capabilities of an Image service\n * @example\n * The WMSService will normalize the response to the WMS `GetCapabilities` data structure extracted from WMS XML response\n * into an TileSourceMetadata.\n */\nexport type TileSourceMetadata = {\n name: string;\n title?: string;\n abstract?: string;\n keywords: string[];\n layer: {\n name: string;\n title?: string;\n srs?: string[];\n boundingBox?: [number, number, number, number];\n layers: TileSourceLayer[];\n };\n};\n\nexport type TileSourceLayer = {\n name: string;\n title?: string;\n srs?: string[];\n boundingBox?: [number, number, number, number];\n layers: TileSourceLayer[];\n};\n\nexport type GetTileParameters = {\n /** Layers to render */\n layers: string | string[];\n /** Styling */\n styles?: unknown;\n /** bounding box of the requested map image */\n zoom: number;\n /** tile x coordinate */\n x: number;\n /** tile y coordinate */\n y: number;\n /** srs for the image (not the bounding box) */\n srs?: string;\n /** requested format for the return image */\n format?: 'image/png';\n};\n\n/**\n * MapTileSource - data sources that allow data to be queried by (geospatial) extents\n * @note\n * - If geospatial, bounding box is expected to be in web mercator coordinates\n */\nexport abstract class TileSource extends DataSource {\n abstract getMetadata(): Promise<TileSourceMetadata>;\n abstract getTile(parameters: GetTileParameters): Promise<ImageType>;\n}\n"],"mappings":"AAGA,SAAQA,UAAU,QAAO,eAAe;AAoDxC,OAAO,MAAeC,UAAU,SAASD,UAAU,CAAC"}
@@ -1,17 +1,12 @@
1
-
2
-
3
1
  export function getFetchFunction(options) {
4
2
  const fetchFunction = options === null || options === void 0 ? void 0 : options.fetch;
5
-
6
3
  if (fetchFunction && typeof fetchFunction === 'function') {
7
4
  return (url, fetchOptions) => fetchFunction(url, fetchOptions);
8
5
  }
9
-
10
6
  const fetchOptions = options === null || options === void 0 ? void 0 : options.fetch;
11
7
  if (fetchOptions && typeof fetchOptions !== 'function') {
12
8
  return url => fetch(url, fetchOptions);
13
9
  }
14
-
15
10
  return url => fetch(url);
16
11
  }
17
12
  export function mergeImageServiceProps(props) {
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","names":["getFetchFunction","options","fetchFunction","fetch","url","fetchOptions","mergeImageServiceProps","props","loadOptions"],"sources":["../../../../../src/lib/sources/utils/utils.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderOptions} from '@loaders.gl/loader-utils';\n\n/**\n * Gets the current fetch function from options\n * @todo - move to loader-utils module\n * @todo - use in core module counterpart\n * @param options\n * @param context\n */\nexport function getFetchFunction(options?: LoaderOptions) {\n const fetchFunction = options?.fetch;\n\n // options.fetch can be a function\n if (fetchFunction && typeof fetchFunction === 'function') {\n return (url: string, fetchOptions?: RequestInit) => fetchFunction(url, fetchOptions);\n }\n\n // options.fetch can be an options object, use global fetch with those options\n const fetchOptions = options?.fetch;\n if (fetchOptions && typeof fetchOptions !== 'function') {\n return (url) => fetch(url, fetchOptions);\n }\n\n // else return the global fetch function\n return (url) => fetch(url);\n}\n\nexport function mergeImageServiceProps<Props extends {loadOptions?: any}>(\n props: Props\n): Required<Props> {\n // @ts-expect-error\n return {\n // Default fetch\n ...props,\n loadOptions: {\n ...props.loadOptions,\n fetch: getFetchFunction(props.loadOptions)\n }\n };\n}\n"],"mappings":";;AAWA,OAAO,SAASA,gBAAgB,CAACC,OAAuB,EAAE;EACxD,MAAMC,aAAa,GAAGD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEE,KAAK;;EAGpC,IAAID,aAAa,IAAI,OAAOA,aAAa,KAAK,UAAU,EAAE;IACxD,OAAO,CAACE,GAAW,EAAEC,YAA0B,KAAKH,aAAa,CAACE,GAAG,EAAEC,YAAY,CAAC;EACtF;;EAGA,MAAMA,YAAY,GAAGJ,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEE,KAAK;EACnC,IAAIE,YAAY,IAAI,OAAOA,YAAY,KAAK,UAAU,EAAE;IACtD,OAAQD,GAAG,IAAKD,KAAK,CAACC,GAAG,EAAEC,YAAY,CAAC;EAC1C;;EAGA,OAAQD,GAAG,IAAKD,KAAK,CAACC,GAAG,CAAC;AAC5B;AAEA,OAAO,SAASE,sBAAsB,CACpCC,KAAY,EACK;EAEjB,OAAO;IAEL,GAAGA,KAAK;IACRC,WAAW,EAAE;MACX,GAAGD,KAAK,CAACC,WAAW;MACpBL,KAAK,EAAEH,gBAAgB,CAACO,KAAK,CAACC,WAAW;IAC3C;EACF,CAAC;AACH"}
1
+ {"version":3,"file":"utils.js","names":["getFetchFunction","options","fetchFunction","fetch","url","fetchOptions","mergeImageServiceProps","props","loadOptions"],"sources":["../../../../../src/lib/sources/utils/utils.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderOptions} from '@loaders.gl/loader-utils';\n\n/**\n * Gets the current fetch function from options\n * @todo - move to loader-utils module\n * @todo - use in core module counterpart\n * @param options\n * @param context\n */\nexport function getFetchFunction(options?: LoaderOptions) {\n const fetchFunction = options?.fetch;\n\n // options.fetch can be a function\n if (fetchFunction && typeof fetchFunction === 'function') {\n return (url: string, fetchOptions?: RequestInit) => fetchFunction(url, fetchOptions);\n }\n\n // options.fetch can be an options object, use global fetch with those options\n const fetchOptions = options?.fetch;\n if (fetchOptions && typeof fetchOptions !== 'function') {\n return (url) => fetch(url, fetchOptions);\n }\n\n // else return the global fetch function\n return (url) => fetch(url);\n}\n\nexport function mergeImageServiceProps<Props extends {loadOptions?: any}>(\n props: Props\n): Required<Props> {\n // @ts-expect-error\n return {\n // Default fetch\n ...props,\n loadOptions: {\n ...props.loadOptions,\n fetch: getFetchFunction(props.loadOptions)\n }\n };\n}\n"],"mappings":"AAWA,OAAO,SAASA,gBAAgBA,CAACC,OAAuB,EAAE;EACxD,MAAMC,aAAa,GAAGD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEE,KAAK;EAGpC,IAAID,aAAa,IAAI,OAAOA,aAAa,KAAK,UAAU,EAAE;IACxD,OAAO,CAACE,GAAW,EAAEC,YAA0B,KAAKH,aAAa,CAACE,GAAG,EAAEC,YAAY,CAAC;EACtF;EAGA,MAAMA,YAAY,GAAGJ,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEE,KAAK;EACnC,IAAIE,YAAY,IAAI,OAAOA,YAAY,KAAK,UAAU,EAAE;IACtD,OAAQD,GAAG,IAAKD,KAAK,CAACC,GAAG,EAAEC,YAAY,CAAC;EAC1C;EAGA,OAAQD,GAAG,IAAKD,KAAK,CAACC,GAAG,CAAC;AAC5B;AAEA,OAAO,SAASE,sBAAsBA,CACpCC,KAAY,EACK;EAEjB,OAAO;IAEL,GAAGA,KAAK;IACRC,WAAW,EAAE;MACX,GAAGD,KAAK,CAACC,WAAW;MACpBL,KAAK,EAAEH,gBAAgB,CAACO,KAAK,CAACC,WAAW;IAC3C;EACF,CAAC;AACH"}
@@ -1,5 +1,4 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
-
3
2
  export class ArcGISFeatureService {
4
3
  constructor(props) {
5
4
  _defineProperty(this, "url", void 0);
@@ -9,13 +8,11 @@ export class ArcGISFeatureService {
9
8
  this.loadOptions = props.loadOptions || {};
10
9
  this.fetch = props.fetch || fetch;
11
10
  }
12
-
13
11
  metadataURL(options) {
14
12
  return this.getUrl({
15
13
  ...options
16
14
  });
17
15
  }
18
-
19
16
  exportImageURL(options) {
20
17
  const {
21
18
  boundingBox
@@ -1 +1 @@
1
- {"version":3,"file":"arcgis-feature-service.js","names":["ArcGISFeatureService","constructor","props","url","loadOptions","fetch","metadataURL","options","getUrl","exportImageURL","boundingBox","path"],"sources":["../../../src/wip/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,WAAW,CAACC,KAAgC,EAAE;IAAA;IAAA;IAAA;IAC5C,IAAI,CAACC,GAAG,GAAGD,KAAK,CAACC,GAAG;IACpB,IAAI,CAACC,WAAW,GAAGF,KAAK,CAACE,WAAW,IAAI,CAAC,CAAC;IAC1C,IAAI,CAACC,KAAK,GAAGH,KAAK,CAACG,KAAK,IAAIA,KAAK;EACnC;;EAIAC,WAAW,CAACC,OAA+C,EAAU;IACnE,OAAO,IAAI,CAACC,MAAM,CAAC;MAAC,GAAGD;IAAO,CAAC,CAAC;EAClC;;EAQAE,cAAc,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
+ {"version":3,"file":"arcgis-feature-service.js","names":["ArcGISFeatureService","constructor","props","_defineProperty","url","loadOptions","fetch","metadataURL","options","getUrl","exportImageURL","boundingBox","path"],"sources":["../../../src/wip/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,7 +1,4 @@
1
-
2
-
3
1
  import { XMLLoader } from '@loaders.gl/xml';
4
-
5
2
  export function parseWCSCapabilities(text, options) {
6
3
  const parsedXML = XMLLoader.parseTextSync(text, {
7
4
  ...options,
@@ -1 +1 @@
1
- {"version":3,"file":"parse-wcs-capabilities.js","names":["XMLLoader","parseWCSCapabilities","text","options","parsedXML","parseTextSync","xml","removeNSPrefix","xmlCapabilities","Capabilities"],"sources":["../../../../../src/wip/lib/wcs/parse-wcs-capabilities.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\n/** All capabilities of a WCS service - response to a WCS `GetCapabilities` data structure extracted from XML */\nexport type WCSCapabilities = {\n serviceIdentification: {\n title: string;\n serviceTypeVersion: string;\n serviceType: string;\n };\n\n serviceProvider: {\n providerName: string;\n providerSite: string;\n serviceContact: {\n individualName: string;\n positionName: string;\n contactInfo: {\n address: {\n administrativeArea: string;\n city: string;\n country: string;\n deliveryPoint: string;\n electronicMailAddress: string;\n postalCode: string;\n };\n phone: {\n voice: string;\n };\n };\n };\n };\n\n operationsMetadata: {\n GetCapabilities: any;\n GetFeatureInfo: any;\n GetTile: any;\n };\n\n contents: {\n layers: {\n abstract: string;\n identifier: string;\n title: string;\n formats: string[];\n styles: {\n identifier: string;\n isDefault: string;\n title: string;\n abstract?: string;\n }[];\n bounds: {\n left: number;\n right: number;\n bottom: number;\n top: number;\n };\n tileMatrixSetLinks: {\n tileMatrixSet: string;\n }[];\n tileMatrixSets: {\n identifier: string;\n matrixIds: {\n identifier: string;\n matrixHeight: number;\n matrixWidth: number;\n scaleDenominator: number;\n tileWidth: number;\n tileHeight: number;\n topLeftCorner: {\n lon: number;\n lat: number;\n };\n }[];\n };\n }[];\n };\n};\n\n/**\n * Parses a typed data structure from raw XML for `GetCapabilities` response\n * @note Error handlings is fairly weak\n */\nexport function parseWCSCapabilities(text: string, options): WCSCapabilities {\n const parsedXML = XMLLoader.parseTextSync(text, {...options, xml: {...options?.xml, removeNSPrefix: true}});\n const xmlCapabilities: any = parsedXML.Capabilities || parsedXML;\n return xmlCapabilities;\n}\n"],"mappings":";;AAEA,SAAQA,SAAS,QAAO,iBAAiB;;AAkFzC,OAAO,SAASC,oBAAoB,CAACC,IAAY,EAAEC,OAAO,EAAmB;EAC3E,MAAMC,SAAS,GAAGJ,SAAS,CAACK,aAAa,CAACH,IAAI,EAAE;IAAC,GAAGC,OAAO;IAAEG,GAAG,EAAE;MAAC,IAAGH,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEG,GAAG;MAAEC,cAAc,EAAE;IAAI;EAAC,CAAC,CAAC;EAC3G,MAAMC,eAAoB,GAAGJ,SAAS,CAACK,YAAY,IAAIL,SAAS;EAChE,OAAOI,eAAe;AACxB"}
1
+ {"version":3,"file":"parse-wcs-capabilities.js","names":["XMLLoader","parseWCSCapabilities","text","options","parsedXML","parseTextSync","xml","removeNSPrefix","xmlCapabilities","Capabilities"],"sources":["../../../../../src/wip/lib/wcs/parse-wcs-capabilities.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\n/** All capabilities of a WCS service - response to a WCS `GetCapabilities` data structure extracted from XML */\nexport type WCSCapabilities = {\n serviceIdentification: {\n title: string;\n serviceTypeVersion: string;\n serviceType: string;\n };\n\n serviceProvider: {\n providerName: string;\n providerSite: string;\n serviceContact: {\n individualName: string;\n positionName: string;\n contactInfo: {\n address: {\n administrativeArea: string;\n city: string;\n country: string;\n deliveryPoint: string;\n electronicMailAddress: string;\n postalCode: string;\n };\n phone: {\n voice: string;\n };\n };\n };\n };\n\n operationsMetadata: {\n GetCapabilities: any;\n GetFeatureInfo: any;\n GetTile: any;\n };\n\n contents: {\n layers: {\n abstract: string;\n identifier: string;\n title: string;\n formats: string[];\n styles: {\n identifier: string;\n isDefault: string;\n title: string;\n abstract?: string;\n }[];\n bounds: {\n left: number;\n right: number;\n bottom: number;\n top: number;\n };\n tileMatrixSetLinks: {\n tileMatrixSet: string;\n }[];\n tileMatrixSets: {\n identifier: string;\n matrixIds: {\n identifier: string;\n matrixHeight: number;\n matrixWidth: number;\n scaleDenominator: number;\n tileWidth: number;\n tileHeight: number;\n topLeftCorner: {\n lon: number;\n lat: number;\n };\n }[];\n };\n }[];\n };\n};\n\n/**\n * Parses a typed data structure from raw XML for `GetCapabilities` response\n * @note Error handlings is fairly weak\n */\nexport function parseWCSCapabilities(text: string, options): WCSCapabilities {\n const parsedXML = XMLLoader.parseTextSync(text, {...options, xml: {...options?.xml, removeNSPrefix: true}});\n const xmlCapabilities: any = parsedXML.Capabilities || parsedXML;\n return xmlCapabilities;\n}\n"],"mappings":"AAEA,SAAQA,SAAS,QAAO,iBAAiB;AAkFzC,OAAO,SAASC,oBAAoBA,CAACC,IAAY,EAAEC,OAAO,EAAmB;EAC3E,MAAMC,SAAS,GAAGJ,SAAS,CAACK,aAAa,CAACH,IAAI,EAAE;IAAC,GAAGC,OAAO;IAAEG,GAAG,EAAE;MAAC,IAAGH,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEG,GAAG;MAAEC,cAAc,EAAE;IAAI;EAAC,CAAC,CAAC;EAC3G,MAAMC,eAAoB,GAAGJ,SAAS,CAACK,YAAY,IAAIL,SAAS;EAChE,OAAOI,eAAe;AACxB"}
@@ -1,7 +1,4 @@
1
-
2
-
3
1
  import { XMLLoader } from '@loaders.gl/xml';
4
-
5
2
  export function parseWFSCapabilities(text, options) {
6
3
  const parsedXML = XMLLoader.parseTextSync(text, {
7
4
  ...options,
@@ -1 +1 @@
1
- {"version":3,"file":"parse-wfs-capabilities.js","names":["XMLLoader","parseWFSCapabilities","text","options","parsedXML","parseTextSync","xml","removeNSPrefix","uncapitalizeKeys","xmlCapabilities","Capabilities"],"sources":["../../../../../src/wip/lib/wfs/parse-wfs-capabilities.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\n/** All capabilities of a WFS service - response to a WFS `GetCapabilities` data structure extracted from XML */\nexport type WFSCapabilities = {\n serviceIdentification: {\n title: string;\n serviceTypeVersion: string;\n serviceType: string;\n };\n\n serviceProvider: {\n providerName: string;\n providerSite: string;\n serviceContact: {\n individualName: string;\n positionName: string;\n contactInfo: {\n address: {\n administrativeArea: string;\n city: string;\n country: string;\n deliveryPoint: string;\n electronicMailAddress: string;\n postalCode: string;\n };\n phone: {\n voice: string;\n };\n };\n };\n };\n\n operationsMetadata: {\n GetCapabilities: any;\n GetFeatureInfo: any;\n GetTile: any;\n };\n\n contents: {\n layers: {\n abstract: string;\n identifier: string;\n title: string;\n formats: string[];\n styles: {\n identifier: string;\n isDefault: string;\n title: string;\n abstract?: string;\n }[];\n bounds: {\n left: number;\n right: number;\n bottom: number;\n top: number;\n };\n tileMatrixSetLinks: {\n tileMatrixSet: string;\n }[];\n tileMatrixSets: {\n identifier: string;\n matrixIds: {\n identifier: string;\n matrixHeight: number;\n matrixWidth: number;\n scaleDenominator: number;\n tileWidth: number;\n tileHeight: number;\n topLeftCorner: {\n lon: number;\n lat: number;\n };\n }[];\n };\n }[];\n };\n};\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 const parsedXML = XMLLoader.parseTextSync(text, {...options, xml: {\n ...options?.xml, \n removeNSPrefix: true,\n uncapitalizeKeys: true\n }});\n\n const xmlCapabilities: any = parsedXML.Capabilities || parsedXML;\n return xmlCapabilities;\n}\n"],"mappings":";;AAEA,SAAQA,SAAS,QAAO,iBAAiB;;AAkFzC,OAAO,SAASC,oBAAoB,CAACC,IAAY,EAAEC,OAAO,EAAmB;EAC3E,MAAMC,SAAS,GAAGJ,SAAS,CAACK,aAAa,CAACH,IAAI,EAAE;IAAC,GAAGC,OAAO;IAAEG,GAAG,EAAE;MAChE,IAAGH,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEG,GAAG;MACfC,cAAc,EAAE,IAAI;MACpBC,gBAAgB,EAAE;IACpB;EAAC,CAAC,CAAC;EAEH,MAAMC,eAAoB,GAAGL,SAAS,CAACM,YAAY,IAAIN,SAAS;EAChE,OAAOK,eAAe;AACxB"}
1
+ {"version":3,"file":"parse-wfs-capabilities.js","names":["XMLLoader","parseWFSCapabilities","text","options","parsedXML","parseTextSync","xml","removeNSPrefix","uncapitalizeKeys","xmlCapabilities","Capabilities"],"sources":["../../../../../src/wip/lib/wfs/parse-wfs-capabilities.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\n/** All capabilities of a WFS service - response to a WFS `GetCapabilities` data structure extracted from XML */\nexport type WFSCapabilities = {\n serviceIdentification: {\n title: string;\n serviceTypeVersion: string;\n serviceType: string;\n };\n\n serviceProvider: {\n providerName: string;\n providerSite: string;\n serviceContact: {\n individualName: string;\n positionName: string;\n contactInfo: {\n address: {\n administrativeArea: string;\n city: string;\n country: string;\n deliveryPoint: string;\n electronicMailAddress: string;\n postalCode: string;\n };\n phone: {\n voice: string;\n };\n };\n };\n };\n\n operationsMetadata: {\n GetCapabilities: any;\n GetFeatureInfo: any;\n GetTile: any;\n };\n\n contents: {\n layers: {\n abstract: string;\n identifier: string;\n title: string;\n formats: string[];\n styles: {\n identifier: string;\n isDefault: string;\n title: string;\n abstract?: string;\n }[];\n bounds: {\n left: number;\n right: number;\n bottom: number;\n top: number;\n };\n tileMatrixSetLinks: {\n tileMatrixSet: string;\n }[];\n tileMatrixSets: {\n identifier: string;\n matrixIds: {\n identifier: string;\n matrixHeight: number;\n matrixWidth: number;\n scaleDenominator: number;\n tileWidth: number;\n tileHeight: number;\n topLeftCorner: {\n lon: number;\n lat: number;\n };\n }[];\n };\n }[];\n };\n};\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 const parsedXML = XMLLoader.parseTextSync(text, {...options, xml: {\n ...options?.xml, \n removeNSPrefix: true,\n uncapitalizeKeys: true\n }});\n\n const xmlCapabilities: any = parsedXML.Capabilities || parsedXML;\n return xmlCapabilities;\n}\n"],"mappings":"AAEA,SAAQA,SAAS,QAAO,iBAAiB;AAkFzC,OAAO,SAASC,oBAAoBA,CAACC,IAAY,EAAEC,OAAO,EAAmB;EAC3E,MAAMC,SAAS,GAAGJ,SAAS,CAACK,aAAa,CAACH,IAAI,EAAE;IAAC,GAAGC,OAAO;IAAEG,GAAG,EAAE;MAChE,IAAGH,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEG,GAAG;MACfC,cAAc,EAAE,IAAI;MACpBC,gBAAgB,EAAE;IACpB;EAAC,CAAC,CAAC;EAEH,MAAMC,eAAoB,GAAGL,SAAS,CAACM,YAAY,IAAIN,SAAS;EAChE,OAAOK,eAAe;AACxB"}
@@ -1,7 +1,4 @@
1
-
2
-
3
1
  import { XMLLoader } from '@loaders.gl/xml';
4
-
5
2
  export function parseWMTSCapabilities(text, options) {
6
3
  const parsedXML = XMLLoader.parseTextSync(text, {
7
4
  ...options,
@@ -1 +1 @@
1
- {"version":3,"file":"parse-wmts-capabilities.js","names":["XMLLoader","parseWMTSCapabilities","text","options","parsedXML","parseTextSync","xml","removeNSPrefix","uncapitalizeKeys","xmlCapabilities","Capabilities"],"sources":["../../../../../src/wip/lib/wmts/parse-wmts-capabilities.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\n\n/** All capabilities of a WMTS service - response to a WMTS `GetCapabilities` data structure extracted from XML */\nexport type WMTSCapabilities = {\n serviceIdentification: {\n title: string;\n serviceTypeVersion: string;\n serviceType: string;\n };\n\n serviceProvider: {\n providerName: string;\n providerSite: string;\n serviceContact: {\n individualName: string;\n positionName: string;\n contactInfo: {\n address: {\n administrativeArea: string;\n city: string;\n country: string;\n deliveryPoint: string;\n electronicMailAddress: string;\n postalCode: string;\n };\n phone: {\n voice: string;\n };\n };\n };\n };\n\n operationsMetadata: {\n GetCapabilities: any;\n GetFeatureInfo: any;\n GetTile: any;\n };\n\n contents: {\n layers: WMTSLayer[];\n };\n};\n\n/** A layer in WMTS */\nexport type WMTSLayer = {\n abstract: string;\n identifier: string;\n title: string;\n formats: string[];\n styles: {\n identifier: string;\n isDefault: string;\n title: string;\n abstract?: string;\n }[];\n bounds: {\n left: number;\n right: number;\n bottom: number;\n top: number;\n };\n tileMatrixSetLinks: {\n tileMatrixSet: string;\n }[];\n tileMatrixSets: WMTSTileMatrixSet[];\n};\n\n/** A zoom level in WMTS */\nexport type WMTSTileMatrixSet = {\n identifier: string;\n matrixIds: {\n identifier: string;\n matrixHeight: number;\n matrixWidth: number;\n scaleDenominator: number;\n tileWidth: number;\n tileHeight: number;\n topLeftCorner: {\n lon: number;\n lat: number;\n };\n };\n}\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 const parsedXML = XMLLoader.parseTextSync(text, {...options, xml: {\n ...options?.xml, \n removeNSPrefix: true,\n uncapitalizeKeys: true\n }});\n\n const xmlCapabilities: any = parsedXML.Capabilities || parsedXML;\n return xmlCapabilities;\n}\n\n/**\n * Parses a typed data structure from raw XML for `GetCapabilities` response\n * @note Error handlings is fairly weak\n */\n// export function parseWMTSCapabilities(text: string, options): WMTSCapabilities {\n// const parsedXML = XMLLoader.parseTextSync(text, options);\n// const xmlCapabilities: any =\n// parsedXML.WMT_MS_Capabilities || parsedXML.WMS_Capabilities || parsedXML;\n// return extractCapabilities(xmlCapabilities);\n// }\n\n/** Extract typed capability data from XML */\n// function extractCapabilities(xml: any): WMTSCapabilities {\n// const capabilities: WMTSCapabilities = {\n// name: xml.Service?.Name || 'unnamed',\n// title: xml.Service?.Title,\n// keywords: [],\n// requests: {},\n// layer: extractLayer(xml.Capability?.Layer),\n// raw: xml\n// };\n\n// for (const keyword of xml.Service?.KeywordList?.Keyword || []) {\n// capabilities.keywords.push(keyword);\n// }\n\n// for (const [name, xmlRequest] of Object.entries(xml.Capability?.Request || {})) {\n// capabilities.requests[name] = extractRequest(name, xmlRequest);\n// }\n\n// return capabilities;\n// }\n\n// /** Extract typed request data from XML */\n// function extractRequest(name: string, xmlRequest: any): WMSRequest {\n// const format: string | string[] = xmlRequest?.Format;\n// const mimeTypes: string[] = Array.isArray(format) ? format : [format];\n// return {name, mimeTypes};\n// }\n\n// /** Extract request data */\n// function extractLayer(xmlLayer: any): WMSLayer {\n// const layer: WMSLayer = {\n// name: xmlLayer?.Name,\n// title: xmlLayer?.Title,\n// srs: xmlLayer?.SRS || [],\n// layers: []\n// };\n\n// // Single layer is not represented as array in XML\n// const xmlLayers = getXMLArray(xmlLayer?.Layer);\n\n// for (const xmlSubLayer of xmlLayers) {\n// layer.layers?.push(extractLayer(xmlSubLayer));\n// }\n\n// return layer;\n// }\n\n// function getXMLArray(xmlValue: any) {\n// if (Array.isArray(xmlValue)) {\n// return xmlValue;\n// }\n// if (xmlValue) {\n// return [xmlValue];\n// }\n// return [];\n// }\n"],"mappings":";;AAEA,SAAQA,SAAS,QAAO,iBAAiB;;AAyFzC,OAAO,SAASC,qBAAqB,CAACC,IAAY,EAAEC,OAAO,EAAoB;EAC7E,MAAMC,SAAS,GAAGJ,SAAS,CAACK,aAAa,CAACH,IAAI,EAAE;IAAC,GAAGC,OAAO;IAAEG,GAAG,EAAE;MAChE,IAAGH,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEG,GAAG;MACfC,cAAc,EAAE,IAAI;MACpBC,gBAAgB,EAAE;IACpB;EAAC,CAAC,CAAC;EAEH,MAAMC,eAAoB,GAAGL,SAAS,CAACM,YAAY,IAAIN,SAAS;EAChE,OAAOK,eAAe;AACxB"}
1
+ {"version":3,"file":"parse-wmts-capabilities.js","names":["XMLLoader","parseWMTSCapabilities","text","options","parsedXML","parseTextSync","xml","removeNSPrefix","uncapitalizeKeys","xmlCapabilities","Capabilities"],"sources":["../../../../../src/wip/lib/wmts/parse-wmts-capabilities.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\n\n/** All capabilities of a WMTS service - response to a WMTS `GetCapabilities` data structure extracted from XML */\nexport type WMTSCapabilities = {\n serviceIdentification: {\n title: string;\n serviceTypeVersion: string;\n serviceType: string;\n };\n\n serviceProvider: {\n providerName: string;\n providerSite: string;\n serviceContact: {\n individualName: string;\n positionName: string;\n contactInfo: {\n address: {\n administrativeArea: string;\n city: string;\n country: string;\n deliveryPoint: string;\n electronicMailAddress: string;\n postalCode: string;\n };\n phone: {\n voice: string;\n };\n };\n };\n };\n\n operationsMetadata: {\n GetCapabilities: any;\n GetFeatureInfo: any;\n GetTile: any;\n };\n\n contents: {\n layers: WMTSLayer[];\n };\n};\n\n/** A layer in WMTS */\nexport type WMTSLayer = {\n abstract: string;\n identifier: string;\n title: string;\n formats: string[];\n styles: {\n identifier: string;\n isDefault: string;\n title: string;\n abstract?: string;\n }[];\n bounds: {\n left: number;\n right: number;\n bottom: number;\n top: number;\n };\n tileMatrixSetLinks: {\n tileMatrixSet: string;\n }[];\n tileMatrixSets: WMTSTileMatrixSet[];\n};\n\n/** A zoom level in WMTS */\nexport type WMTSTileMatrixSet = {\n identifier: string;\n matrixIds: {\n identifier: string;\n matrixHeight: number;\n matrixWidth: number;\n scaleDenominator: number;\n tileWidth: number;\n tileHeight: number;\n topLeftCorner: {\n lon: number;\n lat: number;\n };\n };\n}\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 const parsedXML = XMLLoader.parseTextSync(text, {...options, xml: {\n ...options?.xml, \n removeNSPrefix: true,\n uncapitalizeKeys: true\n }});\n\n const xmlCapabilities: any = parsedXML.Capabilities || parsedXML;\n return xmlCapabilities;\n}\n\n/**\n * Parses a typed data structure from raw XML for `GetCapabilities` response\n * @note Error handlings is fairly weak\n */\n// export function parseWMTSCapabilities(text: string, options): WMTSCapabilities {\n// const parsedXML = XMLLoader.parseTextSync(text, options);\n// const xmlCapabilities: any =\n// parsedXML.WMT_MS_Capabilities || parsedXML.WMS_Capabilities || parsedXML;\n// return extractCapabilities(xmlCapabilities);\n// }\n\n/** Extract typed capability data from XML */\n// function extractCapabilities(xml: any): WMTSCapabilities {\n// const capabilities: WMTSCapabilities = {\n// name: xml.Service?.Name || 'unnamed',\n// title: xml.Service?.Title,\n// keywords: [],\n// requests: {},\n// layer: extractLayer(xml.Capability?.Layer),\n// raw: xml\n// };\n\n// for (const keyword of xml.Service?.KeywordList?.Keyword || []) {\n// capabilities.keywords.push(keyword);\n// }\n\n// for (const [name, xmlRequest] of Object.entries(xml.Capability?.Request || {})) {\n// capabilities.requests[name] = extractRequest(name, xmlRequest);\n// }\n\n// return capabilities;\n// }\n\n// /** Extract typed request data from XML */\n// function extractRequest(name: string, xmlRequest: any): WMSRequest {\n// const format: string | string[] = xmlRequest?.Format;\n// const mimeTypes: string[] = Array.isArray(format) ? format : [format];\n// return {name, mimeTypes};\n// }\n\n// /** Extract request data */\n// function extractLayer(xmlLayer: any): WMSLayer {\n// const layer: WMSLayer = {\n// name: xmlLayer?.Name,\n// title: xmlLayer?.Title,\n// srs: xmlLayer?.SRS || [],\n// layers: []\n// };\n\n// // Single layer is not represented as array in XML\n// const xmlLayers = getXMLArray(xmlLayer?.Layer);\n\n// for (const xmlSubLayer of xmlLayers) {\n// layer.layers?.push(extractLayer(xmlSubLayer));\n// }\n\n// return layer;\n// }\n\n// function getXMLArray(xmlValue: any) {\n// if (Array.isArray(xmlValue)) {\n// return xmlValue;\n// }\n// if (xmlValue) {\n// return [xmlValue];\n// }\n// return [];\n// }\n"],"mappings":"AAEA,SAAQA,SAAS,QAAO,iBAAiB;AAyFzC,OAAO,SAASC,qBAAqBA,CAACC,IAAY,EAAEC,OAAO,EAAoB;EAC7E,MAAMC,SAAS,GAAGJ,SAAS,CAACK,aAAa,CAACH,IAAI,EAAE;IAAC,GAAGC,OAAO;IAAEG,GAAG,EAAE;MAChE,IAAGH,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEG,GAAG;MACfC,cAAc,EAAE,IAAI;MACpBC,gBAAgB,EAAE;IACpB;EAAC,CAAC,CAAC;EAEH,MAAMC,eAAoB,GAAGL,SAAS,CAACM,YAAY,IAAIN,SAAS;EAChE,OAAOK,eAAe;AACxB"}
@@ -1,8 +1,5 @@
1
-
2
-
3
1
  import { parseWCSCapabilities } from './lib/wcs/parse-wcs-capabilities';
4
-
5
- const VERSION = typeof "3.4.0-alpha.2" !== 'undefined' ? "3.4.0-alpha.2" : 'latest';
2
+ const VERSION = typeof "3.4.0-alpha.3" !== 'undefined' ? "3.4.0-alpha.3" : 'latest';
6
3
  export const WCSCapabilitiesLoader = {
7
4
  id: 'wcs-capabilities',
8
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,sBAAkB,KAAK,WAAW,qBAAiB,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,OAAOC,WAAwB,EAAEH,OAA0B,KAChEZ,oBAAoB,CAAC,IAAIgB,WAAW,EAAE,CAACC,MAAM,CAACF,WAAW,CAAC,EAAEH,OAAO,CAAC;EACtEM,aAAa,EAAE,CAACC,IAAY,EAAEP,OAA0B,KAAKZ,oBAAoB,CAACmB,IAAI,EAAEP,OAAO;AACjG,CAAC;AAED,SAASD,WAAW,CAACQ,IAAY,EAAW;EAE1C,OAAOA,IAAI,CAACC,UAAU,CAAC,OAAO,CAAC;AACjC;AAEA,OAAO,MAAMC,+BAAiD,GAAGnB,qBAAqB"}
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,sBAAkB,KAAK,WAAW,qBAAiB,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,EAAE,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,8 +1,5 @@
1
-
2
-
3
1
  import { parseWFSCapabilities } from './lib/wfs/parse-wfs-capabilities';
4
-
5
- const VERSION = typeof "3.4.0-alpha.2" !== 'undefined' ? "3.4.0-alpha.2" : 'latest';
2
+ const VERSION = typeof "3.4.0-alpha.3" !== 'undefined' ? "3.4.0-alpha.3" : 'latest';
6
3
  export const WFSCapabilitiesLoader = {
7
4
  id: 'wfs-capabilities',
8
5
  name: 'WFS Capabilities',
@@ -1 +1 @@
1
- {"version":3,"file":"wfs-capabilities-loader.js","names":["parseWFSCapabilities","VERSION","WFSCapabilitiesLoader","id","name","module","version","worker","extensions","mimeTypes","testText","testXMLFile","options","wms","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 = {\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 wms: {}\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,sBAAkB,KAAK,WAAW,qBAAiB,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,OAAOC,WAAwB,EAAEH,OAA0B,KAChEZ,oBAAoB,CAAC,IAAIgB,WAAW,EAAE,CAACC,MAAM,CAACF,WAAW,CAAC,EAAEH,OAAO,CAAC;EACtEM,aAAa,EAAE,CAACC,IAAY,EAAEP,OAA0B,KAAKZ,oBAAoB,CAACmB,IAAI,EAAEP,OAAO;AACjG,CAAC;AAED,SAASD,WAAW,CAACQ,IAAY,EAAW;EAE1C,OAAOA,IAAI,CAACC,UAAU,CAAC,OAAO,CAAC;AACjC;AAEA,OAAO,MAAMC,+BAAiD,GAAGnB,qBAAqB"}
1
+ {"version":3,"file":"wfs-capabilities-loader.js","names":["parseWFSCapabilities","VERSION","WFSCapabilitiesLoader","id","name","module","version","worker","extensions","mimeTypes","testText","testXMLFile","options","wms","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 = {\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 wms: {}\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,sBAAkB,KAAK,WAAW,qBAAiB,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,EAAE,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,3 @@
1
-
2
-
3
1
  import { WMSCapabilitiesLoader } from '../wms-capabilities-loader';
4
2
  import { parseWMSFeatureInfo } from '../lib/parsers/wms/parse-wms-features';
5
3
  export const WMSFeatureInfoLoader = {
@@ -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 {WMSCapabilitiesLoader, WMSLoaderOptions} 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?: WMSLoaderOptions) =>\n parseWMSFeatureInfo(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: WMSLoaderOptions) => parseWMSFeatureInfo(text, options)\n};\n\nexport const _typecheckWMSFeatureInfoLoader: LoaderWithParser = WMSFeatureInfoLoader;\n"],"mappings":";;AAGA,SAAQA,qBAAqB,QAAyB,4BAA4B;AAGlF,SAAQC,mBAAmB,QAAO,uCAAuC;AAOzE,OAAO,MAAMC,oBAAoB,GAAG;EAClC,GAAGF,qBAAqB;EAExBG,EAAE,EAAE,kBAAkB;EACtBC,IAAI,EAAE,iBAAiB;EAEvBC,KAAK,EAAE,OAAOC,WAAwB,EAAEC,OAA0B,KAChEN,mBAAmB,CAAC,IAAIO,WAAW,EAAE,CAACC,MAAM,CAACH,WAAW,CAAC,EAAEC,OAAO,CAAC;EACrEG,aAAa,EAAE,CAACC,IAAY,EAAEJ,OAA0B,KAAKN,mBAAmB,CAACU,IAAI,EAAEJ,OAAO;AAChG,CAAC;AAED,OAAO,MAAMK,8BAAgD,GAAGV,oBAAoB"}
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 {WMSCapabilitiesLoader, WMSLoaderOptions} 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?: WMSLoaderOptions) =>\n parseWMSFeatureInfo(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: WMSLoaderOptions) => parseWMSFeatureInfo(text, options)\n};\n\nexport const _typecheckWMSFeatureInfoLoader: LoaderWithParser = WMSFeatureInfoLoader;\n"],"mappings":"AAGA,SAAQA,qBAAqB,QAAyB,4BAA4B;AAGlF,SAAQC,mBAAmB,QAAO,uCAAuC;AAOzE,OAAO,MAAMC,oBAAoB,GAAG;EAClC,GAAGF,qBAAqB;EAExBG,EAAE,EAAE,kBAAkB;EACtBC,IAAI,EAAE,iBAAiB;EAEvBC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEC,OAA0B,KAChEN,mBAAmB,CAAC,IAAIO,WAAW,EAAE,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,3 @@
1
-
2
-
3
1
  import { WMSCapabilitiesLoader } from '../wms-capabilities-loader';
4
2
  import { parseWMSLayerDescription } from '../lib/parsers/wms/parse-wms-layer-description';
5
3
  export const WMSLayerDescriptionLoader = {
@@ -1 +1 @@
1
- {"version":3,"file":"wms-layer-description-loader.js","names":["WMSCapabilitiesLoader","parseWMSLayerDescription","WMSLayerDescriptionLoader","id","name","parse","arrayBuffer","options","TextDecoder","decode","parseTextSync","text","_typecheckWMSFeatureInfoLoader"],"sources":["../../../src/wip/wms-layer-description-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type{WMSLoaderOptions} from '../wms-capabilities-loader';\nimport {WMSCapabilitiesLoader} from '../wms-capabilities-loader';\n\nimport type {WMSLayerDescription} from '../lib/parsers/wms/parse-wms-layer-description';\nimport {parseWMSLayerDescription} from '../lib/parsers/wms/parse-wms-layer-description';\n\nexport {WMSLayerDescription};\n\n/**\n * Loader for the response to the WMS DescribeLayer request\n */\nexport const WMSLayerDescriptionLoader = {\n ...WMSCapabilitiesLoader,\n\n id: 'wms-layer-description',\n name: 'WMS DescribeLayer',\n\n parse: async (arrayBuffer: ArrayBuffer, options?: WMSLoaderOptions) =>\n parseWMSLayerDescription(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: WMSLoaderOptions) => parseWMSLayerDescription(text, options)\n};\n\nexport const _typecheckWMSFeatureInfoLoader: LoaderWithParser = WMSLayerDescriptionLoader;\n"],"mappings":";;AAIA,SAAQA,qBAAqB,QAAO,4BAA4B;AAGhE,SAAQC,wBAAwB,QAAO,gDAAgD;AAOvF,OAAO,MAAMC,yBAAyB,GAAG;EACvC,GAAGF,qBAAqB;EAExBG,EAAE,EAAE,uBAAuB;EAC3BC,IAAI,EAAE,mBAAmB;EAEzBC,KAAK,EAAE,OAAOC,WAAwB,EAAEC,OAA0B,KAChEN,wBAAwB,CAAC,IAAIO,WAAW,EAAE,CAACC,MAAM,CAACH,WAAW,CAAC,EAAEC,OAAO,CAAC;EAC1EG,aAAa,EAAE,CAACC,IAAY,EAAEJ,OAA0B,KAAKN,wBAAwB,CAACU,IAAI,EAAEJ,OAAO;AACrG,CAAC;AAED,OAAO,MAAMK,8BAAgD,GAAGV,yBAAyB"}
1
+ {"version":3,"file":"wms-layer-description-loader.js","names":["WMSCapabilitiesLoader","parseWMSLayerDescription","WMSLayerDescriptionLoader","id","name","parse","arrayBuffer","options","TextDecoder","decode","parseTextSync","text","_typecheckWMSFeatureInfoLoader"],"sources":["../../../src/wip/wms-layer-description-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type{WMSLoaderOptions} from '../wms-capabilities-loader';\nimport {WMSCapabilitiesLoader} from '../wms-capabilities-loader';\n\nimport type {WMSLayerDescription} from '../lib/parsers/wms/parse-wms-layer-description';\nimport {parseWMSLayerDescription} from '../lib/parsers/wms/parse-wms-layer-description';\n\nexport {WMSLayerDescription};\n\n/**\n * Loader for the response to the WMS DescribeLayer request\n */\nexport const WMSLayerDescriptionLoader = {\n ...WMSCapabilitiesLoader,\n\n id: 'wms-layer-description',\n name: 'WMS DescribeLayer',\n\n parse: async (arrayBuffer: ArrayBuffer, options?: WMSLoaderOptions) =>\n parseWMSLayerDescription(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: WMSLoaderOptions) => parseWMSLayerDescription(text, options)\n};\n\nexport const _typecheckWMSFeatureInfoLoader: LoaderWithParser = WMSLayerDescriptionLoader;\n"],"mappings":"AAIA,SAAQA,qBAAqB,QAAO,4BAA4B;AAGhE,SAAQC,wBAAwB,QAAO,gDAAgD;AAOvF,OAAO,MAAMC,yBAAyB,GAAG;EACvC,GAAGF,qBAAqB;EAExBG,EAAE,EAAE,uBAAuB;EAC3BC,IAAI,EAAE,mBAAmB;EAEzBC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEC,OAA0B,KAChEN,wBAAwB,CAAC,IAAIO,WAAW,EAAE,CAACC,MAAM,CAACH,WAAW,CAAC,EAAEC,OAAO,CAAC;EAC1EG,aAAa,EAAEA,CAACC,IAAY,EAAEJ,OAA0B,KAAKN,wBAAwB,CAACU,IAAI,EAAEJ,OAAO;AACrG,CAAC;AAED,OAAO,MAAMK,8BAAgD,GAAGV,yBAAyB"}
@@ -1,10 +1,5 @@
1
-
2
-
3
- import { WMTSCapabilities } from './lib/wmts/parse-wmts-capabilities';
4
1
  import { parseWMTSCapabilities } from './lib/wmts/parse-wmts-capabilities';
5
-
6
- const VERSION = typeof "3.4.0-alpha.2" !== 'undefined' ? "3.4.0-alpha.2" : 'latest';
7
- export { WMTSCapabilities };
2
+ const VERSION = typeof "3.4.0-alpha.3" !== 'undefined' ? "3.4.0-alpha.3" : 'latest';
8
3
  export const WMTSCapabilitiesLoader = {
9
4
  id: 'wmts-capabilities',
10
5
  name: 'WMTS Capabilities',
@@ -1 +1 @@
1
- {"version":3,"file":"wmts-capabilities-loader.js","names":["WMTSCapabilities","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, LoaderOptions} from '@loaders.gl/loader-utils';\nimport {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\nexport {WMTSCapabilities};\n\nexport type WMTSLoaderOptions = LoaderOptions & {\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":";;AAGA,SAAQA,gBAAgB,QAAO,oCAAoC;AACnE,SAAQC,qBAAqB,QAAO,oCAAoC;;AAIxE,MAAMC,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAE3E,SAAQF,gBAAgB;AASxB,OAAO,MAAMG,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,OAAOC,WAAwB,EAAEH,OAA2B,KACjEZ,qBAAqB,CAAC,IAAIgB,WAAW,EAAE,CAACC,MAAM,CAACF,WAAW,CAAC,EAAEH,OAAO,CAAC;EACvEM,aAAa,EAAE,CAACC,IAAY,EAAEP,OAA2B,KAAKZ,qBAAqB,CAACmB,IAAI,EAAEP,OAAO;AACnG,CAAC;AAED,SAASD,WAAW,CAACQ,IAAY,EAAW;EAE1C,OAAOA,IAAI,CAACC,UAAU,CAAC,OAAO,CAAC;AACjC;AAEA,OAAO,MAAMC,gCAAkD,GAAGnB,sBAAsB"}
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, LoaderOptions} from '@loaders.gl/loader-utils';\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 = LoaderOptions & {\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":"AAIA,SAAQA,qBAAqB,QAAO,oCAAoC;AAIxE,MAAMC,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,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,EAAE,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,9 +1,5 @@
1
-
2
-
3
1
  import { parseWMSCapabilities } from './lib/parsers/wms/parse-wms-capabilities';
4
-
5
- const VERSION = typeof "3.4.0-alpha.2" !== 'undefined' ? "3.4.0-alpha.2" : 'latest';
6
-
2
+ const VERSION = typeof "3.4.0-alpha.3" !== 'undefined' ? "3.4.0-alpha.3" : 'latest';
7
3
  export const WMSCapabilitiesLoader = {
8
4
  id: 'wms-capabilities',
9
5
  name: 'WMS Capabilities',
@@ -16,8 +12,8 @@ export const WMSCapabilitiesLoader = {
16
12
  options: {
17
13
  wms: {}
18
14
  },
19
- parse: async (arrayBuffer, options) => parseWMSCapabilities(new TextDecoder().decode(arrayBuffer), options),
20
- parseTextSync: (text, options) => parseWMSCapabilities(text, options)
15
+ parse: async (arrayBuffer, options) => parseWMSCapabilities(new TextDecoder().decode(arrayBuffer), options === null || options === void 0 ? void 0 : options.wms),
16
+ parseTextSync: (text, options) => parseWMSCapabilities(text, options === null || options === void 0 ? void 0 : options.wms)
21
17
  };
22
18
  function testXMLFile(text) {
23
19
  return text.startsWith('<?xml');
@@ -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","_typecheckWMSCapabilitiesLoader"],"sources":["../../src/wms-capabilities-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {WMSCapabilities} from './lib/parsers/wms/parse-wms-capabilities';\nimport {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 type\nexport type {WMSCapabilities};\n\nexport type WMSLoaderOptions = LoaderOptions & {\n wms?: {};\n};\n\n/**\n * Loader for the response to the WMS GetCapability request\n */\nexport const WMSCapabilitiesLoader = {\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?: WMSLoaderOptions) =>\n parseWMSCapabilities(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: WMSLoaderOptions) => parseWMSCapabilities(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 _typecheckWMSCapabilitiesLoader: LoaderWithParser = WMSCapabilitiesLoader;\n"],"mappings":";;AAIA,SAAQA,oBAAoB,QAAO,0CAA0C;;AAI7E,MAAMC,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;;AAY3E,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,OAAOC,WAAwB,EAAEH,OAA0B,KAChEZ,oBAAoB,CAAC,IAAIgB,WAAW,EAAE,CAACC,MAAM,CAACF,WAAW,CAAC,EAAEH,OAAO,CAAC;EACtEM,aAAa,EAAE,CAACC,IAAY,EAAEP,OAA0B,KAAKZ,oBAAoB,CAACmB,IAAI,EAAEP,OAAO;AACjG,CAAC;AAED,SAASD,WAAW,CAACQ,IAAY,EAAW;EAE1C,OAAOA,IAAI,CAACC,UAAU,CAAC,OAAO,CAAC;AACjC;AAEA,OAAO,MAAMC,+BAAiD,GAAGnB,qBAAqB"}
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","_typecheckWMSCapabilitiesLoader"],"sources":["../../src/wms-capabilities-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {WMSCapabilities} from './lib/parsers/wms/parse-wms-capabilities';\nimport {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 type\nexport type {WMSCapabilities};\n\nexport type WMSLoaderOptions = LoaderOptions & {\n wms?: {\n /** Add inherited layer information to sub layers */\n inheritedLayerProps?: boolean;\n /** Whether to include \"raw\" XML-derived JSON */\n raw?: boolean;\n };\n};\n\n/**\n * Loader for the response to the WMS GetCapability request\n */\nexport const WMSCapabilitiesLoader = {\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?: WMSLoaderOptions) =>\n parseWMSCapabilities(new TextDecoder().decode(arrayBuffer), options?.wms),\n parseTextSync: (text: string, options?: WMSLoaderOptions) =>\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\nexport const _typecheckWMSCapabilitiesLoader: LoaderWithParser = WMSCapabilitiesLoader;\n"],"mappings":"AAIA,SAAQA,oBAAoB,QAAO,0CAA0C;AAI7E,MAAMC,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAiB3E,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,EAAE,CAACC,MAAM,CAACF,WAAW,CAAC,EAAEH,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,GAAG,CAAC;EAC3EK,aAAa,EAAEA,CAACC,IAAY,EAAEP,OAA0B,KACtDZ,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;AAEA,OAAO,MAAMC,+BAAiD,GAAGnB,qBAAqB"}
@@ -1,8 +1,5 @@
1
-
2
-
3
1
  import { parseWMSError } from './lib/parsers/wms/parse-wms-error';
4
-
5
- const VERSION = typeof "3.4.0-alpha.2" !== 'undefined' ? "3.4.0-alpha.2" : 'latest';
2
+ const VERSION = typeof "3.4.0-alpha.3" !== 'undefined' ? "3.4.0-alpha.3" : 'latest';
6
3
  export const WMSErrorLoader = {
7
4
  id: 'wms-error',
8
5
  name: 'WMS Error',
@@ -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","Error","_typecheckWMSErrorLoader"],"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 = {\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\nexport const _typecheckWMSErrorLoader: LoaderWithParser = WMSErrorLoader;\n"],"mappings":";;AAGA,SAAQA,aAAa,QAAO,mCAAmC;;AAI/D,MAAMC,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAc3E,OAAO,MAAMC,cAAc,GAAG;EAC5BC,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,OAAOC,WAAwB,EAAEJ,OAA0B,KAChEK,aAAa,CAAC,IAAIC,WAAW,EAAE,CAACC,MAAM,CAACH,WAAW,CAAC,EAAEJ,OAAO,CAAC;EAC/DQ,SAAS,EAAE,CAACJ,WAAwB,EAAEJ,OAA0B,KAC9DK,aAAa,CAAC,IAAIC,WAAW,EAAE,CAACC,MAAM,CAACH,WAAW,CAAC,EAAEJ,OAAO,CAAC;EAC/DK,aAAa,EAAE,CAACI,IAAY,EAAET,OAA0B,KAAaK,aAAa,CAACI,IAAI,EAAET,OAAO;AAClG,CAAC;AAED,SAASD,WAAW,CAACU,IAAY,EAAW;EAE1C,OAAOA,IAAI,CAACC,UAAU,CAAC,OAAO,CAAC;AACjC;AAEA,SAASL,aAAa,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,gCAAyBA,KAAK,CAAE;EAChF,IAAID,UAAU,CAACT,YAAY,EAAE;IAC3B,MAAM,IAAIa,KAAK,CAACF,OAAO,CAAC;EAC1B;EACA,OAAOA,OAAO;AAChB;AAEA,OAAO,MAAMG,wBAA0C,GAAG1B,cAAc"}
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","_typecheckWMSErrorLoader"],"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 = {\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\nexport const _typecheckWMSErrorLoader: LoaderWithParser = WMSErrorLoader;\n"],"mappings":"AAGA,SAAQA,aAAa,QAAO,mCAAmC;AAI/D,MAAMC,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAc3E,OAAO,MAAMC,cAAc,GAAG;EAC5BC,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,EAAE,CAACC,MAAM,CAACH,WAAW,CA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