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

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} +998 -1229
  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) {
@@ -202,7 +193,10 @@
202
193
  return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData, i));
203
194
  } else if (options.unpairedTags.indexOf(tagName) !== -1) {
204
195
  } else {
205
- tags.push({ tagName, tagStartPos });
196
+ tags.push({
197
+ tagName,
198
+ tagStartPos
199
+ });
206
200
  }
207
201
  tagFound = true;
208
202
  }
@@ -246,7 +240,10 @@
246
240
  } else if (tags.length == 1) {
247
241
  return getErrorObject("InvalidTag", "Unclosed tag '" + tags[0].tagName + "'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos));
248
242
  } 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 });
243
+ return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags.map((t) => t.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", {
244
+ line: 1,
245
+ col: 1
246
+ });
250
247
  }
251
248
  return true;
252
249
  };
@@ -478,15 +475,22 @@
478
475
  add(key, val2) {
479
476
  if (key === "__proto__")
480
477
  key = "#__proto__";
481
- this.child.push({ [key]: val2 });
478
+ this.child.push({
479
+ [key]: val2
480
+ });
482
481
  }
483
482
  addChild(node) {
484
483
  if (node.tagname === "__proto__")
485
484
  node.tagname = "#__proto__";
486
485
  if (node[":@"] && Object.keys(node[":@"]).length > 0) {
487
- this.child.push({ [node.tagname]: node.child, [":@"]: node[":@"] });
486
+ this.child.push({
487
+ [node.tagname]: node.child,
488
+ [":@"]: node[":@"]
489
+ });
488
490
  } else {
489
- this.child.push({ [node.tagname]: node.child });
491
+ this.child.push({
492
+ [node.tagname]: node.child
493
+ });
490
494
  }
491
495
  }
492
496
  };
@@ -551,11 +555,14 @@
551
555
  } else {
552
556
  throw new Error(`Invalid Tag instead of DOCTYPE`);
553
557
  }
554
- return { entities, i };
558
+ return {
559
+ entities,
560
+ i
561
+ };
555
562
  }
