@loaders.gl/wms 4.0.0-alpha.6 → 4.0.0-alpha.7

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 (81) hide show
  1. package/dist/dist.min.js +39 -6
  2. package/dist/es5/csw-capabilities-loader.js +1 -1
  3. package/dist/es5/csw-domain-loader.js +1 -1
  4. package/dist/es5/csw-records-loader.js +1 -1
  5. package/dist/es5/gml-loader.js +1 -1
  6. package/dist/es5/index.js.map +1 -1
  7. package/dist/es5/lerc-loader.js +1 -1
  8. package/dist/es5/lib/parsers/wms/parse-wms-capabilities.js +41 -5
  9. package/dist/es5/lib/parsers/wms/parse-wms-capabilities.js.map +1 -1
  10. package/dist/es5/lib/parsers/wms/parse-wms-layer-description.js.map +1 -1
  11. package/dist/es5/lib/services/ogc/csw-service.js.map +1 -1
  12. package/dist/es5/lib/services/ogc/wms-service.js +7 -2
  13. package/dist/es5/lib/services/ogc/wms-service.js.map +1 -1
  14. package/dist/es5/lib/sources/image-source.js.map +1 -1
  15. package/dist/es5/wip/wcs-capabilities-loader.js +1 -1
  16. package/dist/es5/wip/wfs-capabilities-loader.js +1 -1
  17. package/dist/es5/wip/wms-feature-info-loader.js.map +1 -1
  18. package/dist/es5/wip/wms-layer-description-loader.js.map +1 -1
  19. package/dist/es5/wip/wmts-capabilities-loader.js +1 -1
  20. package/dist/es5/wip/wmts-capabilities-loader.js.map +1 -1
  21. package/dist/es5/wms-capabilities-loader.js +1 -1
  22. package/dist/es5/wms-capabilities-loader.js.map +1 -1
  23. package/dist/es5/wms-error-loader.js +1 -1
  24. package/dist/esm/csw-capabilities-loader.js +1 -1
  25. package/dist/esm/csw-domain-loader.js +1 -1
  26. package/dist/esm/csw-records-loader.js +1 -1
  27. package/dist/esm/gml-loader.js +1 -1
  28. package/dist/esm/index.js.map +1 -1
  29. package/dist/esm/lerc-loader.js +1 -1
  30. package/dist/esm/lib/parsers/wms/parse-wms-capabilities.js +41 -5
  31. package/dist/esm/lib/parsers/wms/parse-wms-capabilities.js.map +1 -1
  32. package/dist/esm/lib/parsers/wms/parse-wms-layer-description.js.map +1 -1
  33. package/dist/esm/lib/services/ogc/csw-service.js.map +1 -1
  34. package/dist/esm/lib/services/ogc/wms-service.js +6 -1
  35. package/dist/esm/lib/services/ogc/wms-service.js.map +1 -1
  36. package/dist/esm/lib/sources/image-source.js.map +1 -1
  37. package/dist/esm/wip/wcs-capabilities-loader.js +1 -1
  38. package/dist/esm/wip/wfs-capabilities-loader.js +1 -1
  39. package/dist/esm/wip/wms-feature-info-loader.js.map +1 -1
  40. package/dist/esm/wip/wms-layer-description-loader.js.map +1 -1
  41. package/dist/esm/wip/wmts-capabilities-loader.js +1 -1
  42. package/dist/esm/wip/wmts-capabilities-loader.js.map +1 -1
  43. package/dist/esm/wms-capabilities-loader.js +1 -1
  44. package/dist/esm/wms-capabilities-loader.js.map +1 -1
  45. package/dist/esm/wms-error-loader.js +1 -1
  46. package/dist/index.d.ts +5 -3
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/index.js +0 -4
  49. package/dist/lib/parsers/wms/parse-wms-capabilities.d.ts +26 -2
  50. package/dist/lib/parsers/wms/parse-wms-capabilities.d.ts.map +1 -1
  51. package/dist/lib/parsers/wms/parse-wms-capabilities.js +40 -6
  52. package/dist/lib/parsers/wms/parse-wms-layer-description.d.ts +2 -1
  53. package/dist/lib/parsers/wms/parse-wms-layer-description.d.ts.map +1 -1
  54. package/dist/lib/services/ogc/csw-service.d.ts +5 -3
  55. package/dist/lib/services/ogc/csw-service.d.ts.map +1 -1
  56. package/dist/lib/services/ogc/csw-service.js +1 -2
  57. package/dist/lib/services/ogc/wms-service.d.ts +31 -6
  58. package/dist/lib/services/ogc/wms-service.d.ts.map +1 -1
  59. package/dist/lib/services/ogc/wms-service.js +6 -1
  60. package/dist/lib/sources/image-source.d.ts +13 -4
  61. package/dist/lib/sources/image-source.d.ts.map +1 -1
  62. package/dist/wip/wms-feature-info-loader.d.ts +3 -3
  63. package/dist/wip/wms-feature-info-loader.d.ts.map +1 -1
  64. package/dist/wip/wms-layer-description-loader.d.ts +3 -3
  65. package/dist/wip/wms-layer-description-loader.d.ts.map +1 -1
  66. package/dist/wip/wmts-capabilities-loader.d.ts +3 -2
  67. package/dist/wip/wmts-capabilities-loader.d.ts.map +1 -1
  68. package/dist/wms-capabilities-loader.d.ts +11 -7
  69. package/dist/wms-capabilities-loader.d.ts.map +1 -1
  70. package/dist/wms-capabilities-loader.js +6 -2
  71. package/package.json +6 -6
  72. package/src/index.ts +11 -4
  73. package/src/lib/parsers/wms/parse-wms-capabilities.ts +74 -9
  74. package/src/lib/parsers/wms/parse-wms-layer-description.ts +5 -1
  75. package/src/lib/services/ogc/csw-service.ts +12 -4
  76. package/src/lib/services/ogc/wms-service.ts +16 -3
  77. package/src/lib/sources/image-source.ts +16 -4
  78. package/src/wip/wms-feature-info-loader.ts +4 -3
  79. package/src/wip/wms-layer-description-loader.ts +3 -3
  80. package/src/wip/wmts-capabilities-loader.ts +3 -2
  81. package/src/wms-capabilities-loader.ts +22 -9
