@loaders.gl/wms 4.0.0-beta.1 → 4.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/dist/{esm/csw-capabilities-loader.js → csw-capabilities-loader.js} +2 -2
  2. package/dist/csw-capabilities-loader.js.map +1 -0
  3. package/dist/{esm/csw-domain-loader.js → csw-domain-loader.js} +2 -2
  4. package/dist/csw-domain-loader.js.map +1 -0
  5. package/dist/{esm/csw-records-loader.js → csw-records-loader.js} +2 -2
  6. package/dist/csw-records-loader.js.map +1 -0
  7. package/dist/{dist.min.js → dist.dev.js} +1151 -1224
  8. package/dist/{esm/gml-loader.js → gml-loader.js} +2 -2
  9. package/dist/gml-loader.js.map +1 -0
  10. package/dist/index.cjs +1641 -0
  11. package/dist/index.js +18 -0
  12. package/dist/index.js.map +1 -0
  13. package/dist/{esm/lerc-loader.js → lerc-loader.js} +1 -1
  14. package/dist/lerc-loader.js.map +1 -0
  15. package/dist/{esm/lib → lib}/parsers/csw/parse-csw-capabilities.js +1 -1
  16. package/dist/lib/parsers/csw/parse-csw-capabilities.js.map +1 -0
  17. package/dist/{esm/lib → lib}/parsers/csw/parse-csw-domain.js +1 -1
  18. package/dist/lib/parsers/csw/parse-csw-domain.js.map +1 -0
  19. package/dist/{esm/lib → lib}/parsers/csw/parse-csw-records.js +2 -2
  20. package/dist/lib/parsers/csw/parse-csw-records.js.map +1 -0
  21. package/dist/{esm/lib → lib}/parsers/csw/parse-exception-report.js +1 -1
  22. package/dist/lib/parsers/csw/parse-exception-report.js.map +1 -0
  23. package/dist/lib/parsers/gml/deep-strict-equal.js.map +1 -0
  24. package/dist/{esm/lib → lib}/parsers/gml/parse-gml.js +13 -13
  25. package/dist/lib/parsers/gml/parse-gml.js.map +1 -0
  26. package/dist/lib/parsers/lerc/lerc-types.js.map +1 -0
  27. package/dist/{esm/lib → lib}/parsers/wms/parse-wms-capabilities.js +1 -1
  28. package/dist/lib/parsers/wms/parse-wms-capabilities.js.map +1 -0
  29. package/dist/lib/parsers/wms/parse-wms-error.js.map +1 -0
  30. package/dist/lib/parsers/wms/parse-wms-features.js.map +1 -0
  31. package/dist/lib/parsers/wms/parse-wms-layer-description.js.map +1 -0
  32. package/dist/lib/parsers/xml/parse-xml-helpers.js.map +1 -0
  33. package/dist/lib/services/create-image-service.js.map +1 -0
  34. package/dist/{esm/lib → lib}/services/image-service.js +4 -5
  35. package/dist/lib/services/image-service.js.map +1 -0
  36. package/dist/{esm/services → services}/arcgis/arcgis-image-service.js +7 -7
  37. package/dist/services/arcgis/arcgis-image-service.js.map +1 -0
  38. package/dist/{esm/services → services}/arcgis/arcgis-server.js +5 -5
  39. package/dist/services/arcgis/arcgis-server.js.map +1 -0
  40. package/dist/services/create-image-source.js +8 -0
  41. package/dist/services/create-image-source.js.map +1 -0
  42. package/dist/services/ogc/csw-service.d.ts +1 -1
  43. package/dist/services/ogc/csw-service.d.ts.map +1 -1
  44. package/dist/{esm/services → services}/ogc/csw-service.js +10 -11
  45. package/dist/services/ogc/csw-service.js.map +1 -0
  46. package/dist/services/ogc/wms-service.d.ts.map +1 -1
  47. package/dist/{esm/services → services}/ogc/wms-service.js +12 -12
  48. package/dist/services/ogc/wms-service.js.map +1 -0
  49. package/dist/wip/data-source.js.map +1 -0
  50. package/dist/wip/lib/wcs/parse-wcs-capabilities.js.map +1 -0
  51. package/dist/wip/lib/wfs/parse-wfs-capabilities.js.map +1 -0
  52. package/dist/wip/lib/wfs/parse-wfs.js.map +1 -0
  53. package/dist/wip/lib/wmts/parse-wmts-capabilities.js.map +1 -0
  54. package/dist/wip/lib/wmts/parse-wmts.js.map +1 -0
  55. package/dist/{esm/wip → wip}/services/arcgis-feature-service.js +3 -4
  56. package/dist/wip/services/arcgis-feature-service.js.map +1 -0
  57. package/dist/{esm/wip → wip}/wcs-capabilities-loader.js +2 -2
  58. package/dist/wip/wcs-capabilities-loader.js.map +1 -0
  59. package/dist/{esm/wip → wip}/wfs-capabilities-loader.js +2 -2
  60. package/dist/wip/wfs-capabilities-loader.js.map +1 -0
  61. package/dist/{esm/wip → wip}/wms-feature-info-loader.js +2 -2
  62. package/dist/wip/wms-feature-info-loader.js.map +1 -0
  63. package/dist/{esm/wip → wip}/wms-layer-description-loader.js +2 -2
  64. package/dist/wip/wms-layer-description-loader.js.map +1 -0
  65. package/dist/{esm/wip → wip}/wmts-capabilities-loader.js +2 -2
  66. package/dist/wip/wmts-capabilities-loader.js.map +1 -0
  67. package/dist/{esm/wms-capabilities-loader.js → wms-capabilities-loader.js} +2 -2
  68. package/dist/wms-capabilities-loader.js.map +1 -0
  69. package/dist/{esm/wms-error-loader.js → wms-error-loader.js} +3 -3
  70. package/dist/wms-error-loader.js.map +1 -0
  71. package/package.json +18 -10
  72. package/src/services/ogc/csw-service.ts +1 -1
  73. package/src/services/ogc/wms-service.ts +1 -0
  74. package/dist/bundle.d.ts +0 -2
  75. package/dist/bundle.d.ts.map +0 -1
  76. package/dist/es5/bundle.js +0 -6
  77. package/dist/es5/bundle.js.map +0 -1
  78. package/dist/es5/csw-capabilities-loader.js +0 -49
  79. package/dist/es5/csw-capabilities-loader.js.map +0 -1
  80. package/dist/es5/csw-domain-loader.js +0 -49
  81. package/dist/es5/csw-domain-loader.js.map +0 -1
  82. package/dist/es5/csw-records-loader.js +0 -49
  83. package/dist/es5/csw-records-loader.js.map +0 -1
  84. package/dist/es5/gml-loader.js +0 -49
  85. package/dist/es5/gml-loader.js.map +0 -1
  86. package/dist/es5/index.js +0 -131
  87. package/dist/es5/index.js.map +0 -1
  88. package/dist/es5/lerc-loader.js +0 -67
  89. package/dist/es5/lerc-loader.js.map +0 -1
  90. package/dist/es5/lib/parsers/csw/parse-csw-capabilities.js +0 -25
  91. package/dist/es5/lib/parsers/csw/parse-csw-capabilities.js.map +0 -1
  92. package/dist/es5/lib/parsers/csw/parse-csw-domain.js +0 -43
  93. package/dist/es5/lib/parsers/csw/parse-csw-domain.js.map +0 -1
  94. package/dist/es5/lib/parsers/csw/parse-csw-records.js +0 -76
  95. package/dist/es5/lib/parsers/csw/parse-csw-records.js.map +0 -1
  96. package/dist/es5/lib/parsers/csw/parse-exception-report.js +0 -16
  97. package/dist/es5/lib/parsers/csw/parse-exception-report.js.map +0 -1
  98. package/dist/es5/lib/parsers/gml/deep-strict-equal.js +0 -56
  99. package/dist/es5/lib/parsers/gml/deep-strict-equal.js.map +0 -1
  100. package/dist/es5/lib/parsers/gml/parse-gml.js +0 -405
  101. package/dist/es5/lib/parsers/gml/parse-gml.js.map +0 -1
  102. package/dist/es5/lib/parsers/lerc/lerc-types.js +0 -2
  103. package/dist/es5/lib/parsers/lerc/lerc-types.js.map +0 -1
  104. package/dist/es5/lib/parsers/wms/parse-wms-capabilities.js +0 -274
  105. package/dist/es5/lib/parsers/wms/parse-wms-capabilities.js.map +0 -1
  106. package/dist/es5/lib/parsers/wms/parse-wms-error.js +0 -15
  107. package/dist/es5/lib/parsers/wms/parse-wms-error.js.map +0 -1
  108. package/dist/es5/lib/parsers/wms/parse-wms-features.js +0 -32
  109. package/dist/es5/lib/parsers/wms/parse-wms-features.js.map +0 -1
  110. package/dist/es5/lib/parsers/wms/parse-wms-layer-description.js +0 -13
  111. package/dist/es5/lib/parsers/wms/parse-wms-layer-description.js.map +0 -1
  112. package/dist/es5/lib/parsers/xml/parse-xml-helpers.js +0 -67
  113. package/dist/es5/lib/parsers/xml/parse-xml-helpers.js.map +0 -1
  114. package/dist/es5/lib/services/create-image-service.js +0 -53
  115. package/dist/es5/lib/services/create-image-service.js.map +0 -1
  116. package/dist/es5/lib/services/image-service.js +0 -118
  117. package/dist/es5/lib/services/image-service.js.map +0 -1
  118. package/dist/es5/services/arcgis/arcgis-image-service.js +0 -168
  119. package/dist/es5/services/arcgis/arcgis-image-service.js.map +0 -1
  120. package/dist/es5/services/arcgis/arcgis-server.js +0 -111
  121. package/dist/es5/services/arcgis/arcgis-server.js.map +0 -1
  122. package/dist/es5/services/create-image-source.js +0 -14
  123. package/dist/es5/services/create-image-source.js.map +0 -1
  124. package/dist/es5/services/ogc/csw-service.js +0 -359
  125. package/dist/es5/services/ogc/csw-service.js.map +0 -1
  126. package/dist/es5/services/ogc/wms-service.js +0 -539
  127. package/dist/es5/services/ogc/wms-service.js.map +0 -1
  128. package/dist/es5/wip/data-source.js +0 -2
  129. package/dist/es5/wip/data-source.js.map +0 -1
  130. package/dist/es5/wip/lib/wcs/parse-wcs-capabilities.js +0 -22
  131. package/dist/es5/wip/lib/wcs/parse-wcs-capabilities.js.map +0 -1
  132. package/dist/es5/wip/lib/wfs/parse-wfs-capabilities.js +0 -23
  133. package/dist/es5/wip/lib/wfs/parse-wfs-capabilities.js.map +0 -1
  134. package/dist/es5/wip/lib/wfs/parse-wfs.js +0 -41
  135. package/dist/es5/wip/lib/wfs/parse-wfs.js.map +0 -1
  136. package/dist/es5/wip/lib/wmts/parse-wmts-capabilities.js +0 -23
  137. package/dist/es5/wip/lib/wmts/parse-wmts-capabilities.js.map +0 -1
  138. package/dist/es5/wip/lib/wmts/parse-wmts.js +0 -41
  139. package/dist/es5/wip/lib/wmts/parse-wmts.js.map +0 -1
  140. package/dist/es5/wip/services/arcgis-feature-service.js +0 -40
  141. package/dist/es5/wip/services/arcgis-feature-service.js.map +0 -1
  142. package/dist/es5/wip/wcs-capabilities-loader.js +0 -51
  143. package/dist/es5/wip/wcs-capabilities-loader.js.map +0 -1
  144. package/dist/es5/wip/wfs-capabilities-loader.js +0 -51
  145. package/dist/es5/wip/wfs-capabilities-loader.js.map +0 -1
  146. package/dist/es5/wip/wms-feature-info-loader.js +0 -42
  147. package/dist/es5/wip/wms-feature-info-loader.js.map +0 -1
  148. package/dist/es5/wip/wms-layer-description-loader.js +0 -42
  149. package/dist/es5/wip/wms-layer-description-loader.js.map +0 -1
  150. package/dist/es5/wip/wmts-capabilities-loader.js +0 -51
  151. package/dist/es5/wip/wmts-capabilities-loader.js.map +0 -1
  152. package/dist/es5/wms-capabilities-loader.js +0 -49
  153. package/dist/es5/wms-capabilities-loader.js.map +0 -1
  154. package/dist/es5/wms-error-loader.js +0 -66
  155. package/dist/es5/wms-error-loader.js.map +0 -1
  156. package/dist/esm/bundle.js +0 -4
  157. package/dist/esm/bundle.js.map +0 -1
  158. package/dist/esm/csw-capabilities-loader.js.map +0 -1
  159. package/dist/esm/csw-domain-loader.js.map +0 -1
  160. package/dist/esm/csw-records-loader.js.map +0 -1
  161. package/dist/esm/gml-loader.js.map +0 -1
  162. package/dist/esm/index.js +0 -18
  163. package/dist/esm/index.js.map +0 -1
  164. package/dist/esm/lerc-loader.js.map +0 -1
  165. package/dist/esm/lib/parsers/csw/parse-csw-capabilities.js.map +0 -1
  166. package/dist/esm/lib/parsers/csw/parse-csw-domain.js.map +0 -1
  167. package/dist/esm/lib/parsers/csw/parse-csw-records.js.map +0 -1
  168. package/dist/esm/lib/parsers/csw/parse-exception-report.js.map +0 -1
  169. package/dist/esm/lib/parsers/gml/deep-strict-equal.js.map +0 -1
  170. package/dist/esm/lib/parsers/gml/parse-gml.js.map +0 -1
  171. package/dist/esm/lib/parsers/lerc/lerc-types.js.map +0 -1
  172. package/dist/esm/lib/parsers/wms/parse-wms-capabilities.js.map +0 -1
  173. package/dist/esm/lib/parsers/wms/parse-wms-error.js.map +0 -1
  174. package/dist/esm/lib/parsers/wms/parse-wms-features.js.map +0 -1
  175. package/dist/esm/lib/parsers/wms/parse-wms-layer-description.js.map +0 -1
  176. package/dist/esm/lib/parsers/xml/parse-xml-helpers.js.map +0 -1
  177. package/dist/esm/lib/services/create-image-service.js.map +0 -1
  178. package/dist/esm/lib/services/image-service.js.map +0 -1
  179. package/dist/esm/services/arcgis/arcgis-image-service.js.map +0 -1
  180. package/dist/esm/services/arcgis/arcgis-server.js.map +0 -1
  181. package/dist/esm/services/create-image-source.js +0 -8
  182. package/dist/esm/services/create-image-source.js.map +0 -1
  183. package/dist/esm/services/ogc/csw-service.js.map +0 -1
  184. package/dist/esm/services/ogc/wms-service.js.map +0 -1
  185. package/dist/esm/wip/data-source.js.map +0 -1
  186. package/dist/esm/wip/lib/wcs/parse-wcs-capabilities.js.map +0 -1
  187. package/dist/esm/wip/lib/wfs/parse-wfs-capabilities.js.map +0 -1
  188. package/dist/esm/wip/lib/wfs/parse-wfs.js.map +0 -1
  189. package/dist/esm/wip/lib/wmts/parse-wmts-capabilities.js.map +0 -1
  190. package/dist/esm/wip/lib/wmts/parse-wmts.js.map +0 -1
  191. package/dist/esm/wip/services/arcgis-feature-service.js.map +0 -1
  192. package/dist/esm/wip/services/wmts-service.ts.disabled +0 -348
  193. package/dist/esm/wip/wcs-capabilities-loader.js.map +0 -1
  194. package/dist/esm/wip/wfs-capabilities-loader.js.map +0 -1
  195. package/dist/esm/wip/wms-feature-info-loader.js.map +0 -1
  196. package/dist/esm/wip/wms-layer-description-loader.js.map +0 -1
  197. package/dist/esm/wip/wms-layer-description-loader.md.disabled.md +0 -47
  198. package/dist/esm/wip/wmts-capabilities-loader.js.map +0 -1
  199. package/dist/esm/wms-capabilities-loader.js.map +0 -1
  200. package/dist/esm/wms-error-loader.js.map +0 -1
  201. package/src/bundle.ts +0 -6
  202. /package/dist/{esm/lib → lib}/parsers/gml/deep-strict-equal.js +0 -0
  203. /package/dist/{esm/lib → lib}/parsers/lerc/lerc-types.js +0 -0
  204. /package/dist/{esm/lib → lib}/parsers/wms/parse-wms-error.js +0 -0
  205. /package/dist/{esm/lib → lib}/parsers/wms/parse-wms-features.js +0 -0
  206. /package/dist/{esm/lib → lib}/parsers/wms/parse-wms-layer-description.js +0 -0
  207. /package/dist/{esm/lib → lib}/parsers/xml/parse-xml-helpers.js +0 -0
  208. /package/dist/{esm/lib → lib}/services/create-image-service.js +0 -0
  209. /package/dist/{esm/wip → wip}/data-source.js +0 -0
  210. /package/dist/{esm/wip → wip}/lib/wcs/parse-wcs-capabilities.js +0 -0
  211. /package/dist/{esm/wip → wip}/lib/wfs/parse-wfs-capabilities.js +0 -0
  212. /package/dist/{esm/wip → wip}/lib/wfs/parse-wfs.js +0 -0
  213. /package/dist/{esm/wip → wip}/lib/wmts/parse-wmts-capabilities.js +0 -0
  214. /package/dist/{esm/wip → wip}/lib/wmts/parse-wmts.js +0 -0
  215. /package/dist/{es5/wip → wip}/services/wmts-service.ts.disabled +0 -0
  216. /package/dist/{es5/wip → wip}/wms-layer-description-loader.md.disabled.md +0 -0