556
563
  function readEntityExp(xmlData, i) {
557
564
  let entityName2 = "";
558
- for (; i < xmlData.length && (xmlData[i] !== "'" && xmlData[i] !== '"'); i++) {
565
+ for (; i < xmlData.length && xmlData[i] !== "'" && xmlData[i] !== '"'; i++) {
559
566
  entityName2 += xmlData[i];
560
567
  }
561
568
  entityName2 = entityName2.trim();
@@ -619,6 +626,7 @@
619
626
  leadingZeros: true,
620
627
  decimalPoint: ".",
621
628
  eNotation: true
629
+ //skipLike: /regex/
622
630
  };
623
631
  function toNumber(str, options = {}) {
624
632
  options = Object.assign({}, consider, options);
@@ -715,21 +723,60 @@
715
723
  this.tagsNodeStack = [];
716
724
  this.docTypeEntities = {};
717
725
  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: '"' }
726
+ "apos": {
727
+ regex: /&(apos|#39|#x27);/g,
728
+ val: "'"
729
+ },
730
+ "gt": {
731
+ regex: /&(gt|#62|#x3E);/g,
732
+ val: ">"
733
+ },
734
+ "lt": {
735
+ regex: /&(lt|#60|#x3C);/g,
736
+ val: "<"
737
+ },
738
+ "quot": {
739
+ regex: /&(quot|#34|#x22);/g,
740
+ val: '"'
741
+ }
742
+ };
743
+ this.ampEntity = {
744
+ regex: /&(amp|#38|#x26);/g,
745
+ val: "&"
722
746
  };
723
- this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" };
724
747
  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" }
748
+ "space": {
749
+ regex: /&(nbsp|#160);/g,
750
+ val: " "
751
+ },
752
+ "cent": {
753
+ regex: /&(cent|#162);/g,
754
+ val: "\xA2"
755
+ },
756
+ "pound": {
757
+ regex: /&(pound|#163);/g,
758
+ val: "\xA3"
759
+ },
760
+ "yen": {
761
+ regex: /&(yen|#165);/g,
762
+ val: "\xA5"
763
+ },
764
+ "euro": {
765
+ regex: /&(euro|#8364);/g,
766
+ val: "\u20AC"
767
+ },
768
+ "copyright": {
769
+ regex: /&(copy|#169);/g,
770
+ val: "\xA9"
771
+ },
772
+ "reg": {
773
+ regex: /&(reg|#174);/g,
774
+ val: "\xAE"
775
+ },
776
+ "inr": {
777
+ regex: /&(inr|#8377);/g,
778
+ val: "\u20B9"
779
+ }
733
780
  };
734
781
  this.addExternalEntities = addExternalEntities;
735
782
  this.parseXml = parseXml;
@@ -896,7 +943,9 @@
896
943
  if (this.options.commentPropName) {
897
944
  const comment = xmlData.substring(i + 4, endIndex - 2);
898
945
  textData = this.saveTextToParentTag(textData, currentNode, jPath);
899
- currentNode.add(this.options.commentPropName, [{ [this.options.textNodeName]: comment }]);
946
+ currentNode.add(this.options.commentPropName, [{
947
+ [this.options.textNodeName]: comment
948
+ }]);
900
949
  }
901
950
  i = endIndex;
902
951
  } else if (xmlData.substr(i + 1, 2) === "!D") {
@@ -908,7 +957,9 @@
908
957
  const tagExp = xmlData.substring(i + 9, closeIndex);
909
958
  textData = this.saveTextToParentTag(textData, currentNode, jPath);
910
959
  if (this.options.cdataPropName) {
911
- currentNode.add(this.options.cdataPropName, [{ [this.options.textNodeName]: tagExp }]);
960
+ currentNode.add(this.options.cdataPropName, [{
961
+ [this.options.textNodeName]: tagExp
962
+ }]);
912
963
  } else {
913
964
  let val2 = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true);
914
965
  if (val2 == void 0)
@@ -1255,7 +1306,9 @@
1255
1306
  }
1256
1307
  }
1257
1308
  function isLeafTag(obj, options) {
1258
- const { textNodeName } = options;
1309
+ const {
1310
+ textNodeName
1311
+ } = options;
1259
1312
  const propCount = Object.keys(obj).length;
1260
1313
  if (propCount === 0) {
1261
1314
  return true;
@@ -1272,9 +1325,13 @@
1272
1325
  // ../../node_modules/fast-xml-parser/src/xmlparser/XMLParser.js
1273
1326
  var require_XMLParser = __commonJS({
1274
1327
  "../../node_modules/fast-xml-parser/src/xmlparser/XMLParser.js"(exports, module) {
1275
- var { buildOptions } = require_OptionsBuilder();
1328
+ var {
1329
+ buildOptions
1330
+ } = require_OptionsBuilder();
1276
1331
  var OrderedObjParser = require_OrderedObjParser();
1277
- var { prettify } = require_node2json();
1332
+ var {
1333
+ prettify
1334
+ } = require_node2json();
1278
1335
  var validator = require_validator();
1279
1336
  var XMLParser = class {
1280
1337
  constructor(options) {
@@ -1473,13 +1530,22 @@
1473
1530
  preserveOrder: false,
1474
1531
  commentPropName: false,
1475
1532
  unpairedTags: [],
1476
- 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;" }
1482
- ],
1533
+ entities: [{
1534
+ regex: new RegExp("&", "g"),
1535
+ val: "&amp;"
1536
+ }, {
1537
+ regex: new RegExp(">", "g"),
1538
+ val: "&gt;"
1539
+ }, {
1540
+ regex: new RegExp("<", "g"),
1541
+ val: "&lt;"
1542
+ }, {
1543
+ regex: new RegExp("'", "g"),
1544
+ val: "&apos;"
1545
+ }, {
1546
+ regex: new RegExp('"', "g"),
1547
+ val: "&quot;"
1548
+ }],
1483
1549
  processEntities: true,
1484
1550
  stopNodes: [],
1485
1551
  oneListGroup: false
@@ -1580,7 +1646,10 @@
1580
1646
  }
1581
1647
  }
1582
1648
  }
1583
- return { attrStr, val: val2 };
1649
+ return {
1650
+ attrStr,
1651
+ val: val2
1652
+ };
1584
1653
  };
1585
1654
  Builder.prototype.buildAttrPairStr = function(attrName, val2) {
1586
1655
  val2 = this.options.attributeValueProcessor(attrName, "" + val2);
@@ -1688,7 +1757,49 @@
1688
1757
  }
1689
1758
  });
1690
1759
 
1760
+ // src/index.ts
1761
+ var src_exports = {};
1762
+ __export(src_exports, {
1763
+ CSWCapabilitiesLoader: () => CSWCapabilitiesLoader,
1764
+ CSWDomainLoader: () => CSWDomainLoader,
1765
+ CSWRecordsLoader: () => CSWRecordsLoader,
1766
+ CSWService: () => CSWService,
1767
+ ImageService: () => ImageService,
1768
+ ImageSource: () => ImageSource,
1769
+ WMSCapabilitiesLoader: () => WMSCapabilitiesLoader,
1770
+ WMSErrorLoader: () => WMSErrorLoader,
1771
+ WMSService: () => WMSService,
1772
+ WMSSource: () => WMSSource,
1773
+ _ArcGISImageService: () => ArcGISImageService,
1774
+ _GMLLoader: () => GMLLoader,
1775
+ _WFSCapabilitiesLoader: () => WFSCapabilitiesLoader,
1776
+ _WMSFeatureInfoLoader: () => WMSFeatureInfoLoader,
1777
+ _WMSLayerDescriptionLoader: () => WMSLayerDescriptionLoader,
1778
+ _getArcGISServices: () => getArcGISServices,
1779
+ createImageService: () => createImageService,
1780
+ createImageSource: () => createImageSource
1781
+ });
1782
+
1783
+ // ../xml/src/lib/xml-utils/uncapitalize.ts
1784
+ function uncapitalize(str) {
1785
+ return typeof str === "string" ? str.charAt(0).toLowerCase() + str.slice(1) : str;
1786
+ }
1787
+ function uncapitalizeKeys(object) {
1788
+ if (Array.isArray(object)) {
1789
+ return object.map((element) => uncapitalizeKeys(element));
1790
+ }
1791
+ if (object && typeof object === "object") {
1792
+ const newObject = {};
1793
+ for (const [key, value] of Object.entries(object)) {
1794
+ newObject[uncapitalize(key)] = uncapitalizeKeys(value);
1795
+ }
1796
+ return newObject;
1797
+ }
1798
+ return object;
1799
+ }
1800
+
1691
1801
  // ../xml/src/lib/parsers/parse-xml.ts
1802
+ var import_fast_xml_parser = __toESM(require_fxp(), 1);
1692
1803
  function parseXMLSync(text, options) {
1693
1804
  if (options?._parser && options._parser !== "fast-xml-parser") {
1694
1805
  throw new Error(options?._parser);
@@ -1716,49 +1827,39 @@
1716
1827
  const parsedXML = parser.parse(text);
1717
1828
  return parsedXML;
1718
1829
  }
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
1830
 
1727
1831
  // ../xml/src/xml-loader.ts
1832
+ var VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
1833
+ var XMLLoader = {
1834
+ name: "XML",
1835
+ id: "xml",
1836
+ module: "xml",
1837
+ version: VERSION,
1838
+ worker: false,
1839
+ extensions: ["xml"],
1840
+ mimeTypes: ["application/xml", "text/xml"],
1841
+ testText: testXMLFile,
1842
+ options: {
1843
+ xml: {
1844
+ _parser: "fast-xml-parser",
1845
+ uncapitalizeKeys: false,
1846
+ removeNSPrefix: false,
1847
+ textNodeName: "value",
1848
+ arrayPaths: []
1849
+ }
1850
+ },
1851
+ parse: async (arrayBuffer, options) => parseXMLSync(new TextDecoder().decode(arrayBuffer), {
1852
+ ...XMLLoader.options.xml,
1853
+ ...options?.xml
1854
+ }),
1855
+ parseTextSync: (text, options) => parseXMLSync(text, {
1856
+ ...XMLLoader.options.xml,
1857
+ ...options?.xml
1858
+ })
1859
+ };
1728
1860
  function testXMLFile(text) {
1729
1861
  return text.startsWith("<?xml");
1730
1862
  }
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
1863
 
1763
1864
  // ../loader-utils/src/lib/env-utils/assert.ts
1764
1865
  function assert(condition, message) {
@@ -1766,37 +1867,30 @@
1766
1867
  throw new Error(message || "loader assertion failed.");
1767
1868
  }
1768
1869
  }
1769
- var init_assert = __esm({
1770
- "../loader-utils/src/lib/env-utils/assert.ts"() {
1771
- }
1772
- });
1773
1870
 
1774
1871
  // ../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
- });
1872
+ var globals = {
1873
+ self: typeof self !== "undefined" && self,
1874
+ window: typeof window !== "undefined" && window,
1875
+ global: typeof global !== "undefined" && global,
1876
+ document: typeof document !== "undefined" && document
1877
+ };
1878
+ var self_ = globals.self || globals.window || globals.global || {};
1879
+ var window_ = globals.window || globals.self || globals.global || {};
1880
+ var global_ = globals.global || globals.self || globals.window || {};
1881
+ var document_ = globals.document || {};
1882
+ var isBrowser = Boolean(typeof process !== "object" || String(process) !== "[object process]" || process.browser);
1883
+ var matches = typeof process !== "undefined" && process.version && /v([0-9]*)/.exec(process.version);
1884
+ var nodeVersion = matches && parseFloat(matches[1]) || 0;
1793
1885
 
1794
1886
  // ../loader-utils/src/lib/option-utils/merge-loader-options.ts
1795
1887
  function mergeLoaderOptions(baseOptions, newOptions) {
1796
1888
  return mergeOptionsRecursively(baseOptions || {}, newOptions);
1797
1889
  }
1798
1890
  function mergeOptionsRecursively(baseOptions, newOptions) {
1799
- const options = { ...baseOptions };
1891
+ const options = {
1892
+ ...baseOptions
1893
+ };
1800
1894
  for (const [key, newValue] of Object.entries(newOptions)) {
1801
1895
  if (newValue && typeof newValue === "object" && !Array.isArray(newValue)) {
1802
1896
  options[key] = mergeOptionsRecursively(options[key] || {}, newOptions[key]);
@@ -1806,12 +1900,34 @@
1806
1900
  }
1807
1901
  return options;
1808
1902
  }
1809
- var init_merge_loader_options = __esm({
1810
- "../loader-utils/src/lib/option-utils/merge-loader-options.ts"() {
1811
- }
1812
- });
1813
1903
 
1814
1904
  // ../loader-utils/src/lib/sources/data-source.ts
1905
+ var DataSource = class {
1906
+ _needsRefresh = true;
1907
+ constructor(props) {
1908
+ this.props = {
1909
+ ...props
1910
+ };
1911
+ this.loadOptions = {
1912
+ ...props.loadOptions
1913
+ };
1914
+ this.fetch = getFetchFunction(this.loadOptions);
1915
+ }
1916
+ setProps(props) {
1917
+ this.props = Object.assign(this.props, props);
1918
+ this.setNeedsRefresh();
1919
+ }
1920
+ setNeedsRefresh() {
1921
+ this._needsRefresh = true;
1922
+ }
1923
+ getNeedsRefresh(clear = true) {
1924
+ const needsRefresh = this._needsRefresh;
1925
+ if (clear) {
1926
+ this._needsRefresh = false;
1927
+ }
1928
+ return needsRefresh;
1929
+ }
1930
+ };
1815
1931
  function getFetchFunction(options) {
1816
1932
  const fetchFunction = options?.fetch;
1817
1933
  if (fetchFunction && typeof fetchFunction === "function") {
@@ -1823,56 +1939,12 @@
1823
1939
  }
1824
1940
  return (url) => fetch(url);
1825
1941
  }
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
1942
 
1854
1943
  // ../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
- });
1944
+ var ImageSource = class extends DataSource {
1945
+ };
1946
+ __publicField(ImageSource, "type", "template");
1947
+ __publicField(ImageSource, "testURL", (url) => false);
1876
1948
 
1877
1949
  // ../xml/src/lib/xml-utils/xml-utils.ts
1878
1950
  function convertXMLValueToArray(xmlValue) {
@@ -1889,18 +1961,6 @@
1889
1961
  function convertXMLFieldToArrayInPlace(xml, key) {
1890
1962
  xml[key] = convertXMLValueToArray(xml[key]);
1891
1963
  }
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
1964
 
1905
1965
  // src/lib/parsers/csw/parse-exception-report.ts
1906
1966
  function parseExceptionReport(parsedXML) {
@@ -1911,10 +1971,6 @@
1911
1971
  const errorMessage = exceptionReport.exception?.exceptionText || exceptionReport.exception?.exceptionCode || exceptionReport.exception?.locator || "server error";
1912
1972
  throw new Error(`Catalog Server: ${errorMessage}`);
1913
1973
  }
1914
- var init_parse_exception_report = __esm({
1915
- "src/lib/parsers/csw/parse-exception-report.ts"() {
1916
- }
1917
- });
1918
1974
 
1919
1975
  // src/lib/parsers/csw/parse-csw-capabilities.ts
1920
1976
  function parseCSWCapabilities(text, options) {
@@ -1930,39 +1986,27 @@
1930
1986
  const xmlCapabilities = parsedXML.capabilities || parsedXML;
1931
1987
  return xmlCapabilities;
1932
1988
  }
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
1989
 
1940
1990
  // src/csw-capabilities-loader.ts
1991
+ var VERSION2 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
1992
+ var CSWCapabilitiesLoader = {
1993
+ id: "csw-capabilities",
1994
+ name: "CSW Capabilities",
1995
+ module: "wms",
1996
+ version: VERSION2,
1997
+ worker: false,
1998
+ extensions: ["xml"],
1999
+ mimeTypes: ["application/vnd.ogc.csw_xml", "application/xml", "text/xml"],
2000
+ testText: testXMLFile2,
2001
+ options: {
2002
+ csw: {}
2003
+ },
2004
+ parse: async (arrayBuffer, options) => parseCSWCapabilities(new TextDecoder().decode(arrayBuffer), options),
2005
+ parseTextSync: (text, options) => parseCSWCapabilities(text, options)
2006
+ };
1941
2007
  function testXMLFile2(text) {
1942
2008
  return text.startsWith("<?xml");
1943
2009
  }
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
2010
 
1967
2011
  // src/lib/parsers/csw/parse-csw-domain.ts
1968
2012
  function parseCSWDomain(text, options) {
@@ -1972,10 +2016,7 @@
1972
2016
  ...options?.xml,
1973
2017
  removeNSPrefix: true,
1974
2018
  uncapitalizeKeys: true,
1975
- arrayPaths: [
1976
- "GetDomainResponse.DomainValues",
1977
- "GetDomainResponse.DomainValues.ListOfValues.value"
1978
- ]
2019
+ arrayPaths: ["GetDomainResponse.DomainValues", "GetDomainResponse.DomainValues.ListOfValues.value"]
1979
2020
  }
1980
2021
  });
1981
2022
  parseExceptionReport(parsedXML);
@@ -1986,39 +2027,27 @@
1986
2027
  }
1987
2028
  return xmlDomain;
1988
2029
  }
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
2030
 
1996
2031
  // src/csw-domain-loader.ts
2032
+ var VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
2033
+ var CSWDomainLoader = {
2034
+ id: "csw-domain",
2035
+ name: "CSW Domain",
2036
+ module: "wms",
2037
+ version: VERSION3,
2038
+ worker: false,
2039
+ extensions: ["xml"],
2040
+ mimeTypes: ["application/vnd.ogc.csw_xml", "application/xml", "text/xml"],
2041
+ testText: testXMLFile3,
2042
+ options: {
2043
+ csw: {}
2044
+ },
2045
+ parse: async (arrayBuffer, options) => parseCSWDomain(new TextDecoder().decode(arrayBuffer), options),
2046
+ parseTextSync: (text, options) => parseCSWDomain(text, options)
2047
+ };
1997
2048
  function testXMLFile3(text) {
1998
2049
  return text.startsWith("<?xml");
1999
2050
  }
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
2051
 
2023
2052
  // src/lib/parsers/csw/parse-csw-records.ts
2024
2053
  function parseCSWRecords(text, options) {
@@ -2047,52 +2076,34 @@
2047
2076
  delete record.boundingBox;
2048
2077
  convertXMLFieldToArrayInPlace(record, "boundingBoxes");
2049
2078
  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
- ];
2079
+ boundingBox.value = [boundingBox.upperCorner[0], boundingBox.upperCorner[1], boundingBox.lowerCorner[0], boundingBox.lowerCorner[1]];
2056
2080
  delete boundingBox.upperCorner;
2057
2081
  delete boundingBox.lowerCorner;
2058
2082
  }
2059
2083
  }
2060
2084
  return xmlRecords;
2061
2085
  }
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
2086
 
2070
2087
  // src/csw-records-loader.ts
2088
+ var VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
2089
+ var CSWRecordsLoader = {
2090
+ id: "csw-records",
2091
+ name: "CSW Records",
2092
+ module: "wms",
2093
+ version: VERSION4,
2094
+ worker: false,
2095
+ extensions: ["xml"],
2096
+ mimeTypes: ["application/vnd.ogc.csw_xml", "application/xml", "text/xml"],
2097
+ testText: testXMLFile4,
2098
+ options: {
2099
+ csw: {}
2100
+ },
2101
+ parse: async (arrayBuffer, options) => parseCSWRecords(new TextDecoder().decode(arrayBuffer), options),
2102
+ parseTextSync: (text, options) => parseCSWRecords(text, options)
2103
+ };
2071
2104
  function testXMLFile4(text) {
2072
2105
  return text.startsWith("<?xml");
2073
2106
  }
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
2107
 
2097
2108
  // src/lib/parsers/wms/parse-wms-error.ts
2098
2109
  function parseWMSError(text, options) {
@@ -2101,18 +2112,35 @@
2101
2112
  const message = typeof serviceExceptionXML === "string" ? serviceExceptionXML : serviceExceptionXML.value || serviceExceptionXML.code || "Unknown error";
2102
2113
  return message;
2103
2114
  }
2104
- var init_parse_wms_error = __esm({
2105
- "src/lib/parsers/wms/parse-wms-error.ts"() {
2106
- init_src2();
2107
- }
2108
- });
2109
2115
 
2110
2116
  // src/wms-error-loader.ts
2117
+ var VERSION5 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
2118
+ var WMSErrorLoader = {
2119
+ id: "wms-error",
2120
+ name: "WMS Error",
2121
+ module: "wms",
2122
+ version: VERSION5,
2123
+ worker: false,
2124
+ extensions: ["xml"],
2125
+ mimeTypes: ["application/vnd.ogc.se_xml", "application/xml", "text/xml"],
2126
+ testText: testXMLFile5,
2127
+ options: {
2128
+ wms: {
2129
+ throwOnError: false
2130
+ }
2131
+ },
2132
+ parse: async (arrayBuffer, options) => parseTextSync(new TextDecoder().decode(arrayBuffer), options),
2133
+ parseSync: (arrayBuffer, options) => parseTextSync(new TextDecoder().decode(arrayBuffer), options),
2134
+ parseTextSync: (text, options) => parseTextSync(text, options)
2135
+ };
2111
2136
  function testXMLFile5(text) {
2112
2137
  return text.startsWith("<?xml");
2113
2138
  }
2114
2139
  function parseTextSync(text, options) {
2115
- const wmsOptions = { ...WMSErrorLoader.options.wms, ...options?.wms };
2140
+ const wmsOptions = {
2141
+ ...WMSErrorLoader.options.wms,
2142
+ ...options?.wms
2143
+ };
2116
2144
  const error = parseWMSError(text, wmsOptions);
2117
2145
  const message = wmsOptions.minimalErrors ? error : `WMS Service error: ${error}`;
2118
2146
  if (wmsOptions.throwOnError) {
@@ -2120,31 +2148,6 @@
2120
2148
  }
2121
2149
  return message;
2122
2150
  }
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
2151
 
2149
2152
  // src/lib/parsers/xml/parse-xml-helpers.ts
2150
2153
  function getXMLArray(xmlValue) {
@@ -2197,10 +2200,6 @@
2197
2200
  return false;
2198
2201
  }
2199
2202
  }
