KMLLayerView2D-I5FS4ELA.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  1. import {
  2. o,
  3. y as y2
  4. } from "./chunk-SBZKLPXX.js";
  5. import {
  6. i as i2
  7. } from "./chunk-54V4THCX.js";
  8. import {
  9. oe
  10. } from "./chunk-DTSCAH2R.js";
  11. import "./chunk-B5WNDDCF.js";
  12. import "./chunk-DXEPL3XQ.js";
  13. import "./chunk-E5TKVDJT.js";
  14. import "./chunk-XYIYXU3I.js";
  15. import "./chunk-T6DJ6UAT.js";
  16. import "./chunk-WOGDHLUJ.js";
  17. import {
  18. a as a2
  19. } from "./chunk-BFF4N4R7.js";
  20. import {
  21. R,
  22. S,
  23. T
  24. } from "./chunk-O6KMIRUU.js";
  25. import {
  26. c,
  27. n as n2
  28. } from "./chunk-264YGWEE.js";
  29. import {
  30. u,
  31. y as y3
  32. } from "./chunk-KUAEOLV3.js";
  33. import "./chunk-ZLQP3WDC.js";
  34. import "./chunk-WCLXPK5D.js";
  35. import "./chunk-JBMHQ5RK.js";
  36. import {
  37. b,
  38. d,
  39. g
  40. } from "./chunk-5PPOX2P4.js";
  41. import "./chunk-KHMWUB3W.js";
  42. import "./chunk-LDMWL65U.js";
  43. import {
  44. x
  45. } from "./chunk-WBWQJQK4.js";
  46. import "./chunk-A22ACVMF.js";
  47. import {
  48. $,
  49. C
  50. } from "./chunk-I623MZCZ.js";
  51. import "./chunk-TDS6IBMU.js";
  52. import "./chunk-DBT4KOKX.js";
  53. import "./chunk-2GP5D74I.js";
  54. import "./chunk-ZELEU5PN.js";
  55. import "./chunk-O7E4VYJT.js";
  56. import "./chunk-AIG57VB7.js";
  57. import "./chunk-PHAKVYRM.js";
  58. import "./chunk-IDINBHDV.js";
  59. import "./chunk-6LE4RPMZ.js";
  60. import "./chunk-67RFR4NT.js";
  61. import "./chunk-WPDBODJM.js";
  62. import "./chunk-5IVP3KUS.js";
  63. import "./chunk-JXYBFGFY.js";
  64. import "./chunk-EPMXCACW.js";
  65. import "./chunk-UCPKJYXN.js";
  66. import "./chunk-KFLNKWNF.js";
  67. import "./chunk-R24MO4IV.js";
  68. import "./chunk-YQBYWPBD.js";
  69. import "./chunk-UWKVAZQ6.js";
  70. import "./chunk-XBFCIW4K.js";
  71. import "./chunk-T2SKWJGU.js";
  72. import "./chunk-UO3LS2M5.js";
  73. import {
  74. E
  75. } from "./chunk-H2VOWDMO.js";
  76. import "./chunk-QISOH77W.js";
  77. import "./chunk-4HL6BBWO.js";
  78. import "./chunk-KUO7OCMN.js";
  79. import "./chunk-XO5VJRK4.js";
  80. import "./chunk-ST53DRNI.js";
  81. import "./chunk-3WXSWAUV.js";
  82. import "./chunk-27YO3FKC.js";
  83. import "./chunk-EQNT4A7P.js";
  84. import "./chunk-4OM3EX6P.js";
  85. import {
  86. D,
  87. G,
  88. L as L2,
  89. P,
  90. V,
  91. Y,
  92. f as f2
  93. } from "./chunk-3OFVLRSL.js";
  94. import "./chunk-DMVKVC5I.js";
  95. import "./chunk-VEJPYAE4.js";
  96. import "./chunk-UMUHMVL4.js";
  97. import "./chunk-FZSI6IGI.js";
  98. import "./chunk-YFDOPEEZ.js";
  99. import {
  100. i
  101. } from "./chunk-BVA3U6FJ.js";
  102. import "./chunk-IQBIGNPU.js";
  103. import "./chunk-K7B6OWCU.js";
  104. import "./chunk-LXOC7SMQ.js";
  105. import "./chunk-QU433TMZ.js";
  106. import "./chunk-L5DZVCCW.js";
  107. import "./chunk-WNPL3C7R.js";
  108. import "./chunk-E7ZLMIQ7.js";
  109. import "./chunk-JEA4MMTV.js";
  110. import "./chunk-RG3AHHRL.js";
  111. import "./chunk-XHRNCFJT.js";
  112. import "./chunk-UDYHZLTE.js";
  113. import "./chunk-QC7NCR5N.js";
  114. import "./chunk-VQXMCZYH.js";
  115. import "./chunk-JQUWFKNU.js";
  116. import "./chunk-RWQH5X3O.js";
  117. import "./chunk-6334AFGG.js";
  118. import "./chunk-NLLFSKB2.js";
  119. import "./chunk-CC74Y7ET.js";
  120. import "./chunk-TFHLTN6F.js";
  121. import "./chunk-O3JQY77G.js";
  122. import "./chunk-E3G7BRZB.js";
  123. import "./chunk-JKFWEHNK.js";
  124. import "./chunk-IIAN3QNN.js";
  125. import {
  126. rn,
  127. tn
  128. } from "./chunk-P24XEEHY.js";
  129. import "./chunk-WOXHUQGM.js";
  130. import {
  131. f
  132. } from "./chunk-FMPQIGFA.js";
  133. import "./chunk-EDHROVWI.js";
  134. import "./chunk-3IRT3YKJ.js";
  135. import "./chunk-SAJAEMIJ.js";
  136. import "./chunk-TU7WVKU4.js";
  137. import "./chunk-JAUFBT5U.js";
  138. import "./chunk-RHFU6KWO.js";
  139. import "./chunk-3FNKD2EB.js";
  140. import "./chunk-ZOO4I2U4.js";
  141. import "./chunk-JPUFJK2B.js";
  142. import "./chunk-HZ2WKB3G.js";
  143. import "./chunk-3HCJD762.js";
  144. import "./chunk-RVCE264D.js";
  145. import "./chunk-HKJ7X3BD.js";
  146. import "./chunk-Y74D3LKQ.js";
  147. import "./chunk-PK4W65H4.js";
  148. import "./chunk-7C23ILQ4.js";
  149. import "./chunk-P6VVVEX6.js";
  150. import "./chunk-3Z755LKF.js";
  151. import "./chunk-LTZ5XXDV.js";
  152. import "./chunk-IEU3AM37.js";
  153. import "./chunk-SKKBVHTF.js";
  154. import "./chunk-DLMAGHHC.js";
  155. import "./chunk-JOYXMSKE.js";
  156. import "./chunk-YZVAB3DF.js";
  157. import "./chunk-JLYTER4T.js";
  158. import "./chunk-CRHRHOXH.js";
  159. import "./chunk-ZSW35JPD.js";
  160. import "./chunk-JLSNMUQJ.js";
  161. import "./chunk-ECY35CJI.js";
  162. import "./chunk-PT62335L.js";
  163. import "./chunk-JGBXYDGB.js";
  164. import "./chunk-QEWF7QPH.js";
  165. import "./chunk-PJNBFKPF.js";
  166. import "./chunk-C7742RNZ.js";
  167. import "./chunk-FNA5GLRW.js";
  168. import "./chunk-MCWCB5IY.js";
  169. import "./chunk-TV3CFJQR.js";
  170. import {
  171. l
  172. } from "./chunk-TJV6ODRM.js";
  173. import "./chunk-3LVSQLWJ.js";
  174. import "./chunk-4ONPMX2F.js";
  175. import "./chunk-CRGY2SDS.js";
  176. import "./chunk-4T5ZGMEN.js";
  177. import "./chunk-3WQOA5CB.js";
  178. import "./chunk-FZQZIM7U.js";
  179. import "./chunk-CZBRZ6SU.js";
  180. import "./chunk-VGWC3IKZ.js";
  181. import "./chunk-2H5MD622.js";
  182. import "./chunk-3RSFVUKZ.js";
  183. import "./chunk-UVVU4UUO.js";
  184. import "./chunk-O6VYMEIX.js";
  185. import "./chunk-X4SA4ELJ.js";
  186. import "./chunk-5N7JLUJJ.js";
  187. import "./chunk-ZAY3CMAZ.js";
  188. import "./chunk-P3XKUGLS.js";
  189. import "./chunk-LU5IJZB4.js";
  190. import "./chunk-7IBV2TRE.js";
  191. import "./chunk-ZLNEXZAN.js";
  192. import "./chunk-5UVJ64RB.js";
  193. import "./chunk-SFEFRQCL.js";
  194. import "./chunk-3GZSQU56.js";
  195. import "./chunk-ZYRIJWLX.js";
  196. import "./chunk-RYY6632W.js";
  197. import "./chunk-DW42UVIT.js";
  198. import "./chunk-YAEIHDJH.js";
  199. import "./chunk-TJNOJH33.js";
  200. import "./chunk-OSHI574D.js";
  201. import "./chunk-ETGAZ7LF.js";
  202. import "./chunk-75U5LM2V.js";
  203. import "./chunk-RMDDCMKS.js";
  204. import "./chunk-VCH45Q2I.js";
  205. import {
  206. j
  207. } from "./chunk-LBW34VZ2.js";
  208. import "./chunk-GSSTTHIT.js";
  209. import "./chunk-YFSLJIO4.js";
  210. import "./chunk-IM3LVQXV.js";
  211. import "./chunk-55RWC67C.js";
  212. import "./chunk-HZRKBTHJ.js";
  213. import {
  214. U
  215. } from "./chunk-DVUG3KID.js";
  216. import {
  217. a
  218. } from "./chunk-FWSQEIAR.js";
  219. import {
  220. I,
  221. L
  222. } from "./chunk-VEGAOVMY.js";
  223. import {
  224. w,
  225. w2
  226. } from "./chunk-6T6G6LCQ.js";
  227. import "./chunk-YEJL5NEF.js";
  228. import {
  229. k2 as k
  230. } from "./chunk-PQFTYGF5.js";
  231. import {
  232. e,
  233. n5 as n,
  234. y3 as y
  235. } from "./chunk-2Z2TG5CU.js";
  236. import "./chunk-6KZ2LTDA.js";
  237. import "./chunk-U2XHEJM7.js";
  238. import "./chunk-SQOPWYIT.js";
  239. import "./chunk-V6P2MAQQ.js";
  240. import "./chunk-E5O6P5I2.js";
  241. import "./chunk-SPWQ3AWG.js";
  242. import "./chunk-2TIUKVZN.js";
  243. import {
  244. r,
  245. t
  246. } from "./chunk-YXWMMD76.js";
  247. import "./chunk-S5KM4IGW.js";
  248. // node_modules/@arcgis/core/views/support/imageReprojection.js
  249. var b2 = class {
  250. constructor(t2) {
  251. if (t2)
  252. this._ownsRctx = false, this._rctx = t2;
  253. else {
  254. if (b2._instance)
  255. return b2._instanceRefCount++, b2._instance;
  256. b2._instanceRefCount = 1, b2._instance = this, this._ownsRctx = true;
  257. const t3 = document.createElement("canvas").getContext("webgl");
  258. t3.getExtension("OES_texture_float"), this._rctx = new y2(t3, {});
  259. }
  260. const e2 = { applyProjection: true, bilinear: false, bicubic: false }, r2 = o("raster/reproject", "raster/reproject", /* @__PURE__ */ new Map([["a_position", 0]]), e2);
  261. this._program = this._rctx.programCache.acquire(r2.shaders.vertexShader, r2.shaders.fragmentShader, r2.attributes), this._rctx.useProgram(this._program), this._program.setUniform1f("u_opacity", 1), this._program.setUniform1i("u_image", 0), this._program.setUniform1i("u_flipY", 0), this._program.setUniform1i("u_transformGrid", 1), this._quad = new n2(this._rctx, [0, 0, 1, 0, 0, 1, 1, 1]);
  262. }
  263. reprojectTexture(t2, s, n3 = false) {
  264. const o2 = rn(t2.extent, s), m = new w({ x: (t2.extent.xmax - t2.extent.xmin) / t2.texture.descriptor.width, y: (t2.extent.ymax - t2.extent.ymin) / t2.texture.descriptor.height, spatialReference: t2.extent.spatialReference }), { x: l2, y: b3 } = C(m, s, t2.extent);
  265. let D2 = (l2 + b3) / 2;
  266. const T2 = Math.round((o2.xmax - o2.xmin) / D2), j3 = Math.round((o2.ymax - o2.ymin) / D2);
  267. D2 = (o2.width / T2 + o2.height / j3) / 2;
  268. const E2 = new w({ x: D2, y: D2, spatialReference: o2.spatialReference }), R2 = $({ projectedExtent: o2, srcBufferExtent: t2.extent, pixelSize: E2, hasWrapAround: true, spacing: [16, 16] }), C3 = c(this._rctx, R2), y4 = new E(this._rctx, { width: T2, height: j3, pixelFormat: P.RGBA, dataType: G.UNSIGNED_BYTE, wrapMode: D.CLAMP_TO_EDGE, samplingMode: L2.LINEAR, hasMipmap: false }), M = new x(this._rctx, { colorTarget: Y.TEXTURE, depthStencilTarget: V.NONE, width: T2, height: j3 }, y4);
  269. if (this._rctx.bindFramebuffer(M), this._rctx.setViewport(0, 0, T2, j3), this._rctx.useProgram(this._program), this._rctx.bindTexture(t2.texture, 0), this._rctx.bindTexture(C3, 1), this._quad.bind(), this._program.setUniform2f("u_srcImageSize", t2.texture.descriptor.width, t2.texture.descriptor.height), this._program.setUniform2fv("u_transformSpacing", R2.spacing), this._program.setUniform2fv("u_transformGridSize", R2.size), this._program.setUniform2f("u_targetImageSize", T2, j3), this._quad.draw(), this._quad.unbind(), this._rctx.useProgram(null), this._rctx.bindFramebuffer(null), C3.dispose(), n3) {
  270. const t3 = new ImageData(M.descriptor.width, M.descriptor.height);
  271. return M.readPixels(0, 0, M.descriptor.width, M.descriptor.height, P.RGBA, G.UNSIGNED_BYTE, t3.data), M.detachColorTexture(f2.COLOR_ATTACHMENT0), M.dispose(), { texture: y4, extent: o2, imageData: t3 };
  272. }
  273. return M.detachColorTexture(f2.COLOR_ATTACHMENT0), M.dispose(), { texture: y4, extent: o2 };
  274. }
  275. reprojectBitmapData(t2, e2) {
  276. const r2 = S(t2.bitmapData) ? T(t2.bitmapData) : t2.bitmapData, i3 = new E(this._rctx, { width: t2.bitmapData.width, height: t2.bitmapData.height, pixelFormat: P.RGBA, dataType: G.UNSIGNED_BYTE, wrapMode: D.CLAMP_TO_EDGE, samplingMode: L2.LINEAR, hasMipmap: false }, r2), a3 = this.reprojectTexture({ texture: i3, extent: t2.extent }, e2, true);
  277. a3.texture.dispose();
  278. const o2 = document.createElement("canvas");
  279. o2.width = a3.imageData.width, o2.height = a3.imageData.height;
  280. return o2.getContext("2d").putImageData(a3.imageData, 0, 0), { bitmapData: o2, extent: a3.extent };
  281. }
  282. async loadAndReprojectBitmapData(e2, r2, i3) {
  283. const a3 = (await U(e2, { responseType: "image" })).data, s = document.createElement("canvas");
  284. s.width = a3.width, s.height = a3.height;
  285. const n3 = s.getContext("2d");
  286. n3.drawImage(a3, 0, 0);
  287. const o2 = n3.getImageData(0, 0, s.width, s.height);
  288. if (r2.spatialReference.equals(i3))
  289. return { bitmapData: o2, extent: r2 };
  290. const m = this.reprojectBitmapData({ bitmapData: o2, extent: r2 }, i3);
  291. return { bitmapData: m.bitmapData, extent: m.extent };
  292. }
  293. destroy() {
  294. this._ownsRctx ? (b2._instanceRefCount--, 0 === b2._instanceRefCount && (this._quad.dispose(), this._program.dispose(), this._rctx.dispose(), b2._instance = null)) : (this._quad.dispose(), this._program.dispose());
  295. }
  296. };
  297. b2._instanceRefCount = 0;
  298. // node_modules/@arcgis/core/views/2d/layers/KMLLayerView2D.js
  299. var C2 = class {
  300. constructor() {
  301. this.allSublayers = /* @__PURE__ */ new Map(), this.allPoints = [], this.allPolylines = [], this.allPolygons = [], this.allMapImages = [];
  302. }
  303. };
  304. var j2 = class extends y3(u) {
  305. constructor() {
  306. super(...arguments), this._bitmapIndex = /* @__PURE__ */ new Map(), this._mapImageContainer = new a2(), this._kmlVisualData = new C2(), this.allVisiblePoints = new i(), this.allVisiblePolylines = new i(), this.allVisiblePolygons = new i(), this.allVisibleMapImages = new j();
  307. }
  308. async hitTest(e2, i3) {
  309. var _a, _b, _c;
  310. const t2 = this.layer;
  311. return [(_a = this._pointsView) == null ? void 0 : _a.hitTest(e2), (_b = this._polylinesView) == null ? void 0 : _b.hitTest(e2), (_c = this._polygonsView) == null ? void 0 : _c.hitTest(e2)].flat().filter(Boolean).map((i4) => (i4.layer = t2, i4.sourceLayer = t2, { type: "graphic", graphic: i4, layer: t2, mapPoint: e2 }));
  312. }
  313. update(e2) {
  314. this._polygonsView && this._polygonsView.processUpdate(e2), this._polylinesView && this._polylinesView.processUpdate(e2), this._pointsView && this._pointsView.processUpdate(e2);
  315. }
  316. attach() {
  317. this._fetchController = new AbortController(), this.container.addChild(this._mapImageContainer), this._polygonsView = new oe({ view: this.view, graphics: this.allVisiblePolygons, requestUpdateCallback: () => this.requestUpdate(), container: new i2(this.view.featuresTilingScheme) }), this.container.addChild(this._polygonsView.container), this._polylinesView = new oe({ view: this.view, graphics: this.allVisiblePolylines, requestUpdateCallback: () => this.requestUpdate(), container: new i2(this.view.featuresTilingScheme) }), this.container.addChild(this._polylinesView.container), this._pointsView = new oe({ view: this.view, graphics: this.allVisiblePoints, requestUpdateCallback: () => this.requestUpdate(), container: new i2(this.view.featuresTilingScheme) }), this.container.addChild(this._pointsView.container), this.handles.add([this.allVisibleMapImages.on("change", (e2) => {
  318. e2.added.forEach((e3) => this._addMapImage(e3)), e2.removed.forEach((e3) => this._removeMapImage(e3));
  319. }), l(() => this.layer.visibleSublayers, (e2) => {
  320. for (const [i3, t2] of this._kmlVisualData.allSublayers)
  321. t2.visibility = 0;
  322. for (const i3 of e2) {
  323. const e3 = this._kmlVisualData.allSublayers.get(i3.id);
  324. e3 && (e3.visibility = 1);
  325. }
  326. this._refreshCollections();
  327. })]), this.updatingHandles.addPromise(this._fetchService(this._fetchController.signal)), this._imageReprojector = new b2();
  328. }
  329. detach() {
  330. this._fetchController.abort(), this._fetchController = null, this._mapImageContainer.removeAllChildren(), this.container.removeAllChildren(), this._bitmapIndex.clear(), this._polygonsView && (this._polygonsView.destroy(), this._polygonsView = null), this._polylinesView && (this._polylinesView.destroy(), this._polylinesView = null), this._pointsView && (this._pointsView.destroy(), this._pointsView = null), this._imageReprojector && (this._imageReprojector.destroy(), this._imageReprojector = null);
  331. }
  332. moveStart() {
  333. }
  334. viewChange() {
  335. this._polygonsView.viewChange(), this._polylinesView.viewChange(), this._pointsView.viewChange();
  336. }
  337. moveEnd() {
  338. }
  339. isUpdating() {
  340. return this._pointsView.updating || this._polygonsView.updating || this._polylinesView.updating;
  341. }
  342. _addMapImage(e2) {
  343. (this.view.spatialReference.isWGS84 || this.view.spatialReference.isWebMercator) && this._imageReprojector.loadAndReprojectBitmapData(e2.href, w2.fromJSON(e2.extent), this.view.spatialReference).then((i3) => {
  344. const t2 = new R(i3.bitmapData, { immutable: false, requestRenderOnSourceChangedEnabled: true });
  345. t2.x = i3.extent.xmin, t2.y = i3.extent.ymax, t2.resolution = i3.extent.width / i3.bitmapData.width, t2.rotation = e2.rotation, this._mapImageContainer.addChild(t2), this._bitmapIndex.set(e2, t2);
  346. });
  347. }
  348. async _getViewDependentUrl(e2, t2) {
  349. const { viewFormat: o2, viewBoundScale: n3, httpQuery: h } = e2;
  350. if (r(o2)) {
  351. if (t(t2))
  352. throw new Error("Loading this network link requires a view state.");
  353. let y4;
  354. if (await tn(), r(n3) && 1 !== n3) {
  355. const e3 = new w2(t2.extent);
  356. e3.expand(n3), y4 = e3;
  357. } else
  358. y4 = t2.extent;
  359. y4 = rn(y4, k.WGS84);
  360. const g2 = rn(y4, k.WebMercator), w3 = y4.xmin, _ = y4.xmax, b3 = y4.ymin, V2 = y4.ymax, f3 = t2.size[0] * t2.pixelRatio, v = t2.size[1] * t2.pixelRatio, S2 = Math.max(g2.width, g2.height), I2 = { "[bboxWest]": w3.toString(), "[bboxEast]": _.toString(), "[bboxSouth]": b3.toString(), "[bboxNorth]": V2.toString(), "[lookatLon]": y4.center.x.toString(), "[lookatLat]": y4.center.y.toString(), "[lookatRange]": S2.toString(), "[lookatTilt]": "0", "[lookatHeading]": t2.rotation.toString(), "[lookatTerrainLon]": y4.center.x.toString(), "[lookatTerrainLat]": y4.center.y.toString(), "[lookatTerrainAlt]": "0", "[cameraLon]": y4.center.x.toString(), "[cameraLat]": y4.center.y.toString(), "[cameraAlt]": S2.toString(), "[horizFov]": "60", "[vertFov]": "60", "[horizPixels]": f3.toString(), "[vertPixels]": v.toString(), "[terrainEnabled]": "0", "[clientVersion]": a, "[kmlVersion]": "2.2", "[clientName]": "ArcGIS API for JavaScript", "[language]": "en-US" }, x2 = (e3) => {
  361. for (const i3 in e3)
  362. for (const t3 in I2)
  363. e3[i3] = e3[i3].replace(t3, I2[t3]);
  364. }, C3 = L(o2);
  365. x2(C3);
  366. let j3 = {};
  367. r(h) && (j3 = L(h), x2(j3));
  368. const k3 = f(e2.href);
  369. k3.query = { ...k3.query, ...C3, ...j3 };
  370. return `${k3.path}?${I(C3)}`;
  371. }
  372. return e2.href;
  373. }
  374. async _fetchService(e2) {
  375. const i3 = new C2();
  376. await this._loadVisualData(this.layer.url, i3, e2), this._kmlVisualData = i3, this._refreshCollections();
  377. }
  378. _refreshCollections() {
  379. this.allVisiblePoints.removeAll(), this.allVisiblePolylines.removeAll(), this.allVisiblePolygons.removeAll(), this.allVisibleMapImages.removeAll(), this.allVisiblePoints.addMany(this._kmlVisualData.allPoints.filter((e2) => this._isSublayerVisible(e2.sublayerId)).map(({ item: e2 }) => e2)), this.allVisiblePolylines.addMany(this._kmlVisualData.allPolylines.filter((e2) => this._isSublayerVisible(e2.sublayerId)).map(({ item: e2 }) => e2)), this.allVisiblePolygons.addMany(this._kmlVisualData.allPolygons.filter((e2) => this._isSublayerVisible(e2.sublayerId)).map(({ item: e2 }) => e2)), this.allVisibleMapImages.addMany(this._kmlVisualData.allMapImages.filter((e2) => this._isSublayerVisible(e2.sublayerId)).map(({ item: e2 }) => e2));
  380. }
  381. _isSublayerVisible(e2) {
  382. const i3 = this._kmlVisualData.allSublayers.get(e2);
  383. return !!i3.visibility && (-1 === i3.parentFolderId || this._isSublayerVisible(i3.parentFolderId));
  384. }
  385. _loadVisualData(e2, i3, t2) {
  386. return this._fetchParsedKML(e2, t2).then(async (e3) => {
  387. for (const s of e3.sublayers) {
  388. i3.allSublayers.set(s.id, s);
  389. const e4 = s.points ? await b(s.points) : [], a3 = s.polylines ? await b(s.polylines) : [], o2 = s.polygons ? await b(s.polygons) : [], l2 = s.mapImages || [];
  390. if (i3.allPoints.push(...e4.map((e5) => ({ item: e5, sublayerId: s.id }))), i3.allPolylines.push(...a3.map((e5) => ({ item: e5, sublayerId: s.id }))), i3.allPolygons.push(...o2.map((e5) => ({ item: e5, sublayerId: s.id }))), i3.allMapImages.push(...l2.map((e5) => ({ item: e5, sublayerId: s.id }))), s.networkLink) {
  391. const e5 = await this._getViewDependentUrl(s.networkLink, this.view.state);
  392. await this._loadVisualData(e5, i3, t2);
  393. }
  394. }
  395. });
  396. }
  397. _fetchParsedKML(e2, i3) {
  398. return g(e2, this.layer.spatialReference, this.layer.refreshInterval, i3).then((e3) => d(e3.data));
  399. }
  400. _removeMapImage(e2) {
  401. const i3 = this._bitmapIndex.get(e2);
  402. i3 && (this._mapImageContainer.removeChild(i3), this._bitmapIndex.delete(e2));
  403. }
  404. };
  405. e([y()], j2.prototype, "_pointsView", void 0), e([y()], j2.prototype, "_polylinesView", void 0), e([y()], j2.prototype, "_polygonsView", void 0), e([y()], j2.prototype, "updating", void 0), j2 = e([n("esri.views.2d.layers.KMLLayerView2D")], j2);
  406. var k2 = j2;
  407. export {
  408. k2 as default
  409. };
  410. //# sourceMappingURL=KMLLayerView2D-I5FS4ELA.js.map