@@ -1,56 +1,47 @@
1
- (() => {
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if (typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory();
4
+ else if (typeof define === 'function' && define.amd) define([], factory);
5
+ else if (typeof exports === 'object') exports['loader'] = factory();
6
+ else root['loader'] = factory();})(globalThis, function () {
7
+ "use strict";
8
+ var __exports__ = (() => {
2
9
  var __create = Object.create;
3
10
  var __defProp = Object.defineProperty;
4
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
13
  var __getProtoOf = Object.getPrototypeOf;
7
14
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
9
- var __esm = (fn, res) => function __init() {
10
- return fn && (res = (0, fn[Object.keys(fn)[0]])(fn = 0)), res;
11
- };
15
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
16
  var __commonJS = (cb, mod) => function __require() {
13
- return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
17
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
14
18
  };
15
19
  var __export = (target, all) => {
16
- __markAsModule(target);
17
20
  for (var name in all)
18
21
  __defProp(target, name, { get: all[name], enumerable: true });
19
22
  };
20
- var __reExport = (target, module, desc) => {
21
- if (module && typeof module === "object" || typeof module === "function") {
22
- for (let key of __getOwnPropNames(module))
23
- if (!__hasOwnProp.call(target, key) && key !== "default")
24
- __defProp(target, key, { get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable });
23
+ var __copyProps = (to, from, except, desc) => {
24
+ if (from && typeof from === "object" || typeof from === "function") {
25
+ for (let key of __getOwnPropNames(from))
26
+ if (!__hasOwnProp.call(to, key) && key !== except)
27
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
28
  }
26
- return target;
29
+ return to;
27
30
  };
28
- var __toModule = (module) => {
29
- return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? { get: () => module.default, enumerable: true } : { value: module, enumerable: true })), module);
31
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
32
+ // If the importer is in node compatibility mode or this is not an ESM
33
+ // file that has been converted to a CommonJS file using a Babel-
34
+ // compatible transform (i.e. "__esModule" has not been set), then set
35
+ // "default" to the CommonJS "module.exports" for node compatibility.
36
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
37
+ mod
38
+ ));
39
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
40
+ var __publicField = (obj, key, value) => {
41
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
42
+ return value;
30
43
  };
31
44
 
32
- // ../xml/src/lib/xml-utils/uncapitalize.ts
33
- function uncapitalize(str) {
34
- return typeof str === "string" ? str.charAt(0).toLowerCase() + str.slice(1) : str;
35
- }
36
- function uncapitalizeKeys(object) {
37
- if (Array.isArray(object)) {
38
- return object.map((element) => uncapitalizeKeys(element));
39
- }
40
- if (object && typeof object === "object") {
41
- const newObject = {};
42
- for (const [key, value] of Object.entries(object)) {
43
- newObject[uncapitalize(key)] = uncapitalizeKeys(value);
44
- }
45
- return newObject;
46
- }
47
- return object;
48
- }
49
- var init_uncapitalize = __esm({
50
- "../xml/src/lib/xml-utils/uncapitalize.ts"() {
51
- }
52
- });
53
-
54
45
  // ../../node_modules/fast-xml-parser/src/util.js
55
46
  var require_util = __commonJS({
56
47
  "../../node_modules/fast-xml-parser/src/util.js"(exports) {
@@ -117,6 +108,7 @@
117
108
  var util = require_util();
118
109
  var defaultOptions = {
119
110
  allowBooleanAttributes: false,
111
+ //A tag can have attributes without any value
120
112
  unpairedTags: []
121
113
  };
122
114
  exports.validate = function(xmlData, options) {
@@ -202,7 +194,10 @@
202
194
  return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData, i));
203
195
  } else if (options.unpairedTags.indexOf(tagName) !== -1) {
204
196
  } else {
205
- tags.push({ tagName, tagStartPos });
197
+ tags.push({
198
+ tagName,
199
+ tagStartPos
200
+ });
206
201
  }
207
202
  tagFound = true;
208
203
  }
@@ -246,7 +241,10 @@
246
241
  } else if (tags.length == 1) {
247
242
  return getErrorObject("InvalidTag", "Unclosed tag '" + tags[0].tagName + "'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos));
248
243
  } else if (tags.length > 0) {
249
- return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags.map((t) => t.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 });
244
+ return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags.map((t) => t.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", {
245
+ line: 1,
246
+ col: 1
247
+ });
250
248
  }
251
249
  return true;
252
250
  };
@@ -407,6 +405,7 @@
407
405
  const lines = xmlData.substring(0, index).split(/\r?\n/);
408
406
  return {
409
407
  line: lines.length,
408
+ // column number is last line's length + 1, because column numbering starts at 1:
410
409
  col: lines[lines.length - 1].length + 1
411
410
  };
412
411
  }
@@ -426,10 +425,14 @@
426
425
  textNodeName: "#text",
427
426
  ignoreAttributes: true,
428
427
  removeNSPrefix: false,
428
+ // remove NS from tag name or attribute name if true
429
429
  allowBooleanAttributes: false,
430
+ //a tag can have attributes without any value
431
+ //ignoreRootElement : false,
430
432
  parseTagValue: true,
431
433
  parseAttributeValue: false,
432
434
  trimValues: true,
435
+ //Trim string values of tag and attributes
433
436
  cdataPropName: false,
434
437
  numberParseOptions: {
435
438
  hex: true,
@@ -443,6 +446,7 @@
443
446
  return val2;
444
447
  },
445
448
  stopNodes: [],
449
+ //nested tags will not be parsed even for errors
446
450
  alwaysCreateTextNode: false,
447
451
  isArray: () => false,
448
452
  commentPropName: false,
@@ -456,6 +460,7 @@
456
460
  updateTag: function(tagName, jPath, attrs) {
457
461
  return tagName;
458
462
  }
463
+ // skipEmptyListItem: false
459
464
  };
460
465
  var buildOptions = function(options) {
461
466
  return Object.assign({}, defaultOptions, options);
@@ -478,15 +483,22 @@
478
483
  add(key, val2) {
479
484
  if (key === "__proto__")
480
485
  key = "#__proto__";
481
- this.child.push({ [key]: val2 });
486
+ this.child.push({
487
+ [key]: val2
488
+ });
482
489
  }
483
490
  addChild(node) {
484
491
  if (node.tagname === "__proto__")
485
492
  node.tagname = "#__proto__";
486
493
  if (node[":@"] && Object.keys(node[":@"]).length > 0) {
487
- this.child.push({ [node.tagname]: node.child, [":@"]: node[":@"] });
494
+ this.child.push({
495
+ [node.tagname]: node.child,
496
+ [":@"]: node[":@"]
497
+ });
488
498
  } else {
489
- this.child.push({ [node.tagname]: node.child });
499
+ this.child.push({
500
+ [node.tagname]: node.child
501
+ });
490
502
  }
491
503
  }
492
504
  };
@@ -551,11 +563,14 @@
551
563
  } else {
552
564
  throw new Error(`Invalid Tag instead of DOCTYPE`);
553
565
  }
554
- return { entities, i };
566
+ return {
567
+ entities,
568
+ i
569
+ };
555
570
  }