2200
- var init_parse_xml_helpers = __esm({
2201
- "src/lib/parsers/xml/parse-xml-helpers.ts"() {
2202
- }
2203
- });
2204
2203
 
2205
2204
  // src/lib/parsers/wms/parse-wms-capabilities.ts
2206
2205
  function parseWMSCapabilities(xmlText, options) {
@@ -2251,7 +2250,9 @@
2251
2250
  const requests = {};
2252
2251
  for (const [name, xmlRequest] of Object.entries(xmlRequests || {})) {
2253
2252
  const mimeTypes = getXMLStringArray(xmlRequest?.Format);
2254
- requests[name] = { mimeTypes };
2253
+ requests[name] = {
2254
+ mimeTypes
2255
+ };
2255
2256
  }
2256
2257
  return requests;
2257
2258
  }
@@ -2323,30 +2324,35 @@
2323
2324
  eastBoundLongitude: e,
2324
2325
  southBoundLatitude: s
2325
2326
  } = xmlBoundingBox;
2326
- return [
2327
- [w, s],
2328
- [e, n]
2329
- ];
2327
+ return [[w, s], [e, n]];
2330
2328
  }
2331
2329
  function extractLatLonBoundingBox(xmlBoundingBox) {
2332
- const { minx, miny, maxx, maxy } = xmlBoundingBox;
2333
- return [
2334
- [minx, miny],
2335
- [maxx, maxy]
2336
- ];
2330
+ const {
2331
+ minx,
2332
+ miny,
2333
+ maxx,
2334
+ maxy
2335
+ } = xmlBoundingBox;
2336
+ return [[minx, miny], [maxx, maxy]];
2337
2337
  }
2338
2338
  function extractWMSBoundingBoxes(xmlBoundingBoxes) {
2339
2339
  const xmlBoxes = getXMLArray(xmlBoundingBoxes);
2340
2340
  return xmlBoxes.map((xmlBox) => extractWMSBoundingBox(xmlBox));
2341
2341
  }