@@ -1 +1 @@
1
- {"version":3,"file":"parse-wms-capabilities.js","names":["XMLLoader","getXMLArray","getXMLStringArray","getXMLInteger","getXMLFloat","getXMLBoolean","parseWMSCapabilities","xmlText","options","_XMLLoader$parseTextS","parsedXML","parseTextSync","call","xmlCapabilities","WMT_MS_Capabilities","WMS_Capabilities","capabilities","extractCapabilities","inheritedLayerProps","layer","layers","addInheritedLayerProps","includeRawData","raw","includeXMLText","xml","_xml$Service","_xml$Service2","_xml$Service3","_xml$Service4","_xml$Service5","_xml$Service6","_xml$Service6$Keyword","_xml$Service7","_xml$Service8","_xml$Service9","_xml$Service10","_xml$Service11","_xml$Service12","_xml$Service13","_xml$Capability","_xml$Capability2","version","String","name","Service","Name","title","Title","undefined","abstract","Abstract","keywords","KeywordList","Keyword","fees","Fees","JSON","stringify","accessConstraints","AccessConstraints","layerLimit","LayerLimit","maxWidth","maxHeight","requests","extractRequests","Capability","Request","exceptions","extractExceptions","Exception","xmlLayers","Layer","xmlSubLayer","push","extractLayer","key","value","Object","entries","xmlRequests","xmlRequest","mimeTypes","Format","xmlException","xmlExceptionFormats","length","xmlLayer","_xmlLayer$KeywordList","crs","CRS","SRS","Array","isArray","every","_","geographicBoundingBox","EX_GeographicBoundingBox","extractEXBoundingBox","LatLonBoundingBox","extractLatLonBoundingBox","boundingBoxes","BoundingBox","extractWMSBoundingBoxes","opaque","cascaded","queryable","xmlBoundingBox","westBoundLongitude","w","northBoundLatitude","n","eastBoundLongitude","e","southBoundLatitude","s","minx","miny","maxx","maxy","xmlBoundingBoxes","xmlBoxes","map","xmlBox","extractWMSBoundingBox","resx","resy","boundingBox","xResolution","yResolution","parent","subLayer"],"sources":["../../../../../src/lib/parsers/wms/parse-wms-capabilities.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\nimport {\n getXMLArray,\n getXMLStringArray,\n getXMLInteger,\n getXMLFloat,\n getXMLBoolean\n} from '../xml/parse-xml-helpers';\n\n/** All capabilities of a WMS service - response to a WMS `GetCapabilities` data structure extracted from XML */\nexport type WMSCapabilities = {\n /** Version of the WMS service */\n version?: string; // '1.3.0' | '1.1.1' | '1.1.0' | '1.0.0'\n /** A short name for the service */\n name: string;\n /** A human readable name for the service */\n title?: string;\n /** A more extensive description of the service */\n abstract?: string;\n /** A set of keywords e.g. for searching services */\n keywords: string[];\n /** A field of unspecified format, if present describes any access constraints required to use the service. */\n accessConstraints?: string;\n /** A field of unspecified format, if present describes any fees associated with the use of the service */\n fees?: string;\n /** If present, the max number of layers that can be rendered by the service */\n layerLimit?: number;\n /** If present, the widest image that can be rendered by the service */\n maxWidth?: number;\n /** If present, the tallest image that can be rendered by the service */\n maxHeight?: number;\n /** Hierarchical list of layers. */\n layers: WMSLayer[];\n /** A map with information about supported WMS requests. If a record is present, the request is supported by the service */\n requests: Record<string, WMSRequest>;\n /** Information about any exceptions that the service will report (HTTP status != 2xx) */\n exceptions?: WMSExceptions;\n /** Only if `options.raw`: raw untyped JSON parsed from XML. Can include information not extracted in the typed response. */\n raw?: Record<string, unknown>;\n /** Only if `options.xml`, the unparsed XML string can be requested */\n xml?: string;\n};\n\n/**\n * Metadata about a layer\n * Layers inherit many properties from their parent layers, see description of individual props for details.\n * @see https://www.ogc.org/standard/wms/ 7.2.4.6\n */\nexport type WMSLayer = {\n /** The title is a human readable name. It is mandatory on each layer. Not inherited. */\n title: string;\n /** A layer is renderable if it has a name. A named parent layer will render all its sublayers. Not inherited. */\n name?: string;\n /** A narrative description of the map layer. */\n abstract?: string;\n /** A set of keywords e.g. for searching layers */\n keywords: string[];\n /** layer limits in unspecified CRS:84-like lng/lat, for quick access w/o CRS calculations. Defined or inherited. */\n geographicBoundingBox?: [min: [x: number, y: number], max: [x: number, y: number]];\n /** Supported CRS. Either defined or inherited. */\n crs?: string[];\n /** Bounding boxes in specific CRS:es */\n boundingBoxes?: WMSBoundingBox[];\n\n // minScale: number;\n // maxScale: number;\n // dimensions: ?? 7.2.4.6.10\n // MetadataURL\n // Attribution\n // Identifier and AuthorityURL\n // FeatureListURL\n // DataURL\n\n /** Whether queries can be performed on the layer */\n queryable?: boolean;\n /** `false` if layer has significant no-data areas that the client can display as transparent. */\n opaque?: boolean;\n /** WMS cascading allows server to expose layers coming from other WMS servers as if they were local layers */\n cascaded?: boolean;\n // noSubsets: boolean\n // fixedWith: number\n // fixedHeight: number\n\n /** A list of styles. @note not yet supported by WMSCapabilitiesLoader */\n styles?: unknown[];\n\n /** Sublayers - these inherit crs and boundingBox) if not overridden) */\n layers?: WMSLayer[];\n};\n\n/**\n * A bounding box specifies the coordinate range for data in the layer.\n * No data is available outside the bounding box.\n */\nexport type WMSBoundingBox = {\n /** CRS indicates the Layer CRS that applies to this bounding box. */\n crs: string;\n /** `[[w, s], [e, n]]`, indicates the limits of the bounding box using the axis units and order of the specified CRS. */\n boundingBox: [min: [x: number, y: number], max: [x: number, y: number]];\n /** Spatial horizontal resolution of data in same units as bounding box */\n xResolution?: number;\n /** Spatial vertical resolution of data in same units as bounding box */\n yResolution?: number;\n};\n\n/** Metadata about a supported WMS request */\nexport type WMSRequest = {\n /** MIMEtypes that can be returned by this request. */\n mimeTypes: string[];\n};\n\nexport type WMSExceptions = {\n /** MIME types for exception response payloads. */\n mimeTypes: string[];\n};\n\nexport type parseWMSCapabilitiesOptions = {\n /** Add inherited layer information to sub layers */\n inheritedLayerProps?: boolean;\n /** Include the \"raw\" JSON (parsed but untyped, unprocessed XML). May contain additional fields */\n includeRawData?: boolean;\n /** Include the original XML document text. May contain additional information. */\n includeXMLText?: boolean;\n /** @deprecated Use includeRawData` */\n raw?: boolean;\n\n // xml options are passed through to xml loader\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 parseWMSCapabilities(\n xmlText: string,\n options?: parseWMSCapabilitiesOptions\n): WMSCapabilities {\n const parsedXML = XMLLoader.parseTextSync?.(xmlText, options);\n const xmlCapabilities: any =\n parsedXML.WMT_MS_Capabilities || parsedXML.WMS_Capabilities || parsedXML;\n const capabilities = extractCapabilities(xmlCapabilities);\n // In case the processed, normalized capabilities do not contain everything,\n // the user can get the parsed XML structure.\n if (options?.inheritedLayerProps) {\n // Traverse layers and inject missing props from parents\n for (const layer of capabilities.layers) {\n addInheritedLayerProps(layer, null);\n }\n // Not yet implemented\n }\n\n if (options?.includeRawData || options?.raw) {\n capabilities.raw = xmlCapabilities;\n }\n\n if (options?.includeXMLText) {\n capabilities.xml = xmlText;\n }\n\n return capabilities;\n}\n\n/** Extract typed capability data from XML */\nfunction extractCapabilities(xml: any): WMSCapabilities {\n const capabilities: WMSCapabilities = {\n version: String(xml.version || ''),\n name: String(xml.Service?.Name || 'unnamed'),\n title: xml.Service?.Title ? String(xml.Service?.Title) : undefined,\n abstract: xml.Service?.Abstract ? String(xml.Service?.Abstract) : undefined,\n keywords: getXMLStringArray(xml.Service?.KeywordList?.Keyword),\n fees: xml.Service?.Fees ? JSON.stringify(xml.Service?.Fees) : undefined,\n accessConstraints: xml.Service?.AccessConstraints\n ? JSON.stringify(xml.Service?.AccessConstraints)\n : undefined,\n layerLimit: getXMLInteger(xml.Service?.LayerLimit),\n maxWidth: getXMLInteger(xml.Service?.maxWidth),\n maxHeight: getXMLInteger(xml.Service?.maxHeight),\n layers: [],\n requests: extractRequests(xml.Capability?.Request),\n exceptions: extractExceptions(xml.Exception)\n // contact field is a mess of largely irrelevant information, put it last\n // contact: xml.Service?.Contact ? JSON.stringify(xml.Service?.Contact) : undefined,\n };\n\n // LAYERS\n const xmlLayers = getXMLArray(xml.Capability?.Layer);\n for (const xmlSubLayer of xmlLayers) {\n capabilities.layers.push(extractLayer(xmlSubLayer));\n }\n\n // Clean up object\n for (const [key, value] of Object.entries(capabilities)) {\n if (value === undefined) {\n delete capabilities[key];\n }\n }\n\n return capabilities;\n}\n\n/** Extract typed request metadata from XML requests field */\nfunction extractRequests(xmlRequests: any): Record<string, WMSRequest> {\n const requests: Record<string, WMSRequest> = {};\n for (const [name, xmlRequest] of Object.entries(xmlRequests || {}) as any) {\n const mimeTypes = getXMLStringArray(xmlRequest?.Format);\n requests[name] = {mimeTypes};\n }\n return requests;\n}\n\nfunction extractExceptions(xmlException: any): WMSExceptions | undefined {\n const xmlExceptionFormats = getXMLArray(xmlException?.Format);\n if (xmlExceptionFormats.length > 0) {\n return {\n mimeTypes: getXMLStringArray(xmlException)\n };\n }\n return undefined;\n}\n\n/** Extract request data */\n// eslint-disable-next-line complexity, max-statements\nfunction extractLayer(xmlLayer: any): WMSLayer {\n const layer: WMSLayer = {\n // All layers must have a title\n title: String(xmlLayer?.Title || ''),\n // Name is required only if renderable\n name: String(xmlLayer?.Name),\n abstract: String(xmlLayer?.Abstract),\n keywords: getXMLStringArray(xmlLayer.KeywordList?.Keyword)\n };\n\n // WMS 1.3.0 changes SRS to CRS\n const crs = xmlLayer?.CRS || xmlLayer?.SRS;\n if (crs && Array.isArray(crs) && crs.every((_) => typeof _ === 'string')) {\n layer.crs = crs;\n }\n\n // v1.3.0 extract simple geographic bounding box\n let geographicBoundingBox =\n xmlLayer?.EX_GeographicBoundingBox && extractEXBoundingBox(xmlLayer?.EX_GeographicBoundingBox);\n if (geographicBoundingBox) {\n layer.geographicBoundingBox = geographicBoundingBox;\n }\n\n // v1.1.1 extract simple geographic bounding box\n geographicBoundingBox =\n xmlLayer?.LatLonBoundingBox && extractLatLonBoundingBox(xmlLayer?.LatLonBoundingBox);\n if (geographicBoundingBox) {\n layer.geographicBoundingBox = geographicBoundingBox;\n }\n\n // Extract per-CRS bounding boxes\n const boundingBoxes = xmlLayer?.BoundingBox && extractWMSBoundingBoxes(xmlLayer?.BoundingBox);\n if (boundingBoxes && boundingBoxes.length > 0) {\n layer.boundingBoxes = boundingBoxes;\n }\n\n if (xmlLayer?.opaque) {\n layer.opaque = getXMLBoolean(xmlLayer?.opaque);\n }\n if (xmlLayer?.cascaded) {\n layer.cascaded = getXMLBoolean(xmlLayer?.cascaded);\n }\n if (xmlLayer?.queryable) {\n layer.queryable = getXMLBoolean(xmlLayer?.queryable);\n }\n\n // Single layer is not represented as array in XML\n const xmlLayers = getXMLArray(xmlLayer?.Layer);\n const layers: WMSLayer[] = [];\n\n for (const xmlSubLayer of xmlLayers) {\n layers.push(extractLayer(xmlSubLayer));\n }\n\n if (layers.length > 0) {\n layer.layers = layers;\n }\n\n // Clean up object\n for (const [key, value] of Object.entries(layer)) {\n if (value === undefined) {\n delete layer[key];\n }\n }\n\n return layer;\n}\n\n/** WMS 1.3.0 Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractEXBoundingBox(xmlBoundingBox: any): [[number, number], [number, number]] {\n const {\n westBoundLongitude: w,\n northBoundLatitude: n,\n eastBoundLongitude: e,\n southBoundLatitude: s\n } = xmlBoundingBox;\n return [\n [w, s],\n [e, n]\n ];\n}\n\n/** WMS 1.1.1 Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractLatLonBoundingBox(xmlBoundingBox: any): [[number, number], [number, number]] {\n const {minx, miny, maxx, maxy} = xmlBoundingBox;\n return [\n [minx, miny],\n [maxx, maxy]\n ];\n}\n\n/** Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractWMSBoundingBoxes(xmlBoundingBoxes: any): WMSBoundingBox[] {\n const xmlBoxes = getXMLArray(xmlBoundingBoxes);\n return xmlBoxes.map((xmlBox) => extractWMSBoundingBox(xmlBox));\n}\n\n/** Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractWMSBoundingBox(xmlBoundingBox: any): WMSBoundingBox {\n const {CRS, SRS, minx, miny, maxx, maxy, resx, resy} = xmlBoundingBox;\n const boundingBox: WMSBoundingBox = {\n // CRS in 1.3.0, SRS in 1.1.1\n crs: CRS || SRS,\n boundingBox: [\n [getXMLFloat(minx) as number, getXMLFloat(miny) as number],\n [getXMLFloat(maxx) as number, getXMLFloat(maxy) as number]\n ]\n };\n if (resx) {\n boundingBox.xResolution = resx;\n }\n if (resy) {\n boundingBox.yResolution = resy;\n }\n return boundingBox;\n}\n\n/** Traverse layers and inject missing props from parents */\n// eslint-disable-next-line complexity\nfunction addInheritedLayerProps(layer: WMSLayer, parent: WMSLayer | null): void {\n if (parent && parent.geographicBoundingBox && !layer.geographicBoundingBox) {\n layer.geographicBoundingBox = [...parent.geographicBoundingBox];\n }\n\n if (parent && parent.crs && !layer.crs) {\n layer.crs = [...parent.crs];\n }\n\n if (parent && parent.boundingBoxes && !layer.boundingBoxes) {\n layer.boundingBoxes = [...parent.boundingBoxes];\n }\n\n // TODO inherit other elements\n\n for (const subLayer of layer.layers || []) {\n addInheritedLayerProps(subLayer, layer);\n }\n}\n"],"mappings":"AAEA,SAAQA,SAAS,QAAO,iBAAiB;AACzC,SACEC,WAAW,EACXC,iBAAiB,EACjBC,aAAa,EACbC,WAAW,EACXC,aAAa,QACR,0BAA0B;AA8HjC,OAAO,SAASC,oBAA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AC1DnF,KAAK,CAACmF,aAAa,GAAG,CAAC,GAAG6B,MAAM,CAAC7B,aAAa,CAAC;EACjD;EAIA,KAAK,MAAM8B,QAAQ,IAAIjH,KAAK,CAACC,MAAM,IAAI,EAAE,EAAE;IACzCC,sBAAsB,CAAC+G,QAAQ,EAAEjH,KAAK,CAAC;EACzC;AACF"}
1
+ {"version":3,"file":"parse-wms-capabilities.js","names":["XMLLoader","getXMLArray","getXMLStringArray","getXMLInteger","getXMLFloat","getXMLBoolean","parseWMSCapabilities","xmlText","options","_XMLLoader$parseTextS","parsedXML","parseTextSync","call","xmlCapabilities","WMT_MS_Capabilities","WMS_Capabilities","capabilities","extractCapabilities","inheritedLayerProps","layer","layers","addInheritedLayerProps","includeRawData","raw","includeXMLText","xml","_xml$Service","_xml$Service2","_xml$Service3","_xml$Service4","_xml$Service5","_xml$Service6","_xml$Service6$Keyword","_xml$Service7","_xml$Service8","_xml$Service9","_xml$Service10","_xml$Service11","_xml$Service12","_xml$Service13","_xml$Capability","_xml$Capability2","version","String","name","Service","Name","title","Title","undefined","abstract","Abstract","keywords","KeywordList","Keyword","fees","Fees","JSON","stringify","accessConstraints","AccessConstraints","layerLimit","LayerLimit","maxWidth","maxHeight","requests","extractRequests","Capability","Request","exceptions","extractExceptions","Exception","xmlLayers","Layer","xmlSubLayer","push","extractLayer","key","value","Object","entries","xmlRequests","xmlRequest","mimeTypes","Format","xmlException","xmlExceptionFormats","length","xmlLayer","_xmlLayer$KeywordList","crs","CRS","SRS","Array","isArray","every","_","geographicBoundingBox","EX_GeographicBoundingBox","extractEXBoundingBox","LatLonBoundingBox","extractLatLonBoundingBox","boundingBoxes","BoundingBox","extractWMSBoundingBoxes","xmlDimensions","Dimension","dimensions","map","extractDimension","opaque","cascaded","queryable","xmlBoundingBox","westBoundLongitude","w","northBoundLatitude","n","eastBoundLongitude","e","southBoundLatitude","s","minx","miny","maxx","maxy","xmlBoundingBoxes","xmlBoxes","xmlBox","extractWMSBoundingBox","resx","resy","boundingBox","xResolution","yResolution","xmlDimension","units","extent","dimension","unitSymbol","default","defaultValue","multipleValues","nearestValue","current","parent","subLayer"],"sources":["../../../../../src/lib/parsers/wms/parse-wms-capabilities.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\nimport {\n getXMLArray,\n getXMLStringArray,\n getXMLInteger,\n getXMLFloat,\n getXMLBoolean\n} from '../xml/parse-xml-helpers';\n\n/** All capabilities of a WMS service - response to a WMS `GetCapabilities` data structure extracted from XML */\nexport type WMSCapabilities = {\n /** Version of the WMS service */\n version?: string; // '1.3.0' | '1.1.1' | '1.1.0' | '1.0.0'\n /** A short name for the service */\n name: string;\n /** A human readable name for the service */\n title?: string;\n /** A more extensive description of the service */\n abstract?: string;\n /** A set of keywords e.g. for searching services */\n keywords: string[];\n /** A field of unspecified format, if present describes any access constraints required to use the service. */\n accessConstraints?: string;\n /** A field of unspecified format, if present describes any fees associated with the use of the service */\n fees?: string;\n /** If present, the max number of layers that can be rendered by the service */\n layerLimit?: number;\n /** If present, the widest image that can be rendered by the service */\n maxWidth?: number;\n /** If present, the tallest image that can be rendered by the service */\n maxHeight?: number;\n /** Hierarchical list of layers. */\n layers: WMSLayer[];\n /** A map with information about supported WMS requests. If a record is present, the request is supported by the service */\n requests: Record<string, WMSRequest>;\n /** Information about any exceptions that the service will report (HTTP status != 2xx) */\n exceptions?: WMSExceptions;\n /** Only if `options.raw`: raw untyped JSON parsed from XML. Can include information not extracted in the typed response. */\n raw?: Record<string, unknown>;\n /** Only if `options.xml`, the unparsed XML string can be requested */\n xml?: string;\n};\n\n/**\n * Metadata about a layer\n * Layers inherit many properties from their parent layers, see description of individual props for details.\n * @see https://www.ogc.org/standard/wms/ 7.2.4.6\n */\nexport type WMSLayer = {\n /** The title is a human readable name. It is mandatory on each layer. Not inherited. */\n title: string;\n /** A layer is renderable if it has a name. A named parent layer will render all its sublayers. Not inherited. */\n name?: string;\n /** A narrative description of the map layer. */\n abstract?: string;\n /** A set of keywords e.g. for searching layers */\n keywords: string[];\n /** layer limits in unspecified CRS:84-like lng/lat, for quick access w/o CRS calculations. Defined or inherited. */\n geographicBoundingBox?: [min: [x: number, y: number], max: [x: number, y: number]];\n /** Supported CRS. Either defined or inherited. */\n crs?: string[];\n /** Bounding boxes in specific CRS:es */\n boundingBoxes?: WMSBoundingBox[];\n\n // minScale: number;\n // maxScale: number;\n // dimensions: ?? 7.2.4.6.10\n // MetadataURL\n // Attribution\n // Identifier and AuthorityURL\n // FeatureListURL\n // DataURL\n\n /** any extra dimension such as time */\n dimensions?: WMSDimension[];\n\n /** Whether queries can be performed on the layer */\n queryable?: boolean;\n /** `false` if layer has significant no-data areas that the client can display as transparent. */\n opaque?: boolean;\n /** WMS cascading allows server to expose layers coming from other WMS servers as if they were local layers */\n cascaded?: boolean;\n // noSubsets: boolean\n // fixedWith: number\n // fixedHeight: number\n\n /** A list of styles. @note not yet supported by WMSCapabilitiesLoader */\n styles?: unknown[];\n\n /** Sublayers - these inherit crs and boundingBox) if not overridden) */\n layers?: WMSLayer[];\n};\n\n/**\n * A bounding box specifies the coordinate range for data in the layer.\n * No data is available outside the bounding box.\n */\nexport type WMSBoundingBox = {\n /** CRS indicates the Layer CRS that applies to this bounding box. */\n crs: string;\n /** `[[w, s], [e, n]]`, indicates the limits of the bounding box using the axis units and order of the specified CRS. */\n boundingBox: [min: [x: number, y: number], max: [x: number, y: number]];\n /** Spatial horizontal resolution of data in same units as bounding box */\n xResolution?: number;\n /** Spatial vertical resolution of data in same units as bounding box */\n yResolution?: number;\n};\n\n/**\n * An optional dimension that can be queried using the `name=...` parameter\n * Note that layers that have at least one dimension without `default` value\n * become unrenderable unless the dimension value is supplied to GetMap requests.\n */\nexport type WMSDimension = {\n /** name of dimension, becomes a valid parameter key for this layer */\n name: string;\n /** Textual units for this dimensional axis */\n units: string;\n /** Unit symbol for this dimensional axis */\n unitSymbol?: string;\n /** Default value if no value is supplied. If dimension lacks defaultValue, requests fail if no value is supplied */\n defaultValue?: string;\n /** Can multiple values of the dimension be requested? */\n multipleValues?: boolean;\n /* Will nearest values will be substituted when out of range, if false exact values are required */\n nearestValue?: boolean;\n /** A special value \"current\" is supported, typically for time dimension */\n current?: boolean;\n /** Text content indicating available values for dimension */\n extent: string;\n};\n\n/** Metadata about a supported WMS request */\nexport type WMSRequest = {\n /** MIMEtypes that can be returned by this request. */\n mimeTypes: string[];\n};\n\nexport type WMSExceptions = {\n /** MIME types for exception response payloads. */\n mimeTypes: string[];\n};\n\nexport type ParseWMSCapabilitiesOptions = {\n /** Add inherited layer information to sub layers */\n inheritedLayerProps?: boolean;\n /** Include the \"raw\" JSON (parsed but untyped, unprocessed XML). May contain additional fields */\n includeRawData?: boolean;\n /** Include the original XML document text. May contain additional information. */\n includeXMLText?: boolean;\n /** @deprecated Use includeRawData` */\n raw?: boolean;\n // xml options are passed through to xml loader\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 parseWMSCapabilities(\n xmlText: string,\n options?: ParseWMSCapabilitiesOptions\n): WMSCapabilities {\n const parsedXML = XMLLoader.parseTextSync?.(xmlText, options);\n const xmlCapabilities: any =\n parsedXML.WMT_MS_Capabilities || parsedXML.WMS_Capabilities || parsedXML;\n const capabilities = extractCapabilities(xmlCapabilities);\n // In case the processed, normalized capabilities do not contain everything,\n // the user can get the parsed XML structure.\n if (options?.inheritedLayerProps) {\n // Traverse layers and inject missing props from parents\n for (const layer of capabilities.layers) {\n addInheritedLayerProps(layer, null);\n }\n // Not yet implemented\n }\n\n if (options?.includeRawData || options?.raw) {\n capabilities.raw = xmlCapabilities;\n }\n\n if (options?.includeXMLText) {\n capabilities.xml = xmlText;\n }\n\n return capabilities;\n}\n\n/** Extract typed capability data from XML */\nfunction extractCapabilities(xml: any): WMSCapabilities {\n const capabilities: WMSCapabilities = {\n version: String(xml.version || ''),\n name: String(xml.Service?.Name || 'unnamed'),\n title: xml.Service?.Title ? String(xml.Service?.Title) : undefined,\n abstract: xml.Service?.Abstract ? String(xml.Service?.Abstract) : undefined,\n keywords: getXMLStringArray(xml.Service?.KeywordList?.Keyword),\n fees: xml.Service?.Fees ? JSON.stringify(xml.Service?.Fees) : undefined,\n accessConstraints: xml.Service?.AccessConstraints\n ? JSON.stringify(xml.Service?.AccessConstraints)\n : undefined,\n layerLimit: getXMLInteger(xml.Service?.LayerLimit),\n maxWidth: getXMLInteger(xml.Service?.maxWidth),\n maxHeight: getXMLInteger(xml.Service?.maxHeight),\n layers: [],\n requests: extractRequests(xml.Capability?.Request),\n exceptions: extractExceptions(xml.Exception)\n // contact field is a mess of largely irrelevant information, put it last\n // contact: xml.Service?.Contact ? JSON.stringify(xml.Service?.Contact) : undefined,\n };\n\n // LAYERS\n const xmlLayers = getXMLArray(xml.Capability?.Layer);\n for (const xmlSubLayer of xmlLayers) {\n capabilities.layers.push(extractLayer(xmlSubLayer));\n }\n\n // Clean up object\n for (const [key, value] of Object.entries(capabilities)) {\n if (value === undefined) {\n delete capabilities[key];\n }\n }\n\n return capabilities;\n}\n\n/** Extract typed request metadata from XML requests field */\nfunction extractRequests(xmlRequests: any): Record<string, WMSRequest> {\n const requests: Record<string, WMSRequest> = {};\n for (const [name, xmlRequest] of Object.entries(xmlRequests || {}) as any) {\n const mimeTypes = getXMLStringArray(xmlRequest?.Format);\n requests[name] = {mimeTypes};\n }\n return requests;\n}\n\nfunction extractExceptions(xmlException: any): WMSExceptions | undefined {\n const xmlExceptionFormats = getXMLArray(xmlException?.Format);\n if (xmlExceptionFormats.length > 0) {\n return {\n mimeTypes: getXMLStringArray(xmlException)\n };\n }\n return undefined;\n}\n\n/** Extract request data */\n// eslint-disable-next-line complexity, max-statements\nfunction extractLayer(xmlLayer: any): WMSLayer {\n const layer: WMSLayer = {\n // All layers must have a title\n title: String(xmlLayer?.Title || ''),\n // Name is required only if renderable\n name: xmlLayer?.Name && String(xmlLayer?.Name),\n abstract: xmlLayer?.Name && String(xmlLayer?.Abstract),\n keywords: getXMLStringArray(xmlLayer.KeywordList?.Keyword)\n };\n\n // WMS 1.3.0 changes SRS to CRS\n const crs = xmlLayer?.CRS || xmlLayer?.SRS;\n if (crs && Array.isArray(crs) && crs.every((_) => typeof _ === 'string')) {\n layer.crs = crs;\n }\n\n // v1.3.0 extract simple geographic bounding box\n let geographicBoundingBox =\n xmlLayer?.EX_GeographicBoundingBox && extractEXBoundingBox(xmlLayer?.EX_GeographicBoundingBox);\n if (geographicBoundingBox) {\n layer.geographicBoundingBox = geographicBoundingBox;\n }\n\n // v1.1.1 extract simple geographic bounding box\n geographicBoundingBox =\n xmlLayer?.LatLonBoundingBox && extractLatLonBoundingBox(xmlLayer?.LatLonBoundingBox);\n if (geographicBoundingBox) {\n layer.geographicBoundingBox = geographicBoundingBox;\n }\n\n // Extract per-CRS bounding boxes\n const boundingBoxes = xmlLayer?.BoundingBox && extractWMSBoundingBoxes(xmlLayer?.BoundingBox);\n if (boundingBoxes && boundingBoxes.length > 0) {\n layer.boundingBoxes = boundingBoxes;\n }\n\n // Extract dimensions\n const xmlDimensions = getXMLArray(xmlLayer?.Dimension);\n const dimensions = xmlDimensions.map((xml) => extractDimension(xml));\n if (dimensions.length) {\n layer.dimensions = dimensions;\n }\n\n if (xmlLayer?.opaque) {\n layer.opaque = getXMLBoolean(xmlLayer?.opaque);\n }\n if (xmlLayer?.cascaded) {\n layer.cascaded = getXMLBoolean(xmlLayer?.cascaded);\n }\n if (xmlLayer?.queryable) {\n layer.queryable = getXMLBoolean(xmlLayer?.queryable);\n }\n\n // Single layer is not represented as array in XML\n const xmlLayers = getXMLArray(xmlLayer?.Layer);\n const layers: WMSLayer[] = [];\n\n for (const xmlSubLayer of xmlLayers) {\n layers.push(extractLayer(xmlSubLayer));\n }\n\n if (layers.length > 0) {\n layer.layers = layers;\n }\n\n // Clean up object\n for (const [key, value] of Object.entries(layer)) {\n if (value === undefined) {\n delete layer[key];\n }\n }\n\n return layer;\n}\n\n/** WMS 1.3.0 Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractEXBoundingBox(xmlBoundingBox: any): [[number, number], [number, number]] {\n const {\n westBoundLongitude: w,\n northBoundLatitude: n,\n eastBoundLongitude: e,\n southBoundLatitude: s\n } = xmlBoundingBox;\n return [\n [w, s],\n [e, n]\n ];\n}\n\n/** WMS 1.1.1 Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractLatLonBoundingBox(xmlBoundingBox: any): [[number, number], [number, number]] {\n const {minx, miny, maxx, maxy} = xmlBoundingBox;\n return [\n [minx, miny],\n [maxx, maxy]\n ];\n}\n\n/** Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractWMSBoundingBoxes(xmlBoundingBoxes: any): WMSBoundingBox[] {\n const xmlBoxes = getXMLArray(xmlBoundingBoxes);\n return xmlBoxes.map((xmlBox) => extractWMSBoundingBox(xmlBox));\n}\n\n/** Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractWMSBoundingBox(xmlBoundingBox: any): WMSBoundingBox {\n const {CRS, SRS, minx, miny, maxx, maxy, resx, resy} = xmlBoundingBox;\n const boundingBox: WMSBoundingBox = {\n // CRS in 1.3.0, SRS in 1.1.1\n crs: CRS || SRS,\n boundingBox: [\n [getXMLFloat(minx) as number, getXMLFloat(miny) as number],\n [getXMLFloat(maxx) as number, getXMLFloat(maxy) as number]\n ]\n };\n if (resx) {\n boundingBox.xResolution = resx;\n }\n if (resy) {\n boundingBox.yResolution = resy;\n }\n return boundingBox;\n}\n\n/**\n * Extracts optional WMS Dimension layer field\n * @param xmlDimension\n * @example <Dimension name=\"time\" units=\"ISO8601\" default=\"2018-01-01\" nearestValue=\"0\">2001-01-01/2018-01-01/P1Y</Dimension>\n * @see https://mapserver.org/ogc/wms_dimension.html\n */\nfunction extractDimension(xmlDimension: any): WMSDimension {\n const {name, units, value: extent} = xmlDimension;\n\n const dimension: WMSDimension = {name, units, extent};\n\n if (xmlDimension.unitSymbol) {\n dimension.unitSymbol = xmlDimension.unitSymbol;\n }\n if (xmlDimension.default) {\n dimension.defaultValue = xmlDimension.default;\n }\n if (xmlDimension.multipleValues) {\n dimension.multipleValues = getXMLBoolean(xmlDimension.multipleValues);\n }\n if (xmlDimension.nearestValue) {\n dimension.nearestValue = getXMLBoolean(xmlDimension.nearestValue);\n }\n if (xmlDimension.current) {\n dimension.current = getXMLBoolean(xmlDimension.current);\n }\n\n return dimension;\n}\n\n/** Traverse layers and inject missing props from parents */\n// eslint-disable-next-line complexity\nfunction addInheritedLayerProps(layer: WMSLayer, parent: WMSLayer | null): void {\n if (parent?.geographicBoundingBox && !layer.geographicBoundingBox) {\n layer.geographicBoundingBox = [...parent.geographicBoundingBox];\n }\n\n if (parent?.crs && !layer.crs) {\n layer.crs = [...parent.crs];\n }\n\n if (parent?.boundingBoxes && !layer.boundingBoxes) {\n layer.boundingBoxes = [...parent.boundingBoxes];\n }\n\n if (parent?.dimensions && !layer.dimensions) {\n layer.dimensions = [...parent.dimensions];\n }\n\n for (const subLayer of layer.layers || []) {\n addInheritedLayerProps(subLayer, layer);\n }\n}\n"],"mappings":"AAEA,SAAQA,SAAS,QAAO,iBAAiB;AACzC,SACEC,WAAW,EACXC,iBAAiB,EACjBC,aAAa,EACbC,WAAW,EACXC,aAAa,QACR,0BAA0B;AAwJjC,OAAO,SAASC,oBAAoBA,CAClCC,OAAe,EACfC,OAAqC,EACpB;EAAA,IAAAC,qBAAA;EACjB,MAAMC,SAAS,IAAAD,qBAAA,GAAGT,SAAS,CAACW,aAAa,cAAAF,qBAAA,uBAAvBA,qBAAA,CAAAG,IAAA,CAAAZ,SAAS,EAAiBO,OAAO,EAAEC,OAAO,CAAC;EAC7D,MAAMK,eAAoB,GACxBH,SAAS,CAACI,mBAAmB,IAAIJ,SAAS,CAACK,gBAAgB,IAAIL,SAAS;EAC1E,MAAMM,YAAY,GAAGC,mBAAmB,CAACJ,eAAe,CAAC;EAGzD,IAAIL,OAAO,aAAPA,OAAO,eAAPA,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+1 @@
1
- {"version":3,"file":"parse-wms-layer-description.js","names":["XMLLoader","parseWMSLayerDescription","text","options","_XMLLoader$parseTextS","parsedXML","parseTextSync","call"],"sources":["../../../../../src/lib/parsers/wms/parse-wms-layer-description.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\n/** Layer description - response to a WMS `DescribeLayer` request */\nexport type WMSLayerDescription = {\n layers: {}[];\n};\n\n/**\n * Parses a typed data structure from raw XML for `GetFeatureInfo` response\n * @note Error handlings is fairly weak\n */\nexport function parseWMSLayerDescription(text: string, options): WMSLayerDescription {\n const parsedXML = XMLLoader.parseTextSync?.(text, options);\n // TODO - implement parser\n return parsedXML as unknown as WMSLayerDescription;\n}\n"],"mappings":"AAEA,SAAQA,SAAS,QAAO,iBAAiB;AAWzC,OAAO,SAASC,wBAAwBA,CAACC,IAAY,EAAEC,OAAO,EAAuB;EAAA,IAAAC,qBAAA;EACnF,MAAMC,SAAS,IAAAD,qBAAA,GAAGJ,SAAS,CAACM,aAAa,cAAAF,qBAAA,uBAAvBA,qBAAA,CAAAG,IAAA,CAAAP,SAAS,EAAiBE,IAAI,EAAEC,OAAO,CAAC;EAE1D,OAAOE,SAAS;AAClB"}
1
+ {"version":3,"file":"parse-wms-layer-description.js","names":["XMLLoader","parseWMSLayerDescription","text","options","_XMLLoader$parseTextS","parsedXML","parseTextSync","call"],"sources":["../../../../../src/lib/parsers/wms/parse-wms-layer-description.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {XMLLoaderOptions} from '@loaders.gl/xml';\nimport {XMLLoader} from '@loaders.gl/xml';\n\n/** Layer description - response to a WMS `DescribeLayer` request */\nexport type WMSLayerDescription = {\n layers: {}[];\n};\n\n/**\n * Parses a typed data structure from raw XML for `GetFeatureInfo` response\n * @note Error handlings is fairly weak\n */\nexport function parseWMSLayerDescription(\n text: string,\n options?: XMLLoaderOptions\n): WMSLayerDescription {\n const parsedXML = XMLLoader.parseTextSync?.(text, options);\n // TODO - implement parser\n return parsedXML as unknown as WMSLayerDescription;\n}\n"],"mappings":"AAGA,SAAQA,SAAS,QAAO,iBAAiB;AAWzC,OAAO,SAASC,wBAAwBA,CACtCC,IAAY,EACZC,OAA0B,EACL;EAAA,IAAAC,qBAAA;EACrB,MAAMC,SAAS,IAAAD,qBAAA,GAAGJ,SAAS,CAACM,aAAa,cAAAF,qBAAA,uBAAvBA,qBAAA,CAAAG,IAAA,CAAAP,SAAS,EAAiBE,IAAI,EAAEC,OAAO,CAAC;EAE1D,OAAOE,SAAS;AAClB"}
@@ -1 +1 @@
1
- {"version":3,"file":"csw-service.js","names":["DataSource","CSWCapabilitiesLoader","CSWRecordsLoader","CSWDomainLoader","WMSErrorLoader","CSWErrorLoader","CSWService","constructor","props","_defineProperty","getMetadata","capabilities","getCapabilities","normalizeMetadata","getServiceDirectory","options","services","unknownServices","records","getRecords","record","reference","references","url","value","scheme","push","name","title","type","_parseOGCUrl","includeUnknown","concat","parts","split","params","wmsParameters","vendorParameters","getCapabilitiesURL","response","fetch","arrayBuffer","_checkResponse","parse","loadOptions","getRecordsURL","getDomain","getDomainURL","version","service","request","_getCSWUrl","typenames","first","key","Object","entries","Array","isArray","toUpperCase","join","String","encodeURI","contentType","headers","ok","mimeTypes","includes","error","parseSync","Error","_parseError","toLowerCase"],"sources":["../../../../../src/lib/services/ogc/csw-service.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n/* eslint-disable camelcase */\n\nimport type {DataSourceProps} from '../../sources/data-source';\nimport {DataSource} from '../../sources/data-source';\n\nimport type {CSWCapabilities} from '../../../csw-capabilities-loader';\nimport {CSWCapabilitiesLoader} from '../../../csw-capabilities-loader';\n\nimport type {CSWRecords} from '../../../csw-records-loader';\nimport {CSWRecordsLoader} from '../../../csw-records-loader';\n\nimport type {CSWDomain} from '../../../csw-domain-loader';\nimport {CSWDomainLoader} from '../../../csw-domain-loader';\n\nimport {WMSErrorLoader as CSWErrorLoader} from '../../../wms-error-loader';\n\ntype CSWCommonParameters = {\n /** In case the endpoint supports multiple services */\n service?: 'CSW';\n /** In case the endpoint supports multiple CSW versions */\n version?: '1.1.1' | '2.0.0' | '2.0.1' | '3.0.0' | '3.0.0';\n};\n\nexport type CSWGetCapabilitiesParameters = CSWCommonParameters & {\n /** Request type */\n request?: 'GetCapabilities';\n};\n\nexport type CSWGetRecordsParameters = CSWCommonParameters & {\n /** Request type */\n request?: 'GetRecords';\n /** type of records */\n typenames: 'csw:Record';\n};\n\nexport type CSWGetDomainParameters = CSWCommonParameters & {\n /** Request type */\n request?: 'GetDomain';\n // TBA\n};\n\nexport type Service = {name: string; type: string; url: string; params?: string; scheme?: string};\n\nexport type CSWServiceProps = DataSourceProps & {\n url: string;\n};\n\n/**\n * The CSWService class provides\n * - provides type safe methods to form URLs to a CSW service\n * - provides type safe methods to query and parse results (and errors) from a CSW service\n * - implements the ImageService interface\n * @note Only the URL parameter conversion is supported. XML posts are not supported.\n */\nexport class CSWService extends DataSource<CSWServiceProps> {\n static type: 'csw' = 'csw';\n static testURL = (url: string): boolean => url.toLowerCase().includes('csw');\n\n capabilities: CSWCapabilities | null = null;\n\n /** A list of loaders used by the CSWService methods */\n readonly loaders = [CSWErrorLoader, CSWCapabilitiesLoader];\n\n /** Create a CSWService */\n constructor(props: CSWServiceProps) {\n super(props);\n }\n\n async getMetadata(): Promise<CSWCapabilities> {\n const capabilities = await this.getCapabilities();\n return this.normalizeMetadata(capabilities);\n }\n\n normalizeMetadata(capabilities: CSWCapabilities): CSWCapabilities {\n return capabilities;\n }\n\n async getServiceDirectory(options?: {includeUnknown?: boolean}): Promise<Service[]> {\n const services: Service[] = [];\n const unknownServices: Service[] = [];\n\n const records = await this.getRecords();\n for (const record of records.records) {\n for (const reference of record.references) {\n const url = reference.value;\n switch (reference.scheme) {\n case 'OGC:WMS':\n services.push({name: record.title, type: 'ogc-wms-service', ...this._parseOGCUrl(url)});\n break;\n case 'OGC:WMTS':\n services.push({\n name: record.title,\n type: 'ogc-wmts-service',\n ...this._parseOGCUrl(url)\n });\n break;\n case 'OGC:WFS':\n services.push({name: record.title, type: 'ogc-wfs-service', ...this._parseOGCUrl(url)});\n break;\n default:\n unknownServices.push({\n name: record.title,\n type: 'unknown',\n url: reference.value,\n scheme: reference.scheme\n });\n }\n }\n }\n\n return options?.includeUnknown ? services.concat(unknownServices) : services;\n }\n\n _parseOGCUrl(url: string): {url: string; params: string} {\n const parts = url.split('?');\n return {\n url: parts[0],\n params: parts[1] || ''\n };\n }\n\n // CSW Service API Stubs\n\n /** Get Capabilities */\n async getCapabilities(\n wmsParameters?: CSWGetCapabilitiesParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<CSWCapabilities> {\n const url = this.getCapabilitiesURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n const capabilities = await CSWCapabilitiesLoader.parse(arrayBuffer, this.props.loadOptions);\n return capabilities;\n }\n\n /** Get Records */\n async getRecords(\n wmsParameters?: CSWGetRecordsParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<CSWRecords> {\n const url = this.getRecordsURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return await CSWRecordsLoader.parse(arrayBuffer, this.props.loadOptions);\n }\n\n /** Get Domain */\n async getDomain(\n wmsParameters?: CSWGetDomainParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<CSWDomain> {\n const url = this.getDomainURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return await CSWDomainLoader.parse(arrayBuffer, this.props.loadOptions);\n }\n\n // Typed URL creators\n // For applications that want full control of fetching and parsing\n\n /** Generate a URL for the GetCapabilities request */\n getCapabilitiesURL(\n wmsParameters?: CSWGetCapabilitiesParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<CSWGetCapabilitiesParameters> = {\n version: '3.0.0',\n ...wmsParameters,\n ...vendorParameters,\n service: 'CSW',\n request: 'GetCapabilities'\n };\n return this._getCSWUrl(options, vendorParameters);\n }\n\n /** Generate a URL for the GetCapabilities request */\n getRecordsURL(\n wmsParameters?: CSWGetRecordsParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<CSWGetRecordsParameters> = {\n version: '3.0.0',\n typenames: 'csw:Record',\n ...wmsParameters,\n ...vendorParameters,\n service: 'CSW',\n request: 'GetRecords'\n };\n return this._getCSWUrl(options, vendorParameters);\n }\n\n /** Generate a URL for the GetCapabilities request */\n getDomainURL(\n wmsParameters?: CSWGetDomainParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<CSWGetDomainParameters> = {\n version: '3.0.0',\n ...wmsParameters,\n ...vendorParameters,\n service: 'CSW',\n request: 'GetDomain'\n };\n return this._getCSWUrl(options, vendorParameters);\n }\n\n // INTERNAL METHODS\n\n /**\n * @note case _getCSWUrl may need to be overridden to handle certain backends?\n * */\n protected _getCSWUrl(\n options: Record<string, unknown>,\n vendorParameters?: Record<string, unknown>\n ): string {\n let url = this.props.url;\n let first = true;\n for (const [key, value] of Object.entries(options)) {\n url += first ? '?' : '&';\n first = false;\n if (Array.isArray(value)) {\n url += `${key.toUpperCase()}=${value.join(',')}`;\n } else {\n url += `${key.toUpperCase()}=${value ? String(value) : ''}`;\n }\n }\n return encodeURI(url);\n }\n\n /** Checks for and parses a CSW XML formatted ServiceError and throws an exception */\n protected _checkResponse(response: Response, arrayBuffer: ArrayBuffer): void {\n const contentType = response.headers['content-type'];\n if (!response.ok || CSWErrorLoader.mimeTypes.includes(contentType)) {\n const error = CSWErrorLoader.parseSync(arrayBuffer, this.props.loadOptions);\n throw new Error(error);\n }\n }\n\n /** Error situation detected */\n protected _parseError(arrayBuffer: ArrayBuffer): Error {\n const error = CSWErrorLoader.parseSync(arrayBuffer, this.props.loadOptions);\n return new Error(error);\n }\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IACA,OAAOsC,SAAS,CAACvC,GAAG,CAAC;EACvB;EAGUmB,cAAcA,CAACH,QAAkB,EAAEE,WAAwB,EAAQ;IAC3E,MAAMsB,WAAW,GAAGxB,QAAQ,CAACyB,OAAO,CAAC,cAAc,CAAC;IACpD,IAAI,CAACzB,QAAQ,CAAC0B,EAAE,IAAI5D,cAAc,CAAC6D,SAAS,CAACC,QAAQ,CAACJ,WAAW,CAAC,EAAE;MAClE,MAAMK,KAAK,GAAG/D,cAAc,CAACgE,SAAS,CAAC5B,WAAW,EAAE,IAAI,CAACjC,KAAK,CAACoC,WAAW,CAAC;MAC3E,MAAM,IAAI0B,KAAK,CAACF,KAAK,CAAC;IACxB;EACF;EAGUG,WAAWA,CAAC9B,WAAwB,EAAS;IACrD,MAAM2B,KAAK,GAAG/D,cAAc,CAACgE,SAAS,CAAC5B,WAAW,EAAE,IAAI,CAACjC,KAAK,CAACoC,WAAW,CAAC;IAC3E,OAAO,IAAI0B,KAAK,CAACF,KAAK,CAAC;EACzB;AACF;AAAC3D,eAAA,CAhMYH,UAAU,UACA,KAAK;AAAAG,eAAA,CADfH,UAAU,aAEHiB,GAAW,IAAcA,GAAG,CAACiD,WAAW,CAAC,CAAC,CAACL,QAAQ,CAAC,KAAK,CAAC"}
1
+ {"version":3,"file":"csw-service.js","names":["DataSource","CSWCapabilitiesLoader","CSWRecordsLoader","CSWDomainLoader","WMSErrorLoader","CSWErrorLoader","CSWService","constructor","props","_defineProperty","getMetadata","capabilities","getCapabilities","normalizeMetadata","getServiceDirectory","options","services","unknownServices","records","getRecords","record","reference","references","url","value","scheme","push","name","title","type","_parseOGCUrl","includeUnknown","concat","parts","split","params","wmsParameters","vendorParameters","getCapabilitiesURL","response","fetch","arrayBuffer","_checkResponse","parse","loadOptions","getRecordsURL","getDomain","getDomainURL","version","service","request","_getCSWUrl","typenames","first","key","Object","entries","Array","isArray","toUpperCase","join","String","encodeURI","contentType","headers","ok","mimeTypes","includes","error","parseSync","Error","_parseError","toLowerCase"],"sources":["../../../../../src/lib/services/ogc/csw-service.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n/* eslint-disable camelcase */\n\nimport type {DataSourceProps} from '../../sources/data-source';\nimport {DataSource} from '../../sources/data-source';\n\nimport type {CSWCapabilities} from '../../../csw-capabilities-loader';\nimport {CSWCapabilitiesLoader} from '../../../csw-capabilities-loader';\n\nimport type {CSWRecords} from '../../../csw-records-loader';\nimport {CSWRecordsLoader} from '../../../csw-records-loader';\n\nimport type {CSWDomain} from '../../../csw-domain-loader';\nimport {CSWDomainLoader} from '../../../csw-domain-loader';\n\nimport {WMSErrorLoader as CSWErrorLoader} from '../../../wms-error-loader';\n\ntype CSWCommonParameters = {\n /** In case the endpoint supports multiple services */\n service?: 'CSW';\n /** In case the endpoint supports multiple CSW versions */\n version?: '1.1.1' | '2.0.0' | '2.0.1' | '3.0.0';\n};\n\nexport type CSWGetCapabilitiesParameters = CSWCommonParameters & {\n /** Request type */\n request?: 'GetCapabilities';\n};\n\nexport type CSWGetRecordsParameters = CSWCommonParameters & {\n /** Request type */\n request?: 'GetRecords';\n /** type of records */\n typenames: 'csw:Record';\n};\n\nexport type CSWGetDomainParameters = CSWCommonParameters & {\n /** Request type */\n request?: 'GetDomain';\n // TBA\n};\n\n/** Describes a service or resource exposed by the catalog */\nexport type Service = {\n /** name of service or resource */\n name: string;\n /** type of service or resource */\n type: string;\n url: string;\n params?: string;\n scheme?: string;\n};\n\nexport type CSWServiceProps = DataSourceProps & {\n url: string;\n};\n\n/**\n * The CSWService class\n * - provides type safe methods to form URLs to a CSW service\n * - provides type safe methods to query and parse results (and errors) from a CSW service\n * @note Only the URL parameter conversion is supported. XML posts are not supported.\n */\nexport class CSWService extends DataSource<CSWServiceProps> {\n static type: 'csw' = 'csw';\n static testURL = (url: string): boolean => url.toLowerCase().includes('csw');\n\n capabilities: CSWCapabilities | null = null;\n\n /** A list of loaders used by the CSWService methods */\n readonly loaders = [CSWErrorLoader, CSWCapabilitiesLoader];\n\n /** Create a CSWService */\n constructor(props: CSWServiceProps) {\n super(props);\n }\n\n async getMetadata(): Promise<CSWCapabilities> {\n const capabilities = await this.getCapabilities();\n return this.normalizeMetadata(capabilities);\n }\n\n normalizeMetadata(capabilities: CSWCapabilities): CSWCapabilities {\n return capabilities;\n }\n\n async getServiceDirectory(options?: {includeUnknown?: boolean}): Promise<Service[]> {\n const services: Service[] = [];\n const unknownServices: Service[] = [];\n\n const records = await this.getRecords();\n for (const record of records.records) {\n for (const reference of record.references) {\n const url = reference.value;\n switch (reference.scheme) {\n case 'OGC:WMS':\n services.push({name: record.title, type: 'ogc-wms-service', ...this._parseOGCUrl(url)});\n break;\n case 'OGC:WMTS':\n services.push({\n name: record.title,\n type: 'ogc-wmts-service',\n ...this._parseOGCUrl(url)\n });\n break;\n case 'OGC:WFS':\n services.push({name: record.title, type: 'ogc-wfs-service', ...this._parseOGCUrl(url)});\n break;\n default:\n unknownServices.push({\n name: record.title,\n type: 'unknown',\n url: reference.value,\n scheme: reference.scheme\n });\n }\n }\n }\n\n return options?.includeUnknown ? services.concat(unknownServices) : services;\n }\n\n _parseOGCUrl(url: string): {url: string; params: string} {\n const parts = url.split('?');\n return {\n url: parts[0],\n params: parts[1] || ''\n };\n }\n\n // CSW Service API Stubs\n\n /** Get Capabilities */\n async getCapabilities(\n wmsParameters?: CSWGetCapabilitiesParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<CSWCapabilities> {\n const url = this.getCapabilitiesURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n const capabilities = await CSWCapabilitiesLoader.parse(arrayBuffer, this.props.loadOptions);\n return capabilities;\n }\n\n /** Get Records */\n async getRecords(\n wmsParameters?: CSWGetRecordsParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<CSWRecords> {\n const url = this.getRecordsURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return await CSWRecordsLoader.parse(arrayBuffer, this.props.loadOptions);\n }\n\n /** Get Domain */\n async getDomain(\n wmsParameters?: CSWGetDomainParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<CSWDomain> {\n const url = this.getDomainURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return await CSWDomainLoader.parse(arrayBuffer, this.props.loadOptions);\n }\n\n // Typed URL creators\n // For applications that want full control of fetching and parsing\n\n /** Generate a URL for the GetCapabilities request */\n getCapabilitiesURL(\n wmsParameters?: CSWGetCapabilitiesParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<CSWGetCapabilitiesParameters> = {\n version: '3.0.0',\n ...wmsParameters,\n ...vendorParameters,\n service: 'CSW',\n request: 'GetCapabilities'\n };\n return this._getCSWUrl(options, vendorParameters);\n }\n\n /** Generate a URL for the GetCapabilities request */\n getRecordsURL(\n wmsParameters?: CSWGetRecordsParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<CSWGetRecordsParameters> = {\n version: '3.0.0',\n typenames: 'csw:Record',\n ...wmsParameters,\n ...vendorParameters,\n service: 'CSW',\n request: 'GetRecords'\n };\n return this._getCSWUrl(options, vendorParameters);\n }\n\n /** Generate a URL for the GetCapabilities request */\n getDomainURL(\n wmsParameters?: CSWGetDomainParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<CSWGetDomainParameters> = {\n version: '3.0.0',\n ...wmsParameters,\n ...vendorParameters,\n service: 'CSW',\n request: 'GetDomain'\n };\n return this._getCSWUrl(options, vendorParameters);\n }\n\n // INTERNAL METHODS\n\n /**\n * @note case _getCSWUrl may need to be overridden to handle certain backends?\n * */\n protected _getCSWUrl(\n options: Record<string, unknown>,\n vendorParameters?: Record<string, unknown>\n ): string {\n let url = this.props.url;\n let first = true;\n for (const [key, value] of Object.entries(options)) {\n url += first ? '?' : '&';\n first = false;\n if (Array.isArray(value)) {\n url += `${key.toUpperCase()}=${value.join(',')}`;\n } else {\n url += `${key.toUpperCase()}=${value ? String(value) : ''}`;\n }\n }\n return encodeURI(url);\n }\n\n /** Checks for and parses a CSW XML formatted ServiceError and throws an exception */\n protected _checkResponse(response: Response, arrayBuffer: ArrayBuffer): void {\n const contentType = response.headers['content-type'];\n if (!response.ok || CSWErrorLoader.mimeTypes.includes(contentType)) {\n const error = CSWErrorLoader.parseSync(arrayBuffer, this.props.loadOptions);\n throw new Error(error);\n }\n }\n\n /** Error situation detected */\n protected _parseError(arrayBuffer: ArrayBuffer): Error {\n const error = CSWErrorLoader.parseSync(arrayBuffer, this.props.loadOptions);\n return new Error(error);\n }\n}\n"],"mappings":";AAKA,SAAQA,UAAU,QAAO,2BAA2B;AAGpD,SAAQC,qBAAqB,QAAO,kCAAkC;AAGtE,SAAQC,gBAAgB,QAAO,6BAA6B;AAG5D,SAAQC,eAAe,QAAO,4BAA4B;AAE1D,SAAQC,cAAc,IAAIC,cAAc,QAAO,2BAA2B;AAgD1E,OAAO,MAAMC,UAAU,SAASN,UAAU,CAAkB;EAU1DO,WAAWA,CAACC,KAAsB,EAAE;IAClC,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,uBAPwB,IAAI;IAAAA,eAAA,kBAGxB,CAACJ,cAAc,EAAEJ,qBAAqB,CAAC;EAK1D;EAEA,MAAMS,WAAWA,CAAA,EAA6B;IAC5C,MAAMC,YAAY,GAAG,MAAM,IAAI,CAACC,eAAe,CAAC,CAAC;IACjD,OAAO,IAAI,CAACC,iBAAiB,CAACF,YAAY,CAAC;EAC7C;EAEAE,iBAAiBA,CAACF,YAA6B,EAAmB;IAChE,OAAOA,YAAY;EACrB;EAEA,MAAMG,mBAAmBA,CAACC,OAAoC,EAAsB;IAClF,MAAMC,QAAmB,GAAG,EAAE;IAC9B,MAAMC,eAA0B,GAAG,EAAE;IAErC,MAAMC,OAAO,GAAG,MAAM,IAAI,CAAC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,CAAC"}
@@ -29,6 +29,8 @@ export class WMSService extends ImageSource {
29
29
  format: 'image/png',
30
30
  info_format: 'text/plain',
31
31
  transparent: undefined,
32
+ time: undefined,
33
+ elevation: undefined,
32
34
  ...props.wmsParameters
33
35
  };
34
36
  this.vendorParameters = props.vendorParameters || {};
@@ -108,6 +110,8 @@ export class WMSService extends ImageSource {
108
110
  version: this.wmsParameters.version,
109
111
  format: this.wmsParameters.format,
110
112
  transparent: this.wmsParameters.transparent,
113
+ time: this.wmsParameters.time,
114
+ elevation: this.wmsParameters.elevation,
111
115
  layers: this.wmsParameters.layers,
112
116
  styles: this.wmsParameters.styles,
113
117
  crs: this.wmsParameters.crs,
@@ -165,8 +169,9 @@ export class WMSService extends ImageSource {
165
169
  ...this.vendorParameters,
166
170
  ...vendorParameters
167
171
  };
172
+ const IGNORE_EMPTY_KEYS = ['transparent', 'time', 'elevation'];
168
173
  for (const [key, value] of Object.entries(allParameters)) {
169
- if (key !== 'transparent' || value) {
174
+ if (!IGNORE_EMPTY_KEYS.includes(key) || value) {
170
175
  url += first ? '?' : '&';
171
176
  first = false;
172
177
  url += this._getURLParameter(key, value, wmsParameters);
@@ -1 +1 @@
1
- {"version":3,"file":"wms-service.js","names":["ImageLoader","mergeLoaderOptions","ImageSource","WMSCapabilitiesLoader","WMSFeatureInfoLoader","WMSLayerDescriptionLoader","WMSErrorLoader","WMSService","constructor","props","_props$substituteCRS","_defineProperty","url","substituteCRS84","flipCRS","wmsParameters","layers","undefined","query_layers","styles","version","crs","format","info_format","transparent","vendorParameters","getMetadata","capabilities","getCapabilities","normalizeMetadata","getImage","parameters","getMap","getCapabilitiesURL","response","fetch","arrayBuffer","_checkResponse","parse","loadOptions","getMapURL","_parseError","getFeatureInfo","getFeatureInfoURL","getFeatureInfoText","TextDecoder","decode","describeLayer","describeLayerURL","getLegendGraphic","getLegendGraphicURL","options","_getWMSUrl","_getWMS130Parameters","_parseWMSUrl","baseUrl","search","split","searchParams","parameter","key","value","request","first","allParameters","service","Object","entries","_getURLParameter","encodeURI","newParameters","srs","bbox","_flipBoundingBox","toUpperCase","Array","isArray","concat","join","String","bboxValue","length","flipCoordinates","includes","_fetchArrayBuffer","contentType","headers","ok","mimeTypes","wms","throwOnError","error","parseSync","Error","toLowerCase"],"sources":["../../../../../src/lib/services/ogc/wms-service.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n/* eslint-disable camelcase */\nimport type {ImageType} from '@loaders.gl/images';\nimport {ImageLoader} from '@loaders.gl/images';\nimport {mergeLoaderOptions} from '@loaders.gl/loader-utils';\n\nimport type {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/**\n * \"Static\" WMS parameters (not viewport or selected pixel dependent)\n * These can be provided as defaults in the WMSService constructor\n */\nexport type WMSParameters = {\n /** WMS version (all requests) */\n version?: '1.3.0' | '1.1.1';\n /** Layers to render (GetMap, GetFeatureInfo) */\n layers?: string[];\n /** list of layers to query.. (GetFeatureInfo) */\n query_layers?: string[];\n\n /** Coordinate Reference System (CRS) for the image (not the bounding box) */\n crs?: string;\n /** Requested format for the return image (GetMap, GetLegendGraphic) */\n format?: 'image/png';\n /** Requested MIME type of returned feature info (GetFeatureInfo) */\n info_format?: 'text/plain' | 'application/geojson' | 'application/vnd.ogc.gml';\n /** Styling - Not yet supported */\n styles?: unknown;\n /** Any additional parameters specific to this WMSService (GetMap) */\n transparent?: boolean;\n};\n\n/** Parameters for GetCapabilities */\nexport type WMSGetCapabilitiesParameters = {\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.3.0' | '1.1.1';\n};\n\n/** Parameters for GetMap */\nexport type WMSGetMapParameters = {\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.3.0' | '1.1.1';\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** Layers to render - can be provided in service constructor */\n layers?: string | string[];\n /** Coordinate Reference System for the image (not bounding box). can be provided in service constructor. */\n crs?: string;\n /** Styling. can be provided in service constructor */\n styles?: unknown;\n /** Don't render background when no data. can be provided in service constructor */\n transparent?: boolean;\n /** requested format for the return image. can be provided in service constructor */\n format?: 'image/png';\n};\n\n/** GetMap parameters that are specific to the current view */\nexport type WMSGetMapViewParameters = {\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n /** Coordinate Reference System for the image (not bounding box). can be provided in service constructor. */\n crs?: string;\n};\n\n/**\n * Parameters for GetFeatureInfo\n * @see https://imagery.pasda.psu.edu/arcgis/services/pasda/UrbanTreeCanopy_Landcover/MapServer/WmsServer?SERVICE=WMS&\n */\nexport type WMSGetFeatureInfoParameters = {\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.3.0' | '1.1.1';\n /** x coordinate for the feature info request */\n x: number;\n /** y coordinate for the feature info request */\n y: number;\n /** MIME type of returned feature info. Can be specified in service constructor */\n info_format?: 'text/plain' | 'application/geojson' | 'application/vnd.ogc.gml';\n /** list of layers to query. Required but can be specified in service constructor. */\n query_layers?: string[];\n /** Layers to render. Required, but can be specified in service constructor */\n layers?: string[];\n /** Styling */\n styles?: unknown;\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** srs for the image (not the bounding box) */\n crs?: string;\n};\n\n/** GetMap parameters that are specific to the current view */\nexport type WMSGetFeatureInfoViewParameters = {\n /** x coordinate for the feature info request */\n x: number;\n /** y coordinate for the feature info request */\n y: number;\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n /** srs for the image (not the bounding box) */\n crs?: string;\n};\n\n/** Parameters for DescribeLayer */\nexport type WMSDescribeLayerParameters = {\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.3.0' | '1.1.1';\n};\n\n/** Parameters for GetLegendGraphic */\nexport type WMSGetLegendGraphicParameters = {\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.3.0' | '1.1.1';\n};\n\n//\n\n/** Properties for creating a enw WMS service */\nexport type WMSServiceProps = ImageSourceProps & {\n /** Base URL to the service */\n url: string;\n /** In 1.3.0, replaces references to EPSG:4326 with CRS:84 */\n substituteCRS84?: boolean;\n\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<WMSServiceProps> {\n static type: 'wms' = 'wms';\n static testURL = (url: string): boolean => url.toLowerCase().includes('wms');\n\n /** Base URL to the service */\n readonly url: string;\n\n /** In WMS 1.3.0, replaces references to EPSG:4326 with CRS:84. But not always supported. Default: false */\n substituteCRS84: boolean;\n /** In WMS 1.3.0, flips x,y (lng, lat) coordinates for the supplied coordinate systems. Default: ['ESPG:4326'] */\n flipCRS: string[];\n\n /** Default static WMS parameters */\n wmsParameters: Required<WMSParameters>;\n /** Default static vendor parameters */\n vendorParameters?: Record<string, unknown>;\n\n capabilities: WMSCapabilities | null = null;\n\n /** 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.substituteCRS84 = props.substituteCRS84 ?? false;\n this.flipCRS = ['EPSG:4326'];\n\n this.wmsParameters = {\n layers: undefined!,\n query_layers: undefined!,\n styles: undefined,\n version: '1.3.0',\n crs: 'EPSG:4326',\n format: 'image/png',\n info_format: 'text/plain',\n transparent: undefined!,\n ...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 return await this.getMap(parameters);\n }\n\n normalizeMetadata(capabilities: WMSCapabilities): ImageSourceMetadata {\n return capabilities;\n }\n\n // WMS Service API Stubs\n\n /** Get Capabilities */\n async getCapabilities(\n wmsParameters?: WMSGetCapabilitiesParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<WMSCapabilities> {\n const url = this.getCapabilitiesURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n const capabilities = await WMSCapabilitiesLoader.parse(arrayBuffer, this.loadOptions);\n this.capabilities = capabilities;\n return capabilities;\n }\n\n /** Get a map image */\n async getMap(\n wmsParameters: WMSGetMapParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<ImageType> {\n const url = this.getMapURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n try {\n return await ImageLoader.parse(arrayBuffer, this.loadOptions);\n } catch {\n throw this._parseError(arrayBuffer);\n }\n }\n\n /** Get Feature Info for a coordinate */\n async getFeatureInfo(\n wmsParameters: WMSGetFeatureInfoParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<WMSFeatureInfo> {\n const url = this.getFeatureInfoURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return await WMSFeatureInfoLoader.parse(arrayBuffer, this.loadOptions);\n }\n\n /** Get Feature Info for a coordinate */\n async getFeatureInfoText(\n wmsParameters: WMSGetFeatureInfoParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<string> {\n const url = this.getFeatureInfoURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return new TextDecoder().decode(arrayBuffer);\n }\n\n /** Get more information about a layer */\n async describeLayer(\n wmsParameters: WMSDescribeLayerParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<WMSLayerDescription> {\n const url = this.describeLayerURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return await WMSLayerDescriptionLoader.parse(arrayBuffer, this.loadOptions);\n }\n\n /** Get an image with a semantic legend */\n async getLegendGraphic(\n wmsParameters: WMSGetLegendGraphicParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<ImageType> {\n const url = this.getLegendGraphicURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n try {\n return await ImageLoader.parse(arrayBuffer, this.loadOptions);\n } catch {\n throw this._parseError(arrayBuffer);\n }\n }\n\n // Typed URL creators\n // For applications that want full control of fetching and parsing\n\n /** Generate a URL for the GetCapabilities request */\n getCapabilitiesURL(\n wmsParameters?: WMSGetCapabilitiesParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSGetCapabilitiesParameters> = {\n version: this.wmsParameters.version,\n ...wmsParameters\n };\n return this._getWMSUrl('GetCapabilities', options, vendorParameters);\n }\n\n /** Generate a URL for the GetMap request */\n getMapURL(\n wmsParameters: WMSGetMapParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n wmsParameters = this._getWMS130Parameters(wmsParameters);\n const options: Required<WMSGetMapParameters> = {\n version: this.wmsParameters.version,\n format: this.wmsParameters.format,\n transparent: this.wmsParameters.transparent,\n layers: this.wmsParameters.layers,\n styles: this.wmsParameters.styles,\n crs: this.wmsParameters.crs,\n // bbox: [-77.87304, 40.78975, -77.85828, 40.80228],\n // width: 1200,\n // height: 900,\n ...wmsParameters\n };\n return this._getWMSUrl('GetMap', options, vendorParameters);\n }\n\n /** Generate a URL for the GetFeatureInfo request */\n getFeatureInfoURL(\n wmsParameters: WMSGetFeatureInfoParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSGetFeatureInfoParameters> = {\n version: this.wmsParameters.version,\n // query_layers: [],\n // format: this.wmsParameters.format,\n info_format: this.wmsParameters.info_format,\n layers: this.wmsParameters.layers,\n query_layers: this.wmsParameters.query_layers,\n styles: this.wmsParameters.styles,\n crs: this.wmsParameters.crs,\n // bbox: [-77.87304, 40.78975, -77.85828, 40.80228],\n // width: 1200,\n // height: 900,\n // x: undefined!,\n // y: undefined!,\n ...wmsParameters\n };\n return this._getWMSUrl('GetFeatureInfo', options, vendorParameters);\n }\n\n /** Generate a URL for the GetFeatureInfo request */\n describeLayerURL(\n wmsParameters: WMSDescribeLayerParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSDescribeLayerParameters> = {\n version: this.wmsParameters.version,\n ...wmsParameters\n };\n return this._getWMSUrl('DescribeLayer', options, vendorParameters);\n }\n\n getLegendGraphicURL(\n wmsParameters: WMSGetLegendGraphicParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSGetLegendGraphicParameters> = {\n version: this.wmsParameters.version,\n // format?\n ...wmsParameters\n };\n return this._getWMSUrl('GetLegendGraphic', options, vendorParameters);\n }\n\n // INTERNAL METHODS\n\n _parseWMSUrl(url: string): {url: string; parameters: Record<string, unknown>} {\n const [baseUrl, search] = url.split('?');\n const searchParams = search.split('&');\n\n const parameters: Record<string, unknown> = {};\n for (const parameter of searchParams) {\n const [key, value] = parameter.split('=');\n parameters[key] = value;\n }\n\n return {url: baseUrl, parameters};\n }\n\n /**\n * Generate a URL with parameters\n * @note case _getWMSUrl may need to be overridden to handle certain backends?\n * @note at the moment, only URLs with parameters are supported (no XML payloads)\n * */\n protected _getWMSUrl(\n request: string,\n wmsParameters: {version?: '1.3.0' | '1.1.1'; [key: string]: unknown},\n vendorParameters?: Record<string, unknown>\n ): string {\n let url = this.url;\n let first = true;\n\n // Add any vendor searchParams\n const allParameters = {\n service: 'WMS',\n version: wmsParameters.version,\n request,\n ...wmsParameters,\n ...this.vendorParameters,\n ...vendorParameters\n };\n\n // Encode the keys\n 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._getURLParameter(key, value, wmsParameters);\n }\n }\n\n return encodeURI(url);\n }\n\n _getWMS130Parameters<ParametersT extends {crs?: string; srs?: string}>(\n wmsParameters: ParametersT\n ): ParametersT {\n const newParameters = {...wmsParameters};\n if (newParameters.srs) {\n newParameters.crs = newParameters.crs || newParameters.srs;\n delete newParameters.srs;\n }\n return newParameters;\n }\n\n // eslint-disable-complexity\n _getURLParameter(key: string, value: unknown, wmsParameters: WMSParameters): string {\n // Substitute by key\n switch (key) {\n case 'crs':\n // CRS was called SRS before WMS 1.3.0\n if (wmsParameters.version !== '1.3.0') {\n key = 'srs';\n } else if (this.substituteCRS84 && value === 'EPSG:4326') {\n /** In 1.3.0, replaces references to 'EPSG:4326' with the new backwards compatible CRS:84 */\n // Substitute by value\n value = 'CRS:84';\n }\n break;\n\n case 'srs':\n // CRS was called SRS before WMS 1.3.0\n if (wmsParameters.version === '1.3.0') {\n key = 'crs';\n }\n break;\n\n case 'bbox':\n // Coordinate order is flipped for certain CRS in WMS 1.3.0\n const bbox = this._flipBoundingBox(value, wmsParameters);\n if (bbox) {\n value = bbox;\n }\n break;\n\n default:\n // do nothing\n }\n\n key = key.toUpperCase();\n\n return Array.isArray(value)\n ? `${key}=${value.join(',')}`\n : `${key}=${value ? String(value) : ''}`;\n }\n\n /** Coordinate order is flipped for certain CRS in WMS 1.3.0 */\n _flipBoundingBox(\n bboxValue: unknown,\n wmsParameters: WMSParameters\n ): [number, number, number, number] | null {\n // Sanity checks\n if (!Array.isArray(bboxValue) || bboxValue.length !== 4) {\n return null;\n }\n\n const flipCoordinates =\n // Only affects WMS 1.3.0\n wmsParameters.version === '1.3.0' &&\n // Flip if we are dealing with a CRS that was flipped in 1.3.0\n this.flipCRS.includes(wmsParameters.crs || '') &&\n // Don't flip if we are subsituting EPSG:4326 with CRS:84\n !(this.substituteCRS84 && wmsParameters.crs === 'EPSG:4326');\n\n const bbox = bboxValue as [number, number, number, number];\n return flipCoordinates ? [bbox[1], bbox[0], bbox[3], bbox[2]] : bbox;\n }\n\n /** Fetches an array buffer and checks the response (boilerplate reduction) */\n protected async _fetchArrayBuffer(url: string): Promise<ArrayBuffer> {\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return arrayBuffer;\n }\n\n /** Checks for and parses a WMS XML formatted ServiceError and throws an exception */\n protected _checkResponse(response: Response, arrayBuffer: ArrayBuffer): void {\n const contentType = response.headers['content-type'];\n if (!response.ok || WMSErrorLoader.mimeTypes.includes(contentType)) {\n // We want error responses to throw exceptions, the WMSErrorLoader can do this\n const loadOptions = mergeLoaderOptions<WMSLoaderOptions>(this.loadOptions, {\n wms: {throwOnError: true}\n });\n const error = WMSErrorLoader.parseSync(arrayBuffer, loadOptions);\n throw new Error(error);\n }\n }\n\n /** Error situation detected */\n protected _parseError(arrayBuffer: ArrayBuffer): Error {\n const error = WMSErrorLoader.parseSync(arrayBuffer, this.loadOptions);\n return new Error(error);\n }\n}\n"],"mappings":";AAIA,SAAQA,WAAW,QAAO,oBAAoB;AAC9C,SAAQC,kBAAkB,QAAO,0BAA0B;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;AAiJxD,OAAO,MAAMC,UAAU,SAASL,WAAW,CAAkB;EA6B3DM,WAAWA,CAACC,KAAsB,EAAE;IAAA,IAAAC,oBAAA;IAClC,KAAK,CAACD,KAAK,CAAC;IAACE,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,uBAbwB,IAAI;IAAAA,eAAA,kBAGxB,CACjBX,WAAW,EACXM,cAAc,EACdH,qBAAqB,EACrBC,oBAAoB,EACpBC,yBAAyB,CAC1B;IAUC,IAAI,CAACO,GAAG,GAAGH,KAAK,CAACG,GAAG;IAEpB,IAAI,CAACC,eAAe,IAAAH,oBAAA,GAAGD,KAAK,CAACI,eAAe,cAAAH,oBAAA,cAAAA,oBAAA,GAAI,KAAK;IACrD,IAAI,CAACI,OAAO,GAAG,CAAC,WAAW,CAAC;IAE5B,IAAI,CAACC,aAAa,GAAG;MACnBC,MAAM,EAAEC,SAAU;MAClBC,YAAY,EAAED,SAAU;MACxBE,MAAM,EAAEF,SAAS;MACjBG,OAAO,EAAE,OAAO;MAChBC,GAAG,EAAE,WAAW;MAChBC,MAAM,EAAE,WAAW;MACnBC,WAAW,EAAE,YAAY;MACzBC,WAAW,EAAEP,SAAU;MACvB,GAAGR,KAAK,CAACM;IACX,CAAC;IAED,IAAI,CAACU,gBAAgB,GAAGhB,KAAK,CAACgB,gBAAgB,IAAI,CAAC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AACsF,SAAS,CAACxD,WAAW,EAAE,IAAI,CAACG,WAAW,CAAC;IACrE,OAAO,IAAIsD,KAAK,CAACF,KAAK,CAAC;EACzB;AACF;AAAChF,eAAA,CArYYJ,UAAU,UACA,KAAK;AAAAI,eAAA,CADfJ,UAAU,aAEHK,GAAW,IAAcA,GAAG,CAACkF,WAAW,CAAC,CAAC,CAACX,QAAQ,CAAC,KAAK,CAAC"}
1
+ {"version":3,"file":"wms-service.js","names":["ImageLoader","mergeLoaderOptions","ImageSource","WMSCapabilitiesLoader","WMSFeatureInfoLoader","WMSLayerDescriptionLoader","WMSErrorLoader","WMSService","constructor","props","_props$substituteCRS","_defineProperty","url","substituteCRS84","flipCRS","wmsParameters","layers","undefined","query_layers","styles","version","crs","format","info_format","transparent","time","elevation","vendorParameters","getMetadata","capabilities","getCapabilities","normalizeMetadata","getImage","parameters","getMap","getCapabilitiesURL","response","fetch","arrayBuffer","_checkResponse","parse","loadOptions","getMapURL","_parseError","getFeatureInfo","getFeatureInfoURL","getFeatureInfoText","TextDecoder","decode","describeLayer","describeLayerURL","getLegendGraphic","getLegendGraphicURL","options","_getWMSUrl","_getWMS130Parameters","_parseWMSUrl","baseUrl","search","split","searchParams","parameter","key","value","request","first","allParameters","service","IGNORE_EMPTY_KEYS","Object","entries","includes","_getURLParameter","encodeURI","newParameters","srs","bbox","_flipBoundingBox","toUpperCase","Array","isArray","concat","join","String","bboxValue","length","flipCoordinates","_fetchArrayBuffer","contentType","headers","ok","mimeTypes","wms","throwOnError","error","parseSync","Error","toLowerCase"],"sources":["../../../../../src/lib/services/ogc/wms-service.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n/* eslint-disable camelcase */\nimport type {ImageType} from '@loaders.gl/images';\nimport {ImageLoader} from '@loaders.gl/images';\nimport {mergeLoaderOptions} from '@loaders.gl/loader-utils';\n\nimport type {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/**\n * \"Static\" WMS parameters (not viewport or selected pixel dependent)\n * These can be provided as defaults in the WMSService constructor\n */\nexport type WMSParameters = {\n /** WMS version (all requests) */\n version?: '1.3.0' | '1.1.1';\n /** Layers to render (GetMap, GetFeatureInfo) */\n layers?: string[];\n /** list of layers to query.. (GetFeatureInfo) */\n query_layers?: string[];\n\n /** Coordinate Reference System (CRS) for the image (not the bounding box) */\n crs?: string;\n /** Requested format for the return image (GetMap, GetLegendGraphic) */\n format?: 'image/png';\n /** Requested MIME type of returned feature info (GetFeatureInfo) */\n info_format?: 'text/plain' | 'application/geojson' | 'application/vnd.ogc.gml';\n /** Styling - Not yet supported */\n styles?: unknown;\n /** Any additional parameters specific to this WMSService (GetMap) */\n transparent?: boolean;\n /** If layer supports time dimension */\n time?: string;\n /** If layer supports elevation dimension */\n elevation?: string;\n};\n\n/** Parameters for GetCapabilities */\nexport type WMSGetCapabilitiesParameters = {\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.3.0' | '1.1.1';\n};\n\n/** Parameters for GetMap */\nexport type WMSGetMapParameters = {\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.3.0' | '1.1.1';\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** requested format for the return image. can be provided in service constructor */\n format?: 'image/png';\n /** Layers to render - can be provided in service constructor */\n layers?: string | string[];\n /** Coordinate Reference System for the image (not bounding box). can be provided in service constructor. */\n crs?: string;\n /** Styling. can be provided in service constructor */\n styles?: unknown;\n /** Don't render background when no data. can be provided in service constructor */\n transparent?: boolean;\n /** If layer supports time dimension */\n time?: string;\n /** If layer supports elevation dimension */\n elevation?: string;\n};\n\n/** GetMap parameters that are specific to the current view */\nexport type WMSGetMapViewParameters = {\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n /** Coordinate Reference System for the image (not bounding box). can be provided in service constructor. */\n crs?: string;\n};\n\n/**\n * Parameters for GetFeatureInfo\n * @see https://imagery.pasda.psu.edu/arcgis/services/pasda/UrbanTreeCanopy_Landcover/MapServer/WmsServer?SERVICE=WMS&\n */\nexport type WMSGetFeatureInfoParameters = {\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.3.0' | '1.1.1';\n /** x coordinate for the feature info request */\n x: number;\n /** y coordinate for the feature info request */\n y: number;\n /** MIME type of returned feature info. Can be specified in service constructor */\n info_format?: 'text/plain' | 'application/geojson' | 'application/vnd.ogc.gml';\n /** list of layers to query. Required but can be specified in service constructor. */\n query_layers?: string[];\n /** Layers to render. Required, but can be specified in service constructor */\n layers?: string[];\n /** Styling */\n styles?: unknown;\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** srs for the image (not the bounding box) */\n crs?: string;\n};\n\n/** GetMap parameters that are specific to the current view */\nexport type WMSGetFeatureInfoViewParameters = {\n /** x coordinate for the feature info request */\n x: number;\n /** y coordinate for the feature info request */\n y: number;\n /** pixel width of returned image */\n width: number;\n /** pixels */\n height: number;\n /** bounding box of the requested map image */\n bbox: [number, number, number, number];\n /** srs for the image (not the bounding box) */\n crs?: string;\n};\n\n/** Parameters for DescribeLayer */\nexport type WMSDescribeLayerParameters = {\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.3.0' | '1.1.1';\n};\n\n/** Parameters for GetLegendGraphic */\nexport type WMSGetLegendGraphicParameters = {\n /** In case the endpoint supports multiple WMS versions */\n version?: '1.3.0' | '1.1.1';\n};\n\n//\n\n/** Properties for creating a enw WMS service */\nexport type WMSServiceProps = ImageSourceProps & {\n /** Base URL to the service */\n url: string;\n /** In 1.3.0, replaces references to EPSG:4326 with CRS:84 */\n substituteCRS84?: boolean;\n\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<WMSServiceProps> {\n static type: 'wms' = 'wms';\n static testURL = (url: string): boolean => url.toLowerCase().includes('wms');\n\n /** Base URL to the service */\n readonly url: string;\n\n /** In WMS 1.3.0, replaces references to EPSG:4326 with CRS:84. But not always supported. Default: false */\n substituteCRS84: boolean;\n /** In WMS 1.3.0, flips x,y (lng, lat) coordinates for the supplied coordinate systems. Default: ['ESPG:4326'] */\n flipCRS: string[];\n\n /** Default static WMS parameters */\n wmsParameters: Required<WMSParameters>;\n /** Default static vendor parameters */\n vendorParameters?: Record<string, unknown>;\n\n capabilities: WMSCapabilities | null = null;\n\n /** 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.substituteCRS84 = props.substituteCRS84 ?? false;\n this.flipCRS = ['EPSG:4326'];\n\n this.wmsParameters = {\n layers: undefined!,\n query_layers: undefined!,\n styles: undefined,\n version: '1.3.0',\n crs: 'EPSG:4326',\n format: 'image/png',\n info_format: 'text/plain',\n transparent: undefined!,\n time: undefined!,\n elevation: undefined!,\n ...props.wmsParameters\n };\n\n this.vendorParameters = props.vendorParameters || {};\n }\n\n // 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.loadOptions);\n this.capabilities = capabilities;\n return capabilities;\n }\n\n /** Get a map image */\n async getMap(\n wmsParameters: WMSGetMapParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<ImageType> {\n const url = this.getMapURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n try {\n return await ImageLoader.parse(arrayBuffer, this.loadOptions);\n } catch {\n throw this._parseError(arrayBuffer);\n }\n }\n\n /** Get Feature Info for a coordinate */\n async getFeatureInfo(\n wmsParameters: WMSGetFeatureInfoParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<WMSFeatureInfo> {\n const url = this.getFeatureInfoURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return await WMSFeatureInfoLoader.parse(arrayBuffer, this.loadOptions);\n }\n\n /** Get Feature Info for a coordinate */\n async getFeatureInfoText(\n wmsParameters: WMSGetFeatureInfoParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<string> {\n const url = this.getFeatureInfoURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return new TextDecoder().decode(arrayBuffer);\n }\n\n /** Get more information about a layer */\n async describeLayer(\n wmsParameters: WMSDescribeLayerParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<WMSLayerDescription> {\n const url = this.describeLayerURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return await WMSLayerDescriptionLoader.parse(arrayBuffer, this.loadOptions);\n }\n\n /** Get an image with a semantic legend */\n async getLegendGraphic(\n wmsParameters: WMSGetLegendGraphicParameters,\n vendorParameters?: Record<string, unknown>\n ): Promise<ImageType> {\n const url = this.getLegendGraphicURL(wmsParameters, vendorParameters);\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n try {\n return await ImageLoader.parse(arrayBuffer, this.loadOptions);\n } catch {\n throw this._parseError(arrayBuffer);\n }\n }\n\n // Typed URL creators\n // For applications that want full control of fetching and parsing\n\n /** Generate a URL for the GetCapabilities request */\n getCapabilitiesURL(\n wmsParameters?: WMSGetCapabilitiesParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSGetCapabilitiesParameters> = {\n version: this.wmsParameters.version,\n ...wmsParameters\n };\n return this._getWMSUrl('GetCapabilities', options, vendorParameters);\n }\n\n /** Generate a URL for the GetMap request */\n getMapURL(\n wmsParameters: WMSGetMapParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n wmsParameters = this._getWMS130Parameters(wmsParameters);\n const options: Required<WMSGetMapParameters> = {\n version: this.wmsParameters.version,\n format: this.wmsParameters.format,\n transparent: this.wmsParameters.transparent,\n time: this.wmsParameters.time,\n elevation: this.wmsParameters.elevation,\n layers: this.wmsParameters.layers,\n styles: this.wmsParameters.styles,\n crs: this.wmsParameters.crs,\n // bbox: [-77.87304, 40.78975, -77.85828, 40.80228],\n // width: 1200,\n // height: 900,\n ...wmsParameters\n };\n return this._getWMSUrl('GetMap', options, vendorParameters);\n }\n\n /** Generate a URL for the GetFeatureInfo request */\n getFeatureInfoURL(\n wmsParameters: WMSGetFeatureInfoParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSGetFeatureInfoParameters> = {\n version: this.wmsParameters.version,\n // query_layers: [],\n // format: this.wmsParameters.format,\n info_format: this.wmsParameters.info_format,\n layers: this.wmsParameters.layers,\n query_layers: this.wmsParameters.query_layers,\n styles: this.wmsParameters.styles,\n crs: this.wmsParameters.crs,\n // bbox: [-77.87304, 40.78975, -77.85828, 40.80228],\n // width: 1200,\n // height: 900,\n // x: undefined!,\n // y: undefined!,\n ...wmsParameters\n };\n return this._getWMSUrl('GetFeatureInfo', options, vendorParameters);\n }\n\n /** Generate a URL for the GetFeatureInfo request */\n describeLayerURL(\n wmsParameters: WMSDescribeLayerParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSDescribeLayerParameters> = {\n version: this.wmsParameters.version,\n ...wmsParameters\n };\n return this._getWMSUrl('DescribeLayer', options, vendorParameters);\n }\n\n getLegendGraphicURL(\n wmsParameters: WMSGetLegendGraphicParameters,\n vendorParameters?: Record<string, unknown>\n ): string {\n const options: Required<WMSGetLegendGraphicParameters> = {\n version: this.wmsParameters.version,\n // format?\n ...wmsParameters\n };\n return this._getWMSUrl('GetLegendGraphic', options, vendorParameters);\n }\n\n // INTERNAL METHODS\n\n _parseWMSUrl(url: string): {url: string; parameters: Record<string, unknown>} {\n const [baseUrl, search] = url.split('?');\n const searchParams = search.split('&');\n\n const parameters: Record<string, unknown> = {};\n for (const parameter of searchParams) {\n const [key, value] = parameter.split('=');\n parameters[key] = value;\n }\n\n return {url: baseUrl, parameters};\n }\n\n /**\n * Generate a URL with parameters\n * @note case _getWMSUrl may need to be overridden to handle certain backends?\n * @note at the moment, only URLs with parameters are supported (no XML payloads)\n * */\n protected _getWMSUrl(\n request: string,\n wmsParameters: {version?: '1.3.0' | '1.1.1'; [key: string]: unknown},\n vendorParameters?: Record<string, unknown>\n ): string {\n let url = this.url;\n let first = true;\n\n // Add any vendor searchParams\n const allParameters = {\n service: 'WMS',\n version: wmsParameters.version,\n request,\n ...wmsParameters,\n ...this.vendorParameters,\n ...vendorParameters\n };\n\n // Encode the keys\n const IGNORE_EMPTY_KEYS = ['transparent', 'time', 'elevation'];\n for (const [key, value] of Object.entries(allParameters)) {\n // hack to preserve test cases. Not super clear if keys should be included when values are undefined\n if (!IGNORE_EMPTY_KEYS.includes(key) || value) {\n url += first ? '?' : '&';\n first = false;\n url += this._getURLParameter(key, value, wmsParameters);\n }\n }\n\n return encodeURI(url);\n }\n\n _getWMS130Parameters<ParametersT extends {crs?: string; srs?: string}>(\n wmsParameters: ParametersT\n ): ParametersT {\n const newParameters = {...wmsParameters};\n if (newParameters.srs) {\n newParameters.crs = newParameters.crs || newParameters.srs;\n delete newParameters.srs;\n }\n return newParameters;\n }\n\n // eslint-disable-complexity\n _getURLParameter(key: string, value: unknown, wmsParameters: WMSParameters): string {\n // Substitute by key\n switch (key) {\n case 'crs':\n // CRS was called SRS before WMS 1.3.0\n if (wmsParameters.version !== '1.3.0') {\n key = 'srs';\n } else if (this.substituteCRS84 && value === 'EPSG:4326') {\n /** In 1.3.0, replaces references to 'EPSG:4326' with the new backwards compatible CRS:84 */\n // Substitute by value\n value = 'CRS:84';\n }\n break;\n\n case 'srs':\n // CRS was called SRS before WMS 1.3.0\n if (wmsParameters.version === '1.3.0') {\n key = 'crs';\n }\n break;\n\n case 'bbox':\n // Coordinate order is flipped for certain CRS in WMS 1.3.0\n const bbox = this._flipBoundingBox(value, wmsParameters);\n if (bbox) {\n value = bbox;\n }\n break;\n\n default:\n // do nothing\n }\n\n key = key.toUpperCase();\n\n return Array.isArray(value)\n ? `${key}=${value.join(',')}`\n : `${key}=${value ? String(value) : ''}`;\n }\n\n /** Coordinate order is flipped for certain CRS in WMS 1.3.0 */\n _flipBoundingBox(\n bboxValue: unknown,\n wmsParameters: WMSParameters\n ): [number, number, number, number] | null {\n // Sanity checks\n if (!Array.isArray(bboxValue) || bboxValue.length !== 4) {\n return null;\n }\n\n const flipCoordinates =\n // Only affects WMS 1.3.0\n wmsParameters.version === '1.3.0' &&\n // Flip if we are dealing with a CRS that was flipped in 1.3.0\n this.flipCRS.includes(wmsParameters.crs || '') &&\n // Don't flip if we are subsituting EPSG:4326 with CRS:84\n !(this.substituteCRS84 && wmsParameters.crs === 'EPSG:4326');\n\n const bbox = bboxValue as [number, number, number, number];\n return flipCoordinates ? [bbox[1], bbox[0], bbox[3], bbox[2]] : bbox;\n }\n\n /** Fetches an array buffer and checks the response (boilerplate reduction) */\n protected async _fetchArrayBuffer(url: string): Promise<ArrayBuffer> {\n const response = await this.fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n this._checkResponse(response, arrayBuffer);\n return arrayBuffer;\n }\n\n /** Checks for and parses a WMS XML formatted ServiceError and throws an exception */\n protected _checkResponse(response: Response, arrayBuffer: ArrayBuffer): void {\n const contentType = response.headers['content-type'];\n if (!response.ok || WMSErrorLoader.mimeTypes.includes(contentType)) {\n // We want error responses to throw exceptions, the WMSErrorLoader can do this\n const loadOptions = mergeLoaderOptions<WMSLoaderOptions>(this.loadOptions, {\n wms: {throwOnError: true}\n });\n const error = WMSErrorLoader.parseSync(arrayBuffer, loadOptions);\n throw new Error(error);\n }\n }\n\n /** Error situation detected */\n protected _parseError(arrayBuffer: ArrayBuffer): Error {\n const error = WMSErrorLoader.parseSync(arrayBuffer, this.loadOptions);\n return new Error(error);\n }\n}\n"],"mappings":";AAIA,SAAQA,WAAW,QAAO,oBAAoB;AAC9C,SAAQC,kBAAkB,QAAO,0BAA0B;AAI3D,SAAQC,WAAW,QA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WAAwB,EAAS;IACrD,MAAMwD,KAAK,GAAGxF,cAAc,CAACyF,SAAS,CAACzD,WAAW,EAAE,IAAI,CAACG,WAAW,CAAC;IACrE,OAAO,IAAIuD,KAAK,CAACF,KAAK,CAAC;EACzB;AACF;AAACnF,eAAA,CA1YYJ,UAAU,UACA,KAAK;AAAAI,eAAA,CADfJ,UAAU,aAEHK,GAAW,IAAcA,GAAG,CAACqF,WAAW,CAAC,CAAC,CAAC1B,QAAQ,CAAC,KAAK,CAAC"}
@@ -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 layers: ImageSourceLayer[];\n};\n\nexport type ImageSourceLayer = {\n name?: string;\n title?: string;\n crs?: 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 /** crs for the image (not the bounding box) */\n crs?: 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 /** crs for the image (not the bounding box) */\n crs?: 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<PropsT extends ImageSourceProps> extends DataSource<PropsT> {\n abstract getMetadata(): Promise<ImageSourceMetadata>;\n abstract getImage(parameters: GetImageParameters): Promise<ImageType>;\n}\n"],"mappings":"AAIA,SAAQA,UAAU,QAAO,eAAe;AAwExC,OAAO,MAAeC,WAAW,SAA0CD,UAAU,CAAS"}
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`\n * data structure extracted from WMS XML response into an ImageSourceMetadata.\n */\nexport type ImageSourceMetadata = {\n name: string;\n title?: string;\n abstract?: string;\n keywords: string[];\n layers: ImageSourceLayer[];\n};\n\n/** Description of one data layer in the image source */\nexport type ImageSourceLayer = {\n /** Name of this layer */\n name?: string;\n /** Human readable title of this layer */\n title?: string;\n /** Coordinate systems supported by this layer */\n crs?: string[];\n /** layer limits in unspecified CRS:84-like lng/lat, for quick access w/o CRS calculations. */\n geographicBoundingBox?: [min: [x: number, y: number], max: [x: number, y: number]];\n /** Sub layers of this layer */\n layers?: ImageSourceLayer[];\n\n /** @deprecated from v3.4: non-vis.gl style bounding box. Use `.geographicBoundingBox` instead */\n boundingBox?: [number, number, number, number];\n};\n\n/** Generic parameters for requesting an image from an image source */\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 /** crs for the image (not the bounding box) */\n crs?: 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 /** crs for the image (not the bounding box) */\n crs?: 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<\n PropsT extends ImageSourceProps = ImageSourceProps\n> extends DataSource<PropsT> {\n abstract getMetadata(): Promise<ImageSourceMetadata>;\n abstract getImage(parameters: GetImageParameters): Promise<ImageType>;\n}\n"],"mappings":"AAIA,SAAQA,UAAU,QAAO,eAAe;AAkFxC,OAAO,MAAeC,WAAW,SAEvBD,UAAU,CAAS"}
@@ -1,5 +1,5 @@
1
1
  import { parseWCSCapabilities } from './lib/wcs/parse-wcs-capabilities';
2
- const VERSION = typeof "4.0.0-alpha.6" !== 'undefined' ? "4.0.0-alpha.6" : 'latest';
2
+ const VERSION = typeof "4.0.0-alpha.7" !== 'undefined' ? "4.0.0-alpha.7" : 'latest';
3
3
  export const WCSCapabilitiesLoader = {
4
4
  id: 'wcs-capabilities',
5
5
  name: 'WFS Capabilities',
@@ -1,5 +1,5 @@
1
1
  import { parseWFSCapabilities } from './lib/wfs/parse-wfs-capabilities';
2
- const VERSION = typeof "4.0.0-alpha.6" !== 'undefined' ? "4.0.0-alpha.6" : 'latest';
2
+ const VERSION = typeof "4.0.0-alpha.7" !== 'undefined' ? "4.0.0-alpha.7" : 'latest';
3
3
  export const WFSCapabilitiesLoader = {
4
4
  id: 'wfs-capabilities',
5
5
  name: 'WFS Capabilities',
@@ -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,MAAAA,CAAOC,WAAwB,EAAEC,OAA0B,KAChEN,mBAAmB,CAAC,IAAIO,WAAW,CAAC,CAAC,CAACC,MAAM,CAACH,WAAW,CAAC,EAAEC,OAAO,CAAC;EACrEG,aAAa,EAAEA,CAACC,IAAY,EAAEJ,OAA0B,KAAKN,mBAAmB,CAACU,IAAI,EAAEJ,OAAO;AAChG,CAAC;AAED,OAAO,MAAMK,8BAAgD,GAAGV,oBAAoB"}
1
+ {"version":3,"file":"wms-feature-info-loader.js","names":["WMSCapabilitiesLoader","parseWMSFeatureInfo","WMSFeatureInfoLoader","id","name","parse","arrayBuffer","options","TextDecoder","decode","parseTextSync","text","_typecheckWMSFeatureInfoLoader"],"sources":["../../../src/wip/wms-feature-info-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {XMLLoaderOptions} from '@loaders.gl/xml';\nimport {WMSCapabilitiesLoader} from '../wms-capabilities-loader';\n\nimport type {WMSFeatureInfo} from '../lib/parsers/wms/parse-wms-features';\nimport {parseWMSFeatureInfo} from '../lib/parsers/wms/parse-wms-features';\n\nexport {WMSFeatureInfo};\n\n/**\n * Loader for the response to the WMS GetFeatureInfo request\n */\nexport const WMSFeatureInfoLoader = {\n ...WMSCapabilitiesLoader,\n\n id: 'wms-feature-info',\n name: 'WMS FeatureInfo',\n\n parse: async (arrayBuffer: ArrayBuffer, options?: XMLLoaderOptions) =>\n parseWMSFeatureInfo(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: XMLLoaderOptions) => parseWMSFeatureInfo(text, options)\n};\n\nexport const _typecheckWMSFeatureInfoLoader: LoaderWithParser = WMSFeatureInfoLoader;\n"],"mappings":"AAIA,SAAQA,qBAAqB,QAAO,4BAA4B;AAGhE,SAAQC,mBAAmB,QAAO,uCAAuC;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,CAAC,CAAC,CAACC,MAAM,CAACH,WAAW,CAAC,EAAEC,OAAO,CAAC;EACrEG,aAAa,EAAEA,CAACC,IAAY,EAAEJ,OAA0B,KAAKN,mBAAmB,CAACU,IAAI,EAAEJ,OAAO;AAChG,CAAC;AAED,OAAO,MAAMK,8BAAgD,GAAGV,oBAAoB"}
@@ -1 +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,MAAAA,CAAOC,WAAwB,EAAEC,OAA0B,KAChEN,wBAAwB,CAAC,IAAIO,WAAW,CAAC,CAAC,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
+ {"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 {XMLLoaderOptions} from '@loaders.gl/xml';\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?: XMLLoaderOptions) =>\n parseWMSLayerDescription(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: XMLLoaderOptions) => 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,CAAC,CAAC,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,5 +1,5 @@
1
1
  import { parseWMTSCapabilities } from './lib/wmts/parse-wmts-capabilities';
2
- const VERSION = typeof "4.0.0-alpha.6" !== 'undefined' ? "4.0.0-alpha.6" : 'latest';
2
+ const VERSION = typeof "4.0.0-alpha.7" !== 'undefined' ? "4.0.0-alpha.7" : 'latest';
3
3
  export const WMTSCapabilitiesLoader = {
4
4
  id: 'wmts-capabilities',
5
5
  name: 'WMTS Capabilities',
@@ -1 +1 @@
1
- {"version":3,"file":"wmts-capabilities-loader.js","names":["parseWMTSCapabilities","VERSION","WMTSCapabilitiesLoader","id","name","module","version","worker","extensions","mimeTypes","testText","testXMLFile","options","wms","parse","arrayBuffer","TextDecoder","decode","parseTextSync","text","startsWith","_typecheckWMTSCapabilitiesLoader"],"sources":["../../../src/wip/wmts-capabilities-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser, 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,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,EAAEH,OAAO,CAAC;EACvEM,aAAa,EAAEA,CAACC,IAAY,EAAEP,OAA2B,KAAKZ,qBAAqB,CAACmB,IAAI,EAAEP,OAAO;AACnG,CAAC;AAED,SAASD,WAAWA,CAACQ,IAAY,EAAW;EAE1C,OAAOA,IAAI,CAACC,UAAU,CAAC,OAAO,CAAC;AACjC;AAEA,OAAO,MAAMC,gCAAkD,GAAGnB,sBAAsB"}
1
+ {"version":3,"file":"wmts-capabilities-loader.js","names":["parseWMTSCapabilities","VERSION","WMTSCapabilitiesLoader","id","name","module","version","worker","extensions","mimeTypes","testText","testXMLFile","options","wms","parse","arrayBuffer","TextDecoder","decode","parseTextSync","text","startsWith","_typecheckWMTSCapabilitiesLoader"],"sources":["../../../src/wip/wmts-capabilities-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {XMLLoaderOptions} from '@loaders.gl/xml';\n// import type {WMTSCapabilities} from './lib/wmts/parse-wmts-capabilities';\nimport {parseWMTSCapabilities} from './lib/wmts/parse-wmts-capabilities';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n// export type {WMTSCapabilities};\n\nexport type WMTSLoaderOptions = XMLLoaderOptions & {\n wmts?: {};\n};\n\n/**\n * Loader for the response to the WMTS GetCapability request\n */\nexport const WMTSCapabilitiesLoader = {\n id: 'wmts-capabilities',\n name: 'WMTS Capabilities',\n\n module: 'wms',\n version: VERSION,\n worker: false,\n extensions: ['xml'],\n mimeTypes: ['application/vnd.ogc.wmts_xml', 'application/xml', 'text/xml'],\n testText: testXMLFile,\n options: {\n wms: {}\n },\n parse: async (arrayBuffer: ArrayBuffer, options?: WMTSLoaderOptions) =>\n parseWMTSCapabilities(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: WMTSLoaderOptions) => parseWMTSCapabilities(text, options)\n};\n\nfunction testXMLFile(text: string): boolean {\n // TODO - There could be space first.\n return text.startsWith('<?xml');\n}\n\nexport const _typecheckWMTSCapabilitiesLoader: LoaderWithParser = WMTSCapabilitiesLoader;\n"],"mappings":"AAKA,SAAQA,qBAAqB,QAAO,oCAAoC;AAIxE,MAAMC,OAAO,GAAG,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,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,EAAEH,OAAO,CAAC;EACvEM,aAAa,EAAEA,CAACC,IAAY,EAAEP,OAA2B,KAAKZ,qBAAqB,CAACmB,IAAI,EAAEP,OAAO;AACnG,CAAC;AAED,SAASD,WAAWA,CAACQ,IAAY,EAAW;EAE1C,OAAOA,IAAI,CAACC,UAAU,CAAC,OAAO,CAAC;AACjC;AAEA,OAAO,MAAMC,gCAAkD,GAAGnB,sBAAsB"}
@@ -1,5 +1,5 @@
1
1
  import { parseWMSCapabilities } from './lib/parsers/wms/parse-wms-capabilities';
2
- const VERSION = typeof "4.0.0-alpha.6" !== 'undefined' ? "4.0.0-alpha.6" : 'latest';
2
+ const VERSION = typeof "4.0.0-alpha.7" !== 'undefined' ? "4.0.0-alpha.7" : 'latest';
3
3
  export const WMSCapabilitiesLoader = {
4
4
  id: 'wms-capabilities',
5
5
  name: 'WMS Capabilities',
@@ -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 /** 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,CAAC,CAAC,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
+ {"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} from '@loaders.gl/loader-utils';\nimport type {XMLLoaderOptions} from '@loaders.gl/xml';\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 types\nexport type {\n WMSCapabilities,\n WMSLayer,\n WMSBoundingBox,\n WMSDimension,\n WMSRequest,\n WMSExceptions\n} from './lib/parsers/wms/parse-wms-capabilities';\n\nexport type WMSCapabilitiesLoaderOptions = XMLLoaderOptions & {\n wms?: {\n /** Add inherited layer information to sub layers */\n inheritedLayerProps?: boolean;\n /** Include the \"raw\" JSON (parsed but untyped, unprocessed XML). May contain additional fields */\n includeRawData?: boolean;\n /** Include the original XML document text. May contain additional information. */\n includeXMLText?: boolean;\n /** @deprecated Use options.includeRawData` */\n raw?: boolean;\n };\n};\n\n/**\n * Loader for the response to the WMS GetCapability request\n */\nexport const WMSCapabilitiesLoader = {\n id: 'wms-capabilities',\n name: 'WMS Capabilities',\n\n module: 'wms',\n version: VERSION,\n worker: false,\n extensions: ['xml'],\n mimeTypes: ['application/vnd.ogc.wms_xml', 'application/xml', 'text/xml'],\n testText: testXMLFile,\n options: {\n wms: {}\n },\n parse: async (arrayBuffer: ArrayBuffer, options?: WMSCapabilitiesLoaderOptions) =>\n // TODO pass in XML options\n parseWMSCapabilities(new TextDecoder().decode(arrayBuffer), options?.wms),\n parseTextSync: (text: string, options?: WMSCapabilitiesLoaderOptions) =>\n // TODO pass in XML options\n parseWMSCapabilities(text, options?.wms)\n};\n\nfunction testXMLFile(text: string): boolean {\n // TODO - There could be space first.\n return text.startsWith('<?xml');\n}\n\nexport const _typecheckWMSCapabilitiesLoader: LoaderWithParser = WMSCapabilitiesLoader;\n"],"mappings":"AAIA,SAAQA,oBAAoB,QAAO,0CAA0C;AAI7E,MAAMC,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AA4B3E,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,OAAsC,KAE5EZ,oBAAoB,CAAC,IAAIgB,WAAW,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,EAAEH,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,GAAG,CAAC;EAC3EK,aAAa,EAAEA,CAACC,IAAY,EAAEP,OAAsC,KAElEZ,oBAAoB,CAACmB,IAAI,EAAEP,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,GAAG;AAC3C,CAAC;AAED,SAASF,WAAWA,CAACQ,IAAY,EAAW;EAE1C,OAAOA,IAAI,CAACC,UAAU,CAAC,OAAO,CAAC;AACjC;AAEA,OAAO,MAAMC,+BAAiD,GAAGnB,qBAAqB"}
@@ -1,5 +1,5 @@
1
1
  import { parseWMSError } from './lib/parsers/wms/parse-wms-error';
2
- const VERSION = typeof "4.0.0-alpha.6" !== 'undefined' ? "4.0.0-alpha.6" : 'latest';
2
+ const VERSION = typeof "4.0.0-alpha.7" !== 'undefined' ? "4.0.0-alpha.7" : 'latest';
3
3
  export const WMSErrorLoader = {
4
4
  id: 'wms-error',
5
5
  name: 'WMS Error',
package/dist/index.d.ts CHANGED
@@ -6,8 +6,8 @@ export { CSWDomainLoader } from './csw-domain-loader';
6
6
  export type { CSWRecords } from './csw-records-loader';
7
7
  export { CSWRecordsLoader } from './csw-records-loader';
8
8
  export { WMSErrorLoader } from './wms-error-loader';
9
- export type { WMSLoaderOptions } from './wms-capabilities-loader';
10
- export type { WMSCapabilities } from './wms-capabilities-loader';
9
+ export type { WMSCapabilities, WMSLayer, WMSBoundingBox, WMSDimension } from './wms-capabilities-loader';
10
+ export type { WMSCapabilitiesLoaderOptions } from './wms-capabilities-loader';
11
11
  export { WMSCapabilitiesLoader } from './wms-capabilities-loader';
12
12
  export type { WMSFeatureInfo as _WMSFeatureInfo } from './wip/wms-feature-info-loader';
13
13
  export { WMSFeatureInfoLoader as _WMSFeatureInfoLoader } from './wip/wms-feature-info-loader';
@@ -19,8 +19,8 @@ export { WFSCapabilitiesLoader as _WFSCapabilitiesLoader } from './wip/wfs-capab
19
19
  export type { GeoJSON as _GeoJSON } from '@loaders.gl/schema';
20
20
  export type { GMLLoaderOptions as _GMLLoaderOptions } from './gml-loader';
21
21
  export { GMLLoader as _GMLLoader } from './gml-loader';
22
- export type { ImageSourceMetadata } from './lib/sources/image-source';
23
22
  export type { ImageType } from '@loaders.gl/images';
23
+ export type { ImageSourceProps, ImageSourceMetadata } from './lib/sources/image-source';
24
24
  export { ImageSource } from './lib/sources/image-source';
25
25
  export type { ImageServiceType } from './lib/create-image-source';
26
26
  export { createImageSource } from './lib/create-image-source';
@@ -30,4 +30,6 @@ export { CSWService } from './lib/services/ogc/csw-service';
30
30
  export { WMSService } from './lib/services/ogc/wms-service';
31
31
  export { getArcGISServices as _getArcGISServices } from './lib/services/arcgis/arcgis-server';
32
32
  export { ArcGISImageServer as _ArcGISImageServer } from './lib/services/arcgis/arcgis-image-service';
33
+ /** @deprecated Use WMSCapabilitiesLoaderOptions */
34
+ export type { WMSCapabilitiesLoaderOptions as WMSLoaderOptions } from './wms-capabilities-loader';
33
35
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,YAAY,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAEhE,YAAY,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAC,qBAAqB,EAAC,MAAM,2BAA2B,CAAC;AAEhE,YAAY,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAC,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAEpD,YAAY,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AAItD,OAAO,EAAC,cAAc,EAAC,MA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AY,EAAC,eAAe,IAAI,gBAAgB,EAAC,MAAM,+BAA+B,CAAC;AACvF,OAAO,EAAC,qBAAqB,IAAI,sBAAsB,EAAC,MAAM,+BAA+B,CAAC;AAI9F,YAAY,EAAC,OAAO,IAAI,QAAQ,EAAC,MAAM,oBAAoB,CAAC;AAC5D,YAAY,EAAC,gBAAgB,IAAI,iBAAiB,EAAC,MAAM,cAAc,CAAC;AACxE,OAAO,EAAC,SAAS,IAAI,UAAU,EAAC,MAAM,cAAc,CAAC;AAIrD,YAAY,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAC,gBAAgB,EAAE,mBAAmB,EAAC,MAAM,4BAA4B,CAAC;AACtF,OAAO,EAAC,WAAW,EAAC,MAAM,4BAA4B,CAAC;AAEvD,YAAY,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAC,iBAAiB,EAAC,MAAM,2BAA2B,CAAC;AAI5D,YAAY,EAAC,iBAAiB,EAAC,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAC,YAAY,EAAC,MAAM,sCAAsC,CAAC;AAIlE,OAAO,EAAC,UAAU,EAAC,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAC,UAAU,EAAC,MAAM,gCAAgC,CAAC;AAI1D,OAAO,EAAC,iBAAiB,IAAI,kBAAkB,EAAC,MAAM,qCAAqC,CAAC;AAC5F,OAAO,EAAC,iBAAiB,IAAI,kBAAkB,EAAC,MAAM,4CAA4C,CAAC;AAOnG,mDAAmD;AACnD,YAAY,EAAC,4BAA4B,IAAI,gBAAgB,EAAC,MAAM,2BAA2B,CAAC"}
package/dist/index.js CHANGED
@@ -37,7 +37,3 @@ var arcgis_server_1 = require("./lib/services/arcgis/arcgis-server");
37
37
  Object.defineProperty(exports, "_getArcGISServices", { enumerable: true, get: function () { return arcgis_server_1.getArcGISServices; } });
38
38
  var arcgis_image_service_1 = require("./lib/services/arcgis/arcgis-image-service");
39
39
  Object.defineProperty(exports, "_ArcGISImageServer", { enumerable: true, get: function () { return arcgis_image_service_1.ArcGISImageServer; } });
40
- // LERC - Limited Error Raster Compression
41
- // TODO - restore once esbuild bundling issues have been resolved
42
- // export type {LERCData} from './lib/lerc/lerc-types.js';
43
- // export {LERCLoader} from './lerc-loader.js';