TileLayerView2D-57S53H76.js 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. import {
  2. n as n2,
  3. o,
  4. t
  5. } from "./chunk-QPTNFAIA.js";
  6. import {
  7. a,
  8. s as s3
  9. } from "./chunk-6XX7OZ2W.js";
  10. import {
  11. i
  12. } from "./chunk-MQOWDNF7.js";
  13. import {
  14. u,
  15. y as y3
  16. } from "./chunk-ZOTXRPGC.js";
  17. import "./chunk-TVRLP2HY.js";
  18. import "./chunk-QQTL25WV.js";
  19. import "./chunk-J2PY6ANL.js";
  20. import "./chunk-MH3GGTFP.js";
  21. import "./chunk-2ZACOQZJ.js";
  22. import "./chunk-JBMHQ5RK.js";
  23. import "./chunk-WBWQJQK4.js";
  24. import "./chunk-DBT4KOKX.js";
  25. import "./chunk-2GP5D74I.js";
  26. import "./chunk-SCZJ2KEY.js";
  27. import "./chunk-EPMXCACW.js";
  28. import "./chunk-T2SKWJGU.js";
  29. import "./chunk-UO3LS2M5.js";
  30. import "./chunk-H2VOWDMO.js";
  31. import "./chunk-QISOH77W.js";
  32. import "./chunk-UWKVAZQ6.js";
  33. import "./chunk-3WXSWAUV.js";
  34. import "./chunk-27YO3FKC.js";
  35. import "./chunk-EQNT4A7P.js";
  36. import "./chunk-XO5VJRK4.js";
  37. import "./chunk-4OM3EX6P.js";
  38. import "./chunk-3OFVLRSL.js";
  39. import "./chunk-IQBIGNPU.js";
  40. import "./chunk-K7B6OWCU.js";
  41. import {
  42. r as r2
  43. } from "./chunk-BPRMPSTX.js";
  44. import {
  45. y as y2
  46. } from "./chunk-PQGNKUMB.js";
  47. import "./chunk-UDYHZLTE.js";
  48. import "./chunk-DGINNG7Z.js";
  49. import {
  50. h
  51. } from "./chunk-KK6FUQQU.js";
  52. import "./chunk-JQUWFKNU.js";
  53. import "./chunk-RWQH5X3O.js";
  54. import "./chunk-6334AFGG.js";
  55. import {
  56. e as e2
  57. } from "./chunk-TFHLTN6F.js";
  58. import "./chunk-4VZNS7N2.js";
  59. import "./chunk-O3JQY77G.js";
  60. import "./chunk-E3G7BRZB.js";
  61. import "./chunk-EDHROVWI.js";
  62. import "./chunk-3IRT3YKJ.js";
  63. import "./chunk-RDMCXRET.js";
  64. import "./chunk-PJNBFKPF.js";
  65. import "./chunk-C7742RNZ.js";
  66. import {
  67. l
  68. } from "./chunk-BWATQC2Y.js";
  69. import "./chunk-3WQOA5CB.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 "./chunk-X4SA4ELJ.js";
  77. import "./chunk-PE24J2I5.js";
  78. import "./chunk-AUOH2VSO.js";
  79. import "./chunk-ZYRIJWLX.js";
  80. import "./chunk-RYY6632W.js";
  81. import "./chunk-DW42UVIT.js";
  82. import "./chunk-TJNOJH33.js";
  83. import "./chunk-YAEIHDJH.js";
  84. import "./chunk-OSHI574D.js";
  85. import "./chunk-44GMIOGP.js";
  86. import "./chunk-75U5LM2V.js";
  87. import "./chunk-ZHRAUKVQ.js";
  88. import "./chunk-RZK6A2GY.js";
  89. import "./chunk-4NQ74ZR6.js";
  90. import "./chunk-X4LLOW7U.js";
  91. import "./chunk-Z4JTBD7M.js";
  92. import "./chunk-MSBIHK67.js";
  93. import "./chunk-HZRKBTHJ.js";
  94. import "./chunk-CXCDYJ5R.js";
  95. import "./chunk-GAOW3WRZ.js";
  96. import {
  97. E as E2
  98. } from "./chunk-QCKFNSN2.js";
  99. import {
  100. e,
  101. n5 as n,
  102. y3 as y
  103. } from "./chunk-6SOHRC7T.js";
  104. import "./chunk-U2XHEJM7.js";
  105. import "./chunk-SQOPWYIT.js";
  106. import "./chunk-6KZ2LTDA.js";
  107. import {
  108. E,
  109. j
  110. } from "./chunk-V6P2MAQQ.js";
  111. import {
  112. s2 as s,
  113. s3 as s2
  114. } from "./chunk-E5O6P5I2.js";
  115. import "./chunk-SPWQ3AWG.js";
  116. import "./chunk-2TIUKVZN.js";
  117. import {
  118. r
  119. } from "./chunk-YXWMMD76.js";
  120. import "./chunk-S5KM4IGW.js";
  121. // node_modules/@arcgis/core/views/layers/TileLayerView.js
  122. var i2 = (i3) => {
  123. let c = class extends i3 {
  124. async fetchPopupFeatures(e3, s4) {
  125. const { layer: a2 } = this;
  126. if (!e3)
  127. throw new s2("tilelayerview:fetchPopupFeatures", "Nothing to fetch without area", { layer: a2 });
  128. if ("tile" !== a2.type)
  129. throw new s2("tilelayerview:fetchPopupFeatures", "Layer type should be 'tile'", { type: a2.type });
  130. const i4 = this.get("view.scale"), c2 = a2.allSublayers.toArray().filter((e4) => {
  131. const r3 = 0 === e4.minScale || i4 <= e4.minScale, t2 = 0 === e4.maxScale || i4 >= e4.maxScale;
  132. return e4.popupTemplate && e4.popupEnabled && e4.visible && r3 && t2;
  133. });
  134. return E(c2.map(async (r3) => {
  135. const o2 = r3.createQuery(), a3 = r(s4) ? s4.event : null, i5 = s3({ renderer: r3.renderer, event: a3 });
  136. o2.geometry = this.createFetchPopupFeaturesQueryGeometry(e3, i5), o2.outFields = await r3.popupTemplate.getRequiredFields();
  137. return (await r3.queryFeatures(o2)).features;
  138. })).then((e4) => [].concat(...e4.map((e5) => e5.value).filter(Boolean)));
  139. }
  140. };
  141. return e([y()], c.prototype, "layer", void 0), c = e([n("esri.layers.mixins.TileLayerView")], c), c;
  142. };
  143. // node_modules/@arcgis/core/views/2d/layers/TileLayerView2D.js
  144. var _ = [0, 0];
  145. var I = class extends i2(i(t(y3(u)))) {
  146. constructor() {
  147. super(...arguments), this._tileStrategy = null, this._fetchQueue = null, this.layer = null;
  148. }
  149. get resampling() {
  150. return !("resampling" in this.layer) || false !== this.layer.resampling;
  151. }
  152. update(e3) {
  153. this._fetchQueue.pause(), this._fetchQueue.state = e3.state, this._tileStrategy.update(e3), this._fetchQueue.resume();
  154. }
  155. attach() {
  156. const e3 = "tileServers" in this.layer ? this.layer.tileServers : null;
  157. this._tileInfoView = new h(this.layer.tileInfo, this.layer.fullExtent), this._fetchQueue = new y2({ tileInfoView: this._tileInfoView, concurrency: e3 && 10 * e3.length || 10, process: (e4, t2) => this.fetchTile(e4, t2) }), 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, () => {
  158. this.doRefresh();
  159. })), super.attach();
  160. }
  161. detach() {
  162. super.detach(), this._tileStrategy.destroy(), this._fetchQueue.clear(), this.container.removeAllChildren(), this._fetchQueue = this._tileStrategy = this._tileInfoView = null;
  163. }
  164. moveStart() {
  165. this.requestUpdate();
  166. }
  167. viewChange() {
  168. this.requestUpdate();
  169. }
  170. moveEnd() {
  171. this.requestUpdate();
  172. }
  173. supportsSpatialReference(e3) {
  174. var _a;
  175. return E2((_a = this.layer.tileInfo) == null ? void 0 : _a.spatialReference, e3);
  176. }
  177. createFetchPopupFeaturesQueryGeometry(e3, t2) {
  178. return a(e3, t2, this.view);
  179. }
  180. async doRefresh() {
  181. !this.attached || this.updateRequested || this.suspended || (this._fetchQueue.reset(), this._tileStrategy.tiles.forEach((e3) => this._enqueueTileFetch(e3)));
  182. }
  183. isUpdating() {
  184. var _a, _b;
  185. return (_b = (_a = this._fetchQueue) == null ? void 0 : _a.updating) != null ? _b : false;
  186. }
  187. acquireTile(e3) {
  188. const t2 = this._bitmapView.createTile(e3), i3 = t2.bitmap;
  189. return [i3.x, i3.y] = this._tileInfoView.getTileCoords(_, t2.key), i3.resolution = this._tileInfoView.getTileResolution(t2.key), [i3.width, i3.height] = this._tileInfoView.tileInfo.size, this._enqueueTileFetch(t2), this._bitmapView.addChild(t2), this.requestUpdate(), t2;
  190. }
  191. releaseTile(e3) {
  192. this._fetchQueue.abort(e3.key.id), this._bitmapView.removeChild(e3), e3.once("detach", () => e3.destroy()), this.requestUpdate();
  193. }
  194. async fetchTile(e3, t2 = {}) {
  195. const s4 = "tilemapCache" in this.layer ? this.layer.tilemapCache : null, { signal: r3, resamplingLevel: a2 = 0 } = t2;
  196. if (!s4)
  197. try {
  198. return await this._fetchImage(e3, r3);
  199. } catch (h2) {
  200. if (!j(h2) && !this.resampling)
  201. return o(this._tileInfoView.tileInfo.size);
  202. if (a2 < 3) {
  203. const i3 = this._tileInfoView.getTileParentId(e3.id);
  204. if (i3) {
  205. const s5 = new e2(i3), r4 = await this.fetchTile(s5, { ...t2, resamplingLevel: a2 + 1 });
  206. return n2(this._tileInfoView, r4, s5, e3);
  207. }
  208. }
  209. throw h2;
  210. }
  211. const l2 = new e2(0, 0, 0, 0);
  212. let o2;
  213. try {
  214. if (await s4.fetchAvailabilityUpsample(e3.level, e3.row, e3.col, l2, { signal: r3 }), l2.level !== e3.level && !this.resampling)
  215. return o(this._tileInfoView.tileInfo.size);
  216. o2 = await this._fetchImage(l2, r3);
  217. } catch (h2) {
  218. if (j(h2))
  219. throw h2;
  220. o2 = await this._fetchImage(e3, r3);
  221. }
  222. return this.resampling ? n2(this._tileInfoView, o2, l2, e3) : o2;
  223. }
  224. async _enqueueTileFetch(e3) {
  225. if (!this._fetchQueue.has(e3.key.id)) {
  226. try {
  227. const t2 = await this._fetchQueue.push(e3.key);
  228. e3.bitmap.source = t2, e3.bitmap.width = this._tileInfoView.tileInfo.size[0], e3.bitmap.height = this._tileInfoView.tileInfo.size[1], e3.once("attach", () => this.requestUpdate());
  229. } catch (s4) {
  230. j(s4) || s.getLogger(this.declaredClass).error(s4);
  231. }
  232. this.requestUpdate();
  233. }
  234. }
  235. async _fetchImage(e3, t2) {
  236. return this.layer.fetchImageBitmapTile(e3.level, e3.row, e3.col, { signal: t2 });
  237. }
  238. };
  239. e([y()], I.prototype, "_fetchQueue", void 0), e([y()], I.prototype, "resampling", null), I = e([n("esri.views.2d.layers.TileLayerView2D")], I);
  240. var V = I;
  241. export {
  242. V as default
  243. };
  244. //# sourceMappingURL=TileLayerView2D-57S53H76.js.map