2342
2342
  function extractWMSBoundingBox(xmlBoundingBox) {
2343
- const { CRS, SRS, minx, miny, maxx, maxy, resx, resy } = xmlBoundingBox;
2343
+ const {
2344
+ CRS,
2345
+ SRS,
2346
+ minx,
2347
+ miny,
2348
+ maxx,
2349
+ maxy,
2350
+ resx,
2351
+ resy
2352
+ } = xmlBoundingBox;
2344
2353
  const boundingBox = {
2345
2354
  crs: CRS || SRS,
2346
- boundingBox: [
2347
- [getXMLFloat(minx), getXMLFloat(miny)],
2348
- [getXMLFloat(maxx), getXMLFloat(maxy)]
2349
- ]
2355
+ boundingBox: [[getXMLFloat(minx), getXMLFloat(miny)], [getXMLFloat(maxx), getXMLFloat(maxy)]]
2350
2356
  };
2351
2357
  if (resx) {
2352
2358
  boundingBox.xResolution = resx;
@@ -2357,8 +2363,16 @@
2357
2363
  return boundingBox;
2358
2364
  }
2359
2365
  function extractDimension(xmlDimension) {
2360
- const { name, units, value: extent } = xmlDimension;
2361
- const dimension = { name, units, extent };
2366
+ const {
2367
+ name,
2368
+ units,
2369
+ value: extent
2370
+ } = xmlDimension;
2371
+ const dimension = {
2372
+ name,
2373
+ units,
2374
+ extent
2375
+ };
2362
2376
  if (xmlDimension.unitSymbol) {
2363
2377
  dimension.unitSymbol = xmlDimension.unitSymbol;
2364
2378
  }
@@ -2393,39 +2407,27 @@
2393
2407
  addInheritedLayerProps(subLayer, layer);
2394
2408
  }
2395
2409
  }
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
2410
 
2403
2411
  // src/wms-capabilities-loader.ts
2412
+ var VERSION6 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
2413
+ var WMSCapabilitiesLoader = {
2414
+ id: "wms-capabilities",
2415
+ name: "WMS Capabilities",
2416
+ module: "wms",
2417
+ version: VERSION6,
2418
+ worker: false,
2419
+ extensions: ["xml"],
2420
+ mimeTypes: ["application/vnd.ogc.wms_xml", "application/xml", "text/xml"],
2421
+ testText: testXMLFile6,
2422
+ options: {
2423
+ wms: {}
2424
+ },
2425
+ parse: async (arrayBuffer, options) => parseWMSCapabilities(new TextDecoder().decode(arrayBuffer), options?.wms),
2426
+ parseTextSync: (text, options) => parseWMSCapabilities(text, options?.wms)
2427
+ };
2404
2428
  function testXMLFile6(text) {
2405
2429
  return text.startsWith("<?xml");
2406
2430
  }
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
2431
 
2430
2432
  // src/lib/parsers/wms/parse-wms-features.ts
2431
2433
  function parseWMSFeatureInfo(text, options) {
@@ -2441,100 +2443,73 @@
2441
2443
  return {
2442
2444
  attributes: xmlFields,
2443
2445
  type: "",
2444
- bounds: { bottom: 0, top: 0, left: 0, right: 0 }
2446
+ bounds: {
2447
+ bottom: 0,
2448
+ top: 0,
2449
+ left: 0,
2450
+ right: 0
2451
+ }
2445
2452
  };
2446
2453
  }
2447
- var init_parse_wms_features = __esm({
2448
- "src/lib/parsers/wms/parse-wms-features.ts"() {
2449
- init_src2();
2450
- }
2451
- });
2452
2454
 
2453
2455
  // 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
- });
2456
+ var WMSFeatureInfoLoader = {
2457
+ ...WMSCapabilitiesLoader,
2458
+ id: "wms-feature-info",
2459
+ name: "WMS FeatureInfo",
2460
+ parse: async (arrayBuffer, options) => parseWMSFeatureInfo(new TextDecoder().decode(arrayBuffer), options),
2461
+ parseTextSync: (text, options) => parseWMSFeatureInfo(text, options)
2462
+ };
2468
2463
 
2469
2464
  // src/lib/parsers/wms/parse-wms-layer-description.ts
2470
2465
  function parseWMSLayerDescription(text, options) {
2471
2466
  const parsedXML = XMLLoader.parseTextSync?.(text, options);
2472
2467
  return parsedXML;
2473
2468
  }
2474
- var init_parse_wms_layer_description = __esm({
2475
- "src/lib/parsers/wms/parse-wms-layer-description.ts"() {
2476
- init_src2();
2477
- }
2478
- });
2479
2469
 
2480
2470
  // 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
- });
2471
+ var WMSLayerDescriptionLoader = {
2472
+ ...WMSCapabilitiesLoader,
2473
+ id: "wms-layer-description",
2474
+ name: "WMS DescribeLayer",
2475
+ parse: async (arrayBuffer, options) => parseWMSLayerDescription(new TextDecoder().decode(arrayBuffer), options),
2476
+ parseTextSync: (text, options) => parseWMSLayerDescription(text, options)
2477
+ };
2495
2478
 
2496
2479
  // src/wip/lib/wfs/parse-wfs-capabilities.ts
2497
2480
  function parseWFSCapabilities(text, options) {
2498
- const parsedXML = XMLLoader.parseTextSync?.(text, { ...options, xml: {
2499
- ...options?.xml,
2500
- removeNSPrefix: true,
2501
- uncapitalizeKeys: true
2502
- } });
2481
+ const parsedXML = XMLLoader.parseTextSync?.(text, {
2482
+ ...options,
2483
+ xml: {
2484
+ ...options?.xml,
2485
+ removeNSPrefix: true,
2486
+ uncapitalizeKeys: true
2487
+ }
2488
+ });
2503
2489
  const xmlCapabilities = parsedXML.Capabilities || parsedXML;
2504
2490
  return xmlCapabilities;
2505
2491
  }
2506
- var init_parse_wfs_capabilities = __esm({
2507
- "src/wip/lib/wfs/parse-wfs-capabilities.ts"() {
2508
- init_src2();
2509
- }
2510
- });
2511
2492
 
2512
2493
  // src/wip/wfs-capabilities-loader.ts
2494
+ var VERSION7 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
2495
+ var WFSCapabilitiesLoader = {
2496
+ id: "wfs-capabilities",
2497
+ name: "WFS Capabilities",
2498
+ module: "wms",
2499
+ version: VERSION7,
2500
+ worker: false,
2501
+ extensions: ["xml"],
2502
+ mimeTypes: ["application/vnd.ogc.wfs_xml", "application/xml", "text/xml"],
2503
+ testText: testXMLFile7,
2504
+ options: {
2505
+ wfs: {}
2506
+ },
2507
+ parse: async (arrayBuffer, options) => parseWFSCapabilities(new TextDecoder().decode(arrayBuffer), options),
2508
+ parseTextSync: (text, options) => parseWFSCapabilities(text, options)
2509
+ };
2513
2510
  function testXMLFile7(text) {
2514
2511
  return text.startsWith("<?xml");
2515
2512
  }
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
2513
 
2539
2514
  // src/lib/parsers/gml/deep-strict-equal.ts
2540
2515
  function deepStrictEqual(actual, expected, strict) {
@@ -2549,6 +2524,7 @@
2549
2524
  }
2550
2525
  return objEquiv(actual, expected, strict);
2551
2526
  }
2527
+ var pSlice = Array.prototype.slice;
2552
2528
  function isPrimitive(arg) {
2553
2529
  return arg === null || typeof arg !== "object" && typeof arg !== "function";
2554
2530
  }
@@ -2590,12 +2566,6 @@
2590
2566
  }
2591
2567
  return true;
2592
2568
  }
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
2569
 
2600
2570
  // ../../node_modules/@turf/clone/main.es.js
2601
2571
  function clone(geojson) {
@@ -2692,14 +2662,44 @@
2692
2662
  return deepSlice(coord);
2693
2663
  });
2694
2664
  }
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
- });
2665
+ var main_es_default = clone;
2701
2666
 
2702
2667
  // ../../node_modules/@turf/helpers/main.es.js
2668
+ var earthRadius = 63710088e-1;
2669
+ var factors = {
2670
+ meters: earthRadius,
2671
+ metres: earthRadius,
2672
+ millimeters: earthRadius * 1e3,
2673
+ millimetres: earthRadius * 1e3,
2674
+ centimeters: earthRadius * 100,
2675
+ centimetres: earthRadius * 100,
2676
+ kilometers: earthRadius / 1e3,
2677
+ kilometres: earthRadius / 1e3,
2678
+ miles: earthRadius / 1609.344,
2679
+ nauticalmiles: earthRadius / 1852,
2680
+ inches: earthRadius * 39.37,
2681
+ yards: earthRadius / 1.0936,
2682
+ feet: earthRadius * 3.28084,
2683
+ radians: 1,
2684
+ degrees: earthRadius / 111325
2685
+ };
2686
+ var unitsFactors = {
2687
+ meters: 1,
2688
+ metres: 1,
2689
+ millimeters: 1e3,
2690
+ millimetres: 1e3,
2691
+ centimeters: 100,
2692
+ centimetres: 100,
2693
+ kilometers: 1 / 1e3,
2694
+ kilometres: 1 / 1e3,
2695
+ miles: 1 / 1609.344,
2696
+ nauticalmiles: 1 / 1852,
2697
+ inches: 39.37,
2698
+ yards: 1 / 1.0936,
2699
+ feet: 3.28084,
2700
+ radians: 1 / earthRadius,
2701
+ degrees: 1 / 111325
2702
+ };
2703
2703
  function featureCollection(features, options) {
2704
2704
  options = options || {};
2705
2705
  if (!isObject(options))
@@ -2746,46 +2746,6 @@
2746
2746
  if (["string", "number"].indexOf(typeof id) === -1)
2747
2747
  throw new Error("id must be a number or a string");
2748
2748
  }
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
2749
 