556
571
  function readEntityExp(xmlData, i) {
557
572
  let entityName2 = "";
558
- for (; i < xmlData.length && (xmlData[i] !== "'" && xmlData[i] !== '"'); i++) {
573
+ for (; i < xmlData.length && xmlData[i] !== "'" && xmlData[i] !== '"'; i++) {
559
574
  entityName2 += xmlData[i];
560
575
  }
561
576
  entityName2 = entityName2.trim();
@@ -619,6 +634,7 @@
619
634
  leadingZeros: true,
620
635
  decimalPoint: ".",
621
636
  eNotation: true
637
+ //skipLike: /regex/
622
638
  };
623
639
  function toNumber(str, options = {}) {
624
640
  options = Object.assign({}, consider, options);
@@ -715,21 +731,65 @@
715
731
  this.tagsNodeStack = [];
716
732
  this.docTypeEntities = {};
717
733
  this.lastEntities = {
718
- "apos": { regex: /&(apos|#39|#x27);/g, val: "'" },
719
- "gt": { regex: /&(gt|#62|#x3E);/g, val: ">" },
720
- "lt": { regex: /&(lt|#60|#x3C);/g, val: "<" },
721
- "quot": { regex: /&(quot|#34|#x22);/g, val: '"' }
734
+ "apos": {
735
+ regex: /&(apos|#39|#x27);/g,
736
+ val: "'"
737
+ },
738
+ "gt": {
739
+ regex: /&(gt|#62|#x3E);/g,
740
+ val: ">"
741
+ },
742
+ "lt": {
743
+ regex: /&(lt|#60|#x3C);/g,
744
+ val: "<"
745
+ },
746
+ "quot": {
747
+ regex: /&(quot|#34|#x22);/g,
748
+ val: '"'
749
+ }
750
+ };
751
+ this.ampEntity = {
752
+ regex: /&(amp|#38|#x26);/g,
753
+ val: "&"
722
754
  };
723
- this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" };
724
755
  this.htmlEntities = {
725
- "space": { regex: /&(nbsp|#160);/g, val: " " },
726
- "cent": { regex: /&(cent|#162);/g, val: "\xA2" },
727
- "pound": { regex: /&(pound|#163);/g, val: "\xA3" },
728
- "yen": { regex: /&(yen|#165);/g, val: "\xA5" },
729
- "euro": { regex: /&(euro|#8364);/g, val: "\u20AC" },
730
- "copyright": { regex: /&(copy|#169);/g, val: "\xA9" },
731
- "reg": { regex: /&(reg|#174);/g, val: "\xAE" },
732
- "inr": { regex: /&(inr|#8377);/g, val: "\u20B9" }
756
+ "space": {
757
+ regex: /&(nbsp|#160);/g,
758
+ val: " "
759
+ },
760
+ // "lt" : { regex: /&(lt|#60);/g, val: "<" },
761
+ // "gt" : { regex: /&(gt|#62);/g, val: ">" },
762
+ // "amp" : { regex: /&(amp|#38);/g, val: "&" },
763
+ // "quot" : { regex: /&(quot|#34);/g, val: "\"" },
764
+ // "apos" : { regex: /&(apos|#39);/g, val: "'" },
765
+ "cent": {
766
+ regex: /&(cent|#162);/g,
767
+ val: "\xA2"
768
+ },
769
+ "pound": {
770
+ regex: /&(pound|#163);/g,
771
+ val: "\xA3"
772
+ },
773
+ "yen": {
774
+ regex: /&(yen|#165);/g,
775
+ val: "\xA5"
776
+ },
777
+ "euro": {
778
+ regex: /&(euro|#8364);/g,
779
+ val: "\u20AC"
780
+ },
781
+ "copyright": {
782
+ regex: /&(copy|#169);/g,
783
+ val: "\xA9"
784
+ },
785
+ "reg": {
786
+ regex: /&(reg|#174);/g,
787
+ val: "\xAE"
788
+ },
789
+ "inr": {
790
+ regex: /&(inr|#8377);/g,
791
+ val: "\u20B9"
792
+ }
733
793
  };
734
794
  this.addExternalEntities = addExternalEntities;
735
795
  this.parseXml = parseXml;
@@ -896,7 +956,9 @@
896
956
  if (this.options.commentPropName) {
897
957
  const comment = xmlData.substring(i + 4, endIndex - 2);
898
958
  textData = this.saveTextToParentTag(textData, currentNode, jPath);
899
- currentNode.add(this.options.commentPropName, [{ [this.options.textNodeName]: comment }]);
959
+ currentNode.add(this.options.commentPropName, [{
960
+ [this.options.textNodeName]: comment
961
+ }]);
900
962
  }
901
963
  i = endIndex;
902
964
  } else if (xmlData.substr(i + 1, 2) === "!D") {
@@ -908,7 +970,9 @@
908
970
  const tagExp = xmlData.substring(i + 9, closeIndex);
909
971
  textData = this.saveTextToParentTag(textData, currentNode, jPath);
910
972
  if (this.options.cdataPropName) {
911
- currentNode.add(this.options.cdataPropName, [{ [this.options.textNodeName]: tagExp }]);
973
+ currentNode.add(this.options.cdataPropName, [{
974
+ [this.options.textNodeName]: tagExp
975
+ }]);
912
976
  } else {
913
977
  let val2 = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true);
914
978
  if (val2 == void 0)
@@ -1255,7 +1319,9 @@
1255
1319
  }
1256
1320
  }
1257
1321
  function isLeafTag(obj, options) {
1258
- const { textNodeName } = options;
1322
+ const {
1323
+ textNodeName
1324
+ } = options;
1259
1325
  const propCount = Object.keys(obj).length;
1260
1326
  if (propCount === 0) {
1261
1327
  return true;
@@ -1272,15 +1338,24 @@
1272
1338
  // ../../node_modules/fast-xml-parser/src/xmlparser/XMLParser.js
1273
1339
  var require_XMLParser = __commonJS({
1274
1340
  "../../node_modules/fast-xml-parser/src/xmlparser/XMLParser.js"(exports, module) {
1275
- var { buildOptions } = require_OptionsBuilder();
1341
+ var {
1342
+ buildOptions
1343
+ } = require_OptionsBuilder();
1276
1344
  var OrderedObjParser = require_OrderedObjParser();
1277
- var { prettify } = require_node2json();
1345
+ var {
1346
+ prettify
1347
+ } = require_node2json();
1278
1348
  var validator = require_validator();
1279
1349
  var XMLParser = class {
1280
1350
  constructor(options) {
1281
1351
  this.externalEntities = {};
1282
1352
  this.options = buildOptions(options);
1283
1353
  }
1354
+ /**
1355
+ * Parse XML dats to JS object
1356
+ * @param {string|Buffer} xmlData
1357
+ * @param {boolean|Object} validationOption
1358
+ */
1284
1359
  parse(xmlData, validationOption) {
1285
1360
  if (typeof xmlData === "string") {
1286
1361
  } else if (xmlData.toString) {
@@ -1304,6 +1379,11 @@
1304
1379
  else
1305
1380
  return prettify(orderedResult, this.options);
1306
1381
  }
1382
+ /**
1383
+ * Add Entity which is not by default supported by this library
1384
+ * @param {string} key
1385
+ * @param {string} value
1386
+ */
1307
1387
  addEntity(key, value) {
1308
1388
  if (value.indexOf("&") !== -1) {
1309
1389
  throw new Error("Entity value can't have '&'");
@@ -1474,14 +1554,32 @@
1474
1554
  commentPropName: false,
1475
1555
  unpairedTags: [],
1476
1556
  entities: [
1477
- { regex: new RegExp("&", "g"), val: "&amp;" },
1478
- { regex: new RegExp(">", "g"), val: "&gt;" },
1479
- { regex: new RegExp("<", "g"), val: "&lt;" },
1480
- { regex: new RegExp("'", "g"), val: "&apos;" },
1481
- { regex: new RegExp('"', "g"), val: "&quot;" }
1557
+ {
1558
+ regex: new RegExp("&", "g"),
1559
+ val: "&amp;"
1560
+ },
1561
+ //it must be on top
1562
+ {
1563
+ regex: new RegExp(">", "g"),
1564
+ val: "&gt;"
1565
+ },
1566
+ {
1567
+ regex: new RegExp("<", "g"),
1568
+ val: "&lt;"
1569
+ },
1570
+ {
1571
+ regex: new RegExp("'", "g"),
1572
+ val: "&apos;"
1573
+ },
1574
+ {
1575
+ regex: new RegExp('"', "g"),
1576
+ val: "&quot;"
1577
+ }
1482
1578
  ],
1483
1579
  processEntities: true,
1484
1580
  stopNodes: [],
1581
+ // transformTagName: false,
1582
+ // transformAttributeName: false,
1485
1583
  oneListGroup: false
1486
1584
  };
1487
1585
  function Builder(options) {
@@ -1580,7 +1678,10 @@
1580
1678
  }
1581
1679
  }
1582
1680
  }
1583
- return { attrStr, val: val2 };
1681
+ return {
1682
+ attrStr,
1683
+ val: val2
1684
+ };
1584
1685
  };
1585
1686
  Builder.prototype.buildAttrPairStr = function(attrName, val2) {
1586
1687
  val2 = this.options.attributeValueProcessor(attrName, "" + val2);
@@ -1688,20 +1789,69 @@
1688
1789
  }
1689
1790
  });
1690
1791
 
1792
+ // src/index.ts
1793
+ var src_exports = {};
1794
+ __export(src_exports, {
1795
+ CSWCapabilitiesLoader: () => CSWCapabilitiesLoader,
1796
+ CSWDomainLoader: () => CSWDomainLoader,
1797
+ CSWRecordsLoader: () => CSWRecordsLoader,
1798
+ CSWService: () => CSWService,
1799
+ ImageService: () => ImageService,
1800
+ ImageSource: () => ImageSource,
1801
+ WMSCapabilitiesLoader: () => WMSCapabilitiesLoader,
1802
+ WMSErrorLoader: () => WMSErrorLoader,
1803
+ WMSService: () => WMSService,
1804
+ WMSSource: () => WMSSource,
1805
+ _ArcGISImageService: () => ArcGISImageService,
1806
+ _GMLLoader: () => GMLLoader,
1807
+ _WFSCapabilitiesLoader: () => WFSCapabilitiesLoader,
1808
+ _WMSFeatureInfoLoader: () => WMSFeatureInfoLoader,
1809
+ _WMSLayerDescriptionLoader: () => WMSLayerDescriptionLoader,
1810
+ _getArcGISServices: () => getArcGISServices,
1811
+ createImageService: () => createImageService,
1812
+ createImageSource: () => createImageSource
1813
+ });
1814
+
1815
+ // ../xml/src/lib/xml-utils/uncapitalize.ts
1816
+ function uncapitalize(str) {
1817
+ return typeof str === "string" ? str.charAt(0).toLowerCase() + str.slice(1) : str;
1818
+ }
1819
+ function uncapitalizeKeys(object) {
1820
+ if (Array.isArray(object)) {
1821
+ return object.map((element) => uncapitalizeKeys(element));
1822
+ }
1823
+ if (object && typeof object === "object") {
1824
+ const newObject = {};
1825
+ for (const [key, value] of Object.entries(object)) {
1826
+ newObject[uncapitalize(key)] = uncapitalizeKeys(value);
1827
+ }
1828
+ return newObject;
1829
+ }
1830
+ return object;
1831
+ }
1832
+
1691
1833
  // ../xml/src/lib/parsers/parse-xml.ts
1834
+ var import_fast_xml_parser = __toESM(require_fxp(), 1);
1692
1835
  function parseXMLSync(text, options) {
1693
1836
  if (options?._parser && options._parser !== "fast-xml-parser") {
1694
1837
  throw new Error(options?._parser);
1695
1838
  }
1696
1839
  const fastXMLOptions = {
1840
+ // Default FastXML options
1841
+ // https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/docs/v4/2.XMLparseOptions.md#allowbooleanattributes
1697
1842
  allowBooleanAttributes: true,
1843
+ // https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/docs/v4/2.XMLparseOptions.md#ignoredeclaration
1698
1844
  ignoreDeclaration: true,
1845
+ // https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/docs/v4/2.XMLparseOptions.md#removensprefix
1699
1846
  removeNSPrefix: options?.removeNSPrefix,
1847
+ // https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/docs/v4/2.XMLparseOptions.md#textnodename
1700
1848
  textNodeName: options?.textNodeName,
1849
+ // Let's application specify keys that are always arrays
1701
1850
  isArray: (name, jpath, isLeafNode, isAttribute) => {
1702
1851
  const array = Boolean(options?.arrayPaths?.some((path) => jpath === path));
1703
1852
  return array;
1704
1853
  },
1854
+ // Application overrides
1705
1855
  ...options?._fastXML
1706
1856
  };
1707
1857
  const xml = fastParseXML(text, fastXMLOptions);
@@ -1716,49 +1866,39 @@
1716
1866
  const parsedXML = parser.parse(text);
1717
1867
  return parsedXML;
1718
1868
  }
1719
- var import_fast_xml_parser;
1720
- var init_parse_xml = __esm({
1721
- "../xml/src/lib/parsers/parse-xml.ts"() {
1722
- init_uncapitalize();
1723
- import_fast_xml_parser = __toModule(require_fxp());
1724
- }
1725
- });
1726
1869
 
1727
1870
  // ../xml/src/xml-loader.ts
1871
+ var VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
1872
+ var XMLLoader = {
1873
+ name: "XML",
1874
+ id: "xml",
1875
+ module: "xml",
1876
+ version: VERSION,
1877
+ worker: false,
1878
+ extensions: ["xml"],
1879
+ mimeTypes: ["application/xml", "text/xml"],
1880
+ testText: testXMLFile,
1881
+ options: {
1882
+ xml: {
1883
+ _parser: "fast-xml-parser",
1884
+ uncapitalizeKeys: false,
1885
+ removeNSPrefix: false,
1886
+ textNodeName: "value",
1887
+ arrayPaths: []
1888
+ }
1889
+ },
1890
+ parse: async (arrayBuffer, options) => parseXMLSync(new TextDecoder().decode(arrayBuffer), {
1891
+ ...XMLLoader.options.xml,
1892
+ ...options?.xml
1893
+ }),
1894
+ parseTextSync: (text, options) => parseXMLSync(text, {
1895
+ ...XMLLoader.options.xml,
1896
+ ...options?.xml
1897
+ })
1898
+ };
1728
1899
  function testXMLFile(text) {
1729
1900
  return text.startsWith("<?xml");
1730
1901
  }
1731
- var VERSION, XMLLoader;
1732
- var init_xml_loader = __esm({
1733
- "../xml/src/xml-loader.ts"() {
1734
- init_parse_xml();
1735
- VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
1736
- XMLLoader = {
1737
- name: "XML",
1738
- id: "xml",
1739
- module: "xml",
1740
- version: VERSION,
1741
- worker: false,
1742
- extensions: ["xml"],
1743
- mimeTypes: ["application/xml", "text/xml"],
1744
- testText: testXMLFile,
1745
- options: {
1746
- xml: {
1747
- _parser: "fast-xml-parser",
1748
- uncapitalizeKeys: false,
1749
- removeNSPrefix: false,
1750
- textNodeName: "value",
1751
- arrayPaths: []
1752
- }
1753
- },
1754
- parse: async (arrayBuffer, options) => parseXMLSync(new TextDecoder().decode(arrayBuffer), {
1755
- ...XMLLoader.options.xml,
1756
- ...options?.xml
1757
- }),
1758
- parseTextSync: (text, options) => parseXMLSync(text, { ...XMLLoader.options.xml, ...options?.xml })
1759
- };
1760
- }
1761
- });
1762
1902
 
1763
1903
  // ../loader-utils/src/lib/env-utils/assert.ts
1764
1904
  function assert(condition, message) {
@@ -1766,37 +1906,33 @@
1766
1906
  throw new Error(message || "loader assertion failed.");
1767
1907
  }
1768
1908
  }
1769
- var init_assert = __esm({
1770
- "../loader-utils/src/lib/env-utils/assert.ts"() {
1771
- }
1772
- });
1773
1909
 
1774
1910
  // ../loader-utils/src/lib/env-utils/globals.ts
1775
- var globals, self_, window_, global_, document_, isBrowser, matches, nodeVersion;
1776
- var init_globals = __esm({
1777
- "../loader-utils/src/lib/env-utils/globals.ts"() {
1778
- globals = {
1779
- self: typeof self !== "undefined" && self,
1780
- window: typeof window !== "undefined" && window,
1781
- global: typeof global !== "undefined" && global,
1782
- document: typeof document !== "undefined" && document
1783
- };
1784
- self_ = globals.self || globals.window || globals.global || {};
1785
- window_ = globals.window || globals.self || globals.global || {};
1786
- global_ = globals.global || globals.self || globals.window || {};
1787
- document_ = globals.document || {};
1788
- isBrowser = Boolean(typeof process !== "object" || String(process) !== "[object process]" || process.browser);
1789
- matches = typeof process !== "undefined" && process.version && /v([0-9]*)/.exec(process.version);
1790
- nodeVersion = matches && parseFloat(matches[1]) || 0;
1791
- }
1792
- });
1911
+ var globals = {
1912
+ self: typeof self !== "undefined" && self,
1913
+ window: typeof window !== "undefined" && window,
1914
+ global: typeof global !== "undefined" && global,
1915
+ document: typeof document !== "undefined" && document
1916
+ };
1917
+ var self_ = globals.self || globals.window || globals.global || {};
1918
+ var window_ = globals.window || globals.self || globals.global || {};
1919
+ var global_ = globals.global || globals.self || globals.window || {};
1920
+ var document_ = globals.document || {};
1921
+ var isBrowser = (
1922
+ // @ts-ignore process does not exist on browser
1923
+ Boolean(typeof process !== "object" || String(process) !== "[object process]" || process.browser)
1924
+ );
1925
+ var matches = typeof process !== "undefined" && process.version && /v([0-9]*)/.exec(process.version);
1926
+ var nodeVersion = matches && parseFloat(matches[1]) || 0;
1793
1927
 
1794
1928
  // ../loader-utils/src/lib/option-utils/merge-loader-options.ts
1795
1929
  function mergeLoaderOptions(baseOptions, newOptions) {
1796
1930
  return mergeOptionsRecursively(baseOptions || {}, newOptions);
1797
1931
  }
1798
1932
  function mergeOptionsRecursively(baseOptions, newOptions) {
1799
- const options = { ...baseOptions };
1933
+ const options = {
1934
+ ...baseOptions
1935
+ };
1800
1936
  for (const [key, newValue] of Object.entries(newOptions)) {
1801
1937
  if (newValue && typeof newValue === "object" && !Array.isArray(newValue)) {
1802
1938
  options[key] = mergeOptionsRecursively(options[key] || {}, newOptions[key]);
@@ -1806,12 +1942,41 @@
1806
1942
  }
1807
1943
  return options;
1808
1944
  }
1809
- var init_merge_loader_options = __esm({
1810
- "../loader-utils/src/lib/option-utils/merge-loader-options.ts"() {
1811
- }
1812
- });
1813
1945
 
1814
1946
  // ../loader-utils/src/lib/sources/data-source.ts
1947
+ var DataSource = class {
1948
+ /** A resolved fetch function extracted from loadOptions prop */
1949
+ /** The actual load options, if calling a loaders.gl loader */
1950
+ _needsRefresh = true;
1951
+ constructor(props) {
1952
+ this.props = {
1953
+ ...props
1954
+ };
1955
+ this.loadOptions = {
1956
+ ...props.loadOptions
1957
+ };
1958
+ this.fetch = getFetchFunction(this.loadOptions);
1959
+ }
1960
+ setProps(props) {
1961
+ this.props = Object.assign(this.props, props);
1962
+ this.setNeedsRefresh();
1963
+ }
1964
+ /** Mark this data source as needing a refresh (redraw) */
1965
+ setNeedsRefresh() {
1966
+ this._needsRefresh = true;
1967
+ }
1968
+ /**
1969
+ * Does this data source need refreshing?
1970
+ * @note The specifics of the refresh mechanism depends on type of data source
1971
+ */
1972
+ getNeedsRefresh(clear = true) {
1973
+ const needsRefresh = this._needsRefresh;
1974
+ if (clear) {
1975
+ this._needsRefresh = false;
1976
+ }
1977
+ return needsRefresh;
1978
+ }
1979
+ };
1815
1980
  function getFetchFunction(options) {
1816
1981
  const fetchFunction = options?.fetch;
1817
1982
  if (fetchFunction && typeof fetchFunction === "function") {
@@ -1823,56 +1988,12 @@
1823
1988
  }
1824
1989
  return (url) => fetch(url);
1825
1990
  }
1826
- var DataSource;
1827
- var init_data_source = __esm({
1828
- "../loader-utils/src/lib/sources/data-source.ts"() {
1829
- DataSource = class {
1830
- constructor(props) {
1831
- this._needsRefresh = true;
1832
- this.props = { ...props };
1833
- this.loadOptions = { ...props.loadOptions };
1834
- this.fetch = getFetchFunction(this.loadOptions);
1835
- }
1836
- setProps(props) {
1837
- this.props = Object.assign(this.props, props);
1838
- this.setNeedsRefresh();
1839
- }
1840
- setNeedsRefresh() {
1841
- this._needsRefresh = true;
1842
- }
1843
- getNeedsRefresh(clear = true) {
1844
- const needsRefresh = this._needsRefresh;
1845
- if (clear) {
1846
- this._needsRefresh = false;
1847
- }
1848
- return needsRefresh;
1849
- }
1850
- };
1851
- }
1852
- });
1853
1991
 
1854
1992
  // ../loader-utils/src/lib/sources/image-source.ts
1855
- var ImageSource;
1856
- var init_image_source = __esm({
1857
- "../loader-utils/src/lib/sources/image-source.ts"() {
1858
- init_data_source();
1859
- ImageSource = class extends DataSource {
1860
- };
1861
- ImageSource.type = "template";
1862
- ImageSource.testURL = (url) => false;
1863
- }
1864
- });
1865
-
1866
- // ../loader-utils/src/index.ts
1867
- var init_src = __esm({
1868
- "../loader-utils/src/index.ts"() {
1869
- init_assert();
1870
- init_globals();
1871
- init_merge_loader_options();
1872
- init_data_source();
1873
- init_image_source();
1874
- }
1875
- });
1993
+ var ImageSource = class extends DataSource {
1994
+ };
1995
+ __publicField(ImageSource, "type", "template");
1996
+ __publicField(ImageSource, "testURL", (url) => false);
1876
1997
 
1877
1998
  // ../xml/src/lib/xml-utils/xml-utils.ts
1878
1999
  function convertXMLValueToArray(xmlValue) {
@@ -1889,18 +2010,6 @@
1889
2010
  function convertXMLFieldToArrayInPlace(xml, key) {
1890
2011
  xml[key] = convertXMLValueToArray(xml[key]);
1891
2012
  }
1892
- var init_xml_utils = __esm({
1893
- "../xml/src/lib/xml-utils/xml-utils.ts"() {
1894
- }
1895
- });
1896
-
1897
- // ../xml/src/index.ts
1898
- var init_src2 = __esm({
1899
- "../xml/src/index.ts"() {
1900
- init_xml_loader();
1901
- init_xml_utils();
1902
- }
1903
- });
1904
2013
 
1905
2014
  // src/lib/parsers/csw/parse-exception-report.ts
1906
2015
  function parseExceptionReport(parsedXML) {
@@ -1911,10 +2020,6 @@
1911
2020
  const errorMessage = exceptionReport.exception?.exceptionText || exceptionReport.exception?.exceptionCode || exceptionReport.exception?.locator || "server error";
1912
2021
  throw new Error(`Catalog Server: ${errorMessage}`);
1913
2022
  }
1914
- var init_parse_exception_report = __esm({
1915
- "src/lib/parsers/csw/parse-exception-report.ts"() {
1916
- }
1917
- });
1918
2023
 
1919
2024
  // src/lib/parsers/csw/parse-csw-capabilities.ts
1920
2025
  function parseCSWCapabilities(text, options) {
@@ -1930,39 +2035,27 @@
1930
2035
  const xmlCapabilities = parsedXML.capabilities || parsedXML;
1931
2036
  return xmlCapabilities;
1932
2037
  }
1933
- var init_parse_csw_capabilities = __esm({
1934
- "src/lib/parsers/csw/parse-csw-capabilities.ts"() {
1935
- init_src2();
1936
- init_parse_exception_report();
1937
- }
1938
- });
1939
2038
 
1940
2039
  // src/csw-capabilities-loader.ts
2040
+ var VERSION2 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
2041
+ var CSWCapabilitiesLoader = {
2042
+ id: "csw-capabilities",
2043
+ name: "CSW Capabilities",
2044
+ module: "wms",
2045
+ version: VERSION2,
2046
+ worker: false,
2047
+ extensions: ["xml"],
2048
+ mimeTypes: ["application/vnd.ogc.csw_xml", "application/xml", "text/xml"],
2049
+ testText: testXMLFile2,
2050
+ options: {
2051
+ csw: {}
2052
+ },
2053
+ parse: async (arrayBuffer, options) => parseCSWCapabilities(new TextDecoder().decode(arrayBuffer), options),
2054
+ parseTextSync: (text, options) => parseCSWCapabilities(text, options)
2055
+ };
1941
2056
  function testXMLFile2(text) {
1942
2057
  return text.startsWith("<?xml");
1943
2058
  }
1944
- var VERSION2, CSWCapabilitiesLoader;
1945
- var init_csw_capabilities_loader = __esm({
1946
- "src/csw-capabilities-loader.ts"() {
1947
- init_parse_csw_capabilities();
1948
- VERSION2 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
1949
- CSWCapabilitiesLoader = {
1950
- id: "csw-capabilities",
1951
- name: "CSW Capabilities",
1952
- module: "wms",
1953
- version: VERSION2,
1954
- worker: false,
1955
- extensions: ["xml"],
1956
- mimeTypes: ["application/vnd.ogc.csw_xml", "application/xml", "text/xml"],
1957
- testText: testXMLFile2,
1958
- options: {
1959
- csw: {}
1960
- },
1961
- parse: async (arrayBuffer, options) => parseCSWCapabilities(new TextDecoder().decode(arrayBuffer), options),
1962
- parseTextSync: (text, options) => parseCSWCapabilities(text, options)
1963
- };
1964
- }
1965
- });
1966
2059
 
1967
2060
  // src/lib/parsers/csw/parse-csw-domain.ts
1968
2061
  function parseCSWDomain(text, options) {
@@ -1972,10 +2065,7 @@
1972
2065
  ...options?.xml,
1973
2066
  removeNSPrefix: true,
1974
2067
  uncapitalizeKeys: true,
1975
- arrayPaths: [
1976
- "GetDomainResponse.DomainValues",
1977
- "GetDomainResponse.DomainValues.ListOfValues.value"
1978
- ]
2068
+ arrayPaths: ["GetDomainResponse.DomainValues", "GetDomainResponse.DomainValues.ListOfValues.value"]
1979
2069
  }
1980
2070
  });
1981
2071
  parseExceptionReport(parsedXML);
@@ -1986,39 +2076,27 @@
1986
2076
  }
1987
2077
  return xmlDomain;
1988
2078
  }
1989
- var init_parse_csw_domain = __esm({
1990
- "src/lib/parsers/csw/parse-csw-domain.ts"() {
1991
- init_src2();
1992
- init_parse_exception_report();
1993
- }
1994
- });
1995
2079
 
1996
2080
  // src/csw-domain-loader.ts
2081
+ var VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
2082
+ var CSWDomainLoader = {
2083
+ id: "csw-domain",
2084
+ name: "CSW Domain",
2085
+ module: "wms",
2086
+ version: VERSION3,
2087
+ worker: false,
2088
+ extensions: ["xml"],
2089
+ mimeTypes: ["application/vnd.ogc.csw_xml", "application/xml", "text/xml"],
2090
+ testText: testXMLFile3,
2091
+ options: {
2092
+ csw: {}
2093
+ },
2094
+ parse: async (arrayBuffer, options) => parseCSWDomain(new TextDecoder().decode(arrayBuffer), options),
2095
+ parseTextSync: (text, options) => parseCSWDomain(text, options)
2096
+ };
1997
2097
  function testXMLFile3(text) {
1998
2098
  return text.startsWith("<?xml");
1999
2099
  }
2000
- var VERSION3, CSWDomainLoader;
2001
- var init_csw_domain_loader = __esm({
2002
- "src/csw-domain-loader.ts"() {
2003
- init_parse_csw_domain();
2004
- VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
2005
- CSWDomainLoader = {
2006
- id: "csw-domain",
2007
- name: "CSW Domain",
2008
- module: "wms",
2009
- version: VERSION3,
2010
- worker: false,
2011
- extensions: ["xml"],
2012
- mimeTypes: ["application/vnd.ogc.csw_xml", "application/xml", "text/xml"],
2013
- testText: testXMLFile3,
2014
- options: {
2015
- csw: {}
2016
- },
2017
- parse: async (arrayBuffer, options) => parseCSWDomain(new TextDecoder().decode(arrayBuffer), options),
2018
- parseTextSync: (text, options) => parseCSWDomain(text, options)
2019
- };
2020
- }
2021
- });
2022
2100
 
2023
2101
  // src/lib/parsers/csw/parse-csw-records.ts
2024
2102
  function parseCSWRecords(text, options) {
@@ -2047,52 +2125,34 @@
2047
2125
  delete record.boundingBox;
2048
2126
  convertXMLFieldToArrayInPlace(record, "boundingBoxes");
2049
2127
  for (const boundingBox of record.boundingBoxes) {
2050
- boundingBox.value = [
2051
- boundingBox.upperCorner[0],
2052
- boundingBox.upperCorner[1],
2053
- boundingBox.lowerCorner[0],
2054
- boundingBox.lowerCorner[1]
2055
- ];
2128
+ boundingBox.value = [boundingBox.upperCorner[0], boundingBox.upperCorner[1], boundingBox.lowerCorner[0], boundingBox.lowerCorner[1]];
2056
2129
  delete boundingBox.upperCorner;
2057
2130
  delete boundingBox.lowerCorner;
2058
2131
  }
2059
2132
  }
2060
2133
  return xmlRecords;
2061
2134
  }
2062
- var init_parse_csw_records = __esm({
2063
- "src/lib/parsers/csw/parse-csw-records.ts"() {
2064
- init_src2();
2065
- init_src2();
2066
- init_parse_exception_report();
2067
- }
2068
- });
2069
2135
 
2070
2136
  // src/csw-records-loader.ts
2137
+ var VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
2138
+ var CSWRecordsLoader = {
2139
+ id: "csw-records",
2140
+ name: "CSW Records",
2141
+ module: "wms",
2142
+ version: VERSION4,
2143
+ worker: false,
2144
+ extensions: ["xml"],
2145
+ mimeTypes: ["application/vnd.ogc.csw_xml", "application/xml", "text/xml"],
2146
+ testText: testXMLFile4,
2147
+ options: {
2148
+ csw: {}
2149
+ },
2150
+ parse: async (arrayBuffer, options) => parseCSWRecords(new TextDecoder().decode(arrayBuffer), options),
2151
+ parseTextSync: (text, options) => parseCSWRecords(text, options)
2152
+ };
2071
2153
  function testXMLFile4(text) {
2072
2154
  return text.startsWith("<?xml");
2073
2155
  }
2074
- var VERSION4, CSWRecordsLoader;
2075
- var init_csw_records_loader = __esm({
2076
- "src/csw-records-loader.ts"() {
2077
- init_parse_csw_records();
2078
- VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
2079
- CSWRecordsLoader = {
2080
- id: "csw-records",
2081
- name: "CSW Records",
2082
- module: "wms",
2083
- version: VERSION4,
2084
- worker: false,
2085
- extensions: ["xml"],
2086
- mimeTypes: ["application/vnd.ogc.csw_xml", "application/xml", "text/xml"],
2087
- testText: testXMLFile4,
2088
- options: {
2089
- csw: {}
2090
- },
2091
- parse: async (arrayBuffer, options) => parseCSWRecords(new TextDecoder().decode(arrayBuffer), options),
2092
- parseTextSync: (text, options) => parseCSWRecords(text, options)
2093
- };
2094
- }
2095
- });
2096
2156
 
2097
2157
  // src/lib/parsers/wms/parse-wms-error.ts
2098
2158
  function parseWMSError(text, options) {
@@ -2101,18 +2161,35 @@
2101
2161
  const message = typeof serviceExceptionXML === "string" ? serviceExceptionXML : serviceExceptionXML.value || serviceExceptionXML.code || "Unknown error";
2102
2162
  return message;
2103
2163
  }
2104
- var init_parse_wms_error = __esm({
2105
- "src/lib/parsers/wms/parse-wms-error.ts"() {
2106
- init_src2();
2107
- }
2108
- });
2109
2164
 
2110
2165
  // src/wms-error-loader.ts
2166
+ var VERSION5 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
2167
+ var WMSErrorLoader = {
2168
+ id: "wms-error",
2169
+ name: "WMS Error",
2170
+ module: "wms",
2171
+ version: VERSION5,
2172
+ worker: false,
2173
+ extensions: ["xml"],
2174
+ mimeTypes: ["application/vnd.ogc.se_xml", "application/xml", "text/xml"],
2175
+ testText: testXMLFile5,
2176
+ options: {
2177
+ wms: {
2178
+ throwOnError: false
2179
+ }
2180
+ },
2181
+ parse: async (arrayBuffer, options) => parseTextSync(new TextDecoder().decode(arrayBuffer), options),
2182
+ parseSync: (arrayBuffer, options) => parseTextSync(new TextDecoder().decode(arrayBuffer), options),
2183
+ parseTextSync: (text, options) => parseTextSync(text, options)
2184
+ };
2111
2185
  function testXMLFile5(text) {
2112
2186
  return text.startsWith("<?xml");
2113
2187
  }
2114
2188
  function parseTextSync(text, options) {
2115
- const wmsOptions = { ...WMSErrorLoader.options.wms, ...options?.wms };
2189
+ const wmsOptions = {
2190
+ ...WMSErrorLoader.options.wms,
2191
+ ...options?.wms
2192
+ };
2116
2193
  const error = parseWMSError(text, wmsOptions);
2117
2194
  const message = wmsOptions.minimalErrors ? error : `WMS Service error: ${error}`;
2118
2195
  if (wmsOptions.throwOnError) {
@@ -2120,31 +2197,6 @@
2120
2197
  }
2121
2198
  return message;
2122
2199
  }
2123
- var VERSION5, WMSErrorLoader;
2124
- var init_wms_error_loader = __esm({
2125
- "src/wms-error-loader.ts"() {
2126
- init_parse_wms_error();
2127
- VERSION5 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
2128
- WMSErrorLoader = {
2129
- id: "wms-error",
2130
- name: "WMS Error",
2131
- module: "wms",
2132
- version: VERSION5,
2133
- worker: false,
2134
- extensions: ["xml"],
2135
- mimeTypes: ["application/vnd.ogc.se_xml", "application/xml", "text/xml"],
2136
- testText: testXMLFile5,
2137
- options: {
2138
- wms: {
2139
- throwOnError: false
2140
- }
2141
- },
2142
- parse: async (arrayBuffer, options) => parseTextSync(new TextDecoder().decode(arrayBuffer), options),
2143
- parseSync: (arrayBuffer, options) => parseTextSync(new TextDecoder().decode(arrayBuffer), options),
2144
- parseTextSync: (text, options) => parseTextSync(text, options)
2145
- };
2146
- }
2147
- });
2148
2200
 
2149
2201
  // src/lib/parsers/xml/parse-xml-helpers.ts
2150
2202
  function getXMLArray(xmlValue) {
@@ -2197,10 +2249,6 @@
2197
2249
  return false;
2198
2250
  }
2199
2251
  }
2200
- var init_parse_xml_helpers = __esm({
2201
- "src/lib/parsers/xml/parse-xml-helpers.ts"() {
2202
- }
2203
- });
2204
2252
 
2205
2253
  // src/lib/parsers/wms/parse-wms-capabilities.ts
2206
2254
  function parseWMSCapabilities(xmlText, options) {
@@ -2235,6 +2283,8 @@
2235
2283
  layers: [],
2236
2284
  requests: extractRequests(xml.Capability?.Request),
2237
2285
  exceptions: extractExceptions(xml.Exception)
2286
+ // contact field is a mess of largely irrelevant information, put it last
2287
+ // contact: xml.Service?.Contact ? JSON.stringify(xml.Service?.Contact) : undefined,
2238
2288
  };
2239
2289
  const xmlLayers = getXMLArray(xml.Capability?.Layer);
2240
2290
  for (const xmlSubLayer of xmlLayers) {
@@ -2251,7 +2301,9 @@
2251
2301
  const requests = {};
2252
2302
  for (const [name, xmlRequest] of Object.entries(xmlRequests || {})) {
2253
2303
  const mimeTypes = getXMLStringArray(xmlRequest?.Format);
2254
- requests[name] = { mimeTypes };
2304
+ requests[name] = {
2305
+ mimeTypes
2306
+ };
2255
2307
  }
2256
2308
  return requests;
2257
2309
  }
@@ -2266,7 +2318,9 @@
2266
2318
  }
2267
2319
  function extractLayer(xmlLayer) {
2268
2320
  const layer = {
2321
+ // All layers must have a title
2269
2322
  title: String(xmlLayer?.Title || ""),
2323
+ // Name is required only if renderable
2270
2324
  name: xmlLayer?.Name && String(xmlLayer?.Name),
2271
2325
  abstract: xmlLayer?.Name && String(xmlLayer?.Abstract),
2272
2326
  keywords: getXMLStringArray(xmlLayer.KeywordList?.Keyword)
@@ -2323,30 +2377,36 @@
2323
2377
  eastBoundLongitude: e,
2324
2378
  southBoundLatitude: s
2325
2379
  } = xmlBoundingBox;
2326
- return [
2327
- [w, s],
2328
- [e, n]
2329
- ];
2380
+ return [[w, s], [e, n]];
2330
2381
  }
2331
2382
  function extractLatLonBoundingBox(xmlBoundingBox) {
2332
- const { minx, miny, maxx, maxy } = xmlBoundingBox;
2333
- return [
2334
- [minx, miny],
2335
- [maxx, maxy]
2336
- ];
2383
+ const {
2384
+ minx,
2385
+ miny,
2386
+ maxx,
2387
+ maxy
2388
+ } = xmlBoundingBox;
2389
+ return [[minx, miny], [maxx, maxy]];
2337
2390
  }
2338
2391
  function extractWMSBoundingBoxes(xmlBoundingBoxes) {
2339
2392
  const xmlBoxes = getXMLArray(xmlBoundingBoxes);
2340
2393
  return xmlBoxes.map((xmlBox) => extractWMSBoundingBox(xmlBox));
2341
2394
  }
2342
2395
  function extractWMSBoundingBox(xmlBoundingBox) {
2343
- const { CRS, SRS, minx, miny, maxx, maxy, resx, resy } = xmlBoundingBox;
2396
+ const {
2397
+ CRS,
2398
+ SRS,
2399
+ minx,
2400
+ miny,
2401
+ maxx,
2402
+ maxy,
2403
+ resx,
2404
+ resy
2405
+ } = xmlBoundingBox;
2344
2406
  const boundingBox = {
2407
+ // CRS in 1.3.0, SRS in 1.1.1
2345
2408
  crs: CRS || SRS,
2346
- boundingBox: [
2347
- [getXMLFloat(minx), getXMLFloat(miny)],
2348
- [getXMLFloat(maxx), getXMLFloat(maxy)]
2349
- ]
2409
+ boundingBox: [[getXMLFloat(minx), getXMLFloat(miny)], [getXMLFloat(maxx), getXMLFloat(maxy)]]
2350
2410
  };
2351
2411
  if (resx) {
2352
2412
  boundingBox.xResolution = resx;
@@ -2357,8 +2417,16 @@
2357
2417
  return boundingBox;
2358
2418
  }
2359
2419
  function extractDimension(xmlDimension) {
2360
- const { name, units, value: extent } = xmlDimension;
2361
- const dimension = { name, units, extent };
2420
+ const {
2421
+ name,
2422
+ units,
2423
+ value: extent
2424
+ } = xmlDimension;
2425
+ const dimension = {
2426
+ name,
2427
+ units,
2428
+ extent
2429
+ };
2362
2430
  if (xmlDimension.unitSymbol) {
2363
2431
  dimension.unitSymbol = xmlDimension.unitSymbol;
2364
2432
  }
@@ -2393,39 +2461,33 @@
2393
2461
  addInheritedLayerProps(subLayer, layer);
2394
2462
  }
2395
2463
  }
2396
- var init_parse_wms_capabilities = __esm({
2397
- "src/lib/parsers/wms/parse-wms-capabilities.ts"() {
2398
- init_src2();
2399
- init_parse_xml_helpers();
2400
- }
2401
- });
2402
2464
 
2403
2465
  // src/wms-capabilities-loader.ts
2466
+ var VERSION6 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
2467
+ var WMSCapabilitiesLoader = {
2468
+ id: "wms-capabilities",
2469
+ name: "WMS Capabilities",
2470
+ module: "wms",
2471
+ version: VERSION6,
2472
+ worker: false,
2473
+ extensions: ["xml"],
2474
+ mimeTypes: ["application/vnd.ogc.wms_xml", "application/xml", "text/xml"],
2475
+ testText: testXMLFile6,
2476
+ options: {
2477
+ wms: {}
2478
+ },
2479
+ parse: async (arrayBuffer, options) => (
2480
+ // TODO pass in XML options
2481
+ parseWMSCapabilities(new TextDecoder().decode(arrayBuffer), options?.wms)
2482
+ ),
2483
+ parseTextSync: (text, options) => (
2484
+ // TODO pass in XML options
2485
+ parseWMSCapabilities(text, options?.wms)
2486
+ )
2487
+ };
2404
2488
  function testXMLFile6(text) {
2405
2489
  return text.startsWith("<?xml");
2406
2490
  }
2407
- var VERSION6, WMSCapabilitiesLoader;
2408
- var init_wms_capabilities_loader = __esm({
2409
- "src/wms-capabilities-loader.ts"() {
2410
- init_parse_wms_capabilities();
2411
- VERSION6 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
2412
- WMSCapabilitiesLoader = {
2413
- id: "wms-capabilities",
2414
- name: "WMS Capabilities",
2415
- module: "wms",
2416
- version: VERSION6,
2417
- worker: false,
2418
- extensions: ["xml"],
2419
- mimeTypes: ["application/vnd.ogc.wms_xml", "application/xml", "text/xml"],
2420
- testText: testXMLFile6,
2421
- options: {
2422
- wms: {}
2423
- },
2424
- parse: async (arrayBuffer, options) => parseWMSCapabilities(new TextDecoder().decode(arrayBuffer), options?.wms),
2425
- parseTextSync: (text, options) => parseWMSCapabilities(text, options?.wms)
2426
- };
2427
- }
2428
- });
2429
2491
 
2430
2492
  // src/lib/parsers/wms/parse-wms-features.ts
2431
2493
  function parseWMSFeatureInfo(text, options) {
@@ -2441,100 +2503,73 @@
2441
2503
  return {
2442
2504
  attributes: xmlFields,
2443
2505
  type: "",
2444
- bounds: { bottom: 0, top: 0, left: 0, right: 0 }
2506
+ bounds: {
2507
+ bottom: 0,
2508
+ top: 0,
2509
+ left: 0,
2510
+ right: 0
2511
+ }
2445
2512
  };
2446
2513
  }
2447
- var init_parse_wms_features = __esm({
2448
- "src/lib/parsers/wms/parse-wms-features.ts"() {
2449
- init_src2();
2450
- }
2451
- });
2452
2514
 
2453
2515
  // src/wip/wms-feature-info-loader.ts
2454
- var WMSFeatureInfoLoader;
2455
- var init_wms_feature_info_loader = __esm({
2456
- "src/wip/wms-feature-info-loader.ts"() {
2457
- init_wms_capabilities_loader();
2458
- init_parse_wms_features();
2459
- WMSFeatureInfoLoader = {
2460
- ...WMSCapabilitiesLoader,
2461
- id: "wms-feature-info",
2462
- name: "WMS FeatureInfo",
2463
- parse: async (arrayBuffer, options) => parseWMSFeatureInfo(new TextDecoder().decode(arrayBuffer), options),
2464
- parseTextSync: (text, options) => parseWMSFeatureInfo(text, options)
2465
- };
2466
- }
2467
- });
2516
+ var WMSFeatureInfoLoader = {
2517
+ ...WMSCapabilitiesLoader,
2518
+ id: "wms-feature-info",
2519
+ name: "WMS FeatureInfo",
2520
+ parse: async (arrayBuffer, options) => parseWMSFeatureInfo(new TextDecoder().decode(arrayBuffer), options),
2521
+ parseTextSync: (text, options) => parseWMSFeatureInfo(text, options)
2522
+ };
2468
2523
 
2469
2524
  // src/lib/parsers/wms/parse-wms-layer-description.ts
2470
2525
  function parseWMSLayerDescription(text, options) {
2471
2526
  const parsedXML = XMLLoader.parseTextSync?.(text, options);
2472
2527
  return parsedXML;
2473
2528
  }
2474
- var init_parse_wms_layer_description = __esm({
2475
- "src/lib/parsers/wms/parse-wms-layer-description.ts"() {
2476
- init_src2();
2477
- }
2478
- });
2479
2529
 
2480
2530
  // src/wip/wms-layer-description-loader.ts
2481
- var WMSLayerDescriptionLoader;
2482
- var init_wms_layer_description_loader = __esm({
2483
- "src/wip/wms-layer-description-loader.ts"() {
2484
- init_wms_capabilities_loader();
2485
- init_parse_wms_layer_description();
2486
- WMSLayerDescriptionLoader = {
2487
- ...WMSCapabilitiesLoader,
2488
- id: "wms-layer-description",
2489
- name: "WMS DescribeLayer",
2490
- parse: async (arrayBuffer, options) => parseWMSLayerDescription(new TextDecoder().decode(arrayBuffer), options),
2491
- parseTextSync: (text, options) => parseWMSLayerDescription(text, options)
2492
- };
2493
- }
2494
- });
2531
+ var WMSLayerDescriptionLoader = {
2532
+ ...WMSCapabilitiesLoader,
2533
+ id: "wms-layer-description",
2534
+ name: "WMS DescribeLayer",
2535
+ parse: async (arrayBuffer, options) => parseWMSLayerDescription(new TextDecoder().decode(arrayBuffer), options),
2536
+ parseTextSync: (text, options) => parseWMSLayerDescription(text, options)
2537
+ };
2495
2538
 
2496
2539
  // src/wip/lib/wfs/parse-wfs-capabilities.ts
2497
2540
  function parseWFSCapabilities(text, options) {
2498
- const parsedXML = XMLLoader.parseTextSync?.(text, { ...options, xml: {
2499
- ...options?.xml,
2500
- removeNSPrefix: true,
2501
- uncapitalizeKeys: true
2502
- } });
2541
+ const parsedXML = XMLLoader.parseTextSync?.(text, {
2542
+ ...options,
2543
+ xml: {
2544
+ ...options?.xml,
2545
+ removeNSPrefix: true,
2546
+ uncapitalizeKeys: true
2547
+ }
2548
+ });
2503
2549
  const xmlCapabilities = parsedXML.Capabilities || parsedXML;
2504
2550
  return xmlCapabilities;
2505
2551
  }
2506
- var init_parse_wfs_capabilities = __esm({
2507
- "src/wip/lib/wfs/parse-wfs-capabilities.ts"() {
2508
- init_src2();
2509
- }
2510
- });
2511
2552
 
2512
2553
  // src/wip/wfs-capabilities-loader.ts
2554
+ var VERSION7 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
2555
+ var WFSCapabilitiesLoader = {
2556
+ id: "wfs-capabilities",
2557
+ name: "WFS Capabilities",
2558
+ module: "wms",
2559
+ version: VERSION7,
2560
+ worker: false,
2561
+ extensions: ["xml"],
2562
+ mimeTypes: ["application/vnd.ogc.wfs_xml", "application/xml", "text/xml"],
2563
+ testText: testXMLFile7,
2564
+ options: {
2565
+ wfs: {}
2566
+ },
2567
+ parse: async (arrayBuffer, options) => parseWFSCapabilities(new TextDecoder().decode(arrayBuffer), options),
2568
+ parseTextSync: (text, options) => parseWFSCapabilities(text, options)
2569
+ };
2513
2570
  function testXMLFile7(text) {
2514
2571
  return text.startsWith("<?xml");
2515
2572
  }
2516
- var VERSION7, WFSCapabilitiesLoader;
2517
- var init_wfs_capabilities_loader = __esm({
2518
- "src/wip/wfs-capabilities-loader.ts"() {
2519
- init_parse_wfs_capabilities();
2520
- VERSION7 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
2521
- WFSCapabilitiesLoader = {
2522
- id: "wfs-capabilities",
2523
- name: "WFS Capabilities",
2524
- module: "wms",
2525
- version: VERSION7,
2526
- worker: false,
2527
- extensions: ["xml"],
2528
- mimeTypes: ["application/vnd.ogc.wfs_xml", "application/xml", "text/xml"],
2529
- testText: testXMLFile7,
2530
- options: {
2531
- wfs: {}
2532
- },
2533
- parse: async (arrayBuffer, options) => parseWFSCapabilities(new TextDecoder().decode(arrayBuffer), options),
2534
- parseTextSync: (text, options) => parseWFSCapabilities(text, options)
2535
- };
2536
- }
2537
- });
2538
2573
 
2539
2574
  // src/lib/parsers/gml/deep-strict-equal.ts
2540
2575
  function deepStrictEqual(actual, expected, strict) {
@@ -2549,6 +2584,7 @@
2549
2584
  }
2550
2585
  return objEquiv(actual, expected, strict);
2551
2586
  }
2587
+ var pSlice = Array.prototype.slice;
2552
2588
  function isPrimitive(arg) {
2553
2589
  return arg === null || typeof arg !== "object" && typeof arg !== "function";
2554
2590
  }
@@ -2590,12 +2626,6 @@
2590
2626
  }
2591
2627
  return true;
2592
2628
  }
2593
- var pSlice;
2594
- var init_deep_strict_equal = __esm({
2595
- "src/lib/parsers/gml/deep-strict-equal.ts"() {
2596
- pSlice = Array.prototype.slice;
2597
- }
2598
- });
2599
2629
 
2600
2630
  // ../../node_modules/@turf/clone/main.es.js
2601
2631
  function clone(geojson) {
@@ -2692,14 +2722,44 @@
2692
2722
  return deepSlice(coord);
2693
2723
  });
2694
2724
  }
2695
- var main_es_default;
2696
- var init_main_es = __esm({
2697
- "../../node_modules/@turf/clone/main.es.js"() {
2698
- main_es_default = clone;
2699
- }
2700
- });
2725
+ var main_es_default = clone;
2701
2726
 
2702
2727
  // ../../node_modules/@turf/helpers/main.es.js
2728
+ var earthRadius = 63710088e-1;
2729
+ var factors = {
2730
+ meters: earthRadius,
2731
+ metres: earthRadius,
2732
+ millimeters: earthRadius * 1e3,
2733
+ millimetres: earthRadius * 1e3,
2734
+ centimeters: earthRadius * 100,
2735
+ centimetres: earthRadius * 100,
2736
+ kilometers: earthRadius / 1e3,
2737
+ kilometres: earthRadius / 1e3,
2738
+ miles: earthRadius / 1609.344,
2739
+ nauticalmiles: earthRadius / 1852,
2740
+ inches: earthRadius * 39.37,
2741
+ yards: earthRadius / 1.0936,
2742
+ feet: earthRadius * 3.28084,
2743
+ radians: 1,
2744
+ degrees: earthRadius / 111325
2745
+ };
2746
+ var unitsFactors = {
2747
+ meters: 1,
2748
+ metres: 1,
2749
+ millimeters: 1e3,
2750
+ millimetres: 1e3,
2751
+ centimeters: 100,
2752
+ centimetres: 100,
2753
+ kilometers: 1 / 1e3,
2754
+ kilometres: 1 / 1e3,
2755
+ miles: 1 / 1609.344,
2756
+ nauticalmiles: 1 / 1852,
2757
+ inches: 39.37,
2758
+ yards: 1 / 1.0936,
2759
+ feet: 3.28084,
2760
+ radians: 1 / earthRadius,
2761
+ degrees: 1 / 111325
2762
+ };
2703
2763
  function featureCollection(features, options) {
2704
2764
  options = options || {};
2705
2765
  if (!isObject(options))
@@ -2746,46 +2806,6 @@
2746
2806
  if (["string", "number"].indexOf(typeof id) === -1)
2747
2807
  throw new Error("id must be a number or a string");
2748
2808
  }
2749
- var earthRadius, factors, unitsFactors;
2750
- var init_main_es2 = __esm({
2751
- "../../node_modules/@turf/helpers/main.es.js"() {
2752
- earthRadius = 63710088e-1;
2753
- factors = {
2754
- meters: earthRadius,
2755
- metres: earthRadius,
2756
- millimeters: earthRadius * 1e3,
2757
- millimetres: earthRadius * 1e3,
2758
- centimeters: earthRadius * 100,
2759
- centimetres: earthRadius * 100,
2760
- kilometers: earthRadius / 1e3,
2761
- kilometres: earthRadius / 1e3,
2762
- miles: earthRadius / 1609.344,
2763
- nauticalmiles: earthRadius / 1852,
2764
- inches: earthRadius * 39.37,
2765
- yards: earthRadius / 1.0936,
2766
- feet: earthRadius * 3.28084,
2767
- radians: 1,
2768
- degrees: earthRadius / 111325
2769
- };
2770
- unitsFactors = {
2771
- meters: 1,
2772
- metres: 1,
2773
- millimeters: 1e3,
2774
- millimetres: 1e3,
2775
- centimeters: 100,
2776
- centimetres: 100,
2777
- kilometers: 1 / 1e3,
2778
- kilometres: 1 / 1e3,
2779
- miles: 1 / 1609.344,
2780
- nauticalmiles: 1 / 1852,
2781
- inches: 39.37,
2782
- yards: 1 / 1.0936,
2783
- feet: 3.28084,
2784
- radians: 1 / earthRadius,
2785
- degrees: 1 / 111325
2786
- };
2787
- }
2788
- });
2789
2809
 
2790
2810
  // ../../node_modules/@turf/invariant/main.es.js
2791
2811
  function getCoords(coords) {
@@ -2799,11 +2819,6 @@
2799
2819
  return coords;
2800
2820
  throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array");
2801
2821
  }
2802
- var init_main_es3 = __esm({
2803
- "../../node_modules/@turf/invariant/main.es.js"() {
2804
- init_main_es2();
2805
- }
2806
- });
2807
2822
 
2808
2823
  // ../../node_modules/@turf/boolean-clockwise/main.es.js
2809
2824
  function booleanClockwise(line) {
@@ -2824,13 +2839,7 @@
2824
2839
  }
2825
2840
  return sum > 0;
2826
2841
  }
2827
- var main_es_default2;
2828
- var init_main_es4 = __esm({
2829
- "../../node_modules/@turf/boolean-clockwise/main.es.js"() {
2830
- init_main_es3();
2831
- main_es_default2 = booleanClockwise;
2832
- }
2833
- });
2842
+ var main_es_default2 = booleanClockwise;
2834
2843
 
2835
2844
  // ../../node_modules/@turf/meta/main.es.js
2836
2845
  function featureEach(geojson, callback) {
@@ -2884,11 +2893,6 @@
2884
2893
  featureIndex++;
2885
2894
  }
2886
2895
  }
2887
- var init_main_es5 = __esm({
2888
- "../../node_modules/@turf/meta/main.es.js"() {
2889
- init_main_es2();
2890
- }
2891
- });
2892
2896
 
2893
2897
  // ../../node_modules/@turf/rewind/main.es.js
2894
2898
  function rewind(geojson, options) {
@@ -2965,17 +2969,7 @@
2965
2969
  }
2966
2970
  }
2967
2971
  }
2968
- var main_es_default3;
2969
- var init_main_es6 = __esm({
2970
- "../../node_modules/@turf/rewind/main.es.js"() {
2971
- init_main_es();
2972
- init_main_es4();
2973
- init_main_es5();
2974
- init_main_es3();
2975
- init_main_es2();
2976
- main_es_default3 = rewind;
2977
- }
2978
- });
2972
+ var main_es_default3 = rewind;
2979
2973
 
2980
2974
  // src/lib/parsers/gml/parse-gml.ts
2981
2975
  function noTransform(...coords) {
@@ -2983,7 +2977,11 @@
2983
2977
  }
2984
2978
  function parseGML(text, options) {
2985
2979
  const parsedXML = XMLLoader.parseTextSync?.(text, options);
2986
- options = { transformCoords: noTransform, stride: 2, ...options };
2980
+ options = {
2981
+ transformCoords: noTransform,
2982
+ stride: 2,
2983
+ ...options
2984
+ };
2987
2985
  const context = createChildContext(parsedXML, options, {});
2988
2986
  return parseGMLToGeometry(parsedXML, options, context);
2989
2987
  }
@@ -3020,7 +3018,9 @@
3020
3018
  default:
3021
3019
  return null;
3022
3020
  }
3023
- return main_es_default3(geometry, { mutate: true });
3021
+ return main_es_default3(geometry, {
3022
+ mutate: true
3023
+ });
3024
3024
  }
3025
3025
  function parseCoords(s, options, context) {
3026
3026
  const stride = context.srsDimension || options.stride || 2;
@@ -3295,44 +3295,33 @@
3295
3295
  }
3296
3296
  return context;
3297
3297
  }
3298
- var init_parse_gml = __esm({
3299
- "src/lib/parsers/gml/parse-gml.ts"() {
3300
- init_src2();
3301
- init_deep_strict_equal();
3302
- init_main_es6();
3303
- }
3304
- });
3305
3298
 
3306
3299
  // src/gml-loader.ts
3300
+ var VERSION8 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
3301
+ var GMLLoader = {
3302
+ name: "GML",
3303
+ id: "gml",
3304
+ module: "wms",
3305
+ version: VERSION8,
3306
+ worker: false,
3307
+ extensions: ["xml"],
3308
+ mimeTypes: ["application/vnd.ogc.gml", "application/xml", "text/xml"],
3309
+ testText: testXMLFile8,
3310
+ options: {
3311
+ gml: {}
3312
+ },
3313
+ parse: async (arrayBuffer, options) => parseGML(new TextDecoder().decode(arrayBuffer), options),
3314
+ parseTextSync: (text, options) => parseGML(text, options)
3315
+ };
3307
3316
  function testXMLFile8(text) {
3308
3317
  return text.startsWith("<?xml");
3309
3318
  }
3310
- var VERSION8, GMLLoader;
3311
- var init_gml_loader = __esm({
3312
- "src/gml-loader.ts"() {
3313
- init_parse_gml();
3314
- VERSION8 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
3315
- GMLLoader = {
3316
- name: "GML",
3317
- id: "gml",
3318
- module: "wms",
3319
- version: VERSION8,
3320
- worker: false,
3321
- extensions: ["xml"],
3322
- mimeTypes: ["application/vnd.ogc.gml", "application/xml", "text/xml"],
3323
- testText: testXMLFile8,
3324
- options: {
3325
- gml: {}
3326
- },
3327
- parse: async (arrayBuffer, options) => parseGML(new TextDecoder().decode(arrayBuffer), options),
3328
- parseTextSync: (text, options) => parseGML(text, options)
3329
- };
3330
- }
3331
- });
3332
3319
 
3333
3320
  // src/lib/services/create-image-service.ts
3334
3321
  function createImageService(props, services) {
3335
- const { type = "auto" } = props;
3322
+ const {
3323
+ type = "auto"
3324
+ } = props;
3336
3325
  const service = type === "auto" ? guessServiceType(props.url, services) : getServiceOfType(type, services);
3337
3326
  if (!service) {
3338
3327
  throw new Error("Not a valid image source type");
@@ -3355,20 +3344,18 @@
3355
3344
  }
3356
3345
  return null;
3357
3346
  }
3358
- var init_create_image_service = __esm({
3359
- "src/lib/services/create-image-service.ts"() {
3360
- }
3361
- });
3362
3347
 
3363
3348
  // ../images/src/lib/utils/version.ts
3364
- var VERSION9;
3365
- var init_version = __esm({
3366
- "../images/src/lib/utils/version.ts"() {
3367
- VERSION9 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
3368
- }
3369
- });
3349
+ var VERSION9 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
3370
3350
 
3371
3351
  // ../images/src/lib/category-api/image-type.ts
3352
+ var {
3353
+ _parseImageNode
3354
+ } = globalThis;
3355
+ var IMAGE_SUPPORTED = typeof Image !== "undefined";
3356
+ var IMAGE_BITMAP_SUPPORTED = typeof ImageBitmap !== "undefined";
3357
+ var NODE_IMAGE_SUPPORTED = Boolean(_parseImageNode);
3358
+ var DATA_SUPPORTED = isBrowser ? true : NODE_IMAGE_SUPPORTED;
3372
3359
  function isImageTypeSupported(type) {
3373
3360
  switch (type) {
3374
3361
  case "auto":
@@ -3395,17 +3382,6 @@
3395
3382
  }
3396
3383
  throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js");
3397
3384
  }
3398
- var _parseImageNode, IMAGE_SUPPORTED, IMAGE_BITMAP_SUPPORTED, NODE_IMAGE_SUPPORTED, DATA_SUPPORTED;
3399
- var init_image_type = __esm({
3400
- "../images/src/lib/category-api/image-type.ts"() {
3401
- init_src();
3402
- ({ _parseImageNode } = globalThis);
3403
- IMAGE_SUPPORTED = typeof Image !== "undefined";
3404
- IMAGE_BITMAP_SUPPORTED = typeof ImageBitmap !== "undefined";
3405
- NODE_IMAGE_SUPPORTED = Boolean(_parseImageNode);
3406
- DATA_SUPPORTED = isBrowser ? true : NODE_IMAGE_SUPPORTED;
3407
- }
3408
- });
3409
3385
 
3410
3386
  // ../images/src/lib/category-api/parsed-image-api.ts
3411
3387
  function getImageType(image) {
@@ -3446,12 +3422,10 @@
3446
3422
  }
3447
3423
  return null;
3448
3424
  }
3449
- var init_parsed_image_api = __esm({
3450
- "../images/src/lib/category-api/parsed-image-api.ts"() {
3451
- }
3452
- });
3453
3425
 
3454
3426
  // ../images/src/lib/parsers/svg-utils.ts
3427
+ var SVG_DATA_URL_PATTERN = /^data:image\/svg\+xml/;
3428
+ var SVG_URL_PATTERN = /\.svg((\?|#).*)?$/;
3455
3429
  function isSVG(url) {
3456
3430
  return url && (SVG_DATA_URL_PATTERN.test(url) || SVG_URL_PATTERN.test(url));
3457
3431
  }
@@ -3477,13 +3451,6 @@
3477
3451
  }
3478
3452
  return new Blob([new Uint8Array(arrayBuffer)]);
3479
3453
  }
3480
- var SVG_DATA_URL_PATTERN, SVG_URL_PATTERN;
3481
- var init_svg_utils = __esm({
3482
- "../images/src/lib/parsers/svg-utils.ts"() {
3483
- SVG_DATA_URL_PATTERN = /^data:image\/svg\+xml/;
3484
- SVG_URL_PATTERN = /\.svg((\?|#).*)?$/;
3485
- }
3486
- });
3487
3454
 
3488
3455
  // ../images/src/lib/parsers/parse-to-image.ts
3489
3456
  async function parseToImage(arrayBuffer, options, url) {
@@ -3514,13 +3481,10 @@
3514
3481
  }
3515
3482
  });
3516
3483
  }
3517
- var init_parse_to_image = __esm({
3518
- "../images/src/lib/parsers/parse-to-image.ts"() {
3519
- init_svg_utils();
3520
- }
3521
- });
3522
3484
 
3523
3485
  // ../images/src/lib/parsers/parse-to-image-bitmap.ts
3486
+ var EMPTY_OBJECT = {};
3487
+ var imagebitmapOptionsSupported = true;
3524
3488
  async function parseToImageBitmap(arrayBuffer, options, url) {
3525
3489
  let blob;
3526
3490
  if (isSVG(url)) {
@@ -3552,15 +3516,6 @@
3552
3516
  }
3553
3517
  return true;
3554
3518
  }
3555
- var EMPTY_OBJECT, imagebitmapOptionsSupported;
3556
- var init_parse_to_image_bitmap = __esm({
3557
- "../images/src/lib/parsers/parse-to-image-bitmap.ts"() {
3558
- init_svg_utils();
3559
- init_parse_to_image();
3560
- EMPTY_OBJECT = {};
3561
- imagebitmapOptionsSupported = true;
3562
- }
3563
- });
3564
3519
 
3565
3520
  // ../images/src/lib/category-api/parse-isobmff-binary.ts
3566
3521
  function getISOBMFFMediaType(buffer) {
@@ -3577,7 +3532,10 @@
3577
3532
  switch (brandMajor) {
3578
3533
  case "avif":
3579
3534
  case "avis":
3580
- return { extension: "avif", mimeType: "image/avif" };
3535
+ return {
3536
+ extension: "avif",
3537
+ mimeType: "image/avif"
3538
+ };
3581
3539
  default:
3582
3540
  return null;
3583
3541
  }
@@ -3597,12 +3555,10 @@
3597
3555
  }
3598
3556
  return true;
3599
3557
  }
3600
- var init_parse_isobmff_binary = __esm({
3601
- "../images/src/lib/category-api/parse-isobmff-binary.ts"() {
3602
- }
3603
- });
3604
3558
 
3605
3559
  // ../images/src/lib/category-api/binary-image-api.ts
3560
+ var BIG_ENDIAN = false;
3561
+ var LITTLE_ENDIAN = true;
3606
3562
  function getBinaryImageMetadata(binaryData) {
3607
3563
  const dataView = toDataView(binaryData);
3608
3564
  return getPngMetadata(dataView) || getJpegMetadata(dataView) || getGifMetadata(dataView) || getBmpMetadata(dataView) || getISOBMFFMetadata(dataView);
@@ -3615,6 +3571,7 @@
3615
3571
  }
3616
3572
  return {
3617
3573
  mimeType: mediaType.mimeType,
3574
+ // TODO - decode width and height
3618
3575
  width: 0,
3619
3576
  height: 0
3620
3577
  };
@@ -3661,7 +3618,10 @@
3661
3618
  if (!isJpeg) {
3662
3619
  return null;
3663
3620
  }
3664
- const { tableMarkers, sofMarkers } = getJpegMarkers();
3621
+ const {
3622
+ tableMarkers,
3623
+ sofMarkers
3624
+ } = getJpegMarkers();
3665
3625
  let i = 2;
3666
3626
  while (i + 9 < dataView.byteLength) {
3667
3627
  const marker = dataView.getUint16(i, BIG_ENDIAN);
@@ -3669,7 +3629,9 @@
3669
3629
  return {
3670
3630
  mimeType: "image/jpeg",
3671
3631
  height: dataView.getUint16(i + 5, BIG_ENDIAN),
3632
+ // Number of lines
3672
3633
  width: dataView.getUint16(i + 7, BIG_ENDIAN)
3634
+ // Number of pixels per line
3673
3635
  };
3674
3636
  }
3675
3637
  if (!tableMarkers.has(marker)) {
@@ -3681,27 +3643,15 @@
3681
3643
  return null;
3682
3644
  }
3683
3645
  function getJpegMarkers() {
3684
- const tableMarkers = new Set([65499, 65476, 65484, 65501, 65534]);
3646
+ const tableMarkers = /* @__PURE__ */ new Set([65499, 65476, 65484, 65501, 65534]);
3685
3647
  for (let i = 65504; i < 65520; ++i) {
3686
3648
  tableMarkers.add(i);
3687
3649
  }
3688
- const sofMarkers = new Set([
3689
- 65472,
3690
- 65473,
3691
- 65474,
3692
- 65475,
3693
- 65477,
3694
- 65478,
3695
- 65479,
3696
- 65481,
3697
- 65482,
3698
- 65483,
3699
- 65485,
3700
- 65486,
3701
- 65487,
3702
- 65502
3703
- ]);
3704
- return { tableMarkers, sofMarkers };
3650
+ const sofMarkers = /* @__PURE__ */ new Set([65472, 65473, 65474, 65475, 65477, 65478, 65479, 65481, 65482, 65483, 65485, 65486, 65487, 65502]);
3651
+ return {
3652
+ tableMarkers,
3653
+ sofMarkers
3654
+ };
3705
3655
  }
3706
3656
  function toDataView(data) {
3707
3657
  if (data instanceof DataView) {
@@ -3715,35 +3665,25 @@
3715
3665
  }
3716
3666
  throw new Error("toDataView");
3717
3667
  }
3718
- var BIG_ENDIAN, LITTLE_ENDIAN;
3719
- var init_binary_image_api = __esm({
3720
- "../images/src/lib/category-api/binary-image-api.ts"() {
3721
- init_parse_isobmff_binary();
3722
- BIG_ENDIAN = false;
3723
- LITTLE_ENDIAN = true;
3724
- }
3725
- });
3726
3668
 
3727
3669
  // ../images/src/lib/parsers/parse-to-node-image.ts
3728
3670
  async function parseToNodeImage(arrayBuffer, options) {
3729
- const { mimeType } = getBinaryImageMetadata(arrayBuffer) || {};
3671
+ const {
3672
+ mimeType
3673
+ } = getBinaryImageMetadata(arrayBuffer) || {};
3730
3674
  const _parseImageNode2 = globalThis._parseImageNode;
3731
3675
  assert(_parseImageNode2);
3732
3676
  return await _parseImageNode2(arrayBuffer, mimeType);
3733
3677
  }
3734
- var init_parse_to_node_image = __esm({
3735
- "../images/src/lib/parsers/parse-to-node-image.ts"() {
3736
- init_src();
3737
- init_binary_image_api();
3738
- }
3739
- });
3740
3678
 
3741
3679
  // ../images/src/lib/parsers/parse-image.ts
3742
3680
  async function parseImage(arrayBuffer, options, context) {
3743
3681
  options = options || {};
3744
3682
  const imageOptions = options.image || {};
3745
3683
  const imageType = imageOptions.type || "auto";
3746
- const { url } = context || {};
3684
+ const {
3685
+ url
3686
+ } = context || {};
3747
3687
  const loadType = getLoadableImageType(imageType);
3748
3688
  let image;
3749
3689
  switch (loadType) {
@@ -3774,563 +3714,605 @@
3774
3714
  return type;
3775
3715
  }
3776
3716
  }
3777
- var init_parse_image = __esm({
3778
- "../images/src/lib/parsers/parse-image.ts"() {
3779
- init_src();
3780
- init_image_type();
3781
- init_parsed_image_api();
3782
- init_parse_to_image();
3783
- init_parse_to_image_bitmap();
3784
- init_parse_to_node_image();
3785
- }
3786
- });
3787
3717
 
3788
3718
  // ../images/src/image-loader.ts
3789
- var EXTENSIONS, MIME_TYPES, DEFAULT_IMAGE_LOADER_OPTIONS, ImageLoader;
3790
- var init_image_loader = __esm({
3791
- "../images/src/image-loader.ts"() {
3792
- init_version();
3793
- init_parse_image();
3794
- init_binary_image_api();
3795
- EXTENSIONS = ["png", "jpg", "jpeg", "gif", "webp", "bmp", "ico", "svg", "avif"];
3796
- MIME_TYPES = [
3797
- "image/png",
3798
- "image/jpeg",
3799
- "image/gif",
3800
- "image/webp",
3801
- "image/avif",
3802
- "image/bmp",
3803
- "image/vnd.microsoft.icon",
3804
- "image/svg+xml"
3805
- ];
3806
- DEFAULT_IMAGE_LOADER_OPTIONS = {
3807
- image: {
3808
- type: "auto",
3809
- decode: true
3810
- }
3719
+ var EXTENSIONS = ["png", "jpg", "jpeg", "gif", "webp", "bmp", "ico", "svg", "avif"];
3720
+ var MIME_TYPES = ["image/png", "image/jpeg", "image/gif", "image/webp", "image/avif", "image/bmp", "image/vnd.microsoft.icon", "image/svg+xml"];
3721
+ var DEFAULT_IMAGE_LOADER_OPTIONS = {
3722
+ image: {
3723
+ type: "auto",
3724
+ decode: true
3725
+ // if format is HTML
3726
+ }
3727
+ // imagebitmap: {} - passes (platform dependent) parameters to ImageBitmap constructor
3728
+ };
3729
+ var ImageLoader = {
3730
+ id: "image",
3731
+ module: "images",
3732
+ name: "Images",
3733
+ version: VERSION9,
3734
+ mimeTypes: MIME_TYPES,
3735
+ extensions: EXTENSIONS,
3736
+ parse: parseImage,
3737
+ // TODO: byteOffset, byteLength;
3738
+ tests: [(arrayBuffer) => Boolean(getBinaryImageMetadata(new DataView(arrayBuffer)))],
3739
+ options: DEFAULT_IMAGE_LOADER_OPTIONS
3740
+ };
3741
+
3742
+ // src/services/ogc/wms-service.ts
3743
+ var WMSService = {
3744
+ type: "wms",
3745
+ testURL: (url) => url.toLowerCase().includes("wms"),
3746
+ create: (props) => new WMSSource(props)
3747
+ };
3748
+ var WMSSource = class extends ImageSource {
3749
+ /** Base URL to the service */
3750
+ /** In WMS 1.3.0, replaces references to EPSG:4326 with CRS:84. But not always supported. Default: false */
3751
+ /** In WMS 1.3.0, flips x,y (lng, lat) coordinates for the supplied coordinate systems. Default: ['ESPG:4326'] */
3752
+ /** Default static WMS parameters */
3753
+ /** Default static vendor parameters */
3754
+ capabilities = null;
3755
+ /** Create a WMSSource */
3756
+ constructor(props) {
3757
+ super(props);
3758
+ this.url = props.url;
3759
+ this.substituteCRS84 = props.substituteCRS84 ?? false;
3760
+ this.flipCRS = ["EPSG:4326"];
3761
+ this.wmsParameters = {
3762
+ layers: void 0,
3763
+ query_layers: void 0,
3764
+ styles: void 0,
3765
+ version: "1.3.0",
3766
+ crs: "EPSG:4326",
3767
+ format: "image/png",
3768
+ info_format: "text/plain",
3769
+ transparent: void 0,
3770
+ time: void 0,
3771
+ elevation: void 0,
3772
+ ...props.wmsParameters
3773
+ };
3774
+ this.vendorParameters = props.vendorParameters || {};
3775
+ }
3776
+ // ImageService implementation
3777
+ async getMetadata() {
3778
+ const capabilities = await this.getCapabilities();
3779
+ return this.normalizeMetadata(capabilities);
3780
+ }
3781
+ async getImage(parameters) {
3782
+ return await this.getMap(parameters);
3783
+ }
3784
+ normalizeMetadata(capabilities) {
3785
+ return capabilities;
3786
+ }
3787
+ // WMS Service API Stubs
3788
+ /** Get Capabilities */
3789
+ async getCapabilities(wmsParameters, vendorParameters) {
3790
+ const url = this.getCapabilitiesURL(wmsParameters, vendorParameters);
3791
+ const response = await this.fetch(url);
3792
+ const arrayBuffer = await response.arrayBuffer();
3793
+ this._checkResponse(response, arrayBuffer);
3794
+ const capabilities = await WMSCapabilitiesLoader.parse(arrayBuffer, this.loadOptions);
3795
+ this.capabilities = capabilities;
3796
+ return capabilities;
3797
+ }
3798
+ /** Get a map image */
3799
+ async getMap(wmsParameters, vendorParameters) {
3800
+ const url = this.getMapURL(wmsParameters, vendorParameters);
3801
+ const response = await this.fetch(url);
3802
+ const arrayBuffer = await response.arrayBuffer();
3803
+ this._checkResponse(response, arrayBuffer);
3804
+ try {
3805
+ return await ImageLoader.parse(arrayBuffer, this.loadOptions);
3806
+ } catch {
3807
+ throw this._parseError(arrayBuffer);
3808
+ }
3809
+ }
3810
+ /** Get Feature Info for a coordinate */
3811
+ async getFeatureInfo(wmsParameters, vendorParameters) {
3812
+ const url = this.getFeatureInfoURL(wmsParameters, vendorParameters);
3813
+ const response = await this.fetch(url);
3814
+ const arrayBuffer = await response.arrayBuffer();
3815
+ this._checkResponse(response, arrayBuffer);
3816
+ return await WMSFeatureInfoLoader.parse(arrayBuffer, this.loadOptions);
3817
+ }
3818
+ /** Get Feature Info for a coordinate */
3819
+ async getFeatureInfoText(wmsParameters, vendorParameters) {
3820
+ const url = this.getFeatureInfoURL(wmsParameters, vendorParameters);
3821
+ const response = await this.fetch(url);
3822
+ const arrayBuffer = await response.arrayBuffer();
3823
+ this._checkResponse(response, arrayBuffer);
3824
+ return new TextDecoder().decode(arrayBuffer);
3825
+ }
3826
+ /** Get more information about a layer */
3827
+ async describeLayer(wmsParameters, vendorParameters) {
3828
+ const url = this.describeLayerURL(wmsParameters, vendorParameters);
3829
+ const response = await this.fetch(url);
3830
+ const arrayBuffer = await response.arrayBuffer();
3831
+ this._checkResponse(response, arrayBuffer);
3832
+ return await WMSLayerDescriptionLoader.parse(arrayBuffer, this.loadOptions);
3833
+ }
3834
+ /** Get an image with a semantic legend */
3835
+ async getLegendGraphic(wmsParameters, vendorParameters) {
3836
+ const url = this.getLegendGraphicURL(wmsParameters, vendorParameters);
3837
+ const response = await this.fetch(url);
3838
+ const arrayBuffer = await response.arrayBuffer();
3839
+ this._checkResponse(response, arrayBuffer);
3840
+ try {
3841
+ return await ImageLoader.parse(arrayBuffer, this.loadOptions);
3842
+ } catch {
3843
+ throw this._parseError(arrayBuffer);
3844
+ }
3845
+ }
3846
+ // Typed URL creators
3847
+ // For applications that want full control of fetching and parsing
3848
+ /** Generate a URL for the GetCapabilities request */
3849
+ getCapabilitiesURL(wmsParameters, vendorParameters) {
3850
+ const options = {
3851
+ version: this.wmsParameters.version,
3852
+ ...wmsParameters
3853
+ };
3854
+ return this._getWMSUrl("GetCapabilities", options, vendorParameters);
3855
+ }
3856
+ /** Generate a URL for the GetMap request */
3857
+ getMapURL(wmsParameters, vendorParameters) {
3858
+ wmsParameters = this._getWMS130Parameters(wmsParameters);
3859
+ const options = {
3860
+ version: this.wmsParameters.version,
3861
+ format: this.wmsParameters.format,
3862
+ transparent: this.wmsParameters.transparent,
3863
+ time: this.wmsParameters.time,
3864
+ elevation: this.wmsParameters.elevation,
3865
+ layers: this.wmsParameters.layers,
3866
+ styles: this.wmsParameters.styles,
3867
+ crs: this.wmsParameters.crs,
3868
+ // bbox: [-77.87304, 40.78975, -77.85828, 40.80228],
3869
+ // width: 1200,
3870
+ // height: 900,
3871
+ ...wmsParameters
3811
3872
  };
3812
- ImageLoader = {
3813
- id: "image",
3814
- module: "images",
3815
- name: "Images",
3816
- version: VERSION9,
3817
- mimeTypes: MIME_TYPES,
3818
- extensions: EXTENSIONS,
3819
- parse: parseImage,
3820
- tests: [(arrayBuffer) => Boolean(getBinaryImageMetadata(new DataView(arrayBuffer)))],
3821
- options: DEFAULT_IMAGE_LOADER_OPTIONS
3873
+ return this._getWMSUrl("GetMap", options, vendorParameters);
3874
+ }
3875
+ /** Generate a URL for the GetFeatureInfo request */
3876
+ getFeatureInfoURL(wmsParameters, vendorParameters) {
3877
+ wmsParameters = this._getWMS130Parameters(wmsParameters);
3878
+ const options = {
3879
+ version: this.wmsParameters.version,
3880
+ // query_layers: [],
3881
+ // format: this.wmsParameters.format,
3882
+ info_format: this.wmsParameters.info_format,
3883
+ layers: this.wmsParameters.layers,
3884
+ query_layers: this.wmsParameters.query_layers,
3885
+ styles: this.wmsParameters.styles,
3886
+ crs: this.wmsParameters.crs,
3887
+ // bbox: [-77.87304, 40.78975, -77.85828, 40.80228],
3888
+ // width: 1200,
3889
+ // height: 900,
3890
+ // x: undefined!,
3891
+ // y: undefined!,
3892
+ ...wmsParameters
3822
3893
  };
3894
+ return this._getWMSUrl("GetFeatureInfo", options, vendorParameters);
3823
3895
  }
3824
- });
3825
-
3826
- // ../images/src/index.ts
3827
- var init_src3 = __esm({
3828
- "../images/src/index.ts"() {
3829
- init_image_loader();
3896
+ /** Generate a URL for the GetFeatureInfo request */
3897
+ describeLayerURL(wmsParameters, vendorParameters) {
3898
+ const options = {
3899
+ version: this.wmsParameters.version,
3900
+ ...wmsParameters
3901
+ };
3902
+ return this._getWMSUrl("DescribeLayer", options, vendorParameters);
3830
3903
  }
3831
- });
3832
-
3833
- // src/services/ogc/wms-service.ts
3834
- var WMSService, WMSSource;
3835
- var init_wms_service = __esm({
3836
- "src/services/ogc/wms-service.ts"() {
3837
- init_src3();
3838
- init_src();
3839
- init_src();
3840
- init_wms_capabilities_loader();
3841
- init_wms_feature_info_loader();
3842
- init_wms_layer_description_loader();
3843
- init_wms_error_loader();
3844
- WMSService = {
3845
- type: "wms",
3846
- testURL: (url) => url.toLowerCase().includes("wms"),
3847
- create: (props) => new WMSSource(props)
3904
+ getLegendGraphicURL(wmsParameters, vendorParameters) {
3905
+ const options = {
3906
+ version: this.wmsParameters.version,
3907
+ // format?
3908
+ ...wmsParameters
3848
3909
  };
3849
- WMSSource = class extends ImageSource {
3850
- constructor(props) {
3851
- super(props);
3852
- this.capabilities = null;
3853
- this.url = props.url;
3854
- this.substituteCRS84 = props.substituteCRS84 ?? false;
3855
- this.flipCRS = ["EPSG:4326"];
3856
- this.wmsParameters = {
3857
- layers: void 0,
3858
- query_layers: void 0,
3859
- styles: void 0,
3860
- version: "1.3.0",
3861
- crs: "EPSG:4326",
3862
- format: "image/png",
3863
- info_format: "text/plain",
3864
- transparent: void 0,
3865
- time: void 0,
3866
- elevation: void 0,
3867
- ...props.wmsParameters
3868
- };
3869
- this.vendorParameters = props.vendorParameters || {};
3870
- }
3871
- async getMetadata() {
3872
- const capabilities = await this.getCapabilities();
3873
- return this.normalizeMetadata(capabilities);
3874
- }
3875
- async getImage(parameters) {
3876
- return await this.getMap(parameters);
3877
- }
3878
- normalizeMetadata(capabilities) {
3879
- return capabilities;
3880
- }
3881
- async getCapabilities(wmsParameters, vendorParameters) {
3882
- const url = this.getCapabilitiesURL(wmsParameters, vendorParameters);
3883
- const response = await this.fetch(url);
3884
- const arrayBuffer = await response.arrayBuffer();
3885
- this._checkResponse(response, arrayBuffer);
3886
- const capabilities = await WMSCapabilitiesLoader.parse(arrayBuffer, this.loadOptions);
3887
- this.capabilities = capabilities;
3888
- return capabilities;
3889
- }
3890
- async getMap(wmsParameters, vendorParameters) {
3891
- const url = this.getMapURL(wmsParameters, vendorParameters);
3892
- const response = await this.fetch(url);
3893
- const arrayBuffer = await response.arrayBuffer();
3894
- this._checkResponse(response, arrayBuffer);
3895
- try {
3896
- return await ImageLoader.parse(arrayBuffer, this.loadOptions);
3897
- } catch {
3898
- throw this._parseError(arrayBuffer);
3899
- }
3900
- }
3901
- async getFeatureInfo(wmsParameters, vendorParameters) {
3902
- const url = this.getFeatureInfoURL(wmsParameters, vendorParameters);
3903
- const response = await this.fetch(url);
3904
- const arrayBuffer = await response.arrayBuffer();
3905
- this._checkResponse(response, arrayBuffer);
3906
- return await WMSFeatureInfoLoader.parse(arrayBuffer, this.loadOptions);
3907
- }
3908
- async getFeatureInfoText(wmsParameters, vendorParameters) {
3909
- const url = this.getFeatureInfoURL(wmsParameters, vendorParameters);
3910
- const response = await this.fetch(url);
3911
- const arrayBuffer = await response.arrayBuffer();
3912
- this._checkResponse(response, arrayBuffer);
3913
- return new TextDecoder().decode(arrayBuffer);
3914
- }
3915
- async describeLayer(wmsParameters, vendorParameters) {
3916
- const url = this.describeLayerURL(wmsParameters, vendorParameters);
3917
- const response = await this.fetch(url);
3918
- const arrayBuffer = await response.arrayBuffer();
3919
- this._checkResponse(response, arrayBuffer);
3920
- return await WMSLayerDescriptionLoader.parse(arrayBuffer, this.loadOptions);
3921
- }
3922
- async getLegendGraphic(wmsParameters, vendorParameters) {
3923
- const url = this.getLegendGraphicURL(wmsParameters, vendorParameters);
3924
- const response = await this.fetch(url);
3925
- const arrayBuffer = await response.arrayBuffer();
3926
- this._checkResponse(response, arrayBuffer);
3927
- try {
3928
- return await ImageLoader.parse(arrayBuffer, this.loadOptions);
3929
- } catch {
3930
- throw this._parseError(arrayBuffer);
3931
- }
3932
- }
3933
- getCapabilitiesURL(wmsParameters, vendorParameters) {
3934
- const options = {
3935
- version: this.wmsParameters.version,
3936
- ...wmsParameters
3937
- };
3938
- return this._getWMSUrl("GetCapabilities", options, vendorParameters);
3939
- }
3940
- getMapURL(wmsParameters, vendorParameters) {
3941
- wmsParameters = this._getWMS130Parameters(wmsParameters);
3942
- const options = {
3943
- version: this.wmsParameters.version,
3944
- format: this.wmsParameters.format,
3945
- transparent: this.wmsParameters.transparent,
3946
- time: this.wmsParameters.time,
3947
- elevation: this.wmsParameters.elevation,
3948
- layers: this.wmsParameters.layers,
3949
- styles: this.wmsParameters.styles,
3950
- crs: this.wmsParameters.crs,
3951
- ...wmsParameters
3952
- };
3953
- return this._getWMSUrl("GetMap", options, vendorParameters);
3954
- }
3955
- getFeatureInfoURL(wmsParameters, vendorParameters) {
3956
- const options = {
3957
- version: this.wmsParameters.version,
3958
- info_format: this.wmsParameters.info_format,
3959
- layers: this.wmsParameters.layers,
3960
- query_layers: this.wmsParameters.query_layers,
3961
- styles: this.wmsParameters.styles,
3962
- crs: this.wmsParameters.crs,
3963
- ...wmsParameters
3964
- };
3965
- return this._getWMSUrl("GetFeatureInfo", options, vendorParameters);
3966
- }
3967
- describeLayerURL(wmsParameters, vendorParameters) {
3968
- const options = {
3969
- version: this.wmsParameters.version,
3970
- ...wmsParameters
3971
- };
3972
- return this._getWMSUrl("DescribeLayer", options, vendorParameters);
3973
- }
3974
- getLegendGraphicURL(wmsParameters, vendorParameters) {
3975
- const options = {
3976
- version: this.wmsParameters.version,
3977
- ...wmsParameters
3978
- };
3979
- return this._getWMSUrl("GetLegendGraphic", options, vendorParameters);
3980
- }
3981
- _parseWMSUrl(url) {
3982
- const [baseUrl, search] = url.split("?");
3983
- const searchParams = search.split("&");
3984
- const parameters = {};
3985
- for (const parameter of searchParams) {
3986
- const [key, value] = parameter.split("=");
3987
- parameters[key] = value;
3988
- }
3989
- return { url: baseUrl, parameters };
3990
- }
3991
- _getWMSUrl(request, wmsParameters, vendorParameters) {
3992
- let url = this.url;
3993
- let first = true;
3994
- const allParameters = {
3995
- service: "WMS",
3996
- version: wmsParameters.version,
3997
- request,
3998
- ...wmsParameters,
3999
- ...this.vendorParameters,
4000
- ...vendorParameters
4001
- };
4002
- const IGNORE_EMPTY_KEYS = ["transparent", "time", "elevation"];
4003
- for (const [key, value] of Object.entries(allParameters)) {
4004
- if (!IGNORE_EMPTY_KEYS.includes(key) || value) {
4005
- url += first ? "?" : "&";
4006
- first = false;
4007
- url += this._getURLParameter(key, value, wmsParameters);
4008
- }
4009
- }
4010
- return encodeURI(url);
3910
+ return this._getWMSUrl("GetLegendGraphic", options, vendorParameters);
3911
+ }
3912
+ // INTERNAL METHODS
3913
+ _parseWMSUrl(url) {
3914
+ const [baseUrl, search] = url.split("?");
3915
+ const searchParams = search.split("&");
3916
+ const parameters = {};
3917
+ for (const parameter of searchParams) {
3918
+ const [key, value] = parameter.split("=");
3919
+ parameters[key] = value;
3920
+ }
3921
+ return {
3922
+ url: baseUrl,
3923
+ parameters
3924
+ };
3925
+ }
3926
+ /**
3927
+ * Generate a URL with parameters
3928
+ * @note case _getWMSUrl may need to be overridden to handle certain backends?
3929
+ * @note at the moment, only URLs with parameters are supported (no XML payloads)
3930
+ * */
3931
+ _getWMSUrl(request, wmsParameters, vendorParameters) {
3932
+ let url = this.url;
3933
+ let first = true;
3934
+ const allParameters = {
3935
+ service: "WMS",
3936
+ version: wmsParameters.version,
3937
+ request,
3938
+ ...wmsParameters,
3939
+ ...this.vendorParameters,
3940
+ ...vendorParameters
3941
+ };
3942
+ const IGNORE_EMPTY_KEYS = ["transparent", "time", "elevation"];
3943
+ for (const [key, value] of Object.entries(allParameters)) {
3944
+ if (!IGNORE_EMPTY_KEYS.includes(key) || value) {
3945
+ url += first ? "?" : "&";
3946
+ first = false;
3947
+ url += this._getURLParameter(key, value, wmsParameters);
4011
3948
  }
4012
- _getWMS130Parameters(wmsParameters) {
4013
- const newParameters = { ...wmsParameters };
4014
- if (newParameters.srs) {
4015
- newParameters.crs = newParameters.crs || newParameters.srs;
4016
- delete newParameters.srs;
3949
+ }
3950
+ return encodeURI(url);
3951
+ }
3952
+ _getWMS130Parameters(wmsParameters) {
3953
+ const newParameters = {
3954
+ ...wmsParameters
3955
+ };
3956
+ if (newParameters.srs) {
3957
+ newParameters.crs = newParameters.crs || newParameters.srs;
3958
+ delete newParameters.srs;
3959
+ }
3960
+ return newParameters;
3961
+ }
3962
+ // eslint-disable-complexity
3963
+ _getURLParameter(key, value, wmsParameters) {
3964
+ switch (key) {
3965
+ case "crs":
3966
+ if (wmsParameters.version !== "1.3.0") {
3967
+ key = "srs";
3968
+ } else if (this.substituteCRS84 && value === "EPSG:4326") {
3969
+ value = "CRS:84";
4017
3970
  }
4018
- return newParameters;
4019
- }
4020
- _getURLParameter(key, value, wmsParameters) {
4021
- switch (key) {
4022
- case "crs":
4023
- if (wmsParameters.version !== "1.3.0") {
4024
- key = "srs";
4025
- } else if (this.substituteCRS84 && value === "EPSG:4326") {
4026
- value = "CRS:84";
4027
- }
4028
- break;
4029
- case "srs":
4030
- if (wmsParameters.version === "1.3.0") {
4031
- key = "crs";
4032
- }
4033
- break;
4034
- case "bbox":
4035
- const bbox = this._flipBoundingBox(value, wmsParameters);
4036
- if (bbox) {
4037
- value = bbox;
4038
- }
4039
- break;
4040
- default:
3971
+ break;
3972
+ case "srs":
3973
+ if (wmsParameters.version === "1.3.0") {
3974
+ key = "crs";
4041
3975
  }
4042
- key = key.toUpperCase();
4043
- return Array.isArray(value) ? `${key}=${value.join(",")}` : `${key}=${value ? String(value) : ""}`;
4044
- }
4045
- _flipBoundingBox(bboxValue, wmsParameters) {
4046
- if (!Array.isArray(bboxValue) || bboxValue.length !== 4) {
4047
- return null;
3976
+ break;
3977
+ case "bbox":
3978
+ const bbox = this._flipBoundingBox(value, wmsParameters);
3979
+ if (bbox) {
3980
+ value = bbox;
4048
3981
  }
4049
- const flipCoordinates = wmsParameters.version === "1.3.0" && this.flipCRS.includes(wmsParameters.crs || "") && !(this.substituteCRS84 && wmsParameters.crs === "EPSG:4326");
4050
- const bbox = bboxValue;
4051
- return flipCoordinates ? [bbox[1], bbox[0], bbox[3], bbox[2]] : bbox;
4052
- }
4053
- async _fetchArrayBuffer(url) {
4054
- const response = await this.fetch(url);
4055
- const arrayBuffer = await response.arrayBuffer();
4056
- this._checkResponse(response, arrayBuffer);
4057
- return arrayBuffer;
4058
- }
4059
- _checkResponse(response, arrayBuffer) {
4060
- const contentType = response.headers["content-type"];
4061
- if (!response.ok || WMSErrorLoader.mimeTypes.includes(contentType)) {
4062
- const loadOptions = mergeLoaderOptions(this.loadOptions, {
4063
- wms: { throwOnError: true }
4064
- });
4065
- const error = WMSErrorLoader.parseSync?.(arrayBuffer, loadOptions);
4066
- throw new Error(error);
3982
+ break;
3983
+ default:
3984
+ }
3985
+ key = key.toUpperCase();
3986
+ return Array.isArray(value) ? `${key}=${value.join(",")}` : `${key}=${value ? String(value) : ""}`;
3987
+ }
3988
+ /** Coordinate order is flipped for certain CRS in WMS 1.3.0 */
3989
+ _flipBoundingBox(bboxValue, wmsParameters) {
3990
+ if (!Array.isArray(bboxValue) || bboxValue.length !== 4) {
3991
+ return null;
3992
+ }
3993
+ const flipCoordinates = (
3994
+ // Only affects WMS 1.3.0
3995
+ wmsParameters.version === "1.3.0" && // Flip if we are dealing with a CRS that was flipped in 1.3.0
3996
+ this.flipCRS.includes(wmsParameters.crs || "") && // Don't flip if we are subsituting EPSG:4326 with CRS:84
3997
+ !(this.substituteCRS84 && wmsParameters.crs === "EPSG:4326")
3998
+ );
3999
+ const bbox = bboxValue;
4000
+ return flipCoordinates ? [bbox[1], bbox[0], bbox[3], bbox[2]] : bbox;
4001
+ }
4002
+ /** Fetches an array buffer and checks the response (boilerplate reduction) */
4003
+ async _fetchArrayBuffer(url) {
4004
+ const response = await this.fetch(url);
4005
+ const arrayBuffer = await response.arrayBuffer();
4006
+ this._checkResponse(response, arrayBuffer);
4007
+ return arrayBuffer;
4008
+ }
4009
+ /** Checks for and parses a WMS XML formatted ServiceError and throws an exception */
4010
+ _checkResponse(response, arrayBuffer) {
4011
+ const contentType = response.headers["content-type"];
4012
+ if (!response.ok || WMSErrorLoader.mimeTypes.includes(contentType)) {
4013
+ const loadOptions = mergeLoaderOptions(this.loadOptions, {
4014
+ wms: {
4015
+ throwOnError: true
4067
4016
  }
4068
- }
4069
- _parseError(arrayBuffer) {
4070
- const error = WMSErrorLoader.parseSync?.(arrayBuffer, this.loadOptions);
4071
- return new Error(error);
4072
- }
4073
- };
4017
+ });
4018
+ const error = WMSErrorLoader.parseSync?.(arrayBuffer, loadOptions);
4019
+ throw new Error(error);
4020
+ }
4074
4021
  }
4075
- });
4022
+ /** Error situation detected */
4023
+ _parseError(arrayBuffer) {
4024
+ const error = WMSErrorLoader.parseSync?.(arrayBuffer, this.loadOptions);
4025
+ return new Error(error);
4026
+ }
4027
+ };
4076
4028
 
4077
4029
  // src/lib/services/image-service.ts
4078
- var ImageService;
4079
- var init_image_service = __esm({
4080
- "src/lib/services/image-service.ts"() {
4081
- init_src3();
4082
- init_src();
4083
- ImageService = class extends ImageSource {
4084
- constructor(props) {
4085
- super(props);
4086
- }
4087
- async getMetadata() {
4088
- throw new Error("ImageSource.getMetadata not implemented");
4089
- }
4090
- async getImage(parameters) {
4091
- const granularParameters = this.getGranularParameters(parameters);
4092
- const url = this.getURLFromTemplate(granularParameters);
4093
- const response = await this.fetch(url);
4094
- const arrayBuffer = await response.arrayBuffer();
4095
- return await ImageLoader.parse(arrayBuffer);
4096
- }
4097
- getGranularParameters(parameters) {
4098
- const [east, north, west, south] = parameters.bbox;
4099
- return { ...parameters, east, north, south, west };
4100
- }
4101
- getURLFromTemplate(parameters) {
4102
- let url = this.props.url;
4103
- for (const [key, value] of Object.entries(parameters)) {
4104
- url = url.replace(`\${${key}}`, String(value));
4105
- url = url.replace(`{${key}}`, String(value));
4106
- }
4107
- return url;
4108
- }
4030
+ var ImageService = class extends ImageSource {
4031
+ constructor(props) {
4032
+ super(props);
4033
+ }
4034
+ // IMAGE SOURCE API
4035
+ async getMetadata() {
4036
+ throw new Error("ImageSource.getMetadata not implemented");
4037
+ }
4038
+ async getImage(parameters) {
4039
+ const granularParameters = this.getGranularParameters(parameters);
4040
+ const url = this.getURLFromTemplate(granularParameters);
4041
+ const response = await this.fetch(url);
4042
+ const arrayBuffer = await response.arrayBuffer();
4043
+ return await ImageLoader.parse(arrayBuffer);
4044
+ }
4045
+ // HELPERS
4046
+ /** Break up bounding box in east, north, south, west */
4047
+ getGranularParameters(parameters) {
4048
+ const [east, north, west, south] = parameters.bbox;
4049
+ return {
4050
+ ...parameters,
4051
+ east,
4052
+ north,
4053
+ south,
4054
+ west
4109
4055
  };
4110
- ImageService.type = "template";
4111
- ImageService.testURL = (url) => url.toLowerCase().includes("{");
4112
4056
  }
4113
- });
4057
+ /** Supports both ${} and {} notations */
4058
+ getURLFromTemplate(parameters) {
4059
+ let url = this.props.url;
4060
+ for (const [key, value] of Object.entries(parameters)) {
4061
+ url = url.replace(`\${${key}}`, String(value));
4062
+ url = url.replace(`{${key}}`, String(value));
4063
+ }
4064
+ return url;
4065
+ }
4066
+ };
4067
+ __publicField(ImageService, "type", "template");
4068
+ __publicField(ImageService, "testURL", (url) => url.toLowerCase().includes("{"));
4114
4069
 
4115
4070
  // src/services/arcgis/arcgis-image-service.ts
4116
- var ArcGISImageSource, ArcGISImageService;
4117
- var init_arcgis_image_service = __esm({
4118
- "src/services/arcgis/arcgis-image-service.ts"() {
4119
- init_image_service();
4120
- ArcGISImageSource = class extends ImageService {
4121
- constructor(props) {
4122
- super(props);
4123
- }
4124
- async getMetadata() {
4125
- return await this.metadata();
4126
- }
4127
- async getImage(parameters) {
4128
- throw new Error("not implemented");
4129
- }
4130
- async metadata() {
4131
- throw new Error("not implemented");
4132
- }
4133
- exportImage(options) {
4134
- throw new Error("not implemented");
4135
- }
4136
- metadataURL(options) {
4137
- return `${this.props.url}?f=pjson`;
4138
- }
4139
- exportImageURL(options) {
4140
- const bbox = `bbox=${options.bbox[0]},${options.bbox[1]},${options.bbox[2]},${options.bbox[3]}`;
4141
- const size = `size=${options.width},${options.height}`;
4142
- const arcgisOptions = { ...options, bbox, size };
4143
- delete arcgisOptions.width;
4144
- delete arcgisOptions.height;
4145
- return this.getUrl("exportImage", arcgisOptions);
4146
- }
4147
- getUrl(path, options, extra) {
4148
- let url = `${this.props.url}/${path}`;
4149
- let first = true;
4150
- for (const [key, value] of Object.entries(options)) {
4151
- url += first ? "?" : "&";
4152
- first = false;
4153
- if (Array.isArray(value)) {
4154
- url += `${key.toUpperCase()}=${value.join(",")}`;
4155
- } else {
4156
- url += `${key.toUpperCase()}=${value ? String(value) : ""}`;
4157
- }
4158
- }
4159
- return url;
4160
- }
4161
- async checkResponse(response) {
4162
- if (!response.ok) {
4163
- throw new Error("error");
4164
- }
4165
- }
4166
- };
4167
- ArcGISImageService = {
4168
- type: "arcgis-image-server",
4169
- testURL: (url) => url.toLowerCase().includes("ImageServer"),
4170
- create: (props) => new ArcGISImageSource(props)
4071
+ var ArcGISImageSource = class extends ImageService {
4072
+ constructor(props) {
4073
+ super(props);
4074
+ }
4075
+ // ImageSource (normalized endpoints)
4076
+ async getMetadata() {
4077
+ return await this.metadata();
4078
+ }
4079
+ async getImage(parameters) {
4080
+ throw new Error("not implemented");
4081
+ }
4082
+ // ImageServer endpoints
4083
+ async metadata() {
4084
+ throw new Error("not implemented");
4085
+ }
4086
+ /**
4087
+ * Form a URL to an ESRI ImageServer
4088
+ // https://sampleserver6.arcgisonline.com/arcgis/rest/services/NLCDLandCover2001/ImageServer/exportImage?bbox=${bounds[0]},${bounds[1]},${bounds[2]},${bounds[3]}&bboxSR=4326&size=${width},${height}&imageSR=102100&time=&format=jpgpng&pixelType=U8&noData=&noDataInterpretation=esriNoDataMatchAny&interpolation=+RSP_NearestNeighbor&compression=&compressionQuality=&bandIds=&mosaicRule=&renderingRule=&f=image`,
4089
+ */
4090
+ exportImage(options) {
4091
+ throw new Error("not implemented");
4092
+ }
4093
+ // URL creators
4094
+ metadataURL(options) {
4095
+ return `${this.props.url}?f=pjson`;
4096
+ }
4097
+ /**
4098
+ * Form a URL to an ESRI ImageServer
4099
+ // https://sampleserver6.arcgisonline.com/arcgis/rest/services/NLCDLandCover2001/ImageServer/exportImage?
4100
+ // bbox=${bounds[0]},${bounds[1]},${bounds[2]},${bounds[3]}&bboxSR=4326&
4101
+ // size=${width},${height}&imageSR=102100&time=&format=jpgpng&pixelType=U8&
4102
+ // noData=&noDataInterpretation=esriNoDataMatchAny&interpolation=+RSP_NearestNeighbor&compression=&
4103
+ // compressionQuality=&bandIds=&mosaicRule=&renderingRule=&
4104
+ // f=image
4105
+ */
4106
+ exportImageURL(options) {
4107
+ const bbox = `bbox=${options.bbox[0]},${options.bbox[1]},${options.bbox[2]},${options.bbox[3]}`;
4108
+ const size = `size=${options.width},${options.height}`;
4109
+ const arcgisOptions = {
4110
+ ...options,
4111
+ bbox,
4112
+ size
4171
4113
  };
4114
+ delete arcgisOptions.width;
4115
+ delete arcgisOptions.height;
4116
+ return this.getUrl("exportImage", arcgisOptions);
4117
+ }
4118
+ // INTERNAL METHODS
4119
+ /**
4120
+ * @note protected, since perhaps getWMSUrl may need to be overridden to handle certain backends?
4121
+ * @note if override is common, maybe add a callback prop?
4122
+ * */
4123
+ getUrl(path, options, extra) {
4124
+ let url = `${this.props.url}/${path}`;
4125
+ let first = true;
4126
+ for (const [key, value] of Object.entries(options)) {
4127
+ url += first ? "?" : "&";
4128
+ first = false;
4129
+ if (Array.isArray(value)) {
4130
+ url += `${key.toUpperCase()}=${value.join(",")}`;
4131
+ } else {
4132
+ url += `${key.toUpperCase()}=${value ? String(value) : ""}`;
4133
+ }
4134
+ }
4135
+ return url;
4172
4136
  }
4173
- });
4137
+ /** Checks for and parses a WMS XML formatted ServiceError and throws an exception */
4138
+ async checkResponse(response) {
4139
+ if (!response.ok) {
4140
+ throw new Error("error");
4141
+ }
4142
+ }
4143
+ };
4144
+ var ArcGISImageService = {
4145
+ type: "arcgis-image-server",
4146
+ testURL: (url) => url.toLowerCase().includes("ImageServer"),
4147
+ create: (props) => new ArcGISImageSource(props)
4148
+ };
4174
4149
 
4175
4150
  // src/services/create-image-source.ts
4151
+ var SERVICES = [WMSService, ArcGISImageService];
4176
4152
  function createImageSource(props) {
4177
4153
  return createImageService(props, SERVICES);
4178
4154
  }
4179
- var SERVICES;
4180
- var init_create_image_source = __esm({
4181
- "src/services/create-image-source.ts"() {
4182
- init_create_image_service();
4183
- init_wms_service();
4184
- init_arcgis_image_service();
4185
- SERVICES = [WMSService, ArcGISImageService];
4186
- }
4187
- });
4188
4155
 
4189
4156
  // src/services/ogc/csw-service.ts
4190
- var CSWService;
4191
- var init_csw_service = __esm({
4192
- "src/services/ogc/csw-service.ts"() {
4193
- init_src();
4194
- init_csw_capabilities_loader();
4195
- init_csw_records_loader();
4196
- init_csw_domain_loader();
4197
- init_wms_error_loader();
4198
- CSWService = class extends DataSource {
4199
- constructor(props) {
4200
- super(props);
4201
- this.capabilities = null;
4202
- this.loaders = [WMSErrorLoader, CSWCapabilitiesLoader];
4203
- }
4204
- async getMetadata() {
4205
- const capabilities = await this.getCapabilities();
4206
- return this.normalizeMetadata(capabilities);
4207
- }
4208
- normalizeMetadata(capabilities) {
4209
- return capabilities;
4210
- }
4211
- async getServiceDirectory(options) {
4212
- const services = [];
4213
- const unknownServices = [];
4214
- const records = await this.getRecords();
4215
- for (const record of records.records) {
4216
- for (const reference of record.references) {
4217
- const url = reference.value;
4218
- switch (reference.scheme) {
4219
- case "OGC:WMS":
4220
- services.push({ name: record.title, type: "ogc-wms-service", ...this._parseOGCUrl(url) });
4221
- break;
4222
- case "OGC:WMTS":
4223
- services.push({
4224
- name: record.title,
4225
- type: "ogc-wmts-service",
4226
- ...this._parseOGCUrl(url)
4227
- });
4228
- break;
4229
- case "OGC:WFS":
4230
- services.push({ name: record.title, type: "ogc-wfs-service", ...this._parseOGCUrl(url) });
4231
- break;
4232
- default:
4233
- unknownServices.push({
4234
- name: record.title,
4235
- type: "unknown",
4236
- url: reference.value,
4237
- scheme: reference.scheme
4238
- });
4239
- }
4240
- }
4241
- }
4242
- return options?.includeUnknown ? services.concat(unknownServices) : services;
4243
- }
4244
- _parseOGCUrl(url) {
4245
- const parts = url.split("?");
4246
- return {
4247
- url: parts[0],
4248
- params: parts[1] || ""
4249
- };
4250
- }
4251
- async getCapabilities(wmsParameters, vendorParameters) {
4252
- const url = this.getCapabilitiesURL(wmsParameters, vendorParameters);
4253
- const response = await this.fetch(url);
4254
- const arrayBuffer = await response.arrayBuffer();
4255
- this._checkResponse(response, arrayBuffer);
4256
- const capabilities = await CSWCapabilitiesLoader.parse(arrayBuffer, this.props.loadOptions);
4257
- return capabilities;
4258
- }
4259
- async getRecords(wmsParameters, vendorParameters) {
4260
- const url = this.getRecordsURL(wmsParameters, vendorParameters);
4261
- const response = await this.fetch(url);
4262
- const arrayBuffer = await response.arrayBuffer();
4263
- this._checkResponse(response, arrayBuffer);
4264
- return await CSWRecordsLoader.parse(arrayBuffer, this.props.loadOptions);
4265
- }
4266
- async getDomain(wmsParameters, vendorParameters) {
4267
- const url = this.getDomainURL(wmsParameters, vendorParameters);
4268
- const response = await this.fetch(url);
4269
- const arrayBuffer = await response.arrayBuffer();
4270
- this._checkResponse(response, arrayBuffer);
4271
- return await CSWDomainLoader.parse(arrayBuffer, this.props.loadOptions);
4272
- }
4273
- getCapabilitiesURL(wmsParameters, vendorParameters) {
4274
- const options = {
4275
- version: "3.0.0",
4276
- ...wmsParameters,
4277
- ...vendorParameters,
4278
- service: "CSW",
4279
- request: "GetCapabilities"
4280
- };
4281
- return this._getCSWUrl(options, vendorParameters);
4282
- }
4283
- getRecordsURL(wmsParameters, vendorParameters) {
4284
- const options = {
4285
- version: "3.0.0",
4286
- typenames: "csw:Record",
4287
- ...wmsParameters,
4288
- ...vendorParameters,
4289
- service: "CSW",
4290
- request: "GetRecords"
4291
- };
4292
- return this._getCSWUrl(options, vendorParameters);
4293
- }
4294
- getDomainURL(wmsParameters, vendorParameters) {
4295
- const options = {
4296
- version: "3.0.0",
4297
- ...wmsParameters,
4298
- ...vendorParameters,
4299
- service: "CSW",
4300
- request: "GetDomain"
4301
- };
4302
- return this._getCSWUrl(options, vendorParameters);
4303
- }
4304
- _getCSWUrl(options, vendorParameters) {
4305
- let url = this.props.url;
4306
- let first = true;
4307
- for (const [key, value] of Object.entries(options)) {
4308
- url += first ? "?" : "&";
4309
- first = false;
4310
- if (Array.isArray(value)) {
4311
- url += `${key.toUpperCase()}=${value.join(",")}`;
4312
- } else {
4313
- url += `${key.toUpperCase()}=${value ? String(value) : ""}`;
4314
- }
4315
- }
4316
- return encodeURI(url);
4317
- }
4318
- _checkResponse(response, arrayBuffer) {
4319
- const contentType = response.headers["content-type"];
4320
- if (!response.ok || WMSErrorLoader.mimeTypes.includes(contentType)) {
4321
- const error = WMSErrorLoader.parseSync?.(arrayBuffer, this.props.loadOptions);
4322
- throw new Error(error);
4157
+ var CSWService = class extends DataSource {
4158
+ capabilities = null;
4159
+ /** A list of loaders used by the CSWService methods */
4160
+ loaders = [WMSErrorLoader, CSWCapabilitiesLoader];
4161
+ /** Create a CSWService */
4162
+ constructor(props) {
4163
+ super(props);
4164
+ }
4165
+ async getMetadata() {
4166
+ const capabilities = await this.getCapabilities();
4167
+ return this.normalizeMetadata(capabilities);
4168
+ }
4169
+ normalizeMetadata(capabilities) {
4170
+ return capabilities;
4171
+ }
4172
+ async getServiceDirectory(options) {
4173
+ const services = [];
4174
+ const unknownServices = [];
4175
+ const records = await this.getRecords();
4176
+ for (const record of records.records) {
4177
+ for (const reference of record.references) {
4178
+ const url = reference.value;
4179
+ switch (reference.scheme) {
4180
+ case "OGC:WMS":
4181
+ services.push({
4182
+ name: record.title,
4183
+ type: "ogc-wms-service",
4184
+ ...this._parseOGCUrl(url)
4185
+ });
4186
+ break;
4187
+ case "OGC:WMTS":
4188
+ services.push({
4189
+ name: record.title,
4190
+ type: "ogc-wmts-service",
4191
+ ...this._parseOGCUrl(url)
4192
+ });
4193
+ break;
4194
+ case "OGC:WFS":
4195
+ services.push({
4196
+ name: record.title,
4197
+ type: "ogc-wfs-service",
4198
+ ...this._parseOGCUrl(url)
4199
+ });
4200
+ break;
4201
+ default:
4202
+ unknownServices.push({
4203
+ name: record.title,
4204
+ type: "unknown",
4205
+ url: reference.value,
4206
+ scheme: reference.scheme
4207
+ });
4323
4208
  }
4324
4209
  }
4325
- _parseError(arrayBuffer) {
4326
- const error = WMSErrorLoader.parseSync?.(arrayBuffer, this.props.loadOptions);
4327
- return new Error(error);
4328
- }
4210
+ }
4211
+ return options?.includeUnknown ? services.concat(unknownServices) : services;
4212
+ }
4213
+ _parseOGCUrl(url) {
4214
+ const parts = url.split("?");
4215
+ return {
4216
+ url: parts[0],
4217
+ params: parts[1] || ""
4329
4218
  };
4330
- CSWService.type = "csw";
4331
- CSWService.testURL = (url) => url.toLowerCase().includes("csw");
4332
4219
  }
4333
- });
4220
+ // CSW Service API Stubs
4221
+ /** Get Capabilities */
4222
+ async getCapabilities(wmsParameters, vendorParameters) {
4223
+ const url = this.getCapabilitiesURL(wmsParameters, vendorParameters);
4224
+ const response = await this.fetch(url);
4225
+ const arrayBuffer = await response.arrayBuffer();
4226
+ this._checkResponse(response, arrayBuffer);
4227
+ const capabilities = await CSWCapabilitiesLoader.parse(arrayBuffer, this.props.loadOptions);
4228
+ return capabilities;
4229
+ }
4230
+ /** Get Records */
4231
+ async getRecords(wmsParameters, vendorParameters) {
4232
+ const url = this.getRecordsURL(wmsParameters, vendorParameters);
4233
+ const response = await this.fetch(url);
4234
+ const arrayBuffer = await response.arrayBuffer();
4235
+ this._checkResponse(response, arrayBuffer);
4236
+ return await CSWRecordsLoader.parse(arrayBuffer, this.props.loadOptions);
4237
+ }
4238
+ /** Get Domain */
4239
+ async getDomain(wmsParameters, vendorParameters) {
4240
+ const url = this.getDomainURL(wmsParameters, vendorParameters);
4241
+ const response = await this.fetch(url);
4242
+ const arrayBuffer = await response.arrayBuffer();
4243
+ this._checkResponse(response, arrayBuffer);
4244
+ return await CSWDomainLoader.parse(arrayBuffer, this.props.loadOptions);
4245
+ }
4246
+ // Typed URL creators
4247
+ // For applications that want full control of fetching and parsing
4248
+ /** Generate a URL for the GetCapabilities request */
4249
+ getCapabilitiesURL(wmsParameters, vendorParameters) {
4250
+ const options = {
4251
+ version: "3.0.0",
4252
+ ...wmsParameters,
4253
+ ...vendorParameters,
4254
+ service: "CSW",
4255
+ request: "GetCapabilities"
4256
+ };
4257
+ return this._getCSWUrl(options, vendorParameters);
4258
+ }
4259
+ /** Generate a URL for the GetCapabilities request */
4260
+ getRecordsURL(wmsParameters, vendorParameters) {
4261
+ const options = {
4262
+ version: "3.0.0",
4263
+ typenames: "csw:Record",
4264
+ ...wmsParameters,
4265
+ ...vendorParameters,
4266
+ service: "CSW",
4267
+ request: "GetRecords"
4268
+ };
4269
+ return this._getCSWUrl(options, vendorParameters);
4270
+ }
4271
+ /** Generate a URL for the GetCapabilities request */
4272
+ getDomainURL(wmsParameters, vendorParameters) {
4273
+ const options = {
4274
+ version: "3.0.0",
4275
+ ...wmsParameters,
4276
+ ...vendorParameters,
4277
+ service: "CSW",
4278
+ request: "GetDomain"
4279
+ };
4280
+ return this._getCSWUrl(options, vendorParameters);
4281
+ }
4282
+ // INTERNAL METHODS
4283
+ /**
4284
+ * @note case _getCSWUrl may need to be overridden to handle certain backends?
4285
+ * */
4286
+ _getCSWUrl(options, vendorParameters) {
4287
+ let url = this.props.url;
4288
+ let first = true;
4289
+ for (const [key, value] of Object.entries(options)) {
4290
+ url += first ? "?" : "&";
4291
+ first = false;
4292
+ if (Array.isArray(value)) {
4293
+ url += `${key.toUpperCase()}=${value.join(",")}`;
4294
+ } else {
4295
+ url += `${key.toUpperCase()}=${value ? String(value) : ""}`;
4296
+ }
4297
+ }
4298
+ return encodeURI(url);
4299
+ }
4300
+ /** Checks for and parses a CSW XML formatted ServiceError and throws an exception */
4301
+ _checkResponse(response, arrayBuffer) {
4302
+ const contentType = response.headers["content-type"];
4303
+ if (!response.ok || WMSErrorLoader.mimeTypes.includes(contentType)) {
4304
+ const error = WMSErrorLoader.parseSync?.(arrayBuffer, this.props.loadOptions);
4305
+ throw new Error(error);
4306
+ }
4307
+ }
4308
+ /** Error situation detected */
4309
+ _parseError(arrayBuffer) {
4310
+ const error = WMSErrorLoader.parseSync?.(arrayBuffer, this.props.loadOptions);
4311
+ return new Error(error);
4312
+ }
4313
+ };
4314
+ __publicField(CSWService, "type", "csw");
4315
+ __publicField(CSWService, "testURL", (url) => url.toLowerCase().includes("csw"));
4334
4316
 
4335
4317
  // src/services/arcgis/arcgis-server.ts
4336
4318
  async function getArcGISServices(url, fetchFile = fetch) {
@@ -4364,62 +4346,7 @@
4364
4346
  }
4365
4347
  return services;
4366
4348
  }
4367
- var init_arcgis_server = __esm({
4368
- "src/services/arcgis/arcgis-server.ts"() {
4369
- }
4370
- });
4371
-
4372
- // src/index.ts
4373
- var src_exports = {};
4374
- __export(src_exports, {
4375
- CSWCapabilitiesLoader: () => CSWCapabilitiesLoader,
4376
- CSWDomainLoader: () => CSWDomainLoader,
4377
- CSWRecordsLoader: () => CSWRecordsLoader,
4378
- CSWService: () => CSWService,
4379
- ImageService: () => ImageService,
4380
- ImageSource: () => ImageSource,
4381
- WMSCapabilitiesLoader: () => WMSCapabilitiesLoader,
4382
- WMSErrorLoader: () => WMSErrorLoader,
4383
- WMSService: () => WMSService,
4384
- WMSSource: () => WMSSource,
4385
- _ArcGISImageService: () => ArcGISImageService,
4386
- _GMLLoader: () => GMLLoader,
4387
- _WFSCapabilitiesLoader: () => WFSCapabilitiesLoader,
4388
- _WMSFeatureInfoLoader: () => WMSFeatureInfoLoader,
4389
- _WMSLayerDescriptionLoader: () => WMSLayerDescriptionLoader,
4390
- _getArcGISServices: () => getArcGISServices,
4391
- createImageService: () => createImageService,
4392
- createImageSource: () => createImageSource
4393
- });
4394
- var init_src4 = __esm({
4395
- "src/index.ts"() {
4396
- init_csw_capabilities_loader();
4397
- init_csw_domain_loader();
4398
- init_csw_records_loader();
4399
- init_wms_error_loader();
4400
- init_wms_capabilities_loader();
4401
- init_wms_feature_info_loader();
4402
- init_wms_layer_description_loader();
4403
- init_wfs_capabilities_loader();
4404
- init_gml_loader();
4405
- init_create_image_service();
4406
- init_create_image_source();
4407
- init_image_service();
4408
- init_csw_service();
4409
- init_wms_service();
4410
- init_arcgis_server();
4411
- init_arcgis_image_service();
4412
- init_src();
4413
- }
4414
- });
4415
-
4416
- // src/bundle.ts
4417
- var require_bundle = __commonJS({
4418
- "src/bundle.ts"(exports, module) {
4419
- var moduleExports = (init_src4(), src_exports);
4420
- globalThis.loaders = globalThis.loaders || {};
4421
- module.exports = Object.assign(globalThis.loaders, moduleExports);
4422
- }
4423
- });
4424
- require_bundle();
4349
+ return __toCommonJS(src_exports);
4425
4350
  })();
4351
+ return __exports__;
4352
+ });