TileLayerView2D-ORYKMEJR.js 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. import {
  2. n as n2,
  3. o,
  4. r as r3
  5. } from "./chunk-22J3OQXH.js";
  6. import {
  7. a,
  8. s as s3
  9. } from "./chunk-RZPC4VQ3.js";
  10. import "./chunk-W4JJD2VH.js";
  11. import "./chunk-6G6XHVK2.js";
  12. import "./chunk-TWB5CT7V.js";
  13. import "./chunk-H3QCF24A.js";
  14. import {
  15. i
  16. } from "./chunk-EAUVYZHD.js";
  17. import {
  18. f,
  19. u
  20. } from "./chunk-MNZXIBJ7.js";
  21. import "./chunk-YJKEIUMW.js";
  22. import "./chunk-JH3PLIM6.js";
  23. import "./chunk-FCDUTNBY.js";
  24. import "./chunk-LL6JU3GU.js";
  25. import "./chunk-ZIWBDWEW.js";
  26. import "./chunk-IQNZZCQJ.js";
  27. import "./chunk-Q4LKAPDF.js";
  28. import "./chunk-TODU7HVH.js";
  29. import "./chunk-23ONSYIH.js";
  30. import "./chunk-3T4BXU2T.js";
  31. import "./chunk-YLVXZ2PS.js";
  32. import "./chunk-EE6TL7XD.js";
  33. import "./chunk-GDB2KX4Y.js";
  34. import "./chunk-546QCRS4.js";
  35. import "./chunk-QXZVBSBH.js";
  36. import "./chunk-773XI6MQ.js";
  37. import "./chunk-WFSV2B2I.js";
  38. import "./chunk-J525NRN3.js";
  39. import "./chunk-MI7HWWFL.js";
  40. import "./chunk-ZHRMTKME.js";
  41. import {
  42. r as r2
  43. } from "./chunk-PCGDLSZ4.js";
  44. import {
  45. p
  46. } from "./chunk-CAYFEZCR.js";
  47. import "./chunk-MFFE4I2S.js";
  48. import "./chunk-LMCIAW5S.js";
  49. import {
  50. h
  51. } from "./chunk-OTS3UE5B.js";
  52. import "./chunk-6RAL4JPQ.js";
  53. import "./chunk-LGW7TID4.js";
  54. import "./chunk-3OHML7FO.js";
  55. import "./chunk-G5AI6ZNE.js";
  56. import {
  57. e as e2
  58. } from "./chunk-FIYKFRB2.js";
  59. import "./chunk-FYNVVMWY.js";
  60. import "./chunk-Q52DVFYK.js";
  61. import "./chunk-HBMVUVZX.js";
  62. import "./chunk-CRGVDJI6.js";
  63. import "./chunk-6P6NA7JB.js";
  64. import "./chunk-XLV7RUSE.js";
  65. import "./chunk-NTUXR253.js";
  66. import "./chunk-RMX2AZ4P.js";
  67. import "./chunk-NE3ESGA6.js";
  68. import {
  69. l
  70. } from "./chunk-YIS6BAC3.js";
  71. import "./chunk-7XXXCK2A.js";
  72. import "./chunk-WJW5DUN6.js";
  73. import "./chunk-PJ7ZQ4VD.js";
  74. import "./chunk-WDLTDV2L.js";
  75. import "./chunk-TERAW6FT.js";
  76. import "./chunk-N2663GRX.js";
  77. import "./chunk-O4FY3ITT.js";
  78. import "./chunk-WEMIK25H.js";
  79. import "./chunk-7N4X6GF3.js";
  80. import "./chunk-JXW4QTJA.js";
  81. import "./chunk-UXF37FQ4.js";
  82. import "./chunk-ZOEK6QHJ.js";
  83. import "./chunk-XNLG7T2T.js";
  84. import "./chunk-IR4PV7VK.js";
  85. import "./chunk-2Z6LERTI.js";
  86. import "./chunk-OWVBLVP3.js";
  87. import "./chunk-AFZ7XSEW.js";
  88. import "./chunk-YBSUITLL.js";
  89. import "./chunk-ALDCDSPV.js";
  90. import "./chunk-DT6EAZQ5.js";
  91. import "./chunk-HNOZUNJ4.js";
  92. import "./chunk-PDKDCAAD.js";
  93. import "./chunk-ECW2QABR.js";
  94. import "./chunk-GCDJLKH4.js";
  95. import {
  96. E as E2
  97. } from "./chunk-MRJEICT6.js";
  98. import {
  99. d,
  100. e,
  101. n2 as n
  102. } from "./chunk-Y3WMVFTW.js";
  103. import "./chunk-SAS7RONY.js";
  104. import "./chunk-WSRBH7BF.js";
  105. import "./chunk-IHXECKQQ.js";
  106. import {
  107. E,
  108. g
  109. } from "./chunk-ULGDPLM2.js";
  110. import {
  111. s,
  112. s3 as s2
  113. } from "./chunk-EMJ4ZSM2.js";
  114. import "./chunk-IKP3YN53.js";
  115. import {
  116. r
  117. } from "./chunk-GZT4BVFP.js";
  118. import "./chunk-A5ICIBVI.js";
  119. // node_modules/@arcgis/core/views/layers/TileLayerView.js
  120. var i2 = (i3) => {
  121. let c = class extends i3 {
  122. async fetchPopupFeatures(e3, s4) {
  123. const { layer: a2 } = this;
  124. if (!e3)
  125. throw new s2("tilelayerview:fetchPopupFeatures", "Nothing to fetch without area", { layer: a2 });
  126. if (a2.type !== "tile")
  127. throw new s2("tilelayerview:fetchPopupFeatures", "Layer type should be 'tile'", { type: a2.type });
  128. const i4 = this.get("view.scale"), c2 = a2.allSublayers.toArray().filter((e4) => {
  129. const r4 = e4.minScale === 0 || i4 <= e4.minScale, t = e4.maxScale === 0 || i4 >= e4.maxScale;
  130. return e4.popupTemplate && e4.popupEnabled && e4.visible && r4 && t;
  131. });
  132. return E(c2.map(async (r4) => {
  133. const o2 = r4.createQuery(), a3 = r(s4) ? s4.event : null, i5 = s3({ renderer: r4.renderer, event: a3 });
  134. o2.geometry = this.createFetchPopupFeaturesQueryGeometry(e3, i5), o2.outFields = await r4.popupTemplate.getRequiredFields();
  135. return (await r4.queryFeatures(o2)).features;
  136. })).then((e4) => [].concat(...e4.map((e5) => e5.value).filter(Boolean)));
  137. }
  138. };
  139. return e([d()], c.prototype, "layer", void 0), c = e([n("esri.layers.mixins.TileLayerView")], c), c;
  140. };
  141. // node_modules/@arcgis/core/views/2d/layers/TileLayerView2D.js
  142. var _ = [0, 0];
  143. var I = class extends i2(i(r3(f(u)))) {
  144. constructor() {
  145. super(...arguments), this._tileStrategy = null, this._fetchQueue = null, this.layer = null;
  146. }
  147. get resampling() {
  148. return !("resampling" in this.layer) || this.layer.resampling !== false;
  149. }
  150. update(e3) {
  151. this._fetchQueue.pause(), this._fetchQueue.state = e3.state, this._tileStrategy.update(e3), this._fetchQueue.resume();
  152. }
  153. attach() {
  154. const e3 = "tileServers" in this.layer ? this.layer.tileServers : null;
  155. this._tileInfoView = new h(this.layer.tileInfo, this.layer.fullExtent), this._fetchQueue = new p({ tileInfoView: this._tileInfoView, concurrency: e3 && 10 * e3.length || 10, process: (e4, t) => this.fetchTile(e4, t) }), this._tileStrategy = new r2({ cachePolicy: "keep", resampling: this.resampling, acquireTile: (e4) => this.acquireTile(e4), releaseTile: (e4) => this.releaseTile(e4), tileInfoView: this._tileInfoView }), this.requestUpdate(), this.handles.add(l(() => this.resampling, () => {
  156. this.doRefresh();
  157. })), super.attach();
  158. }
  159. detach() {
  160. super.detach(), this._tileStrategy.destroy(), this._fetchQueue.clear(), this.container.removeAllChildren(), this._fetchQueue = this._tileStrategy = this._tileInfoView = null;
  161. }
  162. moveStart() {
  163. this.requestUpdate();
  164. }
  165. viewChange() {
  166. this.requestUpdate();
  167. }
  168. moveEnd() {
  169. this.requestUpdate();
  170. }
  171. supportsSpatialReference(e3) {
  172. return E2(this.layer.tileInfo?.spatialReference, e3);
  173. }
  174. createFetchPopupFeaturesQueryGeometry(e3, t) {
  175. return a(e3, t, this.view);
  176. }
  177. async doRefresh() {
  178. this.updateRequested || this.suspended || (this._fetchQueue.reset(), this._tileStrategy.tiles.forEach((e3) => this._enqueueTileFetch(e3)));
  179. }
  180. isUpdating() {
  181. return this._fetchQueue?.updating ?? false;
  182. }
  183. acquireTile(e3) {
  184. const t = this._bitmapView.createTile(e3), i3 = t.bitmap;
  185. return [i3.x, i3.y] = this._tileInfoView.getTileCoords(_, t.key), i3.resolution = this._tileInfoView.getTileResolution(t.key), [i3.width, i3.height] = this._tileInfoView.tileInfo.size, this._enqueueTileFetch(t), this._bitmapView.addChild(t), this.requestUpdate(), t;
  186. }
  187. releaseTile(e3) {
  188. this._fetchQueue.abort(e3.key.id), this._bitmapView.removeChild(e3), e3.once("detach", () => e3.destroy()), this.requestUpdate();
  189. }
  190. async fetchTile(e3, t = {}) {
  191. const s4 = "tilemapCache" in this.layer ? this.layer.tilemapCache : null, { signal: r4, resamplingLevel: l2 = 0 } = t;
  192. if (!s4)
  193. try {
  194. return await this._fetchImage(e3, r4);
  195. } catch (h2) {
  196. if (!g(h2) && !this.resampling)
  197. return o(this._tileInfoView.tileInfo.size);
  198. if (l2 < 3) {
  199. const i3 = this._tileInfoView.getTileParentId(e3.id);
  200. if (i3) {
  201. const s5 = new e2(i3), r5 = await this.fetchTile(s5, { ...t, resamplingLevel: l2 + 1 });
  202. return n2(this._tileInfoView, r5, s5, e3);
  203. }
  204. }
  205. throw h2;
  206. }
  207. const a2 = new e2(0, 0, 0, 0);
  208. let o2;
  209. try {
  210. if (await s4.fetchAvailabilityUpsample(e3.level, e3.row, e3.col, a2, { signal: r4 }), a2.level !== e3.level && !this.resampling)
  211. return o(this._tileInfoView.tileInfo.size);
  212. o2 = await this._fetchImage(a2, r4);
  213. } catch (h2) {
  214. if (g(h2))
  215. throw h2;
  216. o2 = await this._fetchImage(e3, r4);
  217. }
  218. return this.resampling ? n2(this._tileInfoView, o2, a2, e3) : o2;
  219. }
  220. async _enqueueTileFetch(e3) {
  221. if (!this._fetchQueue.has(e3.key.id)) {
  222. try {
  223. const t = await this._fetchQueue.push(e3.key);
  224. e3.bitmap.source = t, e3.bitmap.width = this._tileInfoView.tileInfo.size[0], e3.bitmap.height = this._tileInfoView.tileInfo.size[1], e3.once("attach", () => this.requestUpdate());
  225. } catch (s4) {
  226. g(s4) || s.getLogger(this.declaredClass).error(s4);
  227. }
  228. this.requestUpdate();
  229. }
  230. }
  231. async _fetchImage(e3, t) {
  232. return this.layer.fetchTile(e3.level, e3.row, e3.col, { signal: t });
  233. }
  234. };
  235. e([d()], I.prototype, "_fetchQueue", void 0), e([d()], I.prototype, "resampling", null), I = e([n("esri.views.2d.layers.TileLayerView2D")], I);
  236. var V = I;
  237. export {
  238. V as default
  239. };
  240. //# sourceMappingURL=TileLayerView2D-ORYKMEJR.js.map