2790
2750
  // ../../node_modules/@turf/invariant/main.es.js
2791
2751
  function getCoords(coords) {
@@ -2799,11 +2759,6 @@
2799
2759
  return coords;
2800
2760
  throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array");
2801
2761
  }
2802
- var init_main_es3 = __esm({
2803
- "../../node_modules/@turf/invariant/main.es.js"() {
2804
- init_main_es2();
2805
- }
2806
- });
2807
2762
 
2808
2763
  // ../../node_modules/@turf/boolean-clockwise/main.es.js
2809
2764
  function booleanClockwise(line) {
@@ -2824,13 +2779,7 @@
2824
2779
  }
2825
2780
  return sum > 0;
2826
2781
  }
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
- });
2782
+ var main_es_default2 = booleanClockwise;
2834
2783
 
2835
2784
  // ../../node_modules/@turf/meta/main.es.js
2836
2785
  function featureEach(geojson, callback) {
@@ -2884,11 +2833,6 @@
2884
2833
  featureIndex++;
2885
2834
  }
2886
2835
  }
2887
- var init_main_es5 = __esm({
2888
- "../../node_modules/@turf/meta/main.es.js"() {
2889
- init_main_es2();
2890
- }
2891
- });
2892
2836
 
2893
2837
  // ../../node_modules/@turf/rewind/main.es.js
2894
2838
  function rewind(geojson, options) {
@@ -2965,17 +2909,7 @@
2965
2909
  }
2966
2910
  }
2967
2911
  }
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
- });
2912
+ var main_es_default3 = rewind;
2979
2913
 
2980
2914
  // src/lib/parsers/gml/parse-gml.ts
2981
2915
  function noTransform(...coords) {
@@ -2983,7 +2917,11 @@
2983
2917
  }
2984
2918
  function parseGML(text, options) {
2985
2919
  const parsedXML = XMLLoader.parseTextSync?.(text, options);
2986
- options = { transformCoords: noTransform, stride: 2, ...options };
2920
+ options = {
2921
+ transformCoords: noTransform,
2922
+ stride: 2,
2923
+ ...options
2924
+ };
2987
2925
  const context = createChildContext(parsedXML, options, {});
2988
2926
  return parseGMLToGeometry(parsedXML, options, context);
2989
2927
  }
@@ -3020,7 +2958,9 @@
3020
2958
  default:
3021
2959
  return null;
3022
2960
  }
3023
- return main_es_default3(geometry, { mutate: true });
2961
+ return main_es_default3(geometry, {
2962
+ mutate: true
2963
+ });
3024
2964
  }
3025
2965
  function parseCoords(s, options, context) {
3026
2966
  const stride = context.srsDimension || options.stride || 2;
@@ -3295,44 +3235,33 @@
3295
3235
  }
3296
3236
  return context;
3297
3237
  }
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
3238
 
3306
3239
  // src/gml-loader.ts
3240
+ var VERSION8 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
3241
+ var GMLLoader = {
3242
+ name: "GML",
3243
+ id: "gml",
3244
+ module: "wms",
3245
+ version: VERSION8,
3246
+ worker: false,
3247
+ extensions: ["xml"],
3248
+ mimeTypes: ["application/vnd.ogc.gml", "application/xml", "text/xml"],
3249
+ testText: testXMLFile8,
3250
+ options: {
3251
+ gml: {}
3252
+ },
3253
+ parse: async (arrayBuffer, options) => parseGML(new TextDecoder().decode(arrayBuffer), options),
3254
+ parseTextSync: (text, options) => parseGML(text, options)
3255
+ };
3307
3256
  function testXMLFile8(text) {
3308
3257
  return text.startsWith("<?xml");
3309
3258
  }
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
3259
 
3333
3260
  // src/lib/services/create-image-service.ts
3334
3261
  function createImageService(props, services) {
3335
- const { type = "auto" } = props;
3262
+ const {
3263
+ type = "auto"
3264
+ } = props;
3336
3265
  const service = type === "auto" ? guessServiceType(props.url, services) : getServiceOfType(type, services);
3337
3266
  if (!service) {
3338
3267
  throw new Error("Not a valid image source type");
@@ -3355,20 +3284,16 @@
3355
3284
  }
3356
3285
  return null;
3357
3286
  }
3358
- var init_create_image_service = __esm({
3359
- "src/lib/services/create-image-service.ts"() {
3360
- }
3361
- });
3362
3287
 
3363
3288
  // ../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
- });
3289
+ var VERSION9 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
3370
3290
 
3371
3291
  // ../images/src/lib/category-api/image-type.ts
3292
+ var parseImageNode = globalThis.loaders?.parseImageNode;
3293
+ var IMAGE_SUPPORTED = typeof Image !== "undefined";
3294
+ var IMAGE_BITMAP_SUPPORTED = typeof ImageBitmap !== "undefined";
3295
+ var NODE_IMAGE_SUPPORTED = Boolean(parseImageNode);
3296
+ var DATA_SUPPORTED = isBrowser ? true : NODE_IMAGE_SUPPORTED;
3372
3297
  function isImageTypeSupported(type) {
3373
3298
  switch (type) {
3374
3299
  case "auto":
@@ -3395,17 +3320,6 @@
3395
3320
  }
3396
3321
  throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js");
3397
3322
  }
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
3323
 
3410
3324
  // ../images/src/lib/category-api/parsed-image-api.ts
3411
3325
  function getImageType(image) {
@@ -3446,12 +3360,10 @@
3446
3360
  }
3447
3361
  return null;
3448
3362
  }
3449
- var init_parsed_image_api = __esm({
3450
- "../images/src/lib/category-api/parsed-image-api.ts"() {
3451
- }
3452
- });
3453
3363
 
3454
3364
  // ../images/src/lib/parsers/svg-utils.ts
3365
+ var SVG_DATA_URL_PATTERN = /^data:image\/svg\+xml/;
3366
+ var SVG_URL_PATTERN = /\.svg((\?|#).*)?$/;
3455
3367
  function isSVG(url) {
3456
3368
  return url && (SVG_DATA_URL_PATTERN.test(url) || SVG_URL_PATTERN.test(url));
3457
3369
  }
@@ -3477,13 +3389,6 @@
3477
3389
  }
3478
3390
  return new Blob([new Uint8Array(arrayBuffer)]);
3479
3391
  }
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
3392
 
3488
3393
  // ../images/src/lib/parsers/parse-to-image.ts
3489
3394
  async function parseToImage(arrayBuffer, options, url) {
@@ -3514,13 +3419,10 @@
3514
3419
  }
3515
3420
  });
3516
3421
  }
3517
- var init_parse_to_image = __esm({
3518
- "../images/src/lib/parsers/parse-to-image.ts"() {
3519
- init_svg_utils();
3520
- }
3521
- });
3522
3422
 
3523
3423
  // ../images/src/lib/parsers/parse-to-image-bitmap.ts
3424
+ var EMPTY_OBJECT = {};
3425
+ var imagebitmapOptionsSupported = true;
3524
3426
  async function parseToImageBitmap(arrayBuffer, options, url) {
3525
3427
  let blob;
3526
3428
  if (isSVG(url)) {
@@ -3552,15 +3454,6 @@
3552
3454
  }
3553
3455
  return true;
3554
3456
  }
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
3457
 
3565
3458
  // ../images/src/lib/category-api/parse-isobmff-binary.ts
3566
3459
  function getISOBMFFMediaType(buffer) {
@@ -3577,7 +3470,10 @@
3577
3470
  switch (brandMajor) {
3578
3471
  case "avif":
3579
3472
  case "avis":
3580
- return { extension: "avif", mimeType: "image/avif" };
3473
+ return {
3474
+ extension: "avif",
3475
+ mimeType: "image/avif"
3476
+ };
3581
3477
  default:
3582
3478
  return null;
3583
3479
  }
@@ -3597,12 +3493,10 @@
3597
3493
  }
3598
3494
  return true;
3599
3495
  }
3600
- var init_parse_isobmff_binary = __esm({
3601
- "../images/src/lib/category-api/parse-isobmff-binary.ts"() {
3602
- }
3603
- });
3604
3496
 
3605
3497
  // ../images/src/lib/category-api/binary-image-api.ts
