@loaders.gl/wms 3.4.6 → 4.0.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist.min.js +67 -65
- package/dist/es5/csw-capabilities-loader.js +1 -1
- package/dist/es5/csw-capabilities-loader.js.map +1 -1
- package/dist/es5/csw-domain-loader.js +1 -1
- package/dist/es5/csw-domain-loader.js.map +1 -1
- package/dist/es5/csw-records-loader.js +1 -1
- package/dist/es5/csw-records-loader.js.map +1 -1
- package/dist/es5/gml-loader.js +1 -1
- package/dist/es5/gml-loader.js.map +1 -1
- package/dist/es5/lerc-loader.js +1 -1
- package/dist/es5/lerc-loader.js.map +1 -1
- package/dist/es5/lib/parsers/csw/parse-csw-capabilities.js +2 -1
- package/dist/es5/lib/parsers/csw/parse-csw-capabilities.js.map +1 -1
- package/dist/es5/lib/parsers/csw/parse-csw-domain.js +2 -1
- package/dist/es5/lib/parsers/csw/parse-csw-domain.js.map +1 -1
- package/dist/es5/lib/parsers/csw/parse-csw-records.js +6 -5
- package/dist/es5/lib/parsers/csw/parse-csw-records.js.map +1 -1
- package/dist/es5/lib/parsers/csw/parse-exception-report.js.map +1 -1
- package/dist/es5/lib/parsers/gml/parse-gml.js +2 -1
- package/dist/es5/lib/parsers/gml/parse-gml.js.map +1 -1
- package/dist/es5/lib/parsers/wms/parse-wms-capabilities.js +2 -1
- package/dist/es5/lib/parsers/wms/parse-wms-capabilities.js.map +1 -1
- package/dist/es5/lib/parsers/wms/parse-wms-features.js +2 -2
- package/dist/es5/lib/parsers/wms/parse-wms-features.js.map +1 -1
- package/dist/es5/lib/wfs/parse-wfs.js +41 -0
- package/dist/es5/lib/wfs/parse-wfs.js.map +1 -0
- package/dist/es5/lib/wmts/parse-wmts.js +41 -0
- package/dist/es5/lib/wmts/parse-wmts.js.map +1 -0
- package/dist/es5/wip/lib/wcs/parse-wcs-capabilities.js +2 -1
- package/dist/es5/wip/lib/wcs/parse-wcs-capabilities.js.map +1 -1
- package/dist/es5/wip/lib/wfs/parse-wfs-capabilities.js +2 -1
- package/dist/es5/wip/lib/wfs/parse-wfs-capabilities.js.map +1 -1
- package/dist/es5/wip/lib/wmts/parse-wmts-capabilities.js +2 -1
- package/dist/es5/wip/lib/wmts/parse-wmts-capabilities.js.map +1 -1
- package/dist/es5/wip/wcs-capabilities-loader.js +1 -1
- package/dist/es5/wip/wcs-capabilities-loader.js.map +1 -1
- package/dist/es5/wip/wfs-capabilities-loader.js +1 -1
- package/dist/es5/wip/wfs-capabilities-loader.js.map +1 -1
- package/dist/es5/wip/wmts-capabilities-loader.js +1 -1
- package/dist/es5/wip/wmts-capabilities-loader.js.map +1 -1
- package/dist/es5/wms-capabilities-loader.js +1 -1
- package/dist/es5/wms-capabilities-loader.js.map +1 -1
- package/dist/es5/wms-error-loader.js +1 -1
- package/dist/es5/wms-error-loader.js.map +1 -1
- package/dist/esm/csw-capabilities-loader.js +1 -1
- package/dist/esm/csw-capabilities-loader.js.map +1 -1
- package/dist/esm/csw-domain-loader.js +1 -1
- package/dist/esm/csw-domain-loader.js.map +1 -1
- package/dist/esm/csw-records-loader.js +1 -1
- package/dist/esm/csw-records-loader.js.map +1 -1
- package/dist/esm/gml-loader.js +1 -1
- package/dist/esm/gml-loader.js.map +1 -1
- package/dist/esm/lerc-loader.js +1 -1
- package/dist/esm/lerc-loader.js.map +1 -1
- package/dist/esm/lib/parsers/csw/parse-csw-capabilities.js +2 -1
- package/dist/esm/lib/parsers/csw/parse-csw-capabilities.js.map +1 -1
- package/dist/esm/lib/parsers/csw/parse-csw-domain.js +2 -1
- package/dist/esm/lib/parsers/csw/parse-csw-domain.js.map +1 -1
- package/dist/esm/lib/parsers/csw/parse-csw-records.js +7 -6
- package/dist/esm/lib/parsers/csw/parse-csw-records.js.map +1 -1
- package/dist/esm/lib/parsers/csw/parse-exception-report.js.map +1 -1
- package/dist/esm/lib/parsers/gml/parse-gml.js +2 -1
- package/dist/esm/lib/parsers/gml/parse-gml.js.map +1 -1
- package/dist/esm/lib/parsers/wms/parse-wms-capabilities.js +2 -1
- package/dist/esm/lib/parsers/wms/parse-wms-capabilities.js.map +1 -1
- package/dist/esm/lib/parsers/wms/parse-wms-features.js +2 -2
- package/dist/esm/lib/parsers/wms/parse-wms-features.js.map +1 -1
- package/dist/esm/lib/wfs/parse-wfs.js +28 -0
- package/dist/esm/lib/wfs/parse-wfs.js.map +1 -0
- package/dist/esm/lib/wmts/parse-wmts.js +28 -0
- package/dist/esm/lib/wmts/parse-wmts.js.map +1 -0
- package/dist/esm/wip/lib/wcs/parse-wcs-capabilities.js +2 -1
- package/dist/esm/wip/lib/wcs/parse-wcs-capabilities.js.map +1 -1
- package/dist/esm/wip/lib/wfs/parse-wfs-capabilities.js +2 -1
- package/dist/esm/wip/lib/wfs/parse-wfs-capabilities.js.map +1 -1
- package/dist/esm/wip/lib/wmts/parse-wmts-capabilities.js +2 -1
- package/dist/esm/wip/lib/wmts/parse-wmts-capabilities.js.map +1 -1
- package/dist/esm/wip/wcs-capabilities-loader.js +1 -1
- package/dist/esm/wip/wcs-capabilities-loader.js.map +1 -1
- package/dist/esm/wip/wfs-capabilities-loader.js +1 -1
- package/dist/esm/wip/wfs-capabilities-loader.js.map +1 -1
- package/dist/esm/wip/wmts-capabilities-loader.js +1 -1
- package/dist/esm/wip/wmts-capabilities-loader.js.map +1 -1
- package/dist/esm/wms-capabilities-loader.js +1 -1
- package/dist/esm/wms-capabilities-loader.js.map +1 -1
- package/dist/esm/wms-error-loader.js +1 -1
- package/dist/esm/wms-error-loader.js.map +1 -1
- package/dist/lib/parsers/csw/parse-csw-capabilities.js +1 -1
- package/dist/lib/parsers/csw/parse-csw-domain.js +1 -1
- package/dist/lib/parsers/csw/parse-csw-records.js +6 -6
- package/dist/lib/parsers/csw/parse-exception-report.js +1 -1
- package/dist/lib/parsers/gml/parse-gml.js +1 -1
- package/dist/lib/parsers/wms/parse-wms-capabilities.js +1 -1
- package/dist/lib/parsers/wms/parse-wms-features.js +1 -1
- package/dist/lib/services/ogc/wms-service.d.ts +1 -11
- package/dist/lib/services/ogc/wms-service.d.ts.map +1 -1
- package/dist/lib/wfs/parse-wfs.d.ts +7 -0
- package/dist/lib/wfs/parse-wfs.d.ts.map +1 -0
- package/dist/lib/wfs/parse-wfs.js +32 -0
- package/dist/lib/wmts/parse-wmts.d.ts +7 -0
- package/dist/lib/wmts/parse-wmts.d.ts.map +1 -0
- package/dist/lib/wmts/parse-wmts.js +35 -0
- package/dist/wip/lib/wcs/parse-wcs-capabilities.js +1 -1
- package/dist/wip/lib/wfs/parse-wfs-capabilities.js +1 -1
- package/dist/wip/lib/wmts/parse-wmts-capabilities.js +1 -1
- package/package.json +6 -6
- package/src/lib/parsers/csw/parse-csw-capabilities.ts +1 -1
- package/src/lib/parsers/csw/parse-csw-domain.ts +1 -1
- package/src/lib/parsers/csw/parse-csw-records.ts +6 -6
- package/src/lib/parsers/csw/parse-exception-report.ts +1 -1
- package/src/lib/parsers/gml/parse-gml.ts +1 -1
- package/src/lib/parsers/wms/parse-wms-capabilities.ts +1 -1
- package/src/lib/parsers/wms/parse-wms-features.ts +1 -1
- package/src/lib/wfs/parse-wfs.ts +34 -0
- package/src/lib/wmts/parse-wmts.ts +37 -0
- package/src/wip/lib/wcs/parse-wcs-capabilities.ts +1 -1
- package/src/wip/lib/wfs/parse-wfs-capabilities.ts +1 -1
- package/src/wip/lib/wmts/parse-wmts-capabilities.ts +1 -1
|
@@ -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} 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,
|
|
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,uBAAkB,KAAK,WAAW,sBAAiB,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 "
|
|
2
|
+
const VERSION = typeof "4.0.0-alpha.11" !== 'undefined' ? "4.0.0-alpha.11" : 'latest';
|
|
3
3
|
export const WMSErrorLoader = {
|
|
4
4
|
id: 'wms-error',
|
|
5
5
|
name: 'WMS Error',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wms-error-loader.js","names":["parseWMSError","VERSION","WMSErrorLoader","id","name","module","version","worker","extensions","mimeTypes","testText","testXMLFile","options","wms","throwOnError","parse","arrayBuffer","parseTextSync","TextDecoder","decode","parseSync","text","startsWith","wmsOptions","error","message","minimalErrors","concat","Error","_typecheckWMSErrorLoader"],"sources":["../../src/wms-error-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport {parseWMSError} from './lib/parsers/wms/parse-wms-error';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type WMSLoaderOptions = LoaderOptions & {\n wms?: {\n /** By default the error loader will throw an error with the parsed error message */\n throwOnError?: boolean;\n /** Do not add any text to errors */\n minimalErrors?: boolean;\n };\n};\n\n/**\n * Loader for the response to the WMS GetCapability request\n */\nexport const WMSErrorLoader = {\n id: 'wms-error',\n name: 'WMS Error',\n\n module: 'wms',\n version: VERSION,\n worker: false,\n extensions: ['xml'],\n mimeTypes: ['application/vnd.ogc.se_xml', 'application/xml', 'text/xml'],\n testText: testXMLFile,\n options: {\n wms: {\n throwOnError: false\n }\n },\n parse: async (arrayBuffer: ArrayBuffer, options?: WMSLoaderOptions): Promise<string> =>\n parseTextSync(new TextDecoder().decode(arrayBuffer), options),\n parseSync: (arrayBuffer: ArrayBuffer, options?: WMSLoaderOptions): string =>\n parseTextSync(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: WMSLoaderOptions): string => parseTextSync(text, options)\n};\n\nfunction testXMLFile(text: string): boolean {\n // TODO - There could be space first.\n return text.startsWith('<?xml');\n}\n\nfunction parseTextSync(text: string, options?: WMSLoaderOptions): string {\n const wmsOptions: WMSLoaderOptions['wms'] = {...WMSErrorLoader.options.wms, ...options?.wms};\n const error = parseWMSError(text, wmsOptions);\n const message = wmsOptions.minimalErrors ? error : `WMS Service error: ${error}`;\n if (wmsOptions.throwOnError) {\n throw new Error(message);\n }\n return message;\n}\n\nexport const _typecheckWMSErrorLoader: LoaderWithParser = WMSErrorLoader;\n"],"mappings":"AAGA,SAAQA,aAAa,QAAO,mCAAmC;AAI/D,MAAMC,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"wms-error-loader.js","names":["parseWMSError","VERSION","WMSErrorLoader","id","name","module","version","worker","extensions","mimeTypes","testText","testXMLFile","options","wms","throwOnError","parse","arrayBuffer","parseTextSync","TextDecoder","decode","parseSync","text","startsWith","wmsOptions","error","message","minimalErrors","concat","Error","_typecheckWMSErrorLoader"],"sources":["../../src/wms-error-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport {parseWMSError} from './lib/parsers/wms/parse-wms-error';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type WMSLoaderOptions = LoaderOptions & {\n wms?: {\n /** By default the error loader will throw an error with the parsed error message */\n throwOnError?: boolean;\n /** Do not add any text to errors */\n minimalErrors?: boolean;\n };\n};\n\n/**\n * Loader for the response to the WMS GetCapability request\n */\nexport const WMSErrorLoader = {\n id: 'wms-error',\n name: 'WMS Error',\n\n module: 'wms',\n version: VERSION,\n worker: false,\n extensions: ['xml'],\n mimeTypes: ['application/vnd.ogc.se_xml', 'application/xml', 'text/xml'],\n testText: testXMLFile,\n options: {\n wms: {\n throwOnError: false\n }\n },\n parse: async (arrayBuffer: ArrayBuffer, options?: WMSLoaderOptions): Promise<string> =>\n parseTextSync(new TextDecoder().decode(arrayBuffer), options),\n parseSync: (arrayBuffer: ArrayBuffer, options?: WMSLoaderOptions): string =>\n parseTextSync(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text: string, options?: WMSLoaderOptions): string => parseTextSync(text, options)\n};\n\nfunction testXMLFile(text: string): boolean {\n // TODO - There could be space first.\n return text.startsWith('<?xml');\n}\n\nfunction parseTextSync(text: string, options?: WMSLoaderOptions): string {\n const wmsOptions: WMSLoaderOptions['wms'] = {...WMSErrorLoader.options.wms, ...options?.wms};\n const error = parseWMSError(text, wmsOptions);\n const message = wmsOptions.minimalErrors ? error : `WMS Service error: ${error}`;\n if (wmsOptions.throwOnError) {\n throw new Error(message);\n }\n return message;\n}\n\nexport const _typecheckWMSErrorLoader: LoaderWithParser = WMSErrorLoader;\n"],"mappings":"AAGA,SAAQA,aAAa,QAAO,mCAAmC;AAI/D,MAAMC,OAAO,GAAG,uBAAkB,KAAK,WAAW,sBAAiB,QAAQ;AAc3E,OAAO,MAAMC,cAAc,GAAG;EAC5BC,EAAE,EAAE,WAAW;EACfC,IAAI,EAAE,WAAW;EAEjBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEL,OAAO;EAChBM,MAAM,EAAE,KAAK;EACbC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,SAAS,EAAE,CAAC,4BAA4B,EAAE,iBAAiB,EAAE,UAAU,CAAC;EACxEC,QAAQ,EAAEC,WAAW;EACrBC,OAAO,EAAE;IACPC,GAAG,EAAE;MACHC,YAAY,EAAE;IAChB;EACF,CAAC;EACDC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEJ,OAA0B,KAChEK,aAAa,CAAC,IAAIC,WAAW,CAAC,CAAC,CAACC,MAAM,CAACH,WAAW,CAAC,EAAEJ,OAAO,CAAC;EAC/DQ,SAAS,EAAEA,CAACJ,WAAwB,EAAEJ,OAA0B,KAC9DK,aAAa,CAAC,IAAIC,WAAW,CAAC,CAAC,CAACC,MAAM,CAACH,WAAW,CAAC,EAAEJ,OAAO,CAAC;EAC/DK,aAAa,EAAEA,CAACI,IAAY,EAAET,OAA0B,KAAaK,aAAa,CAACI,IAAI,EAAET,OAAO;AAClG,CAAC;AAED,SAASD,WAAWA,CAACU,IAAY,EAAW;EAE1C,OAAOA,IAAI,CAACC,UAAU,CAAC,OAAO,CAAC;AACjC;AAEA,SAASL,aAAaA,CAACI,IAAY,EAAET,OAA0B,EAAU;EACvE,MAAMW,UAAmC,GAAG;IAAC,GAAGrB,cAAc,CAACU,OAAO,CAACC,GAAG;IAAE,IAAGD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,GAAG;EAAA,CAAC;EAC5F,MAAMW,KAAK,GAAGxB,aAAa,CAACqB,IAAI,EAAEE,UAAU,CAAC;EAC7C,MAAME,OAAO,GAAGF,UAAU,CAACG,aAAa,GAAGF,KAAK,yBAAAG,MAAA,CAAyBH,KAAK,CAAE;EAChF,IAAID,UAAU,CAACT,YAAY,EAAE;IAC3B,MAAM,IAAIc,KAAK,CAACH,OAAO,CAAC;EAC1B;EACA,OAAOA,OAAO;AAChB;AAEA,OAAO,MAAMI,wBAA0C,GAAG3B,cAAc"}
|
|
@@ -9,7 +9,7 @@ const parse_exception_report_1 = require("./parse-exception-report");
|
|
|
9
9
|
* @note Error handlings is fairly weak
|
|
10
10
|
*/
|
|
11
11
|
function parseCSWCapabilities(text, options) {
|
|
12
|
-
const parsedXML = xml_1.XMLLoader.parseTextSync(text, {
|
|
12
|
+
const parsedXML = xml_1.XMLLoader.parseTextSync?.(text, {
|
|
13
13
|
...options,
|
|
14
14
|
xml: {
|
|
15
15
|
...options?.xml,
|
|
@@ -9,7 +9,7 @@ const parse_exception_report_1 = require("./parse-exception-report");
|
|
|
9
9
|
* @note Error handlings is fairly weak
|
|
10
10
|
*/
|
|
11
11
|
function parseCSWDomain(text, options) {
|
|
12
|
-
const parsedXML = xml_1.XMLLoader.parseTextSync(text, {
|
|
12
|
+
const parsedXML = xml_1.XMLLoader.parseTextSync?.(text, {
|
|
13
13
|
...options,
|
|
14
14
|
xml: {
|
|
15
15
|
...options?.xml,
|
|
@@ -10,17 +10,17 @@ const parse_exception_report_1 = require("./parse-exception-report");
|
|
|
10
10
|
* @note Error handlings is fairly weak
|
|
11
11
|
*/
|
|
12
12
|
function parseCSWRecords(text, options) {
|
|
13
|
-
const parsedXML = xml_2.XMLLoader.parseTextSync(text, {
|
|
13
|
+
const parsedXML = xml_2.XMLLoader.parseTextSync?.(text, {
|
|
14
14
|
...options,
|
|
15
15
|
xml: {
|
|
16
16
|
...options?.xml,
|
|
17
17
|
removeNSPrefix: true,
|
|
18
18
|
uncapitalizeKeys: true,
|
|
19
|
-
arrayPaths: []
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
arrayPaths: [],
|
|
20
|
+
_fastXML: {
|
|
21
|
+
...options?.xml?._fastXML,
|
|
22
|
+
parseAttributeValue: true
|
|
23
|
+
}
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
(0, parse_exception_report_1.parseExceptionReport)(parsedXML);
|
|
@@ -9,7 +9,7 @@ exports.parseExceptionReport = void 0;
|
|
|
9
9
|
* @note Error handlings is fairly weak
|
|
10
10
|
*/
|
|
11
11
|
function parseExceptionReport(parsedXML) {
|
|
12
|
-
// const parsedXML = XMLLoader.parseTextSync(text, {
|
|
12
|
+
// const parsedXML = XMLLoader.parseTextSync?.(text, {
|
|
13
13
|
// ...options,
|
|
14
14
|
// xml: {
|
|
15
15
|
// ...options?.xml,
|
|
@@ -17,7 +17,7 @@ function noTransform(...coords) {
|
|
|
17
17
|
*/
|
|
18
18
|
function parseGML(text, options) {
|
|
19
19
|
// GeoJSON | null {
|
|
20
|
-
const parsedXML = xml_1.XMLLoader.parseTextSync(text, options);
|
|
20
|
+
const parsedXML = xml_1.XMLLoader.parseTextSync?.(text, options);
|
|
21
21
|
options = { transformCoords: noTransform, stride: 2, ...options };
|
|
22
22
|
const context = createChildContext(parsedXML, options, {});
|
|
23
23
|
return parseGMLToGeometry(parsedXML, options, context);
|
|
@@ -9,7 +9,7 @@ const parse_xml_helpers_1 = require("../xml/parse-xml-helpers");
|
|
|
9
9
|
* @note Error handlings is fairly weak
|
|
10
10
|
*/
|
|
11
11
|
function parseWMSCapabilities(xmlText, options) {
|
|
12
|
-
const parsedXML = xml_1.XMLLoader.parseTextSync(xmlText, options);
|
|
12
|
+
const parsedXML = xml_1.XMLLoader.parseTextSync?.(xmlText, options);
|
|
13
13
|
const xmlCapabilities = parsedXML.WMT_MS_Capabilities || parsedXML.WMS_Capabilities || parsedXML;
|
|
14
14
|
const capabilities = extractCapabilities(xmlCapabilities);
|
|
15
15
|
// In case the processed, normalized capabilities do not contain everything,
|
|
@@ -8,7 +8,7 @@ const xml_1 = require("@loaders.gl/xml");
|
|
|
8
8
|
* @note Error handlings is fairly weak
|
|
9
9
|
*/
|
|
10
10
|
function parseWMSFeatureInfo(text, options) {
|
|
11
|
-
const parsedXML = xml_1.XMLLoader.parseTextSync(text, options);
|
|
11
|
+
const parsedXML = xml_1.XMLLoader.parseTextSync?.(text, options);
|
|
12
12
|
const xmlFeatureInfo = parsedXML.FeatureInfoResponse?.FIELDS || [];
|
|
13
13
|
const xmlFeatures = Array.isArray(xmlFeatureInfo) ? xmlFeatureInfo : [xmlFeatureInfo];
|
|
14
14
|
return {
|
|
@@ -221,17 +221,7 @@ export declare class WMSService extends ImageSource<WMSServiceProps> {
|
|
|
221
221
|
options: {
|
|
222
222
|
wms: {};
|
|
223
223
|
};
|
|
224
|
-
} |
|
|
225
|
-
id: string;
|
|
226
|
-
module: string;
|
|
227
|
-
name: string;
|
|
228
|
-
version: any;
|
|
229
|
-
mimeTypes: string[];
|
|
230
|
-
extensions: string[];
|
|
231
|
-
parse: typeof import("modules/images/src/lib/parsers/parse-image").default;
|
|
232
|
-
tests: ((arrayBuffer: any) => boolean)[];
|
|
233
|
-
options: import("@loaders.gl/images").ImageLoaderOptions;
|
|
234
|
-
})[];
|
|
224
|
+
} | import("@loaders.gl/loader-utils").LoaderWithParser<ImageType, never, import("@loaders.gl/images").ImageLoaderOptions>)[];
|
|
235
225
|
/** Create a WMSService */
|
|
236
226
|
constructor(props: WMSServiceProps);
|
|
237
227
|
getMetadata(): Promise<ImageSourceMetadata>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wms-service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/ogc/wms-service.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAIlD,OAAO,KAAK,EAAC,mBAAmB,EAAE,kBAAkB,EAAC,MAAM,4BAA4B,CAAC;AACxF,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAC,WAAW,EAAC,MAAM,4BAA4B,CAAC;AAEvD,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,kCAAkC,CAAC;AACtE,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,sCAAsC,CAAC;AACzE,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,2CAA2C,CAAC;AAMnF,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAGhE;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,iCAAiC;IACjC,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAC5B,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAExB,6EAA6E;IAC7E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,oEAAoE;IACpE,WAAW,CAAC,EAAE,YAAY,GAAG,qBAAqB,GAAG,yBAAyB,CAAC;IAC/E,kCAAkC;IAClC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qEAAqE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AG,EAAE,MAAM,GAAG;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAC;IAa7E;;;;SAIK;IACL,SAAS,CAAC,UAAU,CAClB,OAAO,EAAE,MAAM,EACf,aAAa,EAAE;QAAC,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAC,EACpE,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACzC,MAAM;IA4BT,oBAAoB,CAAC,WAAW,SAAS;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAC,EACnE,aAAa,EAAE,WAAW,GACzB,WAAW;IAUd,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,GAAG,MAAM;IAwCnF,+DAA+D;IAC/D,gBAAgB,CACd,SAAS,EAAE,OAAO,EAClB,aAAa,EAAE,aAAa,GAC3B,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IAkB1C,8EAA8E;cAC9D,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAOpE,qFAAqF;IACrF,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,GAAG,IAAI;IAY5E,+BAA+B;IAC/B,SAAS,CAAC,WAAW,CAAC,WAAW,EAAE,WAAW,GAAG,KAAK;CAIvD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type WFSCapabilities = {};
|
|
2
|
+
/**
|
|
3
|
+
* Parses a typed data structure from raw XML for `GetCapabilities` response
|
|
4
|
+
* @note Error handlings is fairly weak
|
|
5
|
+
*/
|
|
6
|
+
export declare function parseWFSCapabilities(text: string, options: any): WFSCapabilities;
|
|
7
|
+
//# sourceMappingURL=parse-wfs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-wfs.d.ts","sourceRoot":"","sources":["../../../src/lib/wfs/parse-wfs.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,eAAe,GAAG,EAAE,CAAC;AAEjC;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,KAAA,GAAG,eAAe,CAM3E"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// loaders.gl, MIT license
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.parseWFSCapabilities = void 0;
|
|
5
|
+
const xml_1 = require("@loaders.gl/xml");
|
|
6
|
+
/**
|
|
7
|
+
* Parses a typed data structure from raw XML for `GetCapabilities` response
|
|
8
|
+
* @note Error handlings is fairly weak
|
|
9
|
+
*/
|
|
10
|
+
function parseWFSCapabilities(text, options) {
|
|
11
|
+
// Remove namespaces in XML
|
|
12
|
+
options = { ...options, xml: { ...options?.xml, removeNSPrefix: true } };
|
|
13
|
+
const parsedXML = xml_1.XMLLoader.parseTextSync?.(text, options);
|
|
14
|
+
const xmlCapabilities = parsedXML.Capabilities || parsedXML;
|
|
15
|
+
return uncapitalizeKeys(xmlCapabilities);
|
|
16
|
+
}
|
|
17
|
+
exports.parseWFSCapabilities = parseWFSCapabilities;
|
|
18
|
+
/** Uncapitalize all keys of an object */
|
|
19
|
+
function uncapitalizeKeys(object) {
|
|
20
|
+
if (object && typeof object === 'object') {
|
|
21
|
+
const newObject = {};
|
|
22
|
+
for (const [key, value] of Object.entries(object)) {
|
|
23
|
+
newObject[uncapitalize(key)] = uncapitalizeKeys(value);
|
|
24
|
+
}
|
|
25
|
+
return newObject;
|
|
26
|
+
}
|
|
27
|
+
return object;
|
|
28
|
+
}
|
|
29
|
+
/** Uncapitalize first letter of a string */
|
|
30
|
+
function uncapitalize(str) {
|
|
31
|
+
return typeof str === 'string' ? str.charAt(0).toLowerCase() + str.slice(1) : str;
|
|
32
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type WMTSCapabilities = {};
|
|
2
|
+
/**
|
|
3
|
+
* Parses a typed data structure from raw XML for `GetCapabilities` response
|
|
4
|
+
* @note Error handlings is fairly weak
|
|
5
|
+
*/
|
|
6
|
+
export declare function parseWMTSCapabilities(text: string, options: any): WMTSCapabilities;
|
|
7
|
+
//# sourceMappingURL=parse-wmts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-wmts.d.ts","sourceRoot":"","sources":["../../../src/lib/wmts/parse-wmts.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAElC;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,KAAA,GAAG,gBAAgB,CAM7E"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// loaders.gl, MIT license
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.parseWMTSCapabilities = void 0;
|
|
5
|
+
const xml_1 = require("@loaders.gl/xml");
|
|
6
|
+
/**
|
|
7
|
+
* Parses a typed data structure from raw XML for `GetCapabilities` response
|
|
8
|
+
* @note Error handlings is fairly weak
|
|
9
|
+
*/
|
|
10
|
+
function parseWMTSCapabilities(text, options) {
|
|
11
|
+
// Remove namespaces in XML
|
|
12
|
+
options = { ...options, xml: { ...options?.xml, removeNSPrefix: true } };
|
|
13
|
+
const parsedXML = xml_1.XMLLoader.parseTextSync?.(text, options);
|
|
14
|
+
const xmlCapabilities = parsedXML.Capabilities || parsedXML;
|
|
15
|
+
return uncapitalizeKeys(xmlCapabilities);
|
|
16
|
+
}
|
|
17
|
+
exports.parseWMTSCapabilities = parseWMTSCapabilities;
|
|
18
|
+
function uncapitalizeKeys(object) {
|
|
19
|
+
if (object && typeof object === 'object') {
|
|
20
|
+
const newObject = {};
|
|
21
|
+
for (const [key, value] of Object.entries(object)) {
|
|
22
|
+
newObject[uncapitalize(key)] = uncapitalizeKeys(value);
|
|
23
|
+
}
|
|
24
|
+
return newObject;
|
|
25
|
+
}
|
|
26
|
+
return object;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Uncapitalize first letter of a string
|
|
30
|
+
* @param {string} str
|
|
31
|
+
* @returns {string}
|
|
32
|
+
*/
|
|
33
|
+
function uncapitalize(str) {
|
|
34
|
+
return typeof str === 'string' ? str.charAt(0).toLowerCase() + str.slice(1) : str;
|
|
35
|
+
}
|
|
@@ -8,7 +8,7 @@ const xml_1 = require("@loaders.gl/xml");
|
|
|
8
8
|
* @note Error handlings is fairly weak
|
|
9
9
|
*/
|
|
10
10
|
function parseWCSCapabilities(text, options) {
|
|
11
|
-
const parsedXML = xml_1.XMLLoader.parseTextSync(text, { ...options, xml: { ...options?.xml, removeNSPrefix: true } });
|
|
11
|
+
const parsedXML = xml_1.XMLLoader.parseTextSync?.(text, { ...options, xml: { ...options?.xml, removeNSPrefix: true } });
|
|
12
12
|
const xmlCapabilities = parsedXML.Capabilities || parsedXML;
|
|
13
13
|
return xmlCapabilities;
|
|
14
14
|
}
|
|
@@ -8,7 +8,7 @@ const xml_1 = require("@loaders.gl/xml");
|
|
|
8
8
|
* @note Error handlings is fairly weak
|
|
9
9
|
*/
|
|
10
10
|
function parseWFSCapabilities(text, options) {
|
|
11
|
-
const parsedXML = xml_1.XMLLoader.parseTextSync(text, { ...options, xml: {
|
|
11
|
+
const parsedXML = xml_1.XMLLoader.parseTextSync?.(text, { ...options, xml: {
|
|
12
12
|
...options?.xml,
|
|
13
13
|
removeNSPrefix: true,
|
|
14
14
|
uncapitalizeKeys: true
|
|
@@ -8,7 +8,7 @@ const xml_1 = require("@loaders.gl/xml");
|
|
|
8
8
|
* @note Error handlings is fairly weak
|
|
9
9
|
*/
|
|
10
10
|
function parseWMTSCapabilities(text, options) {
|
|
11
|
-
const parsedXML = xml_1.XMLLoader.parseTextSync(text, { ...options, xml: {
|
|
11
|
+
const parsedXML = xml_1.XMLLoader.parseTextSync?.(text, { ...options, xml: {
|
|
12
12
|
...options?.xml,
|
|
13
13
|
removeNSPrefix: true,
|
|
14
14
|
uncapitalizeKeys: true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/wms",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-alpha.11",
|
|
4
4
|
"description": "Framework-independent loaders for the WMS (Web Map Service) standard",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@babel/runtime": "^7.3.1",
|
|
42
|
-
"@loaders.gl/images": "
|
|
43
|
-
"@loaders.gl/loader-utils": "
|
|
44
|
-
"@loaders.gl/schema": "
|
|
45
|
-
"@loaders.gl/xml": "
|
|
42
|
+
"@loaders.gl/images": "4.0.0-alpha.11",
|
|
43
|
+
"@loaders.gl/loader-utils": "4.0.0-alpha.11",
|
|
44
|
+
"@loaders.gl/schema": "4.0.0-alpha.11",
|
|
45
|
+
"@loaders.gl/xml": "4.0.0-alpha.11",
|
|
46
46
|
"@turf/rewind": "^5.1.5",
|
|
47
47
|
"deep-strict-equal": "^0.2.0",
|
|
48
48
|
"lerc": "^4.0.1"
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"xmldom": "0.6.0"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "bc680098cfea790c67b7fb95bab96e8d9288d34f"
|
|
54
54
|
}
|
|
@@ -87,7 +87,7 @@ export type CSWCapabilities = {
|
|
|
87
87
|
* @note Error handlings is fairly weak
|
|
88
88
|
*/
|
|
89
89
|
export function parseCSWCapabilities(text: string, options?: XMLLoaderOptions): CSWCapabilities {
|
|
90
|
-
const parsedXML = XMLLoader.parseTextSync(text, {
|
|
90
|
+
const parsedXML = XMLLoader.parseTextSync?.(text, {
|
|
91
91
|
...options,
|
|
92
92
|
xml: {
|
|
93
93
|
...options?.xml,
|
|
@@ -20,7 +20,7 @@ export type CSWDomain = {
|
|
|
20
20
|
* @note Error handlings is fairly weak
|
|
21
21
|
*/
|
|
22
22
|
export function parseCSWDomain(text: string, options?: XMLLoaderOptions): CSWDomain {
|
|
23
|
-
const parsedXML = XMLLoader.parseTextSync(text, {
|
|
23
|
+
const parsedXML = XMLLoader.parseTextSync?.(text, {
|
|
24
24
|
...options,
|
|
25
25
|
xml: {
|
|
26
26
|
...options?.xml,
|
|
@@ -35,17 +35,17 @@ export type CSWRecords = {
|
|
|
35
35
|
* @note Error handlings is fairly weak
|
|
36
36
|
*/
|
|
37
37
|
export function parseCSWRecords(text: string, options?: XMLLoaderOptions): CSWRecords {
|
|
38
|
-
const parsedXML = XMLLoader.parseTextSync(text, {
|
|
38
|
+
const parsedXML = XMLLoader.parseTextSync?.(text, {
|
|
39
39
|
...options,
|
|
40
40
|
xml: {
|
|
41
41
|
...options?.xml,
|
|
42
42
|
removeNSPrefix: true,
|
|
43
43
|
uncapitalizeKeys: true,
|
|
44
|
-
arrayPaths: []
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
arrayPaths: [],
|
|
45
|
+
_fastXML: {
|
|
46
|
+
...options?.xml?._fastXML,
|
|
47
|
+
parseAttributeValue: true
|
|
48
|
+
}
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @note Error handlings is fairly weak
|
|
9
9
|
*/
|
|
10
10
|
export function parseExceptionReport(parsedXML: any): void {
|
|
11
|
-
// const parsedXML = XMLLoader.parseTextSync(text, {
|
|
11
|
+
// const parsedXML = XMLLoader.parseTextSync?.(text, {
|
|
12
12
|
// ...options,
|
|
13
13
|
// xml: {
|
|
14
14
|
// ...options?.xml,
|
|
@@ -45,7 +45,7 @@ export type ParseGMLContext = {
|
|
|
45
45
|
*/
|
|
46
46
|
export function parseGML(text: string, options) {
|
|
47
47
|
// GeoJSON | null {
|
|
48
|
-
const parsedXML = XMLLoader.parseTextSync(text, options);
|
|
48
|
+
const parsedXML = XMLLoader.parseTextSync?.(text, options);
|
|
49
49
|
|
|
50
50
|
options = {transformCoords: noTransform, stride: 2, ...options};
|
|
51
51
|
const context = createChildContext(parsedXML, options, {});
|
|
@@ -163,7 +163,7 @@ export function parseWMSCapabilities(
|
|
|
163
163
|
xmlText: string,
|
|
164
164
|
options?: ParseWMSCapabilitiesOptions
|
|
165
165
|
): WMSCapabilities {
|
|
166
|
-
const parsedXML = XMLLoader.parseTextSync(xmlText, options);
|
|
166
|
+
const parsedXML = XMLLoader.parseTextSync?.(xmlText, options);
|
|
167
167
|
const xmlCapabilities: any =
|
|
168
168
|
parsedXML.WMT_MS_Capabilities || parsedXML.WMS_Capabilities || parsedXML;
|
|
169
169
|
const capabilities = extractCapabilities(xmlCapabilities);
|
|
@@ -18,7 +18,7 @@ export type WMSFeature = {
|
|
|
18
18
|
* @note Error handlings is fairly weak
|
|
19
19
|
*/
|
|
20
20
|
export function parseWMSFeatureInfo(text: string, options): WMSFeatureInfo {
|
|
21
|
-
const parsedXML = XMLLoader.parseTextSync(text, options);
|
|
21
|
+
const parsedXML = XMLLoader.parseTextSync?.(text, options);
|
|
22
22
|
const xmlFeatureInfo: any = parsedXML.FeatureInfoResponse?.FIELDS || [];
|
|
23
23
|
|
|
24
24
|
const xmlFeatures = Array.isArray(xmlFeatureInfo) ? xmlFeatureInfo : [xmlFeatureInfo];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// loaders.gl, MIT license
|
|
2
|
+
|
|
3
|
+
import {XMLLoader} from '@loaders.gl/xml';
|
|
4
|
+
|
|
5
|
+
export type WFSCapabilities = {};
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Parses a typed data structure from raw XML for `GetCapabilities` response
|
|
9
|
+
* @note Error handlings is fairly weak
|
|
10
|
+
*/
|
|
11
|
+
export function parseWFSCapabilities(text: string, options): WFSCapabilities {
|
|
12
|
+
// Remove namespaces in XML
|
|
13
|
+
options = {...options, xml: {...options?.xml, removeNSPrefix: true}};
|
|
14
|
+
const parsedXML = XMLLoader.parseTextSync?.(text, options);
|
|
15
|
+
const xmlCapabilities: any = parsedXML.Capabilities || parsedXML;
|
|
16
|
+
return uncapitalizeKeys(xmlCapabilities);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Uncapitalize all keys of an object */
|
|
20
|
+
function uncapitalizeKeys(object: any): any {
|
|
21
|
+
if (object && typeof object === 'object') {
|
|
22
|
+
const newObject = {};
|
|
23
|
+
for (const [key, value] of Object.entries(object)) {
|
|
24
|
+
newObject[uncapitalize(key)] = uncapitalizeKeys(value);
|
|
25
|
+
}
|
|
26
|
+
return newObject;
|
|
27
|
+
}
|
|
28
|
+
return object;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Uncapitalize first letter of a string */
|
|
32
|
+
function uncapitalize(str: string): string {
|
|
33
|
+
return typeof str === 'string' ? str.charAt(0).toLowerCase() + str.slice(1) : str;
|
|
34
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// loaders.gl, MIT license
|
|
2
|
+
|
|
3
|
+
import {XMLLoader} from '@loaders.gl/xml';
|
|
4
|
+
|
|
5
|
+
export type WMTSCapabilities = {};
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Parses a typed data structure from raw XML for `GetCapabilities` response
|
|
9
|
+
* @note Error handlings is fairly weak
|
|
10
|
+
*/
|
|
11
|
+
export function parseWMTSCapabilities(text: string, options): WMTSCapabilities {
|
|
12
|
+
// Remove namespaces in XML
|
|
13
|
+
options = {...options, xml: {...options?.xml, removeNSPrefix: true}};
|
|
14
|
+
const parsedXML = XMLLoader.parseTextSync?.(text, options);
|
|
15
|
+
const xmlCapabilities: any = parsedXML.Capabilities || parsedXML;
|
|
16
|
+
return uncapitalizeKeys(xmlCapabilities);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function uncapitalizeKeys(object: any): any {
|
|
20
|
+
if (object && typeof object === 'object') {
|
|
21
|
+
const newObject = {};
|
|
22
|
+
for (const [key, value] of Object.entries(object)) {
|
|
23
|
+
newObject[uncapitalize(key)] = uncapitalizeKeys(value);
|
|
24
|
+
}
|
|
25
|
+
return newObject;
|
|
26
|
+
}
|
|
27
|
+
return object;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Uncapitalize first letter of a string
|
|
32
|
+
* @param {string} str
|
|
33
|
+
* @returns {string}
|
|
34
|
+
*/
|
|
35
|
+
function uncapitalize(str: string): string {
|
|
36
|
+
return typeof str === 'string' ? str.charAt(0).toLowerCase() + str.slice(1) : str;
|
|
37
|
+
}
|
|
@@ -83,7 +83,7 @@ export type WCSCapabilities = {
|
|
|
83
83
|
* @note Error handlings is fairly weak
|
|
84
84
|
*/
|
|
85
85
|
export function parseWCSCapabilities(text: string, options): WCSCapabilities {
|
|
86
|
-
const parsedXML = XMLLoader.parseTextSync(text, {...options, xml: {...options?.xml, removeNSPrefix: true}});
|
|
86
|
+
const parsedXML = XMLLoader.parseTextSync?.(text, {...options, xml: {...options?.xml, removeNSPrefix: true}});
|
|
87
87
|
const xmlCapabilities: any = parsedXML.Capabilities || parsedXML;
|
|
88
88
|
return xmlCapabilities;
|
|
89
89
|
}
|
|
@@ -83,7 +83,7 @@ export type WFSCapabilities = {
|
|
|
83
83
|
* @note Error handlings is fairly weak
|
|
84
84
|
*/
|
|
85
85
|
export function parseWFSCapabilities(text: string, options): WFSCapabilities {
|
|
86
|
-
const parsedXML = XMLLoader.parseTextSync(text, {...options, xml: {
|
|
86
|
+
const parsedXML = XMLLoader.parseTextSync?.(text, {...options, xml: {
|
|
87
87
|
...options?.xml,
|
|
88
88
|
removeNSPrefix: true,
|
|
89
89
|
uncapitalizeKeys: true
|
|
@@ -90,7 +90,7 @@ export type WMTSTileMatrixSet = {
|
|
|
90
90
|
* @note Error handlings is fairly weak
|
|
91
91
|
*/
|
|
92
92
|
export function parseWMTSCapabilities(text: string, options): WMTSCapabilities {
|
|
93
|
-
const parsedXML = XMLLoader.parseTextSync(text, {...options, xml: {
|
|
93
|
+
const parsedXML = XMLLoader.parseTextSync?.(text, {...options, xml: {
|
|
94
94
|
...options?.xml,
|
|
95
95
|
removeNSPrefix: true,
|
|
96
96
|
uncapitalizeKeys: true
|