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

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/index.cjs CHANGED
@@ -36,6 +36,7 @@ __export(src_exports, {
36
36
  CSWService: () => CSWService,
37
37
  ImageService: () => ImageService,
38
38
  ImageSource: () => import_loader_utils5.ImageSource,
39
+ LERCLoader: () => LERCLoader,
39
40
  WMSCapabilitiesLoader: () => WMSCapabilitiesLoader,
40
41
  WMSErrorLoader: () => WMSErrorLoader,
41
42
  WMSService: () => WMSService,
@@ -321,8 +322,8 @@ function parseWMSCapabilities(xmlText, options) {
321
322
  addInheritedLayerProps(layer, null);
322
323
  }
323
324
  }
324
- if ((options == null ? void 0 : options.includeRawData) || (options == null ? void 0 : options.raw)) {
325
- capabilities.raw = xmlCapabilities;
325
+ if (options == null ? void 0 : options.includeRawJSON) {
326
+ capabilities.json = xmlCapabilities;
326
327
  }
327
328
  if (options == null ? void 0 : options.includeXMLText) {
328
329
  capabilities.xml = xmlText;
@@ -1021,6 +1022,9 @@ function testXMLFile7(text) {
1021
1022
  return text.startsWith("<?xml");
1022
1023
  }
1023
1024
 
1025
+ // src/index.ts
1026
+ var import_loader_utils5 = require("@loaders.gl/loader-utils");
1027
+
1024
1028
  // src/lib/services/create-image-service.ts
1025
1029
  function createImageService(props, services) {
1026
1030
  const { type = "auto" } = props;
@@ -1637,5 +1641,25 @@ function extractServices(directory, url) {
1637
1641
  return services;
1638
1642
  }
1639
1643
 
1640
- // src/index.ts
1641
- var import_loader_utils5 = require("@loaders.gl/loader-utils");
1644
+ // src/lerc-loader.ts
1645
+ var Lerc = __toESM(require("lerc"), 1);
1646
+ var VERSION8 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
1647
+ var LERCLoader = {
1648
+ id: "lerc",
1649
+ name: "LERC",
1650
+ module: "wms",
1651
+ version: VERSION8,
1652
+ worker: false,
1653
+ extensions: ["lrc", "lerc", "lerc2", "lerc1"],
1654
+ mimeTypes: ["application/octet-stream"],
1655
+ // test: ?,
1656
+ options: {
1657
+ wms: {}
1658
+ },
1659
+ parse: async (arrayBuffer, options) => parseLERC(arrayBuffer, options)
1660
+ };
1661
+ async function parseLERC(arrayBuffer, options) {
1662
+ await Lerc.load();
1663
+ const pixelBlock = Lerc.decode(arrayBuffer, options == null ? void 0 : options.lerc);
1664
+ return pixelBlock;
1665
+ }
package/dist/index.d.ts CHANGED
@@ -19,6 +19,7 @@ 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 { ImageSource } from '@loaders.gl/loader-utils';
22
23
  export type { ImageType } from '@loaders.gl/images';
23
24
  export type { CreateImageServiceProps } from './lib/services/create-image-service';
24
25
  export { createImageService } from './lib/services/create-image-service';
@@ -30,7 +31,6 @@ export { CSWService } from './services/ogc/csw-service';
30
31
  export { WMSSource, WMSService } from './services/ogc/wms-service';
31
32
  export { getArcGISServices as _getArcGISServices } from './services/arcgis/arcgis-server';
32
33
  export { ArcGISImageService as _ArcGISImageService } from './services/arcgis/arcgis-image-service';
33
- /** @deprecated Use WMSCapabilitiesLoaderOptions */
34
- export type { WMSCapabilitiesLoaderOptions as WMSLoaderOptions } from './wms-capabilities-loader';
35
- export { ImageSource } from '@loaders.gl/loader-utils';
34
+ export type { LERCData } from './lib/parsers/lerc/lerc-types';
35
+ export { LERCLoader } from './lerc-loader';
36
36
  //# 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,CAA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EAAC,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAC,SAAS,EAAE,UAAU,EAAC,MAAM,4BAA4B,CAAC;AAIjE,OAAO,EAAC,iBAAiB,IAAI,kBAAkB,EAAC,MAAM,iCAAiC,CAAC;AACxF,OAAO,EAAC,kBAAkB,IAAI,mBAAmB,EAAC,MAAM,wCAAwC,CAAC;AAGjG,YAAY,EAAC,QAAQ,EAAC,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC"}
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@ export { WMSFeatureInfoLoader as _WMSFeatureInfoLoader } from "./wip/wms-feature
7
7
  export { WMSLayerDescriptionLoader as _WMSLayerDescriptionLoader } from "./wip/wms-layer-description-loader.js";
8
8
  export { WFSCapabilitiesLoader as _WFSCapabilitiesLoader } from "./wip/wfs-capabilities-loader.js";
9
9
  export { GMLLoader as _GMLLoader } from "./gml-loader.js";
10
+ export { ImageSource } from '@loaders.gl/loader-utils';
10
11
  export { createImageService } from "./lib/services/create-image-service.js";
11
12
  export { createImageSource } from "./services/create-image-source.js";
12
13
  export { ImageService } from "./lib/services/image-service.js";
@@ -14,5 +15,5 @@ export { CSWService } from "./services/ogc/csw-service.js";
14
15
  export { WMSSource, WMSService } from "./services/ogc/wms-service.js";
15
16
  export { getArcGISServices as _getArcGISServices } from "./services/arcgis/arcgis-server.js";
16
17
  export { ArcGISImageService as _ArcGISImageService } from "./services/arcgis/arcgis-image-service.js";
17
- export { ImageSource } from '@loaders.gl/loader-utils';
18
+ export { LERCLoader } from "./lerc-loader.js";
18
19
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["CSWCapabilitiesLoader","CSWDomainLoader","CSWRecordsLoader","WMSErrorLoader","WMSCapabilitiesLoader","WMSFeatureInfoLoader","_WMSFeatureInfoLoader","WMSLayerDescriptionLoader","_WMSLayerDescriptionLoader","WFSCapabilitiesLoader","_WFSCapabilitiesLoader","GMLLoader","_GMLLoader","createImageService","createImageSource","ImageService","CSWService","WMSSource","WMSService","getArcGISServices","_getArcGISServices","ArcGISImageService","_ArcGISImageService","ImageSource"],"sources":["../src/index.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n// CSW - Catalog Service for the Web\n\nexport type {CSWLoaderOptions} from './csw-capabilities-loader';\n\nexport type {CSWCapabilities} from './csw-capabilities-loader';\nexport {CSWCapabilitiesLoader} from './csw-capabilities-loader';\n\nexport type {CSWDomain} from './csw-domain-loader';\nexport {CSWDomainLoader} from './csw-domain-loader';\n\nexport type {CSWRecords} from './csw-records-loader';\nexport {CSWRecordsLoader} from './csw-records-loader';\n\n// WMS - Web Map Service\n\nexport {WMSErrorLoader} from './wms-error-loader';\n\nexport type {\n WMSCapabilities,\n WMSLayer,\n WMSBoundingBox,\n WMSDimension\n} from './wms-capabilities-loader';\nexport type {WMSCapabilitiesLoaderOptions} from './wms-capabilities-loader';\nexport {WMSCapabilitiesLoader} from './wms-capabilities-loader';\n\nexport type {WMSFeatureInfo as _WMSFeatureInfo} from './wip/wms-feature-info-loader';\nexport {WMSFeatureInfoLoader as _WMSFeatureInfoLoader} from './wip/wms-feature-info-loader';\n\nexport type {WMSLayerDescription as _WMSLayerDescription} from './wip/wms-layer-description-loader';\nexport {WMSLayerDescriptionLoader as _WMSLayerDescriptionLoader} from './wip/wms-layer-description-loader';\n\n// WMTS - Web Map Tile Service\n\n// export type {WMTSLoaderOptions as _WMTSLoaderOptions} from './wip/wmts-capabilities-loader';\n// export type {WMTSCapabilities as _WMTSCapabilities} from './wip/wmts-capabilities-loader';\n// export {WMTSCapabilitiesLoader as _WMTSCapabilitiesLoader} from './wip/wmts-capabilities-loader';\n\n// WFS - Web Feature Service\n\nexport type {WFSLoaderOptions as _WFSLoaderOptions} from './wip/wfs-capabilities-loader';\n\nexport type {WFSCapabilities as _WFSCapabilities} from './wip/wfs-capabilities-loader';\nexport {WFSCapabilitiesLoader as _WFSCapabilitiesLoader} from './wip/wfs-capabilities-loader';\n\n// GML - Geographic Markup Language\n\nexport type {GeoJSON as _GeoJSON} from '@loaders.gl/schema';\nexport type {GMLLoaderOptions as _GMLLoaderOptions} from './gml-loader';\nexport {GMLLoader as _GMLLoader} from './gml-loader';\n\n// EXPERIMENTAL: DATA SOURCES\n\nexport type {ImageType} from '@loaders.gl/images';\n\nexport type {CreateImageServiceProps} from './lib/services/create-image-service';\nexport {createImageService} from './lib/services/create-image-service';\n\nexport type {ImageServiceType} from './services/create-image-source';\nexport {createImageSource} from './services/create-image-source';\n\n// Generic (Template URL) Services\n\nexport type {ImageServiceProps} from './lib/services/image-service';\nexport {ImageService} from './lib/services/image-service';\n\n// OGC Services\n\nexport {CSWService} from './services/ogc/csw-service';\nexport {WMSSource, WMSService} from './services/ogc/wms-service';\n\n// ArcGIS Services\n\nexport {getArcGISServices as _getArcGISServices} from './services/arcgis/arcgis-server';\nexport {ArcGISImageService as _ArcGISImageService} from './services/arcgis/arcgis-image-service';\n\n// LERC - Limited Error Raster Compression\n// TODO - restore once esbuild bundling issues have been resolved\n// export type {LERCData} from './lib/lerc/lerc-types';\n// export {LERCLoader} from './lerc-loader';\n\n/** @deprecated Use WMSCapabilitiesLoaderOptions */\nexport type {WMSCapabilitiesLoaderOptions as WMSLoaderOptions} from './wms-capabilities-loader';\n\n// TODO - restore once deck.gl has been udpated\nexport {ImageSource} from '@loaders.gl/loader-utils';\n"],"mappings":"SAOQA,qBAAqB;AAAA,SAGrBC,eAAe;AAAA,SAGfC,gBAAgB;AAAA,SAIhBC,cAAc;AAAA,SASdC,qBAAqB;AAAA,SAGrBC,oBAAoB,IAAIC,qBAAqB;AAAA,SAG7CC,yBAAyB,IAAIC,0BAA0B;AAAA,SAavDC,qBAAqB,IAAIC,sBAAsB;AAAA,SAM/CC,SAAS,IAAIC,UAAU;AAAA,SAOvBC,kBAAkB;AAAA,SAGlBC,iBAAiB;AAAA,SAKjBC,YAAY;AAAA,SAIZC,UAAU;AAAA,SACVC,SAAS,EAAEC,UAAU;AAAA,SAIrBC,iBAAiB,IAAIC,kBAAkB;AAAA,SACvCC,kBAAkB,IAAIC,mBAAmB;AAWjD,SAAQC,WAAW,QAAO,0BAA0B"}
1
+ {"version":3,"file":"index.js","names":["CSWCapabilitiesLoader","CSWDomainLoader","CSWRecordsLoader","WMSErrorLoader","WMSCapabilitiesLoader","WMSFeatureInfoLoader","_WMSFeatureInfoLoader","WMSLayerDescriptionLoader","_WMSLayerDescriptionLoader","WFSCapabilitiesLoader","_WFSCapabilitiesLoader","GMLLoader","_GMLLoader","ImageSource","createImageService","createImageSource","ImageService","CSWService","WMSSource","WMSService","getArcGISServices","_getArcGISServices","ArcGISImageService","_ArcGISImageService","LERCLoader"],"sources":["../src/index.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n// CSW - Catalog Service for the Web\n\nexport type {CSWLoaderOptions} from './csw-capabilities-loader';\n\nexport type {CSWCapabilities} from './csw-capabilities-loader';\nexport {CSWCapabilitiesLoader} from './csw-capabilities-loader';\n\nexport type {CSWDomain} from './csw-domain-loader';\nexport {CSWDomainLoader} from './csw-domain-loader';\n\nexport type {CSWRecords} from './csw-records-loader';\nexport {CSWRecordsLoader} from './csw-records-loader';\n\n// WMS - Web Map Service\n\nexport {WMSErrorLoader} from './wms-error-loader';\n\nexport type {\n WMSCapabilities,\n WMSLayer,\n WMSBoundingBox,\n WMSDimension\n} from './wms-capabilities-loader';\nexport type {WMSCapabilitiesLoaderOptions} from './wms-capabilities-loader';\nexport {WMSCapabilitiesLoader} from './wms-capabilities-loader';\n\nexport type {WMSFeatureInfo as _WMSFeatureInfo} from './wip/wms-feature-info-loader';\nexport {WMSFeatureInfoLoader as _WMSFeatureInfoLoader} from './wip/wms-feature-info-loader';\n\nexport type {WMSLayerDescription as _WMSLayerDescription} from './wip/wms-layer-description-loader';\nexport {WMSLayerDescriptionLoader as _WMSLayerDescriptionLoader} from './wip/wms-layer-description-loader';\n\n// WMTS - Web Map Tile Service\n\n// export type {WMTSLoaderOptions as _WMTSLoaderOptions} from './wip/wmts-capabilities-loader';\n// export type {WMTSCapabilities as _WMTSCapabilities} from './wip/wmts-capabilities-loader';\n// export {WMTSCapabilitiesLoader as _WMTSCapabilitiesLoader} from './wip/wmts-capabilities-loader';\n\n// WFS - Web Feature Service\n\nexport type {WFSLoaderOptions as _WFSLoaderOptions} from './wip/wfs-capabilities-loader';\n\nexport type {WFSCapabilities as _WFSCapabilities} from './wip/wfs-capabilities-loader';\nexport {WFSCapabilitiesLoader as _WFSCapabilitiesLoader} from './wip/wfs-capabilities-loader';\n\n// GML - Geographic Markup Language\n\nexport type {GeoJSON as _GeoJSON} from '@loaders.gl/schema';\nexport type {GMLLoaderOptions as _GMLLoaderOptions} from './gml-loader';\nexport {GMLLoader as _GMLLoader} from './gml-loader';\n\n// EXPERIMENTAL: DATA SOURCES\n\n// TODO - restore once deck.gl has been udpated\nexport {ImageSource} from '@loaders.gl/loader-utils';\n\nexport type {ImageType} from '@loaders.gl/images';\n\nexport type {CreateImageServiceProps} from './lib/services/create-image-service';\nexport {createImageService} from './lib/services/create-image-service';\n\nexport type {ImageServiceType} from './services/create-image-source';\nexport {createImageSource} from './services/create-image-source';\n\n// Generic (Template URL) Services\n\nexport type {ImageServiceProps} from './lib/services/image-service';\nexport {ImageService} from './lib/services/image-service';\n\n// OGC Services\n\nexport {CSWService} from './services/ogc/csw-service';\nexport {WMSSource, WMSService} from './services/ogc/wms-service';\n\n// ArcGIS Services\n\nexport {getArcGISServices as _getArcGISServices} from './services/arcgis/arcgis-server';\nexport {ArcGISImageService as _ArcGISImageService} from './services/arcgis/arcgis-image-service';\n\n// LERC - Limited Error Raster Compression\nexport type {LERCData} from './lib/parsers/lerc/lerc-types';\nexport {LERCLoader} from './lerc-loader';\n"],"mappings":"SAOQA,qBAAqB;AAAA,SAGrBC,eAAe;AAAA,SAGfC,gBAAgB;AAAA,SAIhBC,cAAc;AAAA,SASdC,qBAAqB;AAAA,SAGrBC,oBAAoB,IAAIC,qBAAqB;AAAA,SAG7CC,yBAAyB,IAAIC,0BAA0B;AAAA,SAavDC,qBAAqB,IAAIC,sBAAsB;AAAA,SAM/CC,SAAS,IAAIC,UAAU;AAK/B,SAAQC,WAAW,QAAO,0BAA0B;AAAC,SAK7CC,kBAAkB;AAAA,SAGlBC,iBAAiB;AAAA,SAKjBC,YAAY;AAAA,SAIZC,UAAU;AAAA,SACVC,SAAS,EAAEC,UAAU;AAAA,SAIrBC,iBAAiB,IAAIC,kBAAkB;AAAA,SACvCC,kBAAkB,IAAIC,mBAAmB;AAAA,SAIzCC,UAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"deep-strict-equal.js","names":["deepStrictEqual","actual","expected","strict","Date","getTime","RegExp","source","global","multiline","lastIndex","ignoreCase","objEquiv","pSlice","Array","prototype","slice","isPrimitive","arg","isArguments","object","Object","toString","call","a","b","undefined","getPrototypeOf","aIsArgs","bIsArgs","ka","keys","kb","key","i","length","sort"],"sources":["../../../../src/lib/parsers/gml/deep-strict-equal.ts"],"sourcesContent":["// https://github.com/nodejs/node/commit/c1d82ac2ff15594840e2a1b9531b506ae067ed27;\n\n// http://wiki.commonjs.org/wiki/Unit_Testing/1.0\n//\n// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!\n//\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n/** @todo replace this ridiculous choice of deepStrictEqual */\n// eslint-disable-next-line complexity\nexport function deepStrictEqual(actual: unknown, expected: unknown, strict?: boolean) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n // } else if (actual instanceof Buffer && expected instanceof Buffer) {\n // return compare(actual, expected) === 0;\n\n // // 7.2. If the expected value is a Date object, the actual value is\n // // equivalent if it is also a Date object that refers to the same time.\n } else if (actual instanceof Date && expected instanceof Date) {\n return actual.getTime() === expected.getTime();\n\n // 7.3 If the expected value is a RegExp object, the actual value is\n // equivalent if it is also a RegExp object with the same source and\n // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).\n } else if (actual instanceof RegExp && expected instanceof RegExp) {\n return (\n actual.source === expected.source &&\n actual.global === expected.global &&\n actual.multiline === expected.multiline &&\n actual.lastIndex === expected.lastIndex &&\n actual.ignoreCase === expected.ignoreCase\n );\n\n // 7.4. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if (\n (actual === null || typeof actual !== 'object') &&\n (expected === null || typeof expected !== 'object')\n ) {\n // eslint-disable-next-line eqeqeq\n return strict ? actual === expected : actual == expected;\n\n // 7.5 For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n }\n return objEquiv(actual, expected, strict);\n}\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst pSlice = Array.prototype.slice;\n\nfunction isPrimitive(arg) {\n return arg === null || (typeof arg !== 'object' && typeof arg !== 'function');\n}\n\nfunction isArguments(object) {\n // eslint-disable-next-line eqeqeq\n return Object.prototype.toString.call(object) == '[object Arguments]';\n}\n\n// eslint-disable-next-line complexity\nfunction objEquiv(a: unknown, b: unknown, strict) {\n if (a === null || a === undefined || b === null || b === undefined) return false;\n // if one is a primitive, the other must be same\n if (isPrimitive(a) || isPrimitive(b)) return a === b;\n if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b)) return false;\n const aIsArgs = isArguments(a);\n const bIsArgs = isArguments(b);\n if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs)) return false;\n if (aIsArgs) {\n a = pSlice.call(a);\n b = pSlice.call(b);\n return deepStrictEqual(a, b, strict);\n }\n const ka = Object.keys(a);\n const kb = Object.keys(b);\n let key;\n let i;\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length !== kb.length) return false;\n // the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n // ~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] !== kb[i]) return false;\n }\n // equivalent values for every corresponding key, and\n // ~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!deepStrictEqual(a[key], b[key], strict)) return false;\n }\n return true;\n}\n"],"mappings":"AA4BA,OAAO,SAASA,eAAeA,CAACC,MAAe,EAAEC,QAAiB,EAAEC,MAAgB,EAAE;EAEpF,IAAIF,MAAM,KAAKC,QAAQ,EAAE;IACvB,OAAO,IAAI;EAMb,CAAC,MAAM,IAAID,MAAM,YAAYG,IAAI,IAAIF,QAAQ,YAAYE,IAAI,EAAE;IAC7D,OAAOH,MAAM,CAACI,OAAO,CAAC,CAAC,KAAKH,QAAQ,CAACG,OAAO,CAAC,CAAC;EAKhD,CAAC,MAAM,IAAIJ,MAAM,YAAYK,MAAM,IAAIJ,QAAQ,YAAYI,MAAM,EAAE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C,CAACQ,GAAG,CAAC,EAAE9B,MAAM,CAAC,EAAE,OAAO,KAAK;EAC5D;EACA,OAAO,IAAI;AACb"}
1
+ {"version":3,"file":"deep-strict-equal.js","names":["deepStrictEqual","actual","expected","strict","Date","getTime","RegExp","source","global","multiline","lastIndex","ignoreCase","objEquiv","pSlice","Array","prototype","slice","isPrimitive","arg","isArguments","object","Object","toString","call","a","b","undefined","getPrototypeOf","aIsArgs","bIsArgs","ka","keys","kb","key","i","length","sort"],"sources":["../../../../src/lib/parsers/gml/deep-strict-equal.ts"],"sourcesContent":["// https://github.com/nodejs/node/commit/c1d82ac2ff15594840e2a1b9531b506ae067ed27;\n\n// http://wiki.commonjs.org/wiki/Unit_Testing/1.0\n//\n// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!\n//\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n/** @todo replace this ridiculous choice of deepStrictEqual */\n// eslint-disable-next-line complexity\nexport function deepStrictEqual(actual: unknown, expected: unknown, strict?: boolean) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n // } else if (actual instanceof Buffer && expected instanceof Buffer) {\n // return compare(actual, expected) === 0;\n\n // // 7.2. If the expected value is a Date object, the actual value is\n // // equivalent if it is also a Date object that refers to the same time.\n } else if (actual instanceof Date && expected instanceof Date) {\n return actual.getTime() === expected.getTime();\n\n // 7.3 If the expected value is a RegExp object, the actual value is\n // equivalent if it is also a RegExp object with the same source and\n // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).\n } else if (actual instanceof RegExp && expected instanceof RegExp) {\n return (\n actual.source === expected.source &&\n actual.global === expected.global &&\n actual.multiline === expected.multiline &&\n actual.lastIndex === expected.lastIndex &&\n actual.ignoreCase === expected.ignoreCase\n );\n\n // 7.4. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if (\n (actual === null || typeof actual !== 'object') &&\n (expected === null || typeof expected !== 'object')\n ) {\n // eslint-disable-next-line eqeqeq\n return strict ? actual === expected : actual == expected;\n\n // 7.5 For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n }\n return objEquiv(actual, expected, strict);\n}\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst pSlice = Array.prototype.slice;\n\nfunction isPrimitive(arg) {\n return arg === null || (typeof arg !== 'object' && typeof arg !== 'function');\n}\n\nfunction isArguments(object) {\n // eslint-disable-next-line eqeqeq\n return Object.prototype.toString.call(object) == '[object Arguments]';\n}\n\n// eslint-disable-next-line complexity\nfunction objEquiv(a: unknown, b: unknown, strict) {\n if (a === null || a === undefined || b === null || b === undefined) return false;\n // if one is a primitive, the other must be same\n if (isPrimitive(a) || isPrimitive(b)) return a === b;\n if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b)) return false;\n const aIsArgs = isArguments(a);\n const bIsArgs = isArguments(b);\n if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs)) return false;\n if (aIsArgs) {\n a = pSlice.call(a);\n b = pSlice.call(b);\n return deepStrictEqual(a, b, strict);\n }\n const ka = Object.keys(a as object);\n const kb = Object.keys(b as object);\n let key;\n let i;\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length !== kb.length) return false;\n // the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n // ~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] !== kb[i]) return false;\n }\n // equivalent values for every corresponding key, and\n // ~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n // @ts-ignore\n if (!deepStrictEqual(a[key], b[key], strict)) return false;\n }\n return true;\n}\n"],"mappings":"AA4BA,OAAO,SAASA,eAAeA,CAACC,MAAe,EAAEC,QAAiB,EAAEC,MAAgB,EAAE;EAEpF,IAAIF,MAAM,KAAKC,QAAQ,EAAE;IACvB,OAAO,IAAI;EAMb,CAAC,MAAM,IAAID,MAAM,YAAYG,IAAI,IAAIF,QAAQ,YAAYE,IAAI,EAAE;IAC7D,OAAOH,MAAM,CAACI,OAAO,CAAC,CAAC,KAAKH,QAAQ,CAACG,OAAO,CAAC,CAAC;EAKhD,CAAC,MAAM,IAAIJ,MAAM,YAAYK,MAAM,IAAIJ,QAAQ,YAAYI,MAAM,EAAE;IACjE,OACEL,MAAM,CAACM,MAAM,KAAKL,QAAQ,CAACK,MAAM,IACjCN,MAAM,CAACO,MAAM,KAAKN,QAAQ,CAACM,MAAM,IACjCP,MAAM,CAACQ,SAAS,KAAKP,QAAQ,CAACO,SAAS,IACvCR,MAAM,CAACS,SAAS,KAAKR,QAAQ,CAACQ,SAAS,IACvCT,MAAM,CAACU,UAAU,KAAKT,QAAQ,CAACS,UAAU;EAK7C,CAAC,MAAM,IACL,CAACV,M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,OAAO,EAAE;IACXJ,CAAC,GAAGX,MAAM,CAACU,IAAI,CAACC,CAAC,CAAC;IAClBC,CAAC,GAAGZ,MAAM,CAACU,IAAI,CAACE,CAAC,CAAC;IAClB,OAAOzB,eAAe,CAACwB,CAAC,EAAEC,CAAC,EAAEtB,MAAM,CAAC;EACtC;EACA,MAAM2B,EAAE,GAAGT,MAAM,CAACU,IAAI,CAACP,CAAW,CAAC;EACnC,MAAMQ,EAAE,GAAGX,MAAM,CAACU,IAAI,CAACN,CAAW,CAAC;EACnC,IAAIQ,GAAG;EACP,IAAIC,CAAC;EAGL,IAAIJ,EAAE,CAACK,MAAM,KAAKH,EAAE,CAACG,MAAM,EAAE,OAAO,KAAK;EAEzCL,EAAE,CAACM,IAAI,CAAC,CAAC;EACTJ,EAAE,CAACI,IAAI,CAAC,CAAC;EAET,KAAKF,CAAC,GAAGJ,EAAE,CAACK,MAAM,GAAG,CAAC,EAAED,CAAC,IAAI,CAAC,EAAEA,CAAC,EAAE,EAAE;IACnC,IAAIJ,EAAE,CAACI,CAAC,CAAC,KAAKF,EAAE,CAACE,CAAC,CAAC,EAAE,OAAO,KAAK;EACnC;EAGA,KAAKA,CAAC,GAAGJ,EAAE,CAACK,MAAM,GAAG,CAAC,EAAED,CAAC,IAAI,CAAC,EAAEA,CAAC,EAAE,EAAE;IACnCD,GAAG,GAAGH,EAAE,CAACI,CAAC,CAAC;IAEX,IAAI,CAAClC,eAAe,CAACwB,CAAC,CAACS,GAAG,CAAC,EAAER,CAAC,CAACQ,GAAG,CAAC,EAAE9B,MAAM,CAAC,EAAE,OAAO,KAAK;EAC5D;EACA,OAAO,IAAI;AACb"}
@@ -26,8 +26,8 @@ export type WMSCapabilities = {
26
26
  requests: Record<string, WMSRequest>;
27
27
  /** Information about any exceptions that the service will report (HTTP status != 2xx) */
28
28
  exceptions?: WMSExceptions;
29
- /** Only if `options.raw`: raw untyped JSON parsed from XML. Can include information not extracted in the typed response. */
30
- raw?: Record<string, unknown>;
29
+ /** Only if `options.json`: raw untyped JSON parsed from XML. Can include information not extracted in the typed response. */
30
+ json?: Record<string, unknown>;
31
31
  /** Only if `options.xml`, the unparsed XML string can be requested */
32
32
  xml?: string;
33
33
  };
@@ -113,11 +113,9 @@ export type ParseWMSCapabilitiesOptions = {
113
113
  /** Add inherited layer information to sub layers */
114
114
  inheritedLayerProps?: boolean;
115
115
  /** Include the "raw" JSON (parsed but untyped, unprocessed XML). May contain additional fields */
116
- includeRawData?: boolean;
116
+ includeRawJSON?: boolean;
117
117
  /** Include the original XML document text. May contain additional information. */
118
118
  includeXMLText?: boolean;
119
- /** @deprecated Use includeRawData` */
120
- raw?: boolean;
121
119
  };
122
120
  /**
123
121
  * Parses a typed data structure from raw XML for `GetCapabilities` response
@@ -1 +1 @@
1
- {"version":3,"file":"parse-wms-capabilities.d.ts","sourceRoot":"","sources":["../../../../src/lib/parsers/wms/parse-wms-capabilities.ts"],"names":[],"mappings":"AAWA,gHAAgH;AAChH,MAAM,MAAM,eAAe,GAAG;IAC5B,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,8GAA8G;IAC9G,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,0GAA0G;IAC1G,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,MAAM,EAAE,QAAQ,EAAE,CAAC;IACnB,2HAA2H;IAC3H,QAAQ,EAAE,MAAM,C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,OAAO,CAAC,EAAE,2BAA2B,GACpC,eAAe,CAwBjB"}
1
+ {"version":3,"file":"parse-wms-capabilities.d.ts","sourceRoot":"","sources":["../../../../src/lib/parsers/wms/parse-wms-capabilities.ts"],"names":[],"mappings":"AAWA,gHAAgH;AAChH,MAAM,MAAM,eAAe,GAAG;IAC5B,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,8GAA8G;IAC9G,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,0GAA0G;IAC1G,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,MAAM,EAAE,QAAQ,EAAE,CAAC;IACnB,2HAA2H;IAC3H,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACrC,yFAAyF;IACzF,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,6HAA6H;IAC7H,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,sEAAsE;IACtE,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,yFAAyF;IACzF,KAAK,EAAE,MAAM,CAAC;IACd,iHAAiH;IACjH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kDAA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AC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oHAAoH;IACpH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yDAAyD;IACzD,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,8CAA8C;AAC9C,MAAM,MAAM,UAAU,GAAG;IACvB,sDAAsD;IACtD,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,kDAAkD;IAClD,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,oDAAoD;IACpD,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,kGAAkG;IAClG,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kFAAkF;IAClF,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,2BAA2B,GACpC,eAAe,CAwBjB"}
@@ -10,8 +10,8 @@ export function parseWMSCapabilities(xmlText, options) {
10
10
  addInheritedLayerProps(layer, null);
11
11
  }
12
12
  }
13
- if (options !== null && options !== void 0 && options.includeRawData || options !== null && options !== void 0 && options.raw) {
14
- capabilities.raw = xmlCapabilities;
13
+ if (options !== null && options !== void 0 && options.includeRawJSON) {
14
+ capabilities.json = xmlCapabilities;
15
15
  }
16
16
  if (options !== null && options !== void 0 && options.includeXMLText) {
17
17
  capabilities.xml = xmlText;
@@ -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","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;AAAC,SAExCC,WAAW,EACXC,iBAAiB,EACjBC,aAAa,EACbC,WAAW,EACXC,aAAa;AAyJf,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,OAAO,CAAEU,mBAAmB,EAAE;IAEhC,KAAK,MAAMC,KAAK,IAAIH,YAAY,CAACI,MAAM,EAAE;MACvCC,sBAAsB,CAACF,KAAK,EAAE,IAAI,CAAC;IACrC;EAEF;EAEA,IAAIX,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEc,cAAc,IAAId,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEe,GAAG,EAAE;IAC3CP,YAAY,CAACO,GAAG,GAAGV,eAAe;EACpC;EAEA,IAAIL,OAAO,aAAPA,OAAO,eAAPA,OAA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AuB,EAAQ;EAC9E,IAAIA,MAAM,aAANA,MAAM,eAANA,MAAM,CAAEhD,qBAAqB,IAAI,CAAC9E,KAAK,CAAC8E,qBAAqB,EAAE;IACjE9E,KAAK,CAAC8E,qBAAqB,GAAG,CAAC,GAAGgD,MAAM,CAAChD,qBAAqB,CAAC;EACjE;EAEA,IAAIgD,MAAM,aAANA,MAAM,eAANA,MAAM,CAAEvD,GAAG,IAAI,CAACvE,KAAK,CAACuE,GAAG,EAAE;IAC7BvE,KAAK,CAACuE,GAAG,GAAG,CAAC,GAAGuD,MAAM,CAACvD,GAAG,CAAC;EAC7B;EAEA,IAAIuD,MAAM,aAANA,MAAM,eAANA,MAAM,CAAE3C,aAAa,IAAI,CAACnF,KAAK,CAACmF,aAAa,EAAE;IACjDnF,KAAK,CAACmF,aAAa,GAAG,CAAC,GAAG2C,MAAM,CAAC3C,aAAa,CAAC;EACjD;EAEA,IAAI2C,MAAM,aAANA,MAAM,eAANA,MAAM,CAAEtC,UAAU,IAAI,CAACxF,KAAK,CAACwF,UAAU,EAAE;IAC3CxF,KAAK,CAACwF,UAAU,GAAG,CAAC,GAAGsC,MAAM,CAACtC,UAAU,CAAC;EAC3C;EAEA,KAAK,MAAMuC,QAAQ,IAAI/H,KAAK,CAACC,MAAM,IAAI,EAAE,EAAE;IACzCC,sBAAsB,CAAC6H,QAAQ,EAAE/H,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","includeRawJSON","json","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.json`: raw untyped JSON parsed from XML. Can include information not extracted in the typed response. */\n json?: 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 includeRawJSON?: boolean;\n /** Include the original XML document text. May contain additional information. */\n includeXMLText?: boolean;\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?.includeRawJSON) {\n capabilities.json = 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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,MAAM,CAACvD,GAAG,CAAC;EAC7B;EAEA,IAAIuD,MAAM,aAANA,MAAM,eAANA,MAAM,CAAE3C,aAAa,IAAI,CAACnF,KAAK,CAACmF,aAAa,EAAE;IACjDnF,KAAK,CAACmF,aAAa,GAAG,CAAC,GAAG2C,MAAM,CAAC3C,aAAa,CAAC;EACjD;EAEA,IAAI2C,MAAM,aAANA,MAAM,eAANA,MAAM,CAAEtC,UAAU,IAAI,CAACxF,KAAK,CAACwF,UAAU,EAAE;IAC3CxF,KAAK,CAACwF,UAAU,GAAG,CAAC,GAAGsC,MAAM,CAACtC,UAAU,CAAC;EAC3C;EAEA,KAAK,MAAMuC,QAAQ,IAAI/H,KAAK,CAACC,MAAM,IAAI,EAAE,EAAE;IACzCC,sBAAsB,CAAC6H,QAAQ,EAAE/H,KAAK,CAAC;EACzC;AACF"}
@@ -7,11 +7,9 @@ export type WMSCapabilitiesLoaderOptions = XMLLoaderOptions & {
7
7
  /** Add inherited layer information to sub layers */
8
8
  inheritedLayerProps?: boolean;
9
9
  /** Include the "raw" JSON (parsed but untyped, unprocessed XML). May contain additional fields */
10
- includeRawData?: boolean;
10
+ includeRawJSON?: boolean;
11
11
  /** Include the original XML document text. May contain additional information. */
12
12
  includeXMLText?: boolean;
13
- /** @deprecated Use options.includeRawData` */
14
- raw?: boolean;
15
13
  };
16
14
  };
17
15
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"wms-capabilities-loader.d.ts","sourceRoot":"","sources":["../src/wms-capabilities-loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAC,eAAe,EAAuB,MAAM,0CAA0C,CAAC;AAO/F,YAAY,EACV,eAAe,EACf,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,UAAU,EACV,aAAa,EACd,MAAM,0CAA0C,CAAC;AAElD,MAAM,MAAM,4BAA4B,GAAG,gBAAgB,GAAG;IAC5D,GAAG,CAAC,EAAE;QACJ,oDAAoD;QACpD,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,kGAAkG;QAClG,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,kFAAkF;QAClF,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,8CAA8C;QAC9C,GAAG,CAAC,EAAE,OAAO,CAAC;KACf,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,gBAAgB,CAClD,eAAe,EACf,KAAK,EACL,4BAA4B,CAoB7B,CAAC"}
1
+ {"version":3,"file":"wms-capabilities-loader.d.ts","sourceRoot":"","sources":["../src/wms-capabilities-loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAC,eAAe,EAAuB,MAAM,0CAA0C,CAAC;AAO/F,YAAY,EACV,eAAe,EACf,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,UAAU,EACV,aAAa,EACd,MAAM,0CAA0C,CAAC;AAElD,MAAM,MAAM,4BAA4B,GAAG,gBAAgB,GAAG;IAC5D,GAAG,CAAC,EAAE;QACJ,oDAAoD;QACpD,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,kGAAkG;QAClG,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,kFAAkF;QAClF,cAAc,CAAC,EAAE,OAAO,CAAC;KAC1B,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,gBAAgB,CAClD,eAAe,EACf,KAAK,EACL,4BAA4B,CAoB7B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"wms-capabilities-loader.js","names":["parseWMSCapabilities","VERSION","__VERSION__","WMSCapabilitiesLoader","id","name","module","version","worker","extensions","mimeTypes","testText","testXMLFile","options","wms","parse","arrayBuffer","TextDecoder","decode","parseTextSync","text","startsWith"],"sources":["../src/wms-capabilities-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {XMLLoaderOptions} from '@loaders.gl/xml';\nimport {WMSCapabilities, parseWMSCapabilities} from './lib/parsers/wms/parse-wms-capabilities';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n// Parsed data types\nexport type {\n WMSCapabilities,\n WMSLayer,\n WMSBoundingBox,\n WMSDimension,\n WMSRequest,\n WMSExceptions\n} from './lib/parsers/wms/parse-wms-capabilities';\n\nexport type WMSCapabilitiesLoaderOptions = XMLLoaderOptions & {\n wms?: {\n /** Add inherited layer information to sub layers */\n inheritedLayerProps?: boolean;\n /** Include the \"raw\" JSON (parsed but untyped, unprocessed XML). May contain additional fields */\n includeRawData?: boolean;\n /** Include the original XML document text. May contain additional information. */\n includeXMLText?: boolean;\n /** @deprecated Use options.includeRawData` */\n raw?: boolean;\n };\n};\n\n/**\n * Loader for the response to the WMS GetCapability request\n */\nexport const WMSCapabilitiesLoader: LoaderWithParser<\n WMSCapabilities,\n never,\n WMSCapabilitiesLoaderOptions\n> = {\n id: 'wms-capabilities',\n name: 'WMS Capabilities',\n\n module: 'wms',\n version: VERSION,\n worker: false,\n extensions: ['xml'],\n mimeTypes: ['application/vnd.ogc.wms_xml', 'application/xml', 'text/xml'],\n testText: testXMLFile,\n options: {\n wms: {}\n },\n parse: async (arrayBuffer: ArrayBuffer, options?: WMSCapabilitiesLoaderOptions) =>\n // TODO pass in XML options\n parseWMSCapabilities(new TextDecoder().decode(arrayBuffer), options?.wms),\n parseTextSync: (text: string, options?: WMSCapabilitiesLoaderOptions) =>\n // TODO pass in XML options\n parseWMSCapabilities(text, options?.wms)\n};\n\nfunction testXMLFile(text: string): boolean {\n // TODO - There could be space first.\n return text.startsWith('<?xml');\n}\n"],"mappings":"SAIyBA,oBAAoB;AAI7C,MAAMC,OAAO,GAAG,OAAOC,WAAW,KAAK,WAAW,GAAGA,WAAW,GAAG,QAAQ;AA4B3E,OAAO,MAAMC,qBAIZ,GAAG;EACFC,EAAE,EAAE,kBAAkB;EACtBC,IAAI,EAAE,kBAAkB;EAExBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEN,OAAO;EAChBO,MAAM,EAAE,KAAK;EACbC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,SAAS,EAAE,CAAC,6BAA6B,EAAE,iBAAiB,EAAE,UAAU,CAAC;EACzEC,QAAQ,EAAEC,WAAW;EACrBC,OAAO,EAAE;IACPC,GAAG,EAAE,CAAC;EACR,CAAC;EACDC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEH,OAAsC,KAE5Eb,oBAAoB,CAAC,IAAIiB,WAAW,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,EAAEH,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,GAAG,CAAC;EAC3EK,aAAa,EAAEA,CAACC,IAAY,EAAEP,OAAsC,KAElEb,oBAAoB,CAACoB,IAAI,EAAEP,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,GAAG;AAC3C,CAAC;AAED,SAASF,WAAWA,CAACQ,IAAY,EAAW;EAE1C,OAAOA,IAAI,CAACC,UAAU,CAAC,OAAO,CAAC;AACjC"}
1
+ {"version":3,"file":"wms-capabilities-loader.js","names":["parseWMSCapabilities","VERSION","__VERSION__","WMSCapabilitiesLoader","id","name","module","version","worker","extensions","mimeTypes","testText","testXMLFile","options","wms","parse","arrayBuffer","TextDecoder","decode","parseTextSync","text","startsWith"],"sources":["../src/wms-capabilities-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {XMLLoaderOptions} from '@loaders.gl/xml';\nimport {WMSCapabilities, parseWMSCapabilities} from './lib/parsers/wms/parse-wms-capabilities';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n// Parsed data types\nexport type {\n WMSCapabilities,\n WMSLayer,\n WMSBoundingBox,\n WMSDimension,\n WMSRequest,\n WMSExceptions\n} from './lib/parsers/wms/parse-wms-capabilities';\n\nexport type WMSCapabilitiesLoaderOptions = XMLLoaderOptions & {\n wms?: {\n /** Add inherited layer information to sub layers */\n inheritedLayerProps?: boolean;\n /** Include the \"raw\" JSON (parsed but untyped, unprocessed XML). May contain additional fields */\n includeRawJSON?: boolean;\n /** Include the original XML document text. May contain additional information. */\n includeXMLText?: boolean;\n };\n};\n\n/**\n * Loader for the response to the WMS GetCapability request\n */\nexport const WMSCapabilitiesLoader: LoaderWithParser<\n WMSCapabilities,\n never,\n WMSCapabilitiesLoaderOptions\n> = {\n id: 'wms-capabilities',\n name: 'WMS Capabilities',\n\n module: 'wms',\n version: VERSION,\n worker: false,\n extensions: ['xml'],\n mimeTypes: ['application/vnd.ogc.wms_xml', 'application/xml', 'text/xml'],\n testText: testXMLFile,\n options: {\n wms: {}\n },\n parse: async (arrayBuffer: ArrayBuffer, options?: WMSCapabilitiesLoaderOptions) =>\n // TODO pass in XML options\n parseWMSCapabilities(new TextDecoder().decode(arrayBuffer), options?.wms),\n parseTextSync: (text: string, options?: WMSCapabilitiesLoaderOptions) =>\n // TODO pass in XML options\n parseWMSCapabilities(text, options?.wms)\n};\n\nfunction testXMLFile(text: string): boolean {\n // TODO - There could be space first.\n return text.startsWith('<?xml');\n}\n"],"mappings":"SAIyBA,oBAAoB;AAI7C,MAAMC,OAAO,GAAG,OAAOC,WAAW,KAAK,WAAW,GAAGA,WAAW,GAAG,QAAQ;AA0B3E,OAAO,MAAMC,qBAIZ,GAAG;EACFC,EAAE,EAAE,kBAAkB;EACtBC,IAAI,EAAE,kBAAkB;EAExBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEN,OAAO;EAChBO,MAAM,EAAE,KAAK;EACbC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,SAAS,EAAE,CAAC,6BAA6B,EAAE,iBAAiB,EAAE,UAAU,CAAC;EACzEC,QAAQ,EAAEC,WAAW;EACrBC,OAAO,EAAE;IACPC,GAAG,EAAE,CAAC;EACR,CAAC;EACDC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEH,OAAsC,KAE5Eb,oBAAoB,CAAC,IAAIiB,WAAW,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,EAAEH,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,GAAG,CAAC;EAC3EK,aAAa,EAAEA,CAACC,IAAY,EAAEP,OAAsC,KAElEb,oBAAoB,CAACoB,IAAI,EAAEP,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,GAAG;AAC3C,CAAC;AAED,SAASF,WAAWA,CAACQ,IAAY,EAAW;EAE1C,OAAOA,IAAI,CAACC,UAAU,CAAC,OAAO,CAAC;AACjC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/wms",
3
- "version": "4.0.0-beta.4",
3
+ "version": "4.0.0-beta.6",
4
4
  "description": "Framework-independent loaders for the WMS (Web Map Service) standard",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -43,17 +43,21 @@
43
43
  ],
44
44
  "scripts": {
45
45
  "pre-build": "npm run build-bundle && npm run build-bundle -- --env=dev",
46
- "build-bundle": "ocular-bundle ./src/index.ts"
46
+ "build-bundle": "# ocular-bundle ./src/index.ts --external:{util,fs,path}"
47
+ },
48
+ "browser": {
49
+ "fs": false,
50
+ "path": false
47
51
  },
48
52
  "dependencies": {
49
53
  "@babel/runtime": "^7.3.1",
50
- "@loaders.gl/images": "4.0.0-beta.4",
51
- "@loaders.gl/loader-utils": "4.0.0-beta.4",
52
- "@loaders.gl/schema": "4.0.0-beta.4",
53
- "@loaders.gl/xml": "4.0.0-beta.4",
54
+ "@loaders.gl/images": "4.0.0-beta.6",
55
+ "@loaders.gl/loader-utils": "4.0.0-beta.6",
56
+ "@loaders.gl/schema": "4.0.0-beta.6",
57
+ "@loaders.gl/xml": "4.0.0-beta.6",
54
58
  "@turf/rewind": "^5.1.5",
55
59
  "deep-strict-equal": "^0.2.0",
56
60
  "lerc": "^4.0.1"
57
61
  },
58
- "gitHead": "848c20b474532d301f2c3f8d4e1fb9bf262b86d4"
62
+ "gitHead": "2840f605b7a551e2ffef5f960231d989a0414c50"
59
63
  }
package/src/index.ts CHANGED
@@ -53,6 +53,9 @@ export {GMLLoader as _GMLLoader} from './gml-loader';
53
53
 
54
54
  // EXPERIMENTAL: DATA SOURCES
55
55
 
56
+ // TODO - restore once deck.gl has been udpated
57
+ export {ImageSource} from '@loaders.gl/loader-utils';
58
+
56
59
  export type {ImageType} from '@loaders.gl/images';
57
60
 
58
61
  export type {CreateImageServiceProps} from './lib/services/create-image-service';
@@ -77,12 +80,5 @@ export {getArcGISServices as _getArcGISServices} from './services/arcgis/arcgis-
77
80
  export {ArcGISImageService as _ArcGISImageService} from './services/arcgis/arcgis-image-service';
78
81
 
79
82
  // LERC - Limited Error Raster Compression
80
- // TODO - restore once esbuild bundling issues have been resolved
81
- // export type {LERCData} from './lib/lerc/lerc-types';
82
- // export {LERCLoader} from './lerc-loader';
83
-
84
- /** @deprecated Use WMSCapabilitiesLoaderOptions */
85
- export type {WMSCapabilitiesLoaderOptions as WMSLoaderOptions} from './wms-capabilities-loader';
86
-
87
- // TODO - restore once deck.gl has been udpated
88
- export {ImageSource} from '@loaders.gl/loader-utils';
83
+ export type {LERCData} from './lib/parsers/lerc/lerc-types';
84
+ export {LERCLoader} from './lerc-loader';
@@ -95,8 +95,8 @@ function objEquiv(a: unknown, b: unknown, strict) {
95
95
  b = pSlice.call(b);
96
96
  return deepStrictEqual(a, b, strict);
97
97
  }
98
- const ka = Object.keys(a);
99
- const kb = Object.keys(b);
98
+ const ka = Object.keys(a as object);
99
+ const kb = Object.keys(b as object);
100
100
  let key;
101
101
  let i;
102
102
  // having the same number of owned properties (keys incorporates
@@ -113,6 +113,7 @@ function objEquiv(a: unknown, b: unknown, strict) {
113
113
  // ~~~possibly expensive deep test
114
114
  for (i = ka.length - 1; i >= 0; i--) {
115
115
  key = ka[i];
116
+ // @ts-ignore
116
117
  if (!deepStrictEqual(a[key], b[key], strict)) return false;
117
118
  }
118
119
  return true;
@@ -37,8 +37,8 @@ export type WMSCapabilities = {
37
37
  requests: Record<string, WMSRequest>;
38
38
  /** Information about any exceptions that the service will report (HTTP status != 2xx) */
39
39
  exceptions?: WMSExceptions;
40
- /** Only if `options.raw`: raw untyped JSON parsed from XML. Can include information not extracted in the typed response. */
41
- raw?: Record<string, unknown>;
40
+ /** Only if `options.json`: raw untyped JSON parsed from XML. Can include information not extracted in the typed response. */
41
+ json?: Record<string, unknown>;
42
42
  /** Only if `options.xml`, the unparsed XML string can be requested */
43
43
  xml?: string;
44
44
  };
@@ -147,12 +147,9 @@ export type ParseWMSCapabilitiesOptions = {
147
147
  /** Add inherited layer information to sub layers */
148
148
  inheritedLayerProps?: boolean;
149
149
  /** Include the "raw" JSON (parsed but untyped, unprocessed XML). May contain additional fields */
150
- includeRawData?: boolean;
150
+ includeRawJSON?: boolean;
151
151
  /** Include the original XML document text. May contain additional information. */
152
152
  includeXMLText?: boolean;
153
- /** @deprecated Use includeRawData` */
154
- raw?: boolean;
155
- // xml options are passed through to xml loader
156
153
  };
157
154
 
158
155
  /**
@@ -177,8 +174,8 @@ export function parseWMSCapabilities(
177
174
  // Not yet implemented
178
175
  }
179
176
 
180
- if (options?.includeRawData || options?.raw) {
181
- capabilities.raw = xmlCapabilities;
177
+ if (options?.includeRawJSON) {
178
+ capabilities.json = xmlCapabilities;
182
179
  }
183
180
 
184
181
  if (options?.includeXMLText) {
@@ -23,11 +23,9 @@ export type WMSCapabilitiesLoaderOptions = XMLLoaderOptions & {
23
23
  /** Add inherited layer information to sub layers */
24
24
  inheritedLayerProps?: boolean;
25
25
  /** Include the "raw" JSON (parsed but untyped, unprocessed XML). May contain additional fields */
26
- includeRawData?: boolean;
26
+ includeRawJSON?: boolean;
27
27
  /** Include the original XML document text. May contain additional information. */
28
28
  includeXMLText?: boolean;
29
- /** @deprecated Use options.includeRawData` */
30
- raw?: boolean;
31
29
  };
32
30
  };
33
31