3498
+ var BIG_ENDIAN = false;
3499
+ var LITTLE_ENDIAN = true;
3606
3500
  function getBinaryImageMetadata(binaryData) {
3607
3501
  const dataView = toDataView(binaryData);
3608
3502
  return getPngMetadata(dataView) || getJpegMetadata(dataView) || getGifMetadata(dataView) || getBmpMetadata(dataView) || getISOBMFFMetadata(dataView);
@@ -3661,7 +3555,10 @@
3661
3555
  if (!isJpeg) {
3662
3556
  return null;
3663
3557
  }
3664
- const { tableMarkers, sofMarkers } = getJpegMarkers();
3558
+ const {
3559
+ tableMarkers,
3560
+ sofMarkers
3561
+ } = getJpegMarkers();
3665
3562
  let i = 2;
3666
3563
  while (i + 9 < dataView.byteLength) {
3667
3564
  const marker = dataView.getUint16(i, BIG_ENDIAN);
@@ -3681,27 +3578,15 @@
3681
3578
  return null;
3682
3579
  }
3683
3580
  function getJpegMarkers() {
3684
- const tableMarkers = new Set([65499, 65476, 65484, 65501, 65534]);
3581
+ const tableMarkers = /* @__PURE__ */ new Set([65499, 65476, 65484, 65501, 65534]);
3685
3582
  for (let i = 65504; i < 65520; ++i) {
3686
3583
  tableMarkers.add(i);
3687
3584
  }
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 };
3585
+ const sofMarkers = /* @__PURE__ */ new Set([65472, 65473, 65474, 65475, 65477, 65478, 65479, 65481, 65482, 65483, 65485, 65486, 65487, 65502]);
3586
+ return {
3587
+ tableMarkers,
3588
+ sofMarkers
3589
+ };
3705
3590
  }
3706
3591
  function toDataView(data) {
3707
3592
  if (data instanceof DataView) {
@@ -3715,35 +3600,25 @@
3715
3600
  }
3716
3601
  throw new Error("toDataView");
3717
3602
  }
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
3603
 
3727
3604
  // ../images/src/lib/parsers/parse-to-node-image.ts
3728
3605
  async function parseToNodeImage(arrayBuffer, options) {
3729
- const { mimeType } = getBinaryImageMetadata(arrayBuffer) || {};
3730
- const _parseImageNode2 = globalThis._parseImageNode;
3731
- assert(_parseImageNode2);
3732
- return await _parseImageNode2(arrayBuffer, mimeType);
3606
+ const {
3607
+ mimeType
3608
+ } = getBinaryImageMetadata(arrayBuffer) || {};
3609
+ const parseImageNode2 = globalThis.loaders?.parseImageNode;
3610
+ assert(parseImageNode2);
3611
+ return await parseImageNode2(arrayBuffer, mimeType);
3733
3612
  }
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
3613
 
3741
3614
  // ../images/src/lib/parsers/parse-image.ts
3742
3615
  async function parseImage(arrayBuffer, options, context) {
3743
3616
  options = options || {};
3744
3617
  const imageOptions = options.image || {};
3745
3618
  const imageType = imageOptions.type || "auto";
3746
- const { url } = context || {};
3619
+ const {
3620
+ url
3621
+ } = context || {};
3747
3622
  const loadType = getLoadableImageType(imageType);
3748
3623
  let image;
3749
3624
  switch (loadType) {
@@ -3774,563 +3649,512 @@
3774
3649
  return type;
3775
3650
  }
3776
3651
  }
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
3652
 
3788
3653
  // ../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
