KMLLayer-G2W3Z42K.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. import {
  2. S,
  3. d,
  4. g,
  5. j as j3
  6. } from "./chunk-XDR4MMPA.js";
  7. import "./chunk-WFHIGLUK.js";
  8. import "./chunk-JB2527A3.js";
  9. import "./chunk-XODJHDJQ.js";
  10. import "./chunk-O2PIYIHJ.js";
  11. import "./chunk-2BWPQRLB.js";
  12. import "./chunk-HPD2S4QL.js";
  13. import "./chunk-C65ZRRQD.js";
  14. import "./chunk-GR4RKUNH.js";
  15. import "./chunk-LTQAWUCK.js";
  16. import "./chunk-W3SLJVWY.js";
  17. import "./chunk-PK4W65H4.js";
  18. import "./chunk-KJZ6SS3P.js";
  19. import "./chunk-OER54WCN.js";
  20. import "./chunk-HOCLACFL.js";
  21. import "./chunk-3MLCBRBA.js";
  22. import "./chunk-WTRZAXRY.js";
  23. import "./chunk-EY2WJSAJ.js";
  24. import "./chunk-YMULPZCD.js";
  25. import "./chunk-4PNYPUDB.js";
  26. import "./chunk-73AMYZFU.js";
  27. import "./chunk-NKMX5M3L.js";
  28. import "./chunk-MGUVQY3Q.js";
  29. import "./chunk-QEWF7QPH.js";
  30. import "./chunk-PJNBFKPF.js";
  31. import "./chunk-C7742RNZ.js";
  32. import "./chunk-SQ2SY4BX.js";
  33. import "./chunk-VLG7MMVR.js";
  34. import "./chunk-TV3CFJQR.js";
  35. import {
  36. U,
  37. a,
  38. j as j2,
  39. l
  40. } from "./chunk-BWATQC2Y.js";
  41. import {
  42. v
  43. } from "./chunk-2DSTZVND.js";
  44. import {
  45. c
  46. } from "./chunk-VXKIGGM4.js";
  47. import {
  48. f
  49. } from "./chunk-KG45D2XL.js";
  50. import {
  51. O
  52. } from "./chunk-JYRZQPQI.js";
  53. import "./chunk-3HZQM2NK.js";
  54. import "./chunk-AR2YN3E2.js";
  55. import "./chunk-U3LEOWJX.js";
  56. import "./chunk-4ONPMX2F.js";
  57. import "./chunk-47NSA4T4.js";
  58. import "./chunk-FUODOQDM.js";
  59. import {
  60. p
  61. } from "./chunk-UMJCSYX5.js";
  62. import {
  63. n as n3
  64. } from "./chunk-UA6W42KP.js";
  65. import "./chunk-3OSQ6GXO.js";
  66. import "./chunk-3WQOA5CB.js";
  67. import {
  68. t
  69. } from "./chunk-2L5METUC.js";
  70. import "./chunk-FZQZIM7U.js";
  71. import "./chunk-CZBRZ6SU.js";
  72. import "./chunk-VGWC3IKZ.js";
  73. import "./chunk-SWMSD4RP.js";
  74. import "./chunk-UKEN2UNL.js";
  75. import "./chunk-UVVU4UUO.js";
  76. import {
  77. l as l2
  78. } from "./chunk-E36TKLKO.js";
  79. import "./chunk-O6VYMEIX.js";
  80. import "./chunk-X4SA4ELJ.js";
  81. import "./chunk-XJCUT65M.js";
  82. import "./chunk-PE24J2I5.js";
  83. import "./chunk-P3XKUGLS.js";
  84. import "./chunk-PIFOHNWC.js";
  85. import "./chunk-LLO7GCYU.js";
  86. import "./chunk-U7RKABRB.js";
  87. import "./chunk-X7CNGECX.js";
  88. import "./chunk-PSEI52P3.js";
  89. import "./chunk-ZLNEXZAN.js";
  90. import "./chunk-5UVJ64RB.js";
  91. import {
  92. b as b2
  93. } from "./chunk-O43KLDSX.js";
  94. import "./chunk-AUOH2VSO.js";
  95. import "./chunk-ZYRIJWLX.js";
  96. import "./chunk-RYY6632W.js";
  97. import "./chunk-DW42UVIT.js";
  98. import "./chunk-TJNOJH33.js";
  99. import "./chunk-YAEIHDJH.js";
  100. import "./chunk-OSHI574D.js";
  101. import "./chunk-44GMIOGP.js";
  102. import "./chunk-75U5LM2V.js";
  103. import "./chunk-ZHRAUKVQ.js";
  104. import "./chunk-RZK6A2GY.js";
  105. import {
  106. j
  107. } from "./chunk-4NQ74ZR6.js";
  108. import "./chunk-X4LLOW7U.js";
  109. import {
  110. m
  111. } from "./chunk-BDA6VH2A.js";
  112. import {
  113. n as n2
  114. } from "./chunk-Z4JTBD7M.js";
  115. import "./chunk-MSBIHK67.js";
  116. import "./chunk-HZRKBTHJ.js";
  117. import "./chunk-5DMBXPN2.js";
  118. import "./chunk-QANZ6BFY.js";
  119. import {
  120. Ut
  121. } from "./chunk-VEGAOVMY.js";
  122. import {
  123. o,
  124. w2
  125. } from "./chunk-CXCDYJ5R.js";
  126. import "./chunk-GAOW3WRZ.js";
  127. import {
  128. k2 as k,
  129. r as r2
  130. } from "./chunk-QCKFNSN2.js";
  131. import {
  132. e,
  133. n5 as n,
  134. u2,
  135. y3 as y
  136. } from "./chunk-6SOHRC7T.js";
  137. import "./chunk-U2XHEJM7.js";
  138. import {
  139. b
  140. } from "./chunk-SQOPWYIT.js";
  141. import "./chunk-6KZ2LTDA.js";
  142. import {
  143. w
  144. } from "./chunk-V6P2MAQQ.js";
  145. import "./chunk-E5O6P5I2.js";
  146. import {
  147. u
  148. } from "./chunk-SPWQ3AWG.js";
  149. import "./chunk-2TIUKVZN.js";
  150. import {
  151. r
  152. } from "./chunk-YXWMMD76.js";
  153. import "./chunk-S5KM4IGW.js";
  154. // node_modules/@arcgis/core/layers/support/KMLSublayer.js
  155. var S2;
  156. var k2 = S2 = class extends n2.EventedMixin(u2(m)) {
  157. constructor(...e2) {
  158. super(...e2), this.description = null, this.id = null, this.networkLink = null, this.sublayers = null, this.title = null, this.sourceJSON = null, this.fullExtent = null, this.addHandles([a(() => this.sublayers, "after-add", ({ item: e3 }) => {
  159. e3.parent = this, e3.layer = this.layer;
  160. }, U), a(() => this.sublayers, "after-remove", ({ item: e3 }) => {
  161. e3.layer = e3.parent = null;
  162. }, U), l(() => this.sublayers, (e3, t2) => {
  163. if (t2)
  164. for (const r3 of t2)
  165. r3.layer = r3.parent = null;
  166. if (e3)
  167. for (const r3 of e3)
  168. r3.parent = this, r3.layer = this.layer;
  169. }, U)]);
  170. }
  171. initialize() {
  172. j2(() => this.networkLink).then(() => j2(() => true === this.visible)).then(() => this.load());
  173. }
  174. load(e2) {
  175. var _a, _b;
  176. if (!this.networkLink)
  177. return;
  178. if (this.networkLink.viewFormat)
  179. return;
  180. const r3 = r(e2) ? e2.signal : null, s = this._fetchService((_b = (_a = this._get("networkLink")) == null ? void 0 : _a.href) != null ? _b : "", r3).then((e3) => {
  181. var _a2;
  182. const r4 = j3(e3.sublayers);
  183. this.fullExtent = w2.fromJSON(r4), this.sourceJSON = e3;
  184. const s2 = b(j.ofType(S2), S(S2, e3));
  185. this.sublayers ? this.sublayers.addMany(s2) : this.sublayers = s2, (_a2 = this.layer) == null ? void 0 : _a2.emit("sublayer-update"), this.layer && this.layer.notifyChange("visibleSublayers");
  186. });
  187. return this.addResolvingPromise(s), Promise.resolve(this);
  188. }
  189. get visible() {
  190. return this._get("visible");
  191. }
  192. set visible(e2) {
  193. this._get("visible") !== e2 && (this._set("visible", e2), this.layer && this.layer.notifyChange("visibleSublayers"));
  194. }
  195. readVisible(e2, t2) {
  196. return !!t2.visibility;
  197. }
  198. set layer(e2) {
  199. this._set("layer", e2), this.sublayers && this.sublayers.forEach((t2) => t2.layer = e2);
  200. }
  201. _fetchService(e2, t2) {
  202. return g(e2, this.layer.outSpatialReference, this.layer.refreshInterval, t2).then((e3) => d(e3.data));
  203. }
  204. };
  205. e([y()], k2.prototype, "description", void 0), e([y()], k2.prototype, "id", void 0), e([y({ readOnly: true, value: null })], k2.prototype, "networkLink", void 0), e([y({ json: { write: { allowNull: true } } })], k2.prototype, "parent", void 0), e([y({ type: j.ofType(S2), json: { write: { allowNull: true } } })], k2.prototype, "sublayers", void 0), e([y({ value: null, json: { read: { source: "name", reader: (e2) => u(e2) } } })], k2.prototype, "title", void 0), e([y({ value: true })], k2.prototype, "visible", null), e([o("visible", ["visibility"])], k2.prototype, "readVisible", null), e([y()], k2.prototype, "sourceJSON", void 0), e([y({ value: null })], k2.prototype, "layer", null), e([y({ type: w2 })], k2.prototype, "fullExtent", void 0), k2 = S2 = e([n("esri.layers.support.KMLSublayer")], k2);
  206. var g2 = k2;
  207. // node_modules/@arcgis/core/layers/KMLLayer.js
  208. var F = ["kml", "xml"];
  209. var O2 = class extends n3(p(t(c(v(O(b2)))))) {
  210. constructor(...e2) {
  211. super(...e2), this._visibleFolders = [], this.allSublayers = new l2({ getCollections: () => [this.sublayers], getChildrenFunction: (e3) => e3.sublayers }), this.outSpatialReference = k.WGS84, this.path = null, this.legendEnabled = false, this.operationalLayerType = "KML", this.sublayers = null, this.type = "kml", this.url = null;
  212. }
  213. initialize() {
  214. this.addHandles([l(() => this.sublayers, (e2, r3) => {
  215. r3 && r3.forEach((e3) => {
  216. e3.parent = null, e3.layer = null;
  217. }), e2 && e2.forEach((e3) => {
  218. e3.parent = this, e3.layer = this;
  219. });
  220. }, U), this.on("sublayer-update", () => this.notifyChange("fullExtent"))]);
  221. }
  222. normalizeCtorArgs(e2, r3) {
  223. return "string" == typeof e2 ? { url: e2, ...r3 } : e2;
  224. }
  225. readSublayersFromItemOrWebMap(e2, r3) {
  226. this._visibleFolders = r3.visibleFolders;
  227. }
  228. readSublayers(e2, r3, t2) {
  229. return S(g2, r3, t2, this._visibleFolders);
  230. }
  231. writeSublayers(e2, r3) {
  232. const t2 = [], o2 = e2.toArray();
  233. for (; o2.length; ) {
  234. const e3 = o2[0];
  235. e3.networkLink || (e3.visible && t2.push(e3.id), e3.sublayers && o2.push(...e3.sublayers.toArray())), o2.shift();
  236. }
  237. r3.visibleFolders = t2;
  238. }
  239. get title() {
  240. const e2 = this._get("title");
  241. return e2 && "defaults" !== this.originOf("title") ? e2 : this.url ? Ut(this.url, F) || "KML" : e2 || "";
  242. }
  243. set title(e2) {
  244. this._set("title", e2);
  245. }
  246. get visibleSublayers() {
  247. const e2 = this.sublayers, r3 = [], t2 = (e3) => {
  248. e3.visible && (r3.push(e3), e3.sublayers && e3.sublayers.forEach(t2));
  249. };
  250. return e2 && e2.forEach(t2), r3;
  251. }
  252. get fullExtent() {
  253. return this._recomputeFullExtent();
  254. }
  255. load(e2) {
  256. const r3 = r(e2) ? e2.signal : null;
  257. return this.addResolvingPromise(this.loadFromPortal({ supportedTypes: ["KML"], supportsData: false }, e2).catch(w).then(() => this._fetchService(r3))), Promise.resolve(this);
  258. }
  259. destroy() {
  260. super.destroy(), this.allSublayers.destroy();
  261. }
  262. async _fetchService(e2) {
  263. const r3 = await Promise.resolve().then(() => {
  264. var _a;
  265. return this.resourceInfo ? { ssl: false, data: this.resourceInfo } : g((_a = this.url) != null ? _a : "", this.outSpatialReference, this.refreshInterval, e2);
  266. }), t2 = d(r3.data);
  267. t2 && this.read(t2, { origin: "service" });
  268. }
  269. _recomputeFullExtent() {
  270. let e2 = null;
  271. r(this.extent) && (e2 = this.extent.clone());
  272. const r3 = (t2) => {
  273. if (t2.sublayers)
  274. for (const s of t2.sublayers.items)
  275. r3(s), s.visible && s.fullExtent && (r(e2) ? e2.union(s.fullExtent) : e2 = s.fullExtent.clone());
  276. };
  277. return r3(this), e2;
  278. }
  279. };
  280. e([y({ readOnly: true })], O2.prototype, "allSublayers", void 0), e([y({ type: k })], O2.prototype, "outSpatialReference", void 0), e([y({ type: String, json: { origins: { "web-scene": { read: true, write: true } }, read: false } })], O2.prototype, "path", void 0), e([y({ readOnly: true, json: { read: false, write: false } })], O2.prototype, "legendEnabled", void 0), e([y({ type: ["show", "hide", "hide-children"] })], O2.prototype, "listMode", void 0), e([y({ type: ["KML"] })], O2.prototype, "operationalLayerType", void 0), e([y({})], O2.prototype, "resourceInfo", void 0), e([y({ type: j.ofType(g2), json: { write: { ignoreOrigin: true } } })], O2.prototype, "sublayers", void 0), e([o(["web-map", "portal-item"], "sublayers", ["visibleFolders"])], O2.prototype, "readSublayersFromItemOrWebMap", null), e([o("service", "sublayers", ["sublayers"])], O2.prototype, "readSublayers", null), e([r2("sublayers")], O2.prototype, "writeSublayers", null), e([y({ readOnly: true, json: { read: false } })], O2.prototype, "type", void 0), e([y({ json: { origins: { "web-map": { read: { source: "title" } } }, write: { ignoreOrigin: true } } })], O2.prototype, "title", null), e([y(f)], O2.prototype, "url", void 0), e([y({ readOnly: true })], O2.prototype, "visibleSublayers", null), e([y({ type: w2 })], O2.prototype, "extent", void 0), e([y()], O2.prototype, "fullExtent", null), O2 = e([n("esri.layers.KMLLayer")], O2);
  281. var M = O2;
  282. export {
  283. M as default
  284. };
  285. //# sourceMappingURL=KMLLayer-G2W3Z42K.js.map