ImageryTileLayerView2D-SIAMUTWD.js 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734
  1. import {
  2. d as d3,
  3. y as y4
  4. } from "./chunk-3HF3HY4M.js";
  5. import {
  6. r as r4
  7. } from "./chunk-T6DJ6UAT.js";
  8. import {
  9. i as i3
  10. } from "./chunk-MQOWDNF7.js";
  11. import {
  12. u as u3,
  13. y as y3
  14. } from "./chunk-ZOTXRPGC.js";
  15. import {
  16. i as i2,
  17. r as r3
  18. } from "./chunk-J2PY6ANL.js";
  19. import {
  20. d as d2,
  21. n3 as n2,
  22. p
  23. } from "./chunk-MH3GGTFP.js";
  24. import "./chunk-2ZACOQZJ.js";
  25. import "./chunk-JBMHQ5RK.js";
  26. import {
  27. a,
  28. f,
  29. g as g4,
  30. u as u2
  31. } from "./chunk-DEU444AC.js";
  32. import {
  33. m
  34. } from "./chunk-NWNFS4JJ.js";
  35. import "./chunk-WBWQJQK4.js";
  36. import {
  37. s as s5
  38. } from "./chunk-F2YXWZUP.js";
  39. import "./chunk-DBT4KOKX.js";
  40. import "./chunk-2GP5D74I.js";
  41. import {
  42. J,
  43. U as U2,
  44. ie,
  45. v
  46. } from "./chunk-BQIDHLG4.js";
  47. import {
  48. j as j3
  49. } from "./chunk-NSDRZKZG.js";
  50. import {
  51. g as g2,
  52. s as s4
  53. } from "./chunk-SCZJ2KEY.js";
  54. import "./chunk-EPMXCACW.js";
  55. import "./chunk-T2SKWJGU.js";
  56. import "./chunk-UO3LS2M5.js";
  57. import "./chunk-H2VOWDMO.js";
  58. import "./chunk-QISOH77W.js";
  59. import "./chunk-UWKVAZQ6.js";
  60. import "./chunk-3WXSWAUV.js";
  61. import "./chunk-27YO3FKC.js";
  62. import {
  63. I
  64. } from "./chunk-EQNT4A7P.js";
  65. import "./chunk-XO5VJRK4.js";
  66. import "./chunk-4OM3EX6P.js";
  67. import "./chunk-3OFVLRSL.js";
  68. import {
  69. mt
  70. } from "./chunk-KUWFZDWB.js";
  71. import {
  72. l as l2
  73. } from "./chunk-YFDOPEEZ.js";
  74. import {
  75. e as e3
  76. } from "./chunk-IQBIGNPU.js";
  77. import "./chunk-AJFR3FGC.js";
  78. import "./chunk-K7B6OWCU.js";
  79. import "./chunk-TFW2HQCV.js";
  80. import {
  81. r as r2
  82. } from "./chunk-BPRMPSTX.js";
  83. import {
  84. y as y2
  85. } from "./chunk-PQGNKUMB.js";
  86. import "./chunk-RG3AHHRL.js";
  87. import "./chunk-UDYHZLTE.js";
  88. import "./chunk-DGINNG7Z.js";
  89. import {
  90. h as h2
  91. } from "./chunk-KK6FUQQU.js";
  92. import "./chunk-JQUWFKNU.js";
  93. import "./chunk-RWQH5X3O.js";
  94. import "./chunk-6334AFGG.js";
  95. import "./chunk-TFHLTN6F.js";
  96. import "./chunk-4VZNS7N2.js";
  97. import {
  98. i,
  99. s as s3
  100. } from "./chunk-O3JQY77G.js";
  101. import "./chunk-VYQHMPYW.js";
  102. import "./chunk-E3G7BRZB.js";
  103. import "./chunk-EDHROVWI.js";
  104. import "./chunk-3IRT3YKJ.js";
  105. import "./chunk-SOSOZIX6.js";
  106. import {
  107. g
  108. } from "./chunk-KJZ6SS3P.js";
  109. import "./chunk-OER54WCN.js";
  110. import "./chunk-HOCLACFL.js";
  111. import "./chunk-3MLCBRBA.js";
  112. import "./chunk-WTRZAXRY.js";
  113. import "./chunk-YMULPZCD.js";
  114. import {
  115. d
  116. } from "./chunk-RDMCXRET.js";
  117. import "./chunk-NKMX5M3L.js";
  118. import "./chunk-PJNBFKPF.js";
  119. import "./chunk-C7742RNZ.js";
  120. import "./chunk-VLG7MMVR.js";
  121. import "./chunk-TV3CFJQR.js";
  122. import {
  123. U,
  124. h,
  125. l,
  126. w
  127. } from "./chunk-BWATQC2Y.js";
  128. import {
  129. j as j2
  130. } from "./chunk-6URCZZA6.js";
  131. import "./chunk-U2WD23Z5.js";
  132. import {
  133. g as g3
  134. } from "./chunk-KG45D2XL.js";
  135. import "./chunk-3HZQM2NK.js";
  136. import "./chunk-AR2YN3E2.js";
  137. import "./chunk-U3LEOWJX.js";
  138. import "./chunk-4ONPMX2F.js";
  139. import "./chunk-47NSA4T4.js";
  140. import "./chunk-FUODOQDM.js";
  141. import "./chunk-3WQOA5CB.js";
  142. import "./chunk-FZQZIM7U.js";
  143. import "./chunk-CZBRZ6SU.js";
  144. import "./chunk-VGWC3IKZ.js";
  145. import {
  146. u
  147. } from "./chunk-SWMSD4RP.js";
  148. import "./chunk-UKEN2UNL.js";
  149. import "./chunk-UVVU4UUO.js";
  150. import "./chunk-X4SA4ELJ.js";
  151. import "./chunk-XJCUT65M.js";
  152. import "./chunk-PE24J2I5.js";
  153. import "./chunk-P3XKUGLS.js";
  154. import "./chunk-U7RKABRB.js";
  155. import "./chunk-X7CNGECX.js";
  156. import "./chunk-PSEI52P3.js";
  157. import "./chunk-ZLNEXZAN.js";
  158. import "./chunk-5UVJ64RB.js";
  159. import "./chunk-AUOH2VSO.js";
  160. import "./chunk-ZYRIJWLX.js";
  161. import "./chunk-RYY6632W.js";
  162. import "./chunk-DW42UVIT.js";
  163. import "./chunk-TJNOJH33.js";
  164. import "./chunk-YAEIHDJH.js";
  165. import "./chunk-OSHI574D.js";
  166. import "./chunk-44GMIOGP.js";
  167. import "./chunk-75U5LM2V.js";
  168. import "./chunk-ZHRAUKVQ.js";
  169. import "./chunk-RZK6A2GY.js";
  170. import "./chunk-4NQ74ZR6.js";
  171. import "./chunk-X4LLOW7U.js";
  172. import "./chunk-BDA6VH2A.js";
  173. import "./chunk-Z4JTBD7M.js";
  174. import "./chunk-MSBIHK67.js";
  175. import "./chunk-HZRKBTHJ.js";
  176. import "./chunk-5DMBXPN2.js";
  177. import "./chunk-QANZ6BFY.js";
  178. import "./chunk-VEGAOVMY.js";
  179. import {
  180. w as w2,
  181. w2 as w3
  182. } from "./chunk-CXCDYJ5R.js";
  183. import "./chunk-GAOW3WRZ.js";
  184. import "./chunk-QCKFNSN2.js";
  185. import {
  186. e,
  187. n5 as n,
  188. y3 as y
  189. } from "./chunk-6SOHRC7T.js";
  190. import "./chunk-U2XHEJM7.js";
  191. import "./chunk-SQOPWYIT.js";
  192. import "./chunk-6KZ2LTDA.js";
  193. import {
  194. E,
  195. j,
  196. x
  197. } from "./chunk-V6P2MAQQ.js";
  198. import {
  199. s2 as s,
  200. s3 as s2
  201. } from "./chunk-E5O6P5I2.js";
  202. import "./chunk-SPWQ3AWG.js";
  203. import "./chunk-2TIUKVZN.js";
  204. import {
  205. e as e2,
  206. r,
  207. t
  208. } from "./chunk-YXWMMD76.js";
  209. import "./chunk-S5KM4IGW.js";
  210. // node_modules/@arcgis/core/views/2d/engine/imagery/RasterTile.js
  211. var i4 = class extends r3 {
  212. constructor(t2, e4, i5, r6, a2, n6, m2 = null) {
  213. super(t2, e4, i5, r6, a2, n6), this.bitmap = new p(m2, null, null), this.bitmap.coordScale = [a2, n6], this.bitmap.once("isReady", () => this.ready());
  214. }
  215. destroy() {
  216. super.destroy(), this.bitmap.destroy(), this.bitmap = null, this.stage = null;
  217. }
  218. set stencilRef(t2) {
  219. this.bitmap.stencilRef = t2;
  220. }
  221. get stencilRef() {
  222. return this.bitmap.stencilRef;
  223. }
  224. setTransform(t2) {
  225. super.setTransform(t2), this.bitmap.transforms.dvs = this.transforms.dvs;
  226. }
  227. _createTransforms() {
  228. return { dvs: e3(), tileMat3: e3() };
  229. }
  230. onAttach() {
  231. this.bitmap.stage = this.stage;
  232. }
  233. onDetach() {
  234. this.bitmap.stage = null;
  235. }
  236. };
  237. // node_modules/@arcgis/core/views/2d/engine/imagery/RasterTileContainer.js
  238. var n3 = class extends i2 {
  239. constructor() {
  240. super(...arguments), this.isCustomTilingScheme = false;
  241. }
  242. createTile(e4) {
  243. const s6 = this._getTileBounds(e4), [i5, r6] = this._tileInfoView.tileInfo.size, o2 = this._tileInfoView.getTileResolution(e4.level);
  244. return new i4(e4, o2, s6[0], s6[3], i5, r6);
  245. }
  246. prepareRenderPasses(e4) {
  247. const s6 = e4.registerRenderPass({ name: "imagery (tile)", brushes: [n2.raster], target: () => this.children.map((e5) => e5.bitmap), drawPhase: I.MAP });
  248. return [...super.prepareRenderPasses(e4), s6];
  249. }
  250. doRender(e4) {
  251. this.visible && e4.drawPhase === I.MAP && super.doRender(e4);
  252. }
  253. _getTileBounds(i5) {
  254. const t2 = this._tileInfoView.getTileBounds(u(), i5);
  255. if (this.isCustomTilingScheme && i5.world) {
  256. const { tileInfo: e4 } = this._tileInfoView, r6 = mt(e4.spatialReference);
  257. if (r6) {
  258. const { resolution: s6 } = e4.lodAt(i5.level), o2 = r6 / s6 % e4.size[0], n6 = o2 ? (e4.size[0] - o2) * s6 : 0;
  259. t2[0] -= n6 * i5.world, t2[2] -= n6 * i5.world;
  260. }
  261. }
  262. return t2;
  263. }
  264. };
  265. // node_modules/@arcgis/core/views/2d/layers/imagery/BaseImageryTileSubView2D.js
  266. var v2 = [0, 0];
  267. var T = class extends d {
  268. constructor() {
  269. super(...arguments), this._emptyTilePixelBlock = null, this._tileStrategy = null, this._tileInfoView = null, this._fetchQueue = null, this._blockCacheRegistryUrl = null, this._blockCacheRegistryId = null, this._srcResolutions = null, this.previousLOD = null, this._needBlockCacheUpdate = false, this._globalSymbolizerParams = null, this._symbolizerParams = null, this._abortController = null, this._isCustomTilingScheme = false, this._globalUpdateRequested = false, this.attached = false, this.container = null, this.layer = null, this.timeExtent = null, this.redrawOrRefetch = x((e4, t2) => !this.previousLOD || this.layerView.suspended ? Promise.resolve() : e4 ? this.updatingHandles.addPromise(this.doRefresh()) : this.updatingHandles.addPromise(this._redrawImage(t2)));
  270. }
  271. get useWebGLForProcessing() {
  272. var _a;
  273. return (_a = this._get("useWebGLForProcessing")) != null ? _a : true;
  274. }
  275. set useWebGLForProcessing(e4) {
  276. this._set("useWebGLForProcessing", e4);
  277. }
  278. get useProgressiveUpdate() {
  279. return null == this._get("useProgressiveUpdate") || this._get("useProgressiveUpdate");
  280. }
  281. set useProgressiveUpdate(e4) {
  282. if (this._tileStrategy && this.useProgressiveUpdate !== e4) {
  283. this._tileStrategy.destroy(), this.container.removeAllChildren();
  284. const t2 = this._getCacheSize(e4);
  285. this._tileStrategy = new r2({ cachePolicy: "purge", acquireTile: (e5) => this.acquireTile(e5), releaseTile: (e5) => this.releaseTile(e5), cacheSize: t2, tileInfoView: this._tileInfoView }), this._set("useProgressiveUpdate", e4), this.layerView.requestUpdate();
  286. }
  287. }
  288. update(e4) {
  289. var _a;
  290. this._fetchQueue.pause(), this._fetchQueue.state = e4.state, this._tileStrategy.update(e4), this._fetchQueue.resume();
  291. const { extent: t2, resolution: i5, scale: s6 } = e4.state, r6 = this._tileInfoView.getClosestInfoForScale(s6);
  292. if (this.layer.raster) {
  293. if (!this.useProgressiveUpdate || this._needBlockCacheUpdate) {
  294. const e5 = this._srcResolutions[r6.level], s7 = t2.toJSON ? t2 : w3.fromJSON(t2);
  295. g4(this._blockCacheRegistryUrl, this._blockCacheRegistryId, s7, i5, e5, this.layer.raster.ioConfig.sampling);
  296. }
  297. this._needBlockCacheUpdate = false, ((_a = this.previousLOD) == null ? void 0 : _a.level) !== r6.level && (this.previousLOD = r6, null == this._symbolizerParams || this.layerView.hasTilingEffects || this._updateSymbolizerParams(), this._tileStrategy.updateCacheSize(0));
  298. }
  299. }
  300. moveEnd() {
  301. !this.layerView.hasTilingEffects && this.useProgressiveUpdate || (this._abortController && this._abortController.abort(), this._abortController = new AbortController(), 0 === this._fetchQueue.length && this._redrawImage(this._abortController.signal).then(() => {
  302. this._globalUpdateRequested = false, this.layerView.requestUpdate();
  303. }));
  304. const e4 = this._getCacheSize(this.useProgressiveUpdate);
  305. this._tileStrategy.updateCacheSize(e4), this.layerView.requestUpdate();
  306. }
  307. get updating() {
  308. var _a;
  309. return ((_a = this._fetchQueue) == null ? void 0 : _a.updating) || this._globalUpdateRequested || !(!this.updatingHandles || !this.updatingHandles.updating);
  310. }
  311. attach() {
  312. l2("2d").supportsTextureFloat || (this.useWebGLForProcessing = false), this._initializeTileInfo(), this._tileInfoView = new h2(this.layerView.tileInfo, this.layerView.fullExtent);
  313. const e4 = this._computeFetchConcurrency();
  314. this._fetchQueue = new y2({ tileInfoView: this._tileInfoView, concurrency: e4, process: (e5, t3) => this._fetchTile1(e5, t3) });
  315. const t2 = this._getCacheSize(this.useProgressiveUpdate);
  316. this._tileStrategy = new r2({ cachePolicy: "purge", acquireTile: (e5) => this.acquireTile(e5), releaseTile: (e5) => this.releaseTile(e5), cacheSize: t2, tileInfoView: this._tileInfoView }), this._updateBlockCacheRegistry();
  317. }
  318. detach() {
  319. this._tileStrategy.destroy(), this._fetchQueue.clear(), this.container.removeAllChildren(), this._fetchQueue = this._tileStrategy = this._tileInfoView = null, f(this._blockCacheRegistryUrl, this._blockCacheRegistryId), this._blockCacheRegistryUrl = this._blockCacheRegistryId = null;
  320. }
  321. acquireTile(e4) {
  322. const t2 = this.container.createTile(e4);
  323. return this._enqueueTileFetch(t2), this.layerView.requestUpdate(), this._needBlockCacheUpdate = true, this._globalUpdateRequested = this.layerView.hasTilingEffects || !this.useProgressiveUpdate, t2;
  324. }
  325. releaseTile(e4) {
  326. this._fetchQueue.abort(e4.key.id), this.container.removeChild(e4), e4.once("detach", () => {
  327. e4.destroy(), this.layerView.requestUpdate();
  328. }), this.layerView.requestUpdate();
  329. }
  330. createEmptyTilePixelBlock(e4 = null) {
  331. const t2 = null == e4 || e4.join(",") === this._tileInfoView.tileInfo.size.join(",");
  332. if (t2 && r(this._emptyTilePixelBlock))
  333. return this._emptyTilePixelBlock;
  334. e4 = e4 || this._tileInfoView.tileInfo.size;
  335. const [i5, r6] = e4, l4 = new g2({ width: i5, height: r6, pixels: [new Uint8Array(i5 * r6)], mask: new Uint8Array(i5 * r6), pixelType: "u8" });
  336. return t2 && (this._emptyTilePixelBlock = l4), l4;
  337. }
  338. _fetchTile1(e4, t2) {
  339. const i5 = r(t2) && t2.signal, l4 = this.canUseWebGLForProcessing(), { layerView: a2 } = this, o2 = !a2.tileInfo.isWrappable && r(U2(a2.view.spatialReference)), h3 = { allowPartialFill: true, datumTransformation: a2.datumTransformation, interpolation: l4 ? "nearest" : this.layer.interpolation, registryId: this._blockCacheRegistryId, requestRawData: l4, signal: e2(i5), srcResolution: this._srcResolutions[e4.level], timeExtent: a2.timeExtent, tileInfo: a2.tileInfo, disableWrapAround: o2 };
  340. return this.fetchTile(e4, h3);
  341. }
  342. _getCacheSize(e4) {
  343. return e4 ? 40 : 0;
  344. }
  345. _initializeTileInfo() {
  346. const e4 = this.layerView.view.spatialReference, t2 = new w2({ x: this.layerView.fullExtent.xmin, y: this.layerView.fullExtent.ymax, spatialReference: e4 }), { scales: i5, srcResolutions: s6, isCustomTilingScheme: r6 } = ie(this.layer.rasterInfo, e4), l4 = j2.create({ spatialReference: e4, size: 512, scales: i5 });
  347. (0 === l4.origin.x || l4.origin.x > t2.x) && (l4.origin = t2), this._isCustomTilingScheme = r6, this.layerView.set("tileInfo", l4), this._srcResolutions = s6 != null ? s6 : [];
  348. }
  349. _computeFetchConcurrency() {
  350. const { blockBoundary: e4 } = this.layer.rasterInfo.storageInfo, t2 = e4[e4.length - 1];
  351. return (t2.maxCol - t2.minCol + 1) * (t2.maxRow - t2.minRow + 1) > 64 ? 2 : 10;
  352. }
  353. async _enqueueTileFetch(e4, t2) {
  354. this.updatingHandles.addPromise(this._enqueueTileFetch1(e4, t2));
  355. }
  356. async _enqueueTileFetch1(e4, t2) {
  357. if (!this._fetchQueue.has(e4.key.id)) {
  358. try {
  359. const t3 = await this._fetchQueue.push(e4.key), { bandIds: r6 } = this.layer;
  360. let l4 = !this.useProgressiveUpdate || this.layerView.hasTilingEffects && !this._globalSymbolizerParams;
  361. if (this._globalUpdateRequested && !this.layerView.moving && 0 === this._fetchQueue.length) {
  362. l4 = false;
  363. try {
  364. await this._redrawImage(this._abortController && this._abortController.signal);
  365. } catch (s6) {
  366. j(s6) && s.getLogger(this.declaredClass).error(s6);
  367. }
  368. this._globalUpdateRequested = false;
  369. }
  370. !this.canUseWebGLForProcessing() && "rasterVF" !== this.type || this.layerView.hasTilingEffects || null != this._symbolizerParams || this._updateSymbolizerParams();
  371. const o2 = this._tileInfoView.getTileCoords(v2, e4.key), h3 = this._tileInfoView.getTileResolution(e4.key);
  372. await this.updateTileSource(e4, { source: t3, symbolizerParams: this._symbolizerParams, globalSymbolizerParams: this._globalSymbolizerParams, suspended: l4, bandIds: r6, coords: o2, resolution: h3 }), e4.once("attach", () => this.layerView.requestUpdate()), this.container.addChild(e4);
  373. } catch (s6) {
  374. j(s6) || s.getLogger(this.declaredClass).error(s6);
  375. }
  376. this.layerView.requestUpdate();
  377. }
  378. }
  379. async _redrawImage(e4) {
  380. if (0 === this.container.children.length)
  381. return;
  382. await this.layer.updateRenderer(), this.layerView.hasTilingEffects ? await this._updateGlobalSymbolizerParams(e4) : (this._updateSymbolizerParams(), this._globalSymbolizerParams = null);
  383. const t2 = this.container.children.map(async (e5) => this.updateTileSymbolizerParameters(e5, { local: this._symbolizerParams, global: this._globalSymbolizerParams }));
  384. await E(t2), this.container.requestRender();
  385. }
  386. async _updateGlobalSymbolizerParams(e4) {
  387. const t2 = { srcResolution: this._srcResolutions[this.previousLOD.level], registryId: this._blockCacheRegistryId, signal: e4 }, i5 = await this.layer.fetchPixels(this.layerView.view.extent, this.layerView.view.width, this.layerView.view.height, t2);
  388. if (!i5 || !i5.pixelBlock)
  389. return;
  390. const s6 = this.layer.symbolizer.generateWebGLParameters({ pixelBlock: s4(i5.pixelBlock, this.layer.bandIds), isGCS: this.layerView.view.spatialReference.isGeographic, resolution: { x: this.previousLOD.resolution, y: this.previousLOD.resolution }, bandIds: this.layer.bandIds });
  391. !this.canUseWebGLForProcessing() && s6 && "stretch" === s6.type && this.layer.renderer && "raster-stretch" === this.layer.renderer.type && (s6.factor = s6.factor.map((e5) => 255 * e5), s6.outMin = Math.round(255 * s6.outMin), s6.outMax = Math.round(255 * s6.outMax)), this._globalSymbolizerParams = s6;
  392. }
  393. _updateSymbolizerParams() {
  394. this._symbolizerParams = this.layer.symbolizer.generateWebGLParameters({ pixelBlock: null, isGCS: this.layerView.view.spatialReference.isGeographic, resolution: { x: this.previousLOD.resolution, y: this.previousLOD.resolution }, bandIds: this.layer.bandIds });
  395. }
  396. _updateBlockCacheRegistry(e4 = false) {
  397. const { url: t2, rasterInfo: i5, raster: s6 } = this.layer, { multidimensionalDefinition: r6 } = this.layer.normalizeRasterFetchOptions({ multidimensionalDefinition: this.layer.multidimensionalDefinition, timeExtent: this.layerView.timeExtent }), l4 = (i5 == null ? void 0 : i5.multidimensionalInfo) ? s6.getSliceIndex(r6) : null, a2 = a(t2, l4);
  398. if (a2 !== this._blockCacheRegistryUrl) {
  399. if (null != this._blockCacheRegistryUrl && f(this._blockCacheRegistryUrl, this._blockCacheRegistryId), this._blockCacheRegistryId = u2(a2, this.layer.raster.rasterInfo), e4) {
  400. const e5 = this._tileInfoView.getClosestInfoForScale(this.layerView.view.scale), t3 = this._srcResolutions[e5.level];
  401. g4(a2, this._blockCacheRegistryId, this.layerView.view.extent, this.layerView.view.resolution, t3, this.layer.raster.ioConfig.sampling);
  402. }
  403. this._blockCacheRegistryUrl = a2;
  404. }
  405. }
  406. async doRefresh() {
  407. if (!this.attached)
  408. return;
  409. await this.layer.updateRenderer(), this.layerView.hasTilingEffects || this._updateSymbolizerParams(), this._updateBlockCacheRegistry(true), this._fetchQueue.reset();
  410. const e4 = [];
  411. this._globalUpdateRequested = this.layerView.hasTilingEffects || !this.useProgressiveUpdate, this._tileStrategy.tiles.forEach((t2) => e4.push(this._enqueueTileFetch(t2))), await E(e4);
  412. }
  413. };
  414. e([y()], T.prototype, "_fetchQueue", void 0), e([y()], T.prototype, "_globalUpdateRequested", void 0), e([y()], T.prototype, "attached", void 0), e([y()], T.prototype, "container", void 0), e([y()], T.prototype, "layer", void 0), e([y()], T.prototype, "layerView", void 0), e([y()], T.prototype, "type", void 0), e([y()], T.prototype, "useWebGLForProcessing", null), e([y()], T.prototype, "useProgressiveUpdate", null), e([y()], T.prototype, "timeExtent", void 0), e([y()], T.prototype, "updating", null), T = e([n("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")], T);
  415. // node_modules/@arcgis/core/views/2d/layers/imagery/ImageryTileView2D.js
  416. var l3 = class extends T {
  417. constructor() {
  418. super(...arguments), this.container = null, this.layer = null, this.type = "raster";
  419. }
  420. attach() {
  421. super.attach(), this.container = new n3(this._tileInfoView), this.container.isCustomTilingScheme = this._isCustomTilingScheme;
  422. }
  423. detach() {
  424. super.detach(), this.container.removeAllChildren(), this.container = null;
  425. }
  426. canUseWebGLForProcessing() {
  427. return this.useWebGLForProcessing && this.layer.symbolizer.canRenderInWebGL && !("majority" === this.layer.interpolation && r4(this.layer));
  428. }
  429. fetchTile(e4, r6) {
  430. return this.layer.fetchTile(e4.level, e4.row, e4.col, r6);
  431. }
  432. async updateTileSource(e4, t2) {
  433. const { bandIds: s6 } = this.layer, i5 = this._getLayerInterpolation(), o2 = this.canUseWebGLForProcessing(), { source: a2, globalSymbolizerParams: l4, suspended: n6, coords: c2, resolution: p2 } = t2, u4 = this.layerView.hasTilingEffects ? l4 : t2.symbolizerParams, { bitmap: d4 } = e4;
  434. if ([d4.x, d4.y] = c2, d4.resolution = p2, a2 && r(a2) && r(a2.pixelBlock)) {
  435. const e5 = { extent: a2.extent, pixelBlock: a2.pixelBlock };
  436. if (d4.rawPixelData = e5, o2)
  437. d4.source = a2.pixelBlock, d4.isRendereredSource = false;
  438. else {
  439. const r6 = await this.layer.applyRenderer(e5, "stretch" === (l4 == null ? void 0 : l4.type) ? l4 : null);
  440. d4.source = r6, d4.isRendereredSource = true;
  441. }
  442. d4.symbolizerParameters = o2 ? u4 : null, o2 ? d4.transformGrid || (d4.transformGrid = a2.transformGrid) : d4.transformGrid = null;
  443. } else {
  444. const e5 = this.createEmptyTilePixelBlock();
  445. d4.source = e5, d4.symbolizerParameters = o2 ? u4 : null, d4.transformGrid = null;
  446. }
  447. d4.bandIds = o2 ? s6 : null, d4.width = this._tileInfoView.tileInfo.size[0], d4.height = this._tileInfoView.tileInfo.size[1], d4.interpolation = i5, d4.suspended = n6, d4.invalidateTexture();
  448. }
  449. async updateTileSymbolizerParameters(e4, t2) {
  450. const { local: s6, global: i5 } = t2, { bandIds: o2 } = this.layer, a2 = this._getLayerInterpolation(), l4 = this.canUseWebGLForProcessing(), { bitmap: n6 } = e4, { rawPixelData: c2 } = n6;
  451. !l4 && r(c2) ? (n6.source = await this.layer.applyRenderer(c2, "stretch" === (i5 == null ? void 0 : i5.type) ? i5 : null), n6.isRendereredSource = true) : (n6.isRendereredSource && r(c2) && (n6.source = c2.pixelBlock), n6.isRendereredSource = false), n6.symbolizerParameters = l4 ? this.layerView.hasTilingEffects ? i5 : s6 : null, n6.bandIds = l4 ? o2 : null, n6.interpolation = a2, n6.suspended = false;
  452. }
  453. _getLayerInterpolation() {
  454. const e4 = this.layer.renderer.type;
  455. if ("raster-colormap" === e4 || "unique-value" === e4 || "class-breaks" === e4)
  456. return "nearest";
  457. const { interpolation: r6 } = this.layer, { renderer: t2 } = this.layer;
  458. return "raster-stretch" === t2.type && null != t2.colorRamp ? "bilinear" === r6 || "cubic" === r6 ? "bilinear" : "nearest" : r6;
  459. }
  460. };
  461. e([y()], l3.prototype, "container", void 0), e([y()], l3.prototype, "layer", void 0), e([y()], l3.prototype, "type", void 0), l3 = e([n("esri.views.2d.layers.imagery.ImageryTileView2D")], l3);
  462. var n4 = l3;
  463. // node_modules/@arcgis/core/views/2d/engine/imagery/RasterVFTile.js
  464. var r5 = class extends r3 {
  465. constructor(t2, s6, e4, a2, r6, o2, l4 = null) {
  466. super(t2, s6, e4, a2, r6, o2), this.tileData = new y4(l4), this.tileData.coordScale = [r6, o2], this.tileData.once("isReady", () => this.ready());
  467. }
  468. destroy() {
  469. super.destroy(), this.tileData.destroy(), this.tileData = null, this.stage = null;
  470. }
  471. set stencilRef(t2) {
  472. this.tileData.stencilRef = t2;
  473. }
  474. get stencilRef() {
  475. return this.tileData.stencilRef;
  476. }
  477. _createTransforms() {
  478. return { dvs: e3(), tileMat3: e3() };
  479. }
  480. setTransform(e4) {
  481. super.setTransform(e4);
  482. const i5 = this.resolution / (e4.resolution * e4.pixelRatio), a2 = this.transforms.tileMat3, [r6, o2] = this.tileData.offset, l4 = [this.x + r6 * this.resolution, this.y - o2 * this.resolution], [h3, n6] = e4.toScreenNoRotation([0, 0], l4), { symbolTileSize: f4 } = this.tileData.symbolizerParameters, m2 = Math.round((this.width - this.tileData.offset[0]) / f4) * f4, c2 = Math.round((this.height - this.tileData.offset[1]) / f4) * f4, u4 = m2 / this.rangeX * i5, D = c2 / this.rangeY * i5;
  483. s3(a2, u4, 0, 0, 0, D, 0, h3, n6, 1), i(this.transforms.dvs, e4.displayViewMat3, a2), this.tileData.transforms.dvs = this.transforms.dvs;
  484. }
  485. onAttach() {
  486. this.tileData.stage = this.stage;
  487. }
  488. onDetach() {
  489. this.tileData.stage = null;
  490. }
  491. };
  492. // node_modules/@arcgis/core/views/2d/engine/imagery/RasterVFTileContainer.js
  493. var o = class extends i2 {
  494. constructor() {
  495. super(...arguments), this.isCustomTilingScheme = false, this.symbolTypes = ["triangle"];
  496. }
  497. createTile(s6) {
  498. const t2 = this._tileInfoView.getTileBounds(u(), s6), [i5, o2] = this._tileInfoView.tileInfo.size, n6 = this._tileInfoView.getTileResolution(s6.level);
  499. return new r5(s6, n6, t2[0], t2[3], i5, o2);
  500. }
  501. prepareRenderPasses(e4) {
  502. const r6 = e4.registerRenderPass({ name: "imagery (vf tile)", brushes: [d2], target: () => this.children.map((e5) => e5.tileData), drawPhase: I.MAP });
  503. return [...super.prepareRenderPasses(e4), r6];
  504. }
  505. doRender(e4) {
  506. this.visible && e4.drawPhase === I.MAP && this.symbolTypes.forEach((s6) => {
  507. e4.renderPass = s6, super.doRender(e4);
  508. });
  509. }
  510. };
  511. // node_modules/@arcgis/core/views/2d/layers/imagery/VectorFieldTileView2D.js
  512. var n5 = class extends T {
  513. constructor() {
  514. super(...arguments), this._handle = null, this.container = null, this.layer = null, this.type = "rasterVF";
  515. }
  516. canUseWebGLForProcessing() {
  517. return false;
  518. }
  519. async fetchTile(e4, t2) {
  520. t2 = { ...t2, interpolation: "nearest", requestProjectedLocalDirections: true };
  521. const i5 = await this.layer.fetchTile(e4.level, e4.row, e4.col, t2);
  522. return "vector-magdir" === this.layer.rasterInfo.dataType && (i5 == null ? void 0 : i5.pixelBlock) && (i5.pixelBlock = await this.layer.convertVectorFieldData(i5.pixelBlock, t2)), i5;
  523. }
  524. updateTileSource(e4, i5) {
  525. const r6 = i5.symbolizerParams, { tileData: o2 } = e4;
  526. o2.key = e4.key, o2.width = this._tileInfoView.tileInfo.size[0], o2.height = this._tileInfoView.tileInfo.size[1];
  527. const { symbolTileSize: s6 } = r6, { source: l4 } = i5;
  528. if (o2.offset = this._getTileSymbolOffset(o2.key, s6), r(l4) && r(l4.pixelBlock)) {
  529. const e5 = { extent: l4.extent, pixelBlock: l4.pixelBlock };
  530. o2.rawPixelData = e5, o2.symbolizerParameters = r6, o2.source = this._sampleVectorFieldData(l4.pixelBlock, r6, o2.offset);
  531. } else {
  532. const e5 = [Math.round((this._tileInfoView.tileInfo[0] - o2.offset[0]) / s6), Math.round((this._tileInfoView.tileInfo[1] - o2.offset[1]) / s6)], t2 = this.createEmptyTilePixelBlock(e5);
  533. o2.source = t2, o2.symbolizerParameters = r6;
  534. }
  535. return o2.invalidateVAO(), Promise.resolve(null);
  536. }
  537. updateTileSymbolizerParameters(e4, i5) {
  538. var _a;
  539. const r6 = i5.local, { symbolTileSize: o2 } = r6, { tileData: s6 } = e4;
  540. s6.offset = this._getTileSymbolOffset(s6.key, o2);
  541. const l4 = s6.symbolizerParameters.symbolTileSize;
  542. return s6.symbolizerParameters = r6, r((_a = s6.rawPixelData) == null ? void 0 : _a.pixelBlock) && l4 !== o2 && (s6.source = this._sampleVectorFieldData(s6.rawPixelData.pixelBlock, s6.symbolizerParameters, s6.offset)), Promise.resolve(null);
  543. }
  544. attach() {
  545. super.attach(), this.container = new o(this._tileInfoView), this.container.isCustomTilingScheme = this._isCustomTilingScheme, this._updateSymbolType(this.layer.renderer), this._handle = l(() => this.layer.renderer, (e4) => this._updateSymbolType(e4));
  546. }
  547. detach() {
  548. super.detach(), this.container.removeAllChildren(), this._handle.remove(), this._handle = null;
  549. }
  550. _getTileSymbolOffset(e4, t2) {
  551. const i5 = e4.col * this._tileInfoView.tileInfo.size[0] % t2, r6 = e4.row * this._tileInfoView.tileInfo.size[1] % t2;
  552. return [i5 > t2 / 2 ? t2 - i5 : -i5, r6 > t2 / 2 ? t2 - r6 : -r6];
  553. }
  554. _sampleVectorFieldData(e4, t2, i5) {
  555. const { symbolTileSize: r6 } = t2;
  556. return j3(e4, "vector-uv", r6, i5);
  557. }
  558. _updateSymbolType(e4) {
  559. "vector-field" === e4.type && (this.container.symbolTypes = "wind-barb" === e4.style ? ["scalar", "triangle"] : "simple-scalar" === e4.style ? ["scalar"] : ["triangle"]);
  560. }
  561. };
  562. e([y()], n5.prototype, "container", void 0), e([y()], n5.prototype, "layer", void 0), e([y()], n5.prototype, "type", void 0), n5 = e([n("esri.views.2d.layers.imagery.VectorFieldTileView2D")], n5);
  563. var c = n5;
  564. // node_modules/@arcgis/core/views/layers/ImageryTileLayerView.js
  565. var f2 = (f4) => {
  566. let m2 = class extends f4 {
  567. constructor() {
  568. super(...arguments), this._rasterFieldPrefix = "Raster.", this.layer = null, this.view = null, this.tileInfo = null;
  569. }
  570. get fullExtent() {
  571. return this._getfullExtent();
  572. }
  573. _getfullExtent() {
  574. return this.projectFullExtent(this.view.spatialReference);
  575. }
  576. get hasTilingEffects() {
  577. return this.layer.renderer && "dynamicRangeAdjustment" in this.layer.renderer && this.layer.renderer.dynamicRangeAdjustment;
  578. }
  579. get datumTransformation() {
  580. return v(e2(this.layer.fullExtent), this.view.spatialReference, true);
  581. }
  582. supportsSpatialReference(e4) {
  583. return !!this.projectFullExtent(e4);
  584. }
  585. projectFullExtent(e4) {
  586. const t2 = e2(this.layer.fullExtent), r6 = v(t2, e4, false);
  587. return J(t2, e4, r6);
  588. }
  589. async fetchPopupFeatures(e4, o2) {
  590. const { layer: a2 } = this;
  591. if (!e4)
  592. throw new s2("imageryTileLayerView:fetchPopupFeatures", "Nothing to fetch without area", { layer: a2 });
  593. const { popupEnabled: n6 } = a2, l4 = s5(a2, o2);
  594. if (!n6 || t(l4))
  595. throw new s2("imageryTileLayerView:fetchPopupFeatures", "Missing required popupTemplate or popupEnabled", { popupEnabled: n6, popupTemplate: l4 });
  596. const p2 = [], { value: u4, magdirValue: f5 } = await a2.identify(e4, { timeExtent: this.timeExtent });
  597. let m3 = "";
  598. if (u4 && u4.length) {
  599. m3 = "imagery-tile" === a2.type && a2.hasStandardTime() && null != u4[0] ? u4.map((e6) => a2.getStandardTimeValue(e6)).join(", ") : u4.join(", ");
  600. const e5 = { ObjectId: 0 };
  601. e5["Raster.ServicePixelValue"] = m3;
  602. const r6 = a2.rasterInfo.attributeTable;
  603. if (r(r6)) {
  604. const { fields: t2, features: o4 } = r6, s7 = t2.find(({ name: e6 }) => "value" === e6.toLowerCase()), i5 = s7 ? o4.find((e6) => String(e6.attributes[s7.name]) === m3) : null;
  605. if (i5) {
  606. for (const r7 in i5.attributes)
  607. if (i5.attributes.hasOwnProperty(r7)) {
  608. e5[this._rasterFieldPrefix + r7] = i5.attributes[r7];
  609. }
  610. }
  611. }
  612. const o3 = a2.rasterInfo.dataType;
  613. "vector-magdir" !== o3 && "vector-uv" !== o3 || (e5["Raster.Magnitude"] = f5 == null ? void 0 : f5[0], e5["Raster.Direction"] = f5 == null ? void 0 : f5[1]);
  614. const s6 = new g(this.fullExtent.clone(), null, e5);
  615. s6.layer = a2, s6.sourceLayer = s6.layer, p2.push(s6);
  616. }
  617. return p2;
  618. }
  619. };
  620. return e([y()], m2.prototype, "layer", void 0), e([y(g3)], m2.prototype, "timeExtent", void 0), e([y()], m2.prototype, "view", void 0), e([y()], m2.prototype, "fullExtent", null), e([y()], m2.prototype, "tileInfo", void 0), e([y({ readOnly: true })], m2.prototype, "hasTilingEffects", null), m2 = e([n("esri.views.layers.ImageryTileLayerView")], m2), m2;
  621. };
  622. // node_modules/@arcgis/core/views/2d/layers/ImageryTileLayerView2D.js
  623. var f3 = class extends f2(i3(y3(u3))) {
  624. constructor() {
  625. super(...arguments), this._useWebGLForProcessing = true, this._useProgressiveUpdate = true, this.subview = null;
  626. }
  627. get useWebGLForProcessing() {
  628. return this._useWebGLForProcessing;
  629. }
  630. set useWebGLForProcessing(e4) {
  631. this._useWebGLForProcessing = e4, this.subview && "useWebGLForProcessing" in this.subview && (this.subview.useWebGLForProcessing = e4);
  632. }
  633. get useProgressiveUpdate() {
  634. return this._useWebGLForProcessing;
  635. }
  636. set useProgressiveUpdate(e4) {
  637. this._useProgressiveUpdate = e4, this.subview && "useProgressiveUpdate" in this.subview && (this.subview.useProgressiveUpdate = e4);
  638. }
  639. update(e4) {
  640. this.subview.update(e4), this.notifyChange("updating");
  641. }
  642. isUpdating() {
  643. return !this.subview || this.subview.updating;
  644. }
  645. attach() {
  646. this.layer.increaseRasterJobHandlerUsage(), this._updateSubview(), this.handles.add([l(() => {
  647. const { layer: e4 } = this;
  648. return { bandIds: e4.bandIds, renderer: e4.renderer, interpolation: e4.interpolation, multidimensionalDefinition: e4.multidimensionalDefinition, rasterFunction: "imagery-tile" === e4.type ? e4.rasterFunction : null };
  649. }, (e4, t2) => {
  650. var _a, _b;
  651. const s6 = e4.interpolation !== t2.interpolation && ("majority" === e4.interpolation || "majority" === t2.interpolation) && r4(this.layer), o2 = e4.renderer !== t2.renderer && ((_a = t2.renderer) == null ? void 0 : _a.type) !== ((_b = e4.renderer) == null ? void 0 : _b.type);
  652. o2 && this._updateSubview();
  653. const a2 = e4.multidimensionalDefinition !== t2.multidimensionalDefinition, n6 = e4.rasterFunction !== t2.rasterFunction, u4 = a2 || s6 || o2 || n6;
  654. this.subview.redrawOrRefetch(u4).catch((e5) => {
  655. j(e5) || s.getLogger(this.declaredClass).error(e5);
  656. }), this.notifyChange("updating");
  657. }), l(() => {
  658. var _a;
  659. return (_a = this.layer.blendMode) != null ? _a : "normal";
  660. }, (e4) => {
  661. this.subview.container.blendMode = e4;
  662. }, w), l(() => {
  663. var _a;
  664. return (_a = this.layer.effect) != null ? _a : null;
  665. }, (e4) => {
  666. this.subview.container.effect = e4;
  667. }, w), l(() => {
  668. var _a;
  669. return (_a = this.layer.multidimensionalSubset) != null ? _a : null;
  670. }, (e4, t2) => {
  671. const { multidimensionalDefinition: o2 } = this.layer;
  672. r(o2) && m(o2, e4) !== m(o2, t2) && (this.subview.redrawOrRefetch(true).catch((e5) => {
  673. j(e5) || s.getLogger(this.declaredClass).error(e5);
  674. }), this.notifyChange("updating"));
  675. }, U), l(() => this.timeExtent, () => {
  676. this.subview.timeExtent = this.timeExtent, this.subview.redrawOrRefetch(true).catch((e4) => {
  677. j(e4) || s.getLogger(this.declaredClass).error(e4);
  678. });
  679. }, h)], "attach");
  680. }
  681. detach() {
  682. var _a;
  683. this.handles.remove("attach"), this.layer.decreaseRasterJobHandlerUsage(), this._detachSubview(this.subview), (_a = this.subview) == null ? void 0 : _a.destroy(), this.subview = null;
  684. }
  685. moveStart() {
  686. this.requestUpdate();
  687. }
  688. viewChange() {
  689. this.requestUpdate();
  690. }
  691. moveEnd() {
  692. this.subview.moveEnd();
  693. }
  694. async hitTest(e4, i5) {
  695. return [{ type: "graphic", layer: this.layer, mapPoint: e4, graphic: new g({ attributes: {}, geometry: e4.clone() }) }];
  696. }
  697. doRefresh() {
  698. var _a;
  699. return (_a = this.subview) == null ? void 0 : _a.doRefresh();
  700. }
  701. _updateSubview() {
  702. var _a;
  703. const e4 = "vector-field" === this.layer.renderer.type ? "rasterVF" : "flow" === this.layer.renderer.type ? "flow" : "raster";
  704. if (this.subview) {
  705. if (this.subview.type === e4)
  706. return void this._attachSubview(this.subview);
  707. this._detachSubview(this.subview), (_a = this.subview) == null ? void 0 : _a.destroy(), this.subview = null;
  708. }
  709. const { layer: t2 } = this;
  710. let i5;
  711. i5 = "rasterVF" === e4 ? new c({ layer: t2, layerView: this }) : "flow" === e4 ? new d3({ layer: t2, layerView: this }) : new n4({ layer: t2, layerView: this }), "useWebGLForProcessing" in i5 && (i5.useWebGLForProcessing = this._useWebGLForProcessing), "useProgressiveUpdate" in i5 && (i5.useProgressiveUpdate = this._useProgressiveUpdate), "previousLOD" in i5 && (i5.previousLOD = this.subview && "previousLOD" in this.subview && this.subview.previousLOD), this._attachSubview(i5), this.subview = i5, this.requestUpdate();
  712. }
  713. _attachSubview(e4) {
  714. e4 && !e4.attached && (e4.attach(), e4.attached = true, this.container.addChildAt(e4.container, 0), e4.container.blendMode = this.layer.blendMode, e4.container.effect = this.layer.effect);
  715. }
  716. _detachSubview(e4) {
  717. (e4 == null ? void 0 : e4.attached) && (this.container.removeChild(e4.container), e4.detach(), e4.attached = false);
  718. }
  719. };
  720. e([y()], f3.prototype, "subview", void 0), e([y()], f3.prototype, "useWebGLForProcessing", null), e([y()], f3.prototype, "useProgressiveUpdate", null), f3 = e([n("esri.views.2d.layers.ImageryTileLayerView2D")], f3);
  721. var L = f3;
  722. export {
  723. L as default
  724. };
  725. //# sourceMappingURL=ImageryTileLayerView2D-SIAMUTWD.js.map