- }
3654
+ var EXTENSIONS = ["png", "jpg", "jpeg", "gif", "webp", "bmp", "ico", "svg", "avif"];
3655
+ var MIME_TYPES = ["image/png", "image/jpeg", "image/gif", "image/webp", "image/avif", "image/bmp", "image/vnd.microsoft.icon", "image/svg+xml"];
3656
+ var DEFAULT_IMAGE_LOADER_OPTIONS = {
3657
+ image: {
3658
+ type: "auto",
3659
+ decode: true
3660
+ }
3661
+ };
3662
+ var ImageLoader = {
3663
+ id: "image",
3664
+ module: "images",
3665
+ name: "Images",
3666
+ version: VERSION9,
3667
+ mimeTypes: MIME_TYPES,
3668
+ extensions: EXTENSIONS,
3669
+ parse: parseImage,
3670
+ tests: [(arrayBuffer) => Boolean(getBinaryImageMetadata(new DataView(arrayBuffer)))],
3671
+ options: DEFAULT_IMAGE_LOADER_OPTIONS
3672
+ };
3673
+
3674
+ // src/services/ogc/wms-service.ts
3675
+ var WMSService = {
3676
+ type: "wms",
3677
+ testURL: (url) => url.toLowerCase().includes("wms"),
3678
+ create: (props) => new WMSSource(props)
3679
+ };
3680
+ var WMSSource = class extends ImageSource {
3681
+ capabilities = null;
3682
+ constructor(props) {
3683
+ super(props);
3684
+ this.url = props.url;
3685
+ this.substituteCRS84 = props.substituteCRS84 ?? false;
3686
+ this.flipCRS = ["EPSG:4326"];
3687
+ this.wmsParameters = {
3688
+ layers: void 0,
3689
+ query_layers: void 0,
3690
+ styles: void 0,
3691
+ version: "1.3.0",
3692
+ crs: "EPSG:4326",
3693
+ format: "image/png",
3694
+ info_format: "text/plain",
3695
+ transparent: void 0,
3696
+ time: void 0,
3697
+ elevation: void 0,
3698
+ ...props.wmsParameters
3811
3699
  };
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
3700
+ this.vendorParameters = props.vendorParameters || {};
3701
+ }
3702
+ async getMetadata() {
3703
+ const capabilities = await this.getCapabilities();
3704
+ return this.normalizeMetadata(capabilities);
3705
+ }
3706
+ async getImage(parameters) {
3707
+ return await this.getMap(parameters);
3708
+ }
3709
+ normalizeMetadata(capabilities) {
3710
+ return capabilities;
3711
+ }
3712
+ async getCapabilities(wmsParameters, vendorParameters) {
3713
+ const url = this.getCapabilitiesURL(wmsParameters, vendorParameters);
3714
+ const response = await this.fetch(url);
3715
+ const arrayBuffer = await response.arrayBuffer();
3716
+ this._checkResponse(response, arrayBuffer);
3717
+ const capabilities = await WMSCapabilitiesLoader.parse(arrayBuffer, this.loadOptions);
3718
+ this.capabilities = capabilities;
3719
+ return capabilities;
3720
+ }
3721
+ async getMap(wmsParameters, vendorParameters) {
3722
+ const url = this.getMapURL(wmsParameters, vendorParameters);
3723
+ const response = await this.fetch(url);
3724
+ const arrayBuffer = await response.arrayBuffer();
3725
+ this._checkResponse(response, arrayBuffer);
3726
+ try {
3727
+ return await ImageLoader.parse(arrayBuffer, this.loadOptions);
3728
+ } catch {
3729
+ throw this._parseError(arrayBuffer);
3730
+ }
3731
+ }
3732
+ async getFeatureInfo(wmsParameters, vendorParameters) {
3733
+ const url = this.getFeatureInfoURL(wmsParameters, vendorParameters);
3734
+ const response = await this.fetch(url);
3735
+ const arrayBuffer = await response.arrayBuffer();
3736
+ this._checkResponse(response, arrayBuffer);
3737
+ return await WMSFeatureInfoLoader.parse(arrayBuffer, this.loadOptions);
3738
+ }
3739
+ async getFeatureInfoText(wmsParameters, vendorParameters) {
3740
+ const url = this.getFeatureInfoURL(wmsParameters, vendorParameters);
3741
+ const response = await this.fetch(url);
3742
+ const arrayBuffer = await response.arrayBuffer();
3743
+ this._checkResponse(response, arrayBuffer);
3744
+ return new TextDecoder().decode(arrayBuffer);
3745
+ }
3746
+ async describeLayer(wmsParameters, vendorParameters) {
3747
+ const url = this.describeLayerURL(wmsParameters, vendorParameters);
3748
+ const response = await this.fetch(url);
3749
+ const arrayBuffer = await response.arrayBuffer();
3750
+ this._checkResponse(response, arrayBuffer);
3751
+ return await WMSLayerDescriptionLoader.parse(arrayBuffer, this.loadOptions);
3752
+ }
3753
+ async getLegendGraphic(wmsParameters, vendorParameters) {
3754
+ const url = this.getLegendGraphicURL(wmsParameters, vendorParameters);
3755
+ const response = await this.fetch(url);
3756
+ const arrayBuffer = await response.arrayBuffer();
3757
+ this._checkResponse(response, arrayBuffer);
3758
+ try {
3759
+ return await ImageLoader.parse(arrayBuffer, this.loadOptions);
3760
+ } catch {
3761
+ throw this._parseError(arrayBuffer);
3762
+ }
3763
+ }
3764
+ getCapabilitiesURL(wmsParameters, vendorParameters) {
3765
+ const options = {
3766
+ version: this.wmsParameters.version,
3767
+ ...wmsParameters
3768
+ };
3769
+ return this._getWMSUrl("GetCapabilities", options, vendorParameters);
3770
+ }
3771
+ getMapURL(wmsParameters, vendorParameters) {
3772
+ wmsParameters = this._getWMS130Parameters(wmsParameters);
3773
+ const options = {
3774
+ version: this.wmsParameters.version,
3775
+ format: this.wmsParameters.format,
3776
+ transparent: this.wmsParameters.transparent,
3777
+ time: this.wmsParameters.time,
3778
+ elevation: this.wmsParameters.elevation,
3779
+ layers: this.wmsParameters.layers,
3780
+ styles: this.wmsParameters.styles,
3781
+ crs: this.wmsParameters.crs,
3782
+ ...wmsParameters
3783
+ };
3784
+ return this._getWMSUrl("GetMap", options, vendorParameters);
3785
+ }
3786
+ getFeatureInfoURL(wmsParameters, vendorParameters) {
3787
+ wmsParameters = this._getWMS130Parameters(wmsParameters);
3788
+ const options = {
3789
+ version: this.wmsParameters.version,
3790
+ info_format: this.wmsParameters.info_format,
3791
+ layers: this.wmsParameters.layers,
3792
+ query_layers: this.wmsParameters.query_layers,
3793
+ styles: this.wmsParameters.styles,
3794
+ crs: this.wmsParameters.crs,
3795
+ ...wmsParameters
3822
3796
  };
3797
+ return this._getWMSUrl("GetFeatureInfo", options, vendorParameters);
3823
3798
  }
3824
- });
3825
-
3826
- // ../images/src/index.ts
3827
- var init_src3 = __esm({
3828
- "../images/src/index.ts"() {
3829
- init_image_loader();
3799
+ describeLayerURL(wmsParameters, vendorParameters) {
3800
+ const options = {
3801
+ version: this.wmsParameters.version,
3802
+ ...wmsParameters
3803
+ };
3804
+ return this._getWMSUrl("DescribeLayer", options, vendorParameters);
3830
3805
  }
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)
3806
+ getLegendGraphicURL(wmsParameters, vendorParameters) {
3807
+ const options = {
3808
+ version: this.wmsParameters.version,
3809
+ ...wmsParameters
3848
3810
  };
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);
3811
+ return this._getWMSUrl("GetLegendGraphic", options, vendorParameters);
3812
+ }
3813
+ _parseWMSUrl(url) {
3814
+ const [baseUrl, search] = url.split("?");
3815
+ const searchParams = search.split("&");
3816
+ const parameters = {};
3817
+ for (const parameter of searchParams) {
3818
+ const [key, value] = parameter.split("=");
3819
+ parameters[key] = value;
3820
+ }
3821
+ return {
3822
+ url: baseUrl,
3823
+ parameters
3824
+ };
3825
+ }
3826
+ _getWMSUrl(request, wmsParameters, vendorParameters) {
3827
+ let url = this.url;
3828
+ let first = true;
3829
+ const allParameters = {
3830
+ service: "WMS",
3831
+ version: wmsParameters.version,
3832
+ request,
3833
+ ...wmsParameters,
3834
+ ...this.vendorParameters,
3835
+ ...vendorParameters
3836
+ };
3837
+ const IGNORE_EMPTY_KEYS = ["transparent", "time", "elevation"];
3838
+ for (const [key, value] of Object.entries(allParameters)) {
3839
+ if (!IGNORE_EMPTY_KEYS.includes(key) || value) {
3840
+ url += first ? "?" : "&";
3841
+ first = false;
3842
+ url += this._getURLParameter(key, value, wmsParameters);
4011
3843
  }
4012
- _getWMS130Parameters(wmsParameters) {
4013
- const newParameters = { ...wmsParameters };
4014
- if (newParameters.srs) {
4015
- newParameters.crs = newParameters.crs || newParameters.srs;
4016
- delete newParameters.srs;
3844
+ }
3845
+ return encodeURI(url);
3846
+ }
3847
+ _getWMS130Parameters(wmsParameters) {
3848
+ const newParameters = {
3849
+ ...wmsParameters
3850
+ };
3851
+ if (newParameters.srs) {
3852
+ newParameters.crs = newParameters.crs || newParameters.srs;
3853
+ delete newParameters.srs;
3854
+ }
3855
+ return newParameters;
3856
+ }
3857
+ _getURLParameter(key, value, wmsParameters) {
3858
+ switch (key) {
3859
+ case "crs":
3860
+ if (wmsParameters.version !== "1.3.0") {
3861
+ key = "srs";
3862
+ } else if (this.substituteCRS84 && value === "EPSG:4326") {
3863
+ value = "CRS:84";
4017
3864
  }
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:
3865
+ break;
3866
+ case "srs":
3867
+ if (wmsParameters.version === "1.3.0") {
3868
+ key = "crs";
4041
3869
  }
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;
3870
+ break;
3871
+ case "bbox":
3872
+ const bbox = this._flipBoundingBox(value, wmsParameters);
3873
+ if (bbox) {
3874
+ value = bbox;
4048
3875
  }
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);
3876
+ break;
3877
+ default:
3878
+ }
3879
+ key = key.toUpperCase();
3880
+ return Array.isArray(value) ? `${key}=${value.join(",")}` : `${key}=${value ? String(value) : ""}`;
3881
+ }
3882
+ _flipBoundingBox(bboxValue, wmsParameters) {
3883
+ if (!Array.isArray(bboxValue) || bboxValue.length !== 4) {
3884
+ return null;
3885
+ }
3886
+ const flipCoordinates = wmsParameters.version === "1.3.0" && this.flipCRS.includes(wmsParameters.crs || "") && !(this.substituteCRS84 && wmsParameters.crs === "EPSG:4326");
3887
+ const bbox = bboxValue;
3888
+ return flipCoordinates ? [bbox[1], bbox[0], bbox[3], bbox[2]] : bbox;
3889
+ }
3890
+ async _fetchArrayBuffer(url) {
3891
+ const response = await this.fetch(url);
3892
+ const arrayBuffer = await response.arrayBuffer();
3893
+ this._checkResponse(response, arrayBuffer);
3894
+ return arrayBuffer;
3895
+ }
3896
+ _checkResponse(response, arrayBuffer) {
3897
+ const contentType = response.headers["content-type"];
3898
+ if (!response.ok || WMSErrorLoader.mimeTypes.includes(contentType)) {
3899
+ const loadOptions = mergeLoaderOptions(this.loadOptions, {
3900
+ wms: {
3901
+ throwOnError: true
4067
3902
  }
4068
- }
4069
- _parseError(arrayBuffer) {
4070
- const error = WMSErrorLoader.parseSync?.(arrayBuffer, this.loadOptions);
4071
- return new Error(error);
4072
- }
4073
- };
3903
+ });
3904
+ const error = WMSErrorLoader.parseSync?.(arrayBuffer, loadOptions);
3905
+ throw new Error(error);
3906
+ }
4074
3907
  }
4075
- });
3908
+ _parseError(arrayBuffer) {
3909
+ const error = WMSErrorLoader.parseSync?.(arrayBuffer, this.loadOptions);
3910
+ return new Error(error);
3911
+ }
3912
+ };
4076
3913
 
4077
3914
  // 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
- }
3915
+ var ImageService = class extends ImageSource {
3916
+ constructor(props) {
3917
+ super(props);
3918
+ }
3919
+ async getMetadata() {
3920
+ throw new Error("ImageSource.getMetadata not implemented");
3921
+ }
3922
+ async getImage(parameters) {
3923
+ const granularParameters = this.getGranularParameters(parameters);
3924
+ const url = this.getURLFromTemplate(granularParameters);
3925
+ const response = await this.fetch(url);
3926
+ const arrayBuffer = await response.arrayBuffer();
3927
+ return await ImageLoader.parse(arrayBuffer);
3928
+ }
3929
+ getGranularParameters(parameters) {
3930
+ const [east, north, west, south] = parameters.bbox;
3931
+ return {
3932
+ ...parameters,
3933
+ east,
3934
+ north,
3935
+ south,
3936
+ west
4109
3937
  };
4110
- ImageService.type = "template";
4111
- ImageService.testURL = (url) => url.toLowerCase().includes("{");
4112
3938
  }
4113
- });
3939
+ getURLFromTemplate(parameters) {
3940
+ let url = this.props.url;
3941
+ for (const [key, value] of Object.entries(parameters)) {
3942
+ url = url.replace(`\${${key}}`, String(value));
3943
+ url = url.replace(`{${key}}`, String(value));
3944
+ }
3945
+ return url;
3946
+ }
3947
+ };
3948
+ __publicField(ImageService, "type", "template");
3949
+ __publicField(ImageService, "testURL", (url) => url.toLowerCase().includes("{"));
4114
3950
 
4115
3951
  // 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)
3952
+ var ArcGISImageSource = class extends ImageService {
3953
+ constructor(props) {
3954
+ super(props);
3955
+ }
3956
+ async getMetadata() {
3957
+ return await this.metadata();
3958
+ }
3959
+ async getImage(parameters) {
3960
+ throw new Error("not implemented");
3961
+ }
3962
+ async metadata() {
3963
+ throw new Error("not implemented");
3964
+ }
3965
+ exportImage(options) {
3966
+ throw new Error("not implemented");
3967
+ }
3968
+ metadataURL(options) {
3969
+ return `${this.props.url}?f=pjson`;
3970
+ }
3971
+ exportImageURL(options) {
3972
+ const bbox = `bbox=${options.bbox[0]},${options.bbox[1]},${options.bbox[2]},${options.bbox[3]}`;
3973
+ const size = `size=${options.width},${options.height}`;
3974
+ const arcgisOptions = {
3975
+ ...options,
3976
+ bbox,
3977
+ size
4171
3978
  };
3979
+ delete arcgisOptions.width;
3980
+ delete arcgisOptions.height;
3981
+ return this.getUrl("exportImage", arcgisOptions);
3982
+ }
3983
+ getUrl(path, options, extra) {
3984
+ let url = `${this.props.url}/${path}`;
3985
+ let first = true;
3986
+ for (const [key, value] of Object.entries(options)) {
3987
+ url += first ? "?" : "&";
3988
+ first = false;
3989
+ if (Array.isArray(value)) {
3990
+ url += `${key.toUpperCase()}=${value.join(",")}`;
3991
+ } else {
3992
+ url += `${key.toUpperCase()}=${value ? String(value) : ""}`;
3993
+ }
3994
+ }
3995
+ return url;
4172
3996
  }
4173
- });
3997
+ async checkResponse(response) {
3998
+ if (!response.ok) {
3999
+ throw new Error("error");
4000
+ }
4001
+ }
4002
+ };
4003
+ var ArcGISImageService = {
4004
+ type: "arcgis-image-server",
4005
+ testURL: (url) => url.toLowerCase().includes("ImageServer"),
4006
+ create: (props) => new ArcGISImageSource(props)
4007
+ };
4174
4008
 
4175
4009
  // src/services/create-image-source.ts
4010
+ var SERVICES = [WMSService, ArcGISImageService];
4176
4011
  function createImageSource(props) {
4177
4012
  return createImageService(props, SERVICES);
4178
4013
  }
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
4014
 
4189
4015
  // 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);
4016
+ var CSWService = class extends DataSource {
4017
+ capabilities = null;
4018
+ loaders = [WMSErrorLoader, CSWCapabilitiesLoader];
4019
+ constructor(props) {
4020
+ super(props);
4021
+ }
4022
+ async getMetadata() {
4023
+ const capabilities = await this.getCapabilities();
4024
+ return this.normalizeMetadata(capabilities);
4025
+ }
4026
+ normalizeMetadata(capabilities) {
4027
+ return capabilities;
4028
+ }
4029
+ async getServiceDirectory(options) {
4030
+ const services = [];
4031
+ const unknownServices = [];
4032
+ const records = await this.getRecords();
4033
+ for (const record of records.records) {
4034
+ for (const reference of record.references) {
4035
+ const url = reference.value;
4036
+ switch (reference.scheme) {
4037
+ case "OGC:WMS":
4038
+ services.push({
4039
+ name: record.title,
4040
+ type: "ogc-wms-service",
4041
+ ...this._parseOGCUrl(url)
4042
+ });
4043
+ break;
4044
+ case "OGC:WMTS":
4045
+ services.push({
4046
+ name: record.title,
4047
+ type: "ogc-wmts-service",
4048
+ ...this._parseOGCUrl(url)
4049
+ });
4050
+ break;
4051
+ case "OGC:WFS":
4052
+ services.push({
4053
+ name: record.title,
4054
+ type: "ogc-wfs-service",
4055
+ ...this._parseOGCUrl(url)
4056
+ });
4057
+ break;
4058
+ default:
4059
+ unknownServices.push({
4060
+ name: record.title,
4061
+ type: "unknown",
4062
+ url: reference.value,
4063
+ scheme: reference.scheme
4064
+ });
4323
4065
  }
4324
4066
  }
4325
- _parseError(arrayBuffer) {
4326
- const error = WMSErrorLoader.parseSync?.(arrayBuffer, this.props.loadOptions);
4327
- return new Error(error);
4328
- }
4067
+ }
4068
+ return options?.includeUnknown ? services.concat(unknownServices) : services;
4069
+ }
4070
+ _parseOGCUrl(url) {
4071
+ const parts = url.split("?");
4072
+ return {
4073
+ url: parts[0],
4074
+ params: parts[1] || ""
4329
4075
  };
4330
- CSWService.type = "csw";
4331
- CSWService.testURL = (url) => url.toLowerCase().includes("csw");
4332
4076
  }
4333
- });
4077
+ async getCapabilities(wmsParameters, vendorParameters) {
4078
+ const url = this.getCapabilitiesURL(wmsParameters, vendorParameters);
4079
+ const response = await this.fetch(url);
4080
+ const arrayBuffer = await response.arrayBuffer();
4081
+ this._checkResponse(response, arrayBuffer);
4082
+ const capabilities = await CSWCapabilitiesLoader.parse(arrayBuffer, this.props.loadOptions);
4083
+ return capabilities;
4084
+ }
4085
+ async getRecords(wmsParameters, vendorParameters) {
4086
+ const url = this.getRecordsURL(wmsParameters, vendorParameters);
4087
+ const response = await this.fetch(url);
4088
+ const arrayBuffer = await response.arrayBuffer();
4089
+ this._checkResponse(response, arrayBuffer);
4090
+ return await CSWRecordsLoader.parse(arrayBuffer, this.props.loadOptions);
4091
+ }
4092
+ async getDomain(wmsParameters, vendorParameters) {
4093
+ const url = this.getDomainURL(wmsParameters, vendorParameters);
4094
+ const response = await this.fetch(url);
4095
+ const arrayBuffer = await response.arrayBuffer();
4096
+ this._checkResponse(response, arrayBuffer);
4097
+ return await CSWDomainLoader.parse(arrayBuffer, this.props.loadOptions);
4098
+ }
4099
+ getCapabilitiesURL(wmsParameters, vendorParameters) {
4100
+ const options = {
4101
+ version: "3.0.0",
4102
+ ...wmsParameters,
4103
+ ...vendorParameters,
4104
+ service: "CSW",
4105
+ request: "GetCapabilities"
4106
+ };
4107
+ return this._getCSWUrl(options, vendorParameters);
4108
+ }
4109
+ getRecordsURL(wmsParameters, vendorParameters) {
4110
+ const options = {
4111
+ version: "3.0.0",
4112
+ typenames: "csw:Record",
4113
+ ...wmsParameters,
4114
+ ...vendorParameters,
4115
+ service: "CSW",
4116
+ request: "GetRecords"
4117
+ };
4118
+ return this._getCSWUrl(options, vendorParameters);
4119
+ }
4120
+ getDomainURL(wmsParameters, vendorParameters) {
4121
+ const options = {
4122
+ version: "3.0.0",
4123
+ ...wmsParameters,
4124
+ ...vendorParameters,
4125
+ service: "CSW",
4126
+ request: "GetDomain"
4127
+ };
4128
+ return this._getCSWUrl(options, vendorParameters);
4129
+ }
4130
+ _getCSWUrl(options, vendorParameters) {
4131
+ let url = this.props.url;
4132
+ let first = true;
4133
+ for (const [key, value] of Object.entries(options)) {
4134
+ url += first ? "?" : "&";
4135
+ first = false;
4136
+ if (Array.isArray(value)) {
4137
+ url += `${key.toUpperCase()}=${value.join(",")}`;
4138
+ } else {
4139
+ url += `${key.toUpperCase()}=${value ? String(value) : ""}`;
4140
+ }
4141
+ }
4142
+ return encodeURI(url);
4143
+ }
4144
+ _checkResponse(response, arrayBuffer) {
4145
+ const contentType = response.headers["content-type"];
4146
+ if (!response.ok || WMSErrorLoader.mimeTypes.includes(contentType)) {
4147
+ const error = WMSErrorLoader.parseSync?.(arrayBuffer, this.props.loadOptions);
4148
+ throw new Error(error);
4149
+ }
4150
+ }
4151
+ _parseError(arrayBuffer) {
4152
+ const error = WMSErrorLoader.parseSync?.(arrayBuffer, this.props.loadOptions);
4153
+ return new Error(error);
4154
+ }
4155
+ };
4156
+ __publicField(CSWService, "type", "csw");
4157
+ __publicField(CSWService, "testURL", (url) => url.toLowerCase().includes("csw"));
4334
4158
 
4335
4159
  // src/services/arcgis/arcgis-server.ts
4336
4160
  async function getArcGISServices(url, fetchFile = fetch) {
@@ -4364,62 +4188,7 @@
4364
4188
  }
4365
4189
  return services;
4366
4190
  }
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();
4191
+ return __toCommonJS(src_exports);
4425
4192
  })();
4193
+ return __exports__;
4194
+ });