ImageryTileLayerView2D-D6NZZS4Z.js 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736
  1. import {
  2. d as d3,
  3. y
  4. } from "./chunk-TQFDJPI3.js";
  5. import {
  6. o,
  7. r as r3
  8. } from "./chunk-6G6XHVK2.js";
  9. import {
  10. s as s5
  11. } from "./chunk-FJ72FJKM.js";
  12. import {
  13. r as r4
  14. } from "./chunk-YR7YKE3S.js";
  15. import {
  16. W,
  17. m,
  18. p as p2
  19. } from "./chunk-H3QCF24A.js";
  20. import {
  21. i as i3
  22. } from "./chunk-EAUVYZHD.js";
  23. import {
  24. f,
  25. u as u4
  26. } from "./chunk-MNZXIBJ7.js";
  27. import "./chunk-YJKEIUMW.js";
  28. import "./chunk-JH3PLIM6.js";
  29. import "./chunk-FCDUTNBY.js";
  30. import "./chunk-LL6JU3GU.js";
  31. import "./chunk-ZIWBDWEW.js";
  32. import "./chunk-IQNZZCQJ.js";
  33. import "./chunk-Q4LKAPDF.js";
  34. import "./chunk-TODU7HVH.js";
  35. import {
  36. I
  37. } from "./chunk-23ONSYIH.js";
  38. import "./chunk-3T4BXU2T.js";
  39. import "./chunk-YLVXZ2PS.js";
  40. import {
  41. g as g3,
  42. i as i2,
  43. s as s4,
  44. u as u3
  45. } from "./chunk-3G6RGU7K.js";
  46. import {
  47. F as F2,
  48. T,
  49. X,
  50. ne
  51. } from "./chunk-Y4GPJDDM.js";
  52. import {
  53. F
  54. } from "./chunk-FUB4YNLX.js";
  55. import {
  56. l as l2,
  57. u as u2
  58. } from "./chunk-EE6TL7XD.js";
  59. import "./chunk-GDB2KX4Y.js";
  60. import "./chunk-546QCRS4.js";
  61. import "./chunk-QXZVBSBH.js";
  62. import "./chunk-773XI6MQ.js";
  63. import "./chunk-WFSV2B2I.js";
  64. import "./chunk-J525NRN3.js";
  65. import "./chunk-MI7HWWFL.js";
  66. import {
  67. mt
  68. } from "./chunk-7BTL34ZE.js";
  69. import {
  70. e as e3
  71. } from "./chunk-ZHRMTKME.js";
  72. import "./chunk-ZVHTCCQC.js";
  73. import {
  74. r as r2
  75. } from "./chunk-PCGDLSZ4.js";
  76. import {
  77. p
  78. } from "./chunk-CAYFEZCR.js";
  79. import "./chunk-MFFE4I2S.js";
  80. import "./chunk-K3NA3LQS.js";
  81. import "./chunk-LMCIAW5S.js";
  82. import {
  83. h as h2
  84. } from "./chunk-OTS3UE5B.js";
  85. import "./chunk-6RAL4JPQ.js";
  86. import {
  87. l as l3
  88. } from "./chunk-4E6K4P67.js";
  89. import "./chunk-LGW7TID4.js";
  90. import "./chunk-3OHML7FO.js";
  91. import "./chunk-G5AI6ZNE.js";
  92. import "./chunk-FIYKFRB2.js";
  93. import "./chunk-FYNVVMWY.js";
  94. import "./chunk-Q52DVFYK.js";
  95. import "./chunk-HBMVUVZX.js";
  96. import {
  97. i,
  98. s as s3
  99. } from "./chunk-CRGVDJI6.js";
  100. import "./chunk-DH2OBAUC.js";
  101. import "./chunk-TNLRDNTC.js";
  102. import "./chunk-6P6NA7JB.js";
  103. import {
  104. g as g4
  105. } from "./chunk-RZFGRBD7.js";
  106. import "./chunk-PUSPZYFZ.js";
  107. import "./chunk-EN7YGJWG.js";
  108. import "./chunk-VBNMTM7L.js";
  109. import "./chunk-3D3QEPRE.js";
  110. import "./chunk-JFNNSBWL.js";
  111. import "./chunk-WNCU6BFU.js";
  112. import "./chunk-PIGRDDRG.js";
  113. import "./chunk-XLV7RUSE.js";
  114. import "./chunk-NTUXR253.js";
  115. import "./chunk-C43UE3Z5.js";
  116. import {
  117. d as d2
  118. } from "./chunk-RMX2AZ4P.js";
  119. import "./chunk-NE3ESGA6.js";
  120. import {
  121. h,
  122. l,
  123. w
  124. } from "./chunk-YIS6BAC3.js";
  125. import "./chunk-7XXXCK2A.js";
  126. import "./chunk-7ZIDBK7B.js";
  127. import {
  128. g as g2
  129. } from "./chunk-PSV473TI.js";
  130. import "./chunk-FONIFA5N.js";
  131. import "./chunk-EG5OI4V4.js";
  132. import "./chunk-65BYCSII.js";
  133. import "./chunk-WZQZRKNH.js";
  134. import "./chunk-LRDX4TO7.js";
  135. import "./chunk-6A4U74YA.js";
  136. import {
  137. S
  138. } from "./chunk-RBZL6SRZ.js";
  139. import "./chunk-WJW5DUN6.js";
  140. import "./chunk-PJ7ZQ4VD.js";
  141. import "./chunk-WDLTDV2L.js";
  142. import "./chunk-TERAW6FT.js";
  143. import {
  144. u
  145. } from "./chunk-N2663GRX.js";
  146. import "./chunk-O4FY3ITT.js";
  147. import "./chunk-WEMIK25H.js";
  148. import "./chunk-7N4X6GF3.js";
  149. import "./chunk-JXW4QTJA.js";
  150. import "./chunk-UXF37FQ4.js";
  151. import "./chunk-ZOEK6QHJ.js";
  152. import "./chunk-XNLG7T2T.js";
  153. import "./chunk-IR4PV7VK.js";
  154. import "./chunk-2Z6LERTI.js";
  155. import "./chunk-OWVBLVP3.js";
  156. import "./chunk-AFZ7XSEW.js";
  157. import "./chunk-4NKD334K.js";
  158. import "./chunk-65K7LC56.js";
  159. import "./chunk-ATPLLI5W.js";
  160. import "./chunk-MXB2XLKV.js";
  161. import "./chunk-XH7RUGVZ.js";
  162. import "./chunk-TBBTRX4O.js";
  163. import "./chunk-YBSUITLL.js";
  164. import "./chunk-ALDCDSPV.js";
  165. import "./chunk-DT6EAZQ5.js";
  166. import "./chunk-HNOZUNJ4.js";
  167. import "./chunk-VNFRAYHO.js";
  168. import "./chunk-R5IG2D6H.js";
  169. import "./chunk-VBRY5KJM.js";
  170. import "./chunk-PDKDCAAD.js";
  171. import {
  172. M2 as M,
  173. j2 as j
  174. } from "./chunk-ECW2QABR.js";
  175. import "./chunk-GCDJLKH4.js";
  176. import "./chunk-MRJEICT6.js";
  177. import {
  178. d,
  179. e,
  180. n2 as n
  181. } from "./chunk-Y3WMVFTW.js";
  182. import "./chunk-SAS7RONY.js";
  183. import "./chunk-WSRBH7BF.js";
  184. import "./chunk-IHXECKQQ.js";
  185. import {
  186. E,
  187. g,
  188. x
  189. } from "./chunk-ULGDPLM2.js";
  190. import {
  191. s,
  192. s3 as s2
  193. } from "./chunk-EMJ4ZSM2.js";
  194. import "./chunk-IKP3YN53.js";
  195. import {
  196. e as e2,
  197. r,
  198. t
  199. } from "./chunk-GZT4BVFP.js";
  200. import "./chunk-A5ICIBVI.js";
  201. // node_modules/@arcgis/core/views/2d/engine/imagery/RasterTile.js
  202. var i4 = class extends r3 {
  203. constructor(t2, e4, i5, r6, a, n5 = null) {
  204. super(t2, e4, i5, r6, a), this.bitmap = new p2(n5, null, null), this.bitmap.coordScale = [r6, a], this.bitmap.once("isReady", () => this.ready());
  205. }
  206. destroy() {
  207. super.destroy(), this.bitmap.destroy(), this.bitmap = null, this.stage = null;
  208. }
  209. set stencilRef(t2) {
  210. this.bitmap.stencilRef = t2;
  211. }
  212. get stencilRef() {
  213. return this.bitmap.stencilRef;
  214. }
  215. setTransform(t2, s6) {
  216. super.setTransform(t2, s6), this.bitmap.transforms.dvs = this.transforms.dvs;
  217. }
  218. _createTransforms() {
  219. return { dvs: e3(), tileMat3: e3() };
  220. }
  221. onAttach() {
  222. this.bitmap.stage = this.stage;
  223. }
  224. onDetach() {
  225. this.bitmap.stage = null;
  226. }
  227. };
  228. // node_modules/@arcgis/core/views/2d/engine/imagery/RasterTileContainer.js
  229. var n2 = class extends o {
  230. constructor() {
  231. super(...arguments), this.isCustomTilingScheme = false;
  232. }
  233. createTile(e4) {
  234. const s6 = this._getTileBounds(e4), [r6, t2] = this._tileInfoView.tileInfo.size;
  235. return new i4(e4, s6[0], s6[3], r6, t2);
  236. }
  237. prepareRenderPasses(e4) {
  238. const s6 = e4.registerRenderPass({ name: "imagery (tile)", brushes: [W.raster], target: () => this.children.map((e5) => e5.bitmap), drawPhase: I.MAP });
  239. return [...super.prepareRenderPasses(e4), s6];
  240. }
  241. doRender(e4) {
  242. this.visible && e4.drawPhase === I.MAP && super.doRender(e4);
  243. }
  244. _getTileBounds(r6) {
  245. const i5 = this._tileInfoView.getTileBounds(u(), r6);
  246. if (this.isCustomTilingScheme && r6.world) {
  247. const { tileInfo: e4 } = this._tileInfoView, t2 = mt(e4.spatialReference);
  248. if (t2) {
  249. const { resolution: s6 } = e4.lodAt(r6.level), o3 = t2 / s6 % e4.size[0], n5 = o3 ? (e4.size[0] - o3) * s6 : 0;
  250. i5[0] -= n5 * r6.world, i5[2] -= n5 * r6.world;
  251. }
  252. }
  253. return i5;
  254. }
  255. };
  256. // node_modules/@arcgis/core/views/2d/layers/imagery/BaseImageryTileSubView2D.js
  257. var R = [0, 0];
  258. var T2 = s.getLogger("esri.views.2d.layers.ImageryTileLayerView2D");
  259. var V = class extends d2 {
  260. constructor() {
  261. 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)));
  262. }
  263. get useWebGLForProcessing() {
  264. return this._get("useWebGLForProcessing") ?? true;
  265. }
  266. set useWebGLForProcessing(e4) {
  267. this._set("useWebGLForProcessing", e4);
  268. }
  269. get useProgressiveUpdate() {
  270. return this._get("useProgressiveUpdate") == null || this._get("useProgressiveUpdate");
  271. }
  272. set useProgressiveUpdate(e4) {
  273. if (this._tileStrategy && this.useProgressiveUpdate !== e4) {
  274. this._tileStrategy.destroy(), this.container.removeAllChildren();
  275. const t2 = this._getCacheSize(e4);
  276. 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();
  277. }
  278. }
  279. update(e4) {
  280. this._fetchQueue.pause(), this._fetchQueue.state = e4.state, this._tileStrategy.update(e4), this._fetchQueue.resume();
  281. const { extent: t2, resolution: i5, scale: s6 } = e4.state, r6 = this._tileInfoView.getClosestInfoForScale(s6);
  282. if (this.layer.raster) {
  283. if (!this.useProgressiveUpdate || this._needBlockCacheUpdate) {
  284. const e5 = this._srcResolutions[r6.level], s7 = t2.toJSON ? t2 : M.fromJSON(t2);
  285. g3(this._blockCacheRegistryUrl, this._blockCacheRegistryId, s7, i5, e5, this.layer.raster.ioConfig.sampling);
  286. }
  287. this._needBlockCacheUpdate = false, this.previousLOD?.level !== r6.level && (this.previousLOD = r6, this._symbolizerParams == null || this.layerView.hasTilingEffects || this._updateSymbolizerParams(), this._tileStrategy.updateCacheSize(0));
  288. }
  289. }
  290. moveEnd() {
  291. !this.layerView.hasTilingEffects && this.useProgressiveUpdate || (this._abortController && this._abortController.abort(), this._abortController = new AbortController(), this._fetchQueue.length === 0 && this._redrawImage(this._abortController.signal).then(() => {
  292. this._globalUpdateRequested = false, this.layerView.requestUpdate();
  293. }));
  294. const e4 = this._getCacheSize(this.useProgressiveUpdate);
  295. this._tileStrategy.updateCacheSize(e4), this.layerView.requestUpdate();
  296. }
  297. get updating() {
  298. return this._fetchQueue?.updating || this._globalUpdateRequested || !(!this.updatingHandles || !this.updatingHandles.updating);
  299. }
  300. attach() {
  301. l3("2d").supportsTextureFloat || (this.useWebGLForProcessing = false), this._initializeTileInfo(), this._tileInfoView = new h2(this.layerView.tileInfo, this.layerView.fullExtent);
  302. const e4 = this._computeFetchConcurrency();
  303. this._fetchQueue = new p({ tileInfoView: this._tileInfoView, concurrency: e4, process: (e5, t3) => this._fetchTile1(e5, t3) });
  304. const t2 = this._getCacheSize(this.useProgressiveUpdate);
  305. this._tileStrategy = new r2({ cachePolicy: "purge", acquireTile: (e5) => this.acquireTile(e5), releaseTile: (e5) => this.releaseTile(e5), cacheSize: t2, tileInfoView: this._tileInfoView }), this._updateBlockCacheRegistry();
  306. }
  307. detach() {
  308. this._tileStrategy.destroy(), this._fetchQueue.clear(), this.container.removeAllChildren(), this._fetchQueue = this._tileStrategy = this._tileInfoView = null, u3(this._blockCacheRegistryUrl, this._blockCacheRegistryId), this._blockCacheRegistryUrl = this._blockCacheRegistryId = null;
  309. }
  310. acquireTile(e4) {
  311. const t2 = this.container.createTile(e4);
  312. return this._enqueueTileFetch(t2), this.layerView.requestUpdate(), this._needBlockCacheUpdate = true, this._globalUpdateRequested = this.layerView.hasTilingEffects || !this.useProgressiveUpdate, t2;
  313. }
  314. releaseTile(e4) {
  315. this._fetchQueue.abort(e4.key.id), this.container.removeChild(e4), e4.once("detach", () => {
  316. e4.destroy(), this.layerView.requestUpdate();
  317. }), this.layerView.requestUpdate();
  318. }
  319. createEmptyTilePixelBlock(e4 = null) {
  320. const t2 = e4 == null || e4.join(",") === this._tileInfoView.tileInfo.size.join(",");
  321. if (t2 && r(this._emptyTilePixelBlock))
  322. return this._emptyTilePixelBlock;
  323. e4 = e4 || this._tileInfoView.tileInfo.size;
  324. const [i5, r6] = e4, l5 = new u2({ width: i5, height: r6, pixels: [new Uint8Array(i5 * r6)], mask: new Uint8Array(i5 * r6), pixelType: "u8" });
  325. return t2 && (this._emptyTilePixelBlock = l5), l5;
  326. }
  327. _fetchTile1(e4, t2) {
  328. const i5 = r(t2) && t2.signal, l5 = this.canUseWebGLForProcessing(), { layerView: a } = this, o3 = !a.tileInfo.isWrappable && r(X(a.view.spatialReference)), h3 = { allowPartialFill: true, datumTransformation: a.datumTransformation, interpolation: l5 ? "nearest" : this.layer.interpolation, registryId: this._blockCacheRegistryId, requestRawData: l5, signal: e2(i5), srcResolution: this._srcResolutions[e4.level], timeExtent: a.timeExtent, tileInfo: a.tileInfo, disableWrapAround: o3 };
  329. return this.fetchTile(e4, h3);
  330. }
  331. _getCacheSize(e4) {
  332. return e4 ? 40 : 0;
  333. }
  334. _initializeTileInfo() {
  335. const e4 = this.layerView.view.spatialReference, t2 = new j({ x: this.layerView.fullExtent.xmin, y: this.layerView.fullExtent.ymax, spatialReference: e4 }), { scales: i5, srcResolutions: s6, isCustomTilingScheme: r6 } = ne(this.layer.rasterInfo, e4), l5 = S.create({ spatialReference: e4, size: 512, scales: i5 });
  336. (l5.origin.x === 0 || l5.origin.x > t2.x) && (l5.origin = t2), this._isCustomTilingScheme = r6, this.layerView.set("tileInfo", l5), this._srcResolutions = s6 ?? [];
  337. }
  338. _computeFetchConcurrency() {
  339. const { blockBoundary: e4 } = this.layer.rasterInfo.storageInfo, t2 = e4[e4.length - 1];
  340. return (t2.maxCol - t2.minCol + 1) * (t2.maxRow - t2.minRow + 1) > 64 ? 2 : 10;
  341. }
  342. async _enqueueTileFetch(e4, t2) {
  343. this.updatingHandles.addPromise(this._enqueueTileFetch1(e4, t2));
  344. }
  345. async _enqueueTileFetch1(e4, t2) {
  346. if (!this._fetchQueue.has(e4.key.id)) {
  347. try {
  348. const t3 = await this._fetchQueue.push(e4.key), { bandIds: s6 } = this.layer;
  349. let r6 = !this.useProgressiveUpdate || this.layerView.hasTilingEffects && !this._globalSymbolizerParams;
  350. if (this._globalUpdateRequested && !this.layerView.moving && this._fetchQueue.length === 0) {
  351. r6 = false;
  352. try {
  353. await this._redrawImage(this._abortController && this._abortController.signal);
  354. } catch (i5) {
  355. g(i5) && T2.error(i5);
  356. }
  357. this._globalUpdateRequested = false;
  358. }
  359. !this.canUseWebGLForProcessing() && this.type !== "rasterVF" || this.layerView.hasTilingEffects || this._symbolizerParams != null || this._updateSymbolizerParams();
  360. const l5 = this._tileInfoView.getTileCoords(R, e4.key), o3 = this._tileInfoView.getTileResolution(e4.key);
  361. await this.updateTileSource(e4, { source: t3, symbolizerParams: this._symbolizerParams, globalSymbolizerParams: this._globalSymbolizerParams, suspended: r6, bandIds: s6, coords: l5, resolution: o3 }), e4.once("attach", () => this.layerView.requestUpdate()), this.container.addChild(e4);
  362. } catch (i5) {
  363. g(i5) || T2.error(i5);
  364. }
  365. this.layerView.requestUpdate();
  366. }
  367. }
  368. async _redrawImage(e4) {
  369. if (this.container.children.length === 0)
  370. return;
  371. await this.layer.updateRenderer(), this.layerView.hasTilingEffects ? await this._updateGlobalSymbolizerParams(e4) : (this._updateSymbolizerParams(), this._globalSymbolizerParams = null);
  372. const t2 = this.container.children.map(async (e5) => this.updateTileSymbolizerParameters(e5, { local: this._symbolizerParams, global: this._globalSymbolizerParams }));
  373. await E(t2), this.container.requestRender();
  374. }
  375. async _updateGlobalSymbolizerParams(e4) {
  376. 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);
  377. if (!i5 || !i5.pixelBlock)
  378. return;
  379. const s6 = this.layer.symbolizer.generateWebGLParameters({ pixelBlock: l2(i5.pixelBlock, this.layer.bandIds), isGCS: this.layerView.view.spatialReference.isGeographic, resolution: { x: this.previousLOD.resolution, y: this.previousLOD.resolution }, bandIds: this.layer.bandIds });
  380. !this.canUseWebGLForProcessing() && s6 && s6.type === "stretch" && this.layer.renderer && this.layer.renderer.type === "raster-stretch" && (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;
  381. }
  382. _updateSymbolizerParams() {
  383. 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 });
  384. }
  385. _updateBlockCacheRegistry(e4 = false) {
  386. const { url: t2, rasterInfo: i5, raster: s6 } = this.layer, { multidimensionalDefinition: r6 } = this.layer.normalizeRasterFetchOptions({ multidimensionalDefinition: this.layer.multidimensionalDefinition, timeExtent: this.layerView.timeExtent }), l5 = i5?.multidimensionalInfo ? s6.getSliceIndex(r6) : null, a = i2(t2, l5);
  387. if (a !== this._blockCacheRegistryUrl) {
  388. if (this._blockCacheRegistryUrl != null && u3(this._blockCacheRegistryUrl, this._blockCacheRegistryId), this._blockCacheRegistryId = s4(a, this.layer.raster.rasterInfo), e4) {
  389. const e5 = this._tileInfoView.getClosestInfoForScale(this.layerView.view.scale), t3 = this._srcResolutions[e5.level];
  390. g3(a, this._blockCacheRegistryId, this.layerView.view.extent, this.layerView.view.resolution, t3, this.layer.raster.ioConfig.sampling);
  391. }
  392. this._blockCacheRegistryUrl = a;
  393. }
  394. }
  395. async doRefresh() {
  396. await this.layer.updateRenderer(), this.layerView.hasTilingEffects || this._updateSymbolizerParams(), this._updateBlockCacheRegistry(true), this._fetchQueue.reset();
  397. const e4 = [];
  398. this._globalUpdateRequested = this.layerView.hasTilingEffects || !this.useProgressiveUpdate, this._tileStrategy.tiles.forEach((t2) => e4.push(this._enqueueTileFetch(t2))), await E(e4);
  399. }
  400. };
  401. e([d()], V.prototype, "_fetchQueue", void 0), e([d()], V.prototype, "_globalUpdateRequested", void 0), e([d()], V.prototype, "attached", void 0), e([d()], V.prototype, "container", void 0), e([d()], V.prototype, "layer", void 0), e([d()], V.prototype, "layerView", void 0), e([d()], V.prototype, "type", void 0), e([d()], V.prototype, "useWebGLForProcessing", null), e([d()], V.prototype, "useProgressiveUpdate", null), e([d()], V.prototype, "timeExtent", void 0), e([d()], V.prototype, "updating", null), V = e([n("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")], V);
  402. // node_modules/@arcgis/core/views/2d/layers/imagery/ImageryTileView2D.js
  403. var l4 = class extends V {
  404. constructor() {
  405. super(...arguments), this.container = null, this.layer = null, this.type = "raster";
  406. }
  407. attach() {
  408. super.attach(), this.container = new n2(this._tileInfoView), this.container.isCustomTilingScheme = this._isCustomTilingScheme;
  409. }
  410. detach() {
  411. super.detach(), this.container.removeAllChildren(), this.container = null;
  412. }
  413. canUseWebGLForProcessing() {
  414. return this.useWebGLForProcessing && this.layer.symbolizer.canRenderInWebGL && !(this.layer.interpolation === "majority" && r4(this.layer));
  415. }
  416. fetchTile(e4, r6) {
  417. return this.layer.fetchTile(e4.level, e4.row, e4.col, r6);
  418. }
  419. async updateTileSource(e4, t2) {
  420. const { bandIds: s6 } = this.layer, i5 = this._getLayerInterpolation(), o3 = this.canUseWebGLForProcessing(), { source: a, globalSymbolizerParams: l5, suspended: n5, coords: c2, resolution: p3 } = t2, u5 = this.layerView.hasTilingEffects ? l5 : t2.symbolizerParams, { bitmap: m4 } = e4;
  421. if ([m4.x, m4.y] = c2, m4.resolution = p3, a && r(a) && r(a.pixelBlock)) {
  422. const e5 = { extent: a.extent, pixelBlock: a.pixelBlock };
  423. if (m4.rawPixelData = e5, o3)
  424. m4.source = a.pixelBlock, m4.isRendereredSource = false;
  425. else {
  426. const r6 = await this.layer.applyRenderer(e5, l5?.type === "stretch" ? l5 : null);
  427. m4.source = r6, m4.isRendereredSource = true;
  428. }
  429. m4.symbolizerParameters = o3 ? u5 : null, o3 ? m4.transformGrid || (m4.transformGrid = a.transformGrid) : m4.transformGrid = null;
  430. } else {
  431. const e5 = this.createEmptyTilePixelBlock();
  432. m4.source = e5, m4.symbolizerParameters = o3 ? u5 : null, m4.transformGrid = null;
  433. }
  434. m4.bandIds = o3 ? s6 : null, m4.width = this._tileInfoView.tileInfo.size[0], m4.height = this._tileInfoView.tileInfo.size[1], m4.interpolation = i5, m4.suspended = n5, m4.invalidateTexture();
  435. }
  436. async updateTileSymbolizerParameters(e4, t2) {
  437. const { local: s6, global: i5 } = t2, { bandIds: o3 } = this.layer, a = this._getLayerInterpolation(), l5 = this.canUseWebGLForProcessing(), { bitmap: n5 } = e4, { rawPixelData: c2 } = n5;
  438. !l5 && r(c2) ? (n5.source = await this.layer.applyRenderer(c2, i5?.type === "stretch" ? i5 : null), n5.isRendereredSource = true) : (n5.isRendereredSource && r(c2) && (n5.source = c2.pixelBlock), n5.isRendereredSource = false), n5.symbolizerParameters = l5 ? this.layerView.hasTilingEffects ? i5 : s6 : null, n5.bandIds = l5 ? o3 : null, n5.interpolation = a, n5.suspended = false;
  439. }
  440. _getLayerInterpolation() {
  441. const e4 = this.layer.renderer.type;
  442. if (e4 === "raster-colormap" || e4 === "unique-value" || e4 === "class-breaks")
  443. return "nearest";
  444. const { interpolation: r6 } = this.layer, { renderer: t2 } = this.layer;
  445. return t2.type === "raster-stretch" && t2.colorRamp != null ? r6 === "bilinear" || r6 === "cubic" ? "bilinear" : "nearest" : r6;
  446. }
  447. };
  448. e([d()], l4.prototype, "container", void 0), e([d()], l4.prototype, "layer", void 0), e([d()], l4.prototype, "type", void 0), l4 = e([n("esri.views.2d.layers.imagery.ImageryTileView2D")], l4);
  449. var n3 = l4;
  450. // node_modules/@arcgis/core/views/2d/engine/imagery/RasterVFTile.js
  451. var r5 = class extends r3 {
  452. constructor(t2, s6, e4, i5, r6, o3 = null) {
  453. super(t2, s6, e4, i5, r6), this.tileData = new y(o3), this.tileData.coordScale = [i5, r6], this.tileData.once("isReady", () => this.ready());
  454. }
  455. destroy() {
  456. super.destroy(), this.tileData.destroy(), this.tileData = null, this.stage = null;
  457. }
  458. set stencilRef(t2) {
  459. this.tileData.stencilRef = t2;
  460. }
  461. get stencilRef() {
  462. return this.tileData.stencilRef;
  463. }
  464. _createTransforms() {
  465. return { dvs: e3(), tileMat3: e3() };
  466. }
  467. setTransform(e4, a) {
  468. super.setTransform(e4, a);
  469. const i5 = a / (e4.resolution * e4.pixelRatio), r6 = this.transforms.tileMat3, [o3, l5] = this.tileData.offset, h3 = [this.x + o3 * a, this.y - l5 * a], [n5, f2] = e4.toScreenNoRotation([0, 0], h3), { symbolTileSize: m4 } = this.tileData.symbolizerParameters, c2 = Math.round((this.width - this.tileData.offset[0]) / m4) * m4, D = Math.round((this.height - this.tileData.offset[1]) / m4) * m4, d4 = c2 / this.rangeX * i5, u5 = D / this.rangeY * i5;
  470. s3(r6, d4, 0, 0, 0, u5, 0, n5, f2, 1), i(this.transforms.dvs, e4.displayViewMat3, r6), this.tileData.transforms.dvs = this.transforms.dvs;
  471. }
  472. onAttach() {
  473. this.tileData.stage = this.stage;
  474. }
  475. onDetach() {
  476. this.tileData.stage = null;
  477. }
  478. };
  479. // node_modules/@arcgis/core/views/2d/engine/imagery/RasterVFTileContainer.js
  480. var o2 = class extends o {
  481. constructor() {
  482. super(...arguments), this.isCustomTilingScheme = false, this.symbolTypes = ["triangle"];
  483. }
  484. createTile(s6) {
  485. const t2 = this._tileInfoView.getTileBounds(u(), s6), [i5, o3] = this._tileInfoView.tileInfo.size;
  486. return new r5(s6, t2[0], t2[3], i5, o3);
  487. }
  488. prepareRenderPasses(e4) {
  489. const r6 = e4.registerRenderPass({ name: "imagery (vf tile)", brushes: [m], target: () => this.children.map((e5) => e5.tileData), drawPhase: I.MAP });
  490. return [...super.prepareRenderPasses(e4), r6];
  491. }
  492. doRender(e4) {
  493. this.visible && e4.drawPhase === I.MAP && this.symbolTypes.forEach((s6) => {
  494. e4.renderPass = s6, super.doRender(e4);
  495. });
  496. }
  497. };
  498. // node_modules/@arcgis/core/views/2d/layers/imagery/VectorFieldTileView2D.js
  499. var c = class extends V {
  500. constructor() {
  501. super(...arguments), this._handle = null, this.container = null, this.layer = null, this.type = "rasterVF";
  502. }
  503. canUseWebGLForProcessing() {
  504. return false;
  505. }
  506. async fetchTile(e4, t2) {
  507. t2 = { ...t2, interpolation: "nearest", requestProjectedLocalDirections: true };
  508. const i5 = await this.layer.fetchTile(e4.level, e4.row, e4.col, t2);
  509. return this.layer.rasterInfo.dataType === "vector-magdir" && i5?.pixelBlock && (i5.pixelBlock = await this.layer.convertVectorFieldData(i5.pixelBlock, t2)), i5;
  510. }
  511. updateTileSource(e4, i5) {
  512. const r6 = i5.symbolizerParams, { tileData: o3 } = e4;
  513. o3.key = e4.key, o3.width = this._tileInfoView.tileInfo.size[0], o3.height = this._tileInfoView.tileInfo.size[1];
  514. const { symbolTileSize: s6 } = r6, { source: l5 } = i5;
  515. if (o3.offset = this._getTileSymbolOffset(o3.key, s6), r(l5) && r(l5.pixelBlock)) {
  516. const e5 = { extent: l5.extent, pixelBlock: l5.pixelBlock };
  517. o3.rawPixelData = e5, o3.symbolizerParameters = r6, o3.source = this._sampleVectorFieldData(l5.pixelBlock, r6, o3.offset);
  518. } else {
  519. const e5 = [Math.round((this._tileInfoView.tileInfo[0] - o3.offset[0]) / s6), Math.round((this._tileInfoView.tileInfo[1] - o3.offset[1]) / s6)], t2 = this.createEmptyTilePixelBlock(e5);
  520. o3.source = t2, o3.symbolizerParameters = r6;
  521. }
  522. return o3.invalidateVAO(), Promise.resolve(null);
  523. }
  524. updateTileSymbolizerParameters(e4, i5) {
  525. const r6 = i5.local, { symbolTileSize: o3 } = r6, { tileData: s6 } = e4;
  526. s6.offset = this._getTileSymbolOffset(s6.key, o3);
  527. const l5 = s6.symbolizerParameters.symbolTileSize;
  528. return s6.symbolizerParameters = r6, r(s6.rawPixelData?.pixelBlock) && l5 !== o3 && (s6.source = this._sampleVectorFieldData(s6.rawPixelData.pixelBlock, s6.symbolizerParameters, s6.offset)), Promise.resolve(null);
  529. }
  530. attach() {
  531. super.attach(), this.container = new o2(this._tileInfoView), this.container.isCustomTilingScheme = this._isCustomTilingScheme, this._updateSymbolType(this.layer.renderer), this._handle = l(() => this.layer.renderer, (e4) => this._updateSymbolType(e4));
  532. }
  533. detach() {
  534. super.detach(), this.container.removeAllChildren(), this._handle.remove(), this._handle = null;
  535. }
  536. _getTileSymbolOffset(e4, t2) {
  537. const i5 = e4.col * this._tileInfoView.tileInfo.size[0] % t2, r6 = e4.row * this._tileInfoView.tileInfo.size[1] % t2;
  538. return [i5 > t2 / 2 ? t2 - i5 : -i5, r6 > t2 / 2 ? t2 - r6 : -r6];
  539. }
  540. _sampleVectorFieldData(e4, t2, i5) {
  541. const { symbolTileSize: r6 } = t2;
  542. return F(e4, "vector-uv", r6, i5);
  543. }
  544. _updateSymbolType(e4) {
  545. e4.type === "vector-field" && (this.container.symbolTypes = e4.style === "wind-barb" ? ["scalar", "triangle"] : e4.style === "simple-scalar" ? ["scalar"] : ["triangle"]);
  546. }
  547. };
  548. e([d()], c.prototype, "container", void 0), e([d()], c.prototype, "layer", void 0), e([d()], c.prototype, "type", void 0), c = e([n("esri.views.2d.layers.imagery.VectorFieldTileView2D")], c);
  549. var n4 = c;
  550. // node_modules/@arcgis/core/views/layers/ImageryTileLayerView.js
  551. var m2 = (m4) => {
  552. let f2 = class extends m4 {
  553. constructor() {
  554. super(...arguments), this._rasterFieldPrefix = "Raster.", this.layer = null, this.view = null, this.tileInfo = null;
  555. }
  556. get fullExtent() {
  557. return this._getfullExtent();
  558. }
  559. _getfullExtent() {
  560. return this.projectFullExtent(this.view.spatialReference);
  561. }
  562. get hasTilingEffects() {
  563. return this.layer.renderer && "dynamicRangeAdjustment" in this.layer.renderer && this.layer.renderer.dynamicRangeAdjustment;
  564. }
  565. get datumTransformation() {
  566. return T(e2(this.layer.fullExtent), this.view.spatialReference, true);
  567. }
  568. supportsSpatialReference(t2) {
  569. return !!this.projectFullExtent(t2);
  570. }
  571. projectFullExtent(t2) {
  572. const e4 = e2(this.layer.fullExtent), r6 = T(e4, t2, false);
  573. return F2(e4, t2, r6);
  574. }
  575. async fetchPopupFeatures(t2, i5) {
  576. const { layer: s6 } = this;
  577. if (!t2)
  578. throw new s2("imageryTileLayerView:fetchPopupFeatures", "Nothing to fetch without area", { layer: s6 });
  579. const { popupEnabled: a } = s6, n5 = s5(s6, i5);
  580. if (!a || t(n5))
  581. throw new s2("imageryTileLayerView:fetchPopupFeatures", "Missing required popupTemplate or popupEnabled", { popupEnabled: a, popupTemplate: n5 });
  582. const l5 = [], { value: u5, magdirValue: m5 } = await s6.identify(t2, { timeExtent: this.timeExtent });
  583. let f3 = "";
  584. if (u5 && u5.length) {
  585. f3 = s6.type === "imagery-tile" && s6.hasStandardTime() && u5[0] != null ? u5.map((t4) => s6.getStandardTimeValue(t4)).join(", ") : u5.join(", ");
  586. const t3 = { ObjectId: 0 }, r6 = "Raster.ServicePixelValue";
  587. t3[r6] = this._formatAttributeValue(f3, r6);
  588. const i6 = s6.rasterInfo?.attributeTable?.features;
  589. if (i6 && i6.length > 0) {
  590. const e4 = i6.filter((t4) => {
  591. const e5 = t4.attributes.value || t4.attributes.Value || t4.attributes.VALUE;
  592. return String(e5) === f3;
  593. });
  594. if (e4.length > 0) {
  595. const r7 = e4[0];
  596. if (r7) {
  597. for (const e5 in r7.attributes)
  598. if (r7.attributes.hasOwnProperty(e5)) {
  599. const i7 = this._rasterFieldPrefix + e5;
  600. t3[i7] = this._formatAttributeValue(r7.attributes[e5], i7);
  601. }
  602. }
  603. }
  604. }
  605. const o3 = s6.rasterInfo.dataType;
  606. o3 !== "vector-magdir" && o3 !== "vector-uv" || (t3["Raster.Magnitude"] = m5?.[0], t3["Raster.Direction"] = m5?.[1]);
  607. const a2 = new g4(this.fullExtent.clone(), null, t3);
  608. a2.layer = s6, a2.sourceLayer = a2.layer, l5.push(a2);
  609. }
  610. return l5;
  611. }
  612. _formatAttributeValue(t2, e4) {
  613. if (typeof t2 == "string") {
  614. const r6 = this.layer.popupTemplate && this.layer.popupTemplate.fieldInfos, i5 = this._getFieldInfo(r6, e4), o3 = i5 && i5.format;
  615. if (o3) {
  616. let e5, r7;
  617. return t2.trim().includes(",") ? (e5 = ",", r7 = e5 + " ", this._formatDelimitedString(t2, e5, r7, o3)) : t2.trim().includes(" ") ? (e5 = r7 = " ", this._formatDelimitedString(t2, e5, r7, o3)) : this._formatNumberFromString(t2, o3);
  618. }
  619. }
  620. return t2;
  621. }
  622. _getFieldInfo(t2, e4) {
  623. if (!t2 || !t2.length || !e4)
  624. return;
  625. const r6 = e4.toLowerCase();
  626. let i5;
  627. return t2.some((t3) => !(!t3.fieldName || t3.fieldName.toLowerCase() !== r6 && t3.fieldName.toLowerCase() !== r6.replace(/ /g, "_")) && (i5 = t3, true)), i5;
  628. }
  629. _formatDelimitedString(t2, e4, r6, i5) {
  630. return t2 && e4 && r6 && i5 ? t2.trim().split(e4).map((t3) => this._formatNumberFromString(t3, i5)).join(r6) : t2;
  631. }
  632. _formatNumberFromString(t2, e4) {
  633. if (!t2 || !e4)
  634. return t2;
  635. const r6 = Number(t2);
  636. return isNaN(r6) ? t2 : e4.format(r6);
  637. }
  638. };
  639. return e([d()], f2.prototype, "layer", void 0), e([d(g2)], f2.prototype, "timeExtent", void 0), e([d()], f2.prototype, "view", void 0), e([d()], f2.prototype, "fullExtent", null), e([d()], f2.prototype, "tileInfo", void 0), e([d({ readOnly: true })], f2.prototype, "hasTilingEffects", null), f2 = e([n("esri.views.layers.ImageryTileLayerView")], f2), f2;
  640. };
  641. // node_modules/@arcgis/core/views/2d/layers/ImageryTileLayerView2D.js
  642. var m3 = s.getLogger("esri.views.2d.layers.ImageryTileLayerView2D");
  643. var y2 = class extends m2(i3(f(u4))) {
  644. constructor() {
  645. super(...arguments), this._useWebGLForProcessing = true, this._useProgressiveUpdate = true, this.subview = null;
  646. }
  647. get useWebGLForProcessing() {
  648. return this._useWebGLForProcessing;
  649. }
  650. set useWebGLForProcessing(e4) {
  651. this._useWebGLForProcessing = e4, this.subview && "useWebGLForProcessing" in this.subview && (this.subview.useWebGLForProcessing = e4);
  652. }
  653. get useProgressiveUpdate() {
  654. return this._useWebGLForProcessing;
  655. }
  656. set useProgressiveUpdate(e4) {
  657. this._useProgressiveUpdate = e4, this.subview && "useProgressiveUpdate" in this.subview && (this.subview.useProgressiveUpdate = e4);
  658. }
  659. update(e4) {
  660. this.subview.update(e4), this.notifyChange("updating");
  661. }
  662. isUpdating() {
  663. return !this.subview || this.subview.updating;
  664. }
  665. attach() {
  666. this.layer.increaseRasterJobHandlerUsage(), this._updateSubview(), this.handles.add([l(() => {
  667. const { layer: e4 } = this;
  668. return { bandIds: e4.bandIds, renderer: e4.renderer, interpolation: e4.interpolation, multidimensionalDefinition: e4.multidimensionalDefinition };
  669. }, (e4, s6) => {
  670. const i5 = e4.interpolation !== s6.interpolation && (e4.interpolation === "majority" || s6.interpolation === "majority") && r4(this.layer), r6 = e4.renderer !== s6.renderer && s6.renderer?.type !== e4.renderer?.type;
  671. r6 && this._updateSubview();
  672. const o3 = e4.multidimensionalDefinition !== s6.multidimensionalDefinition || i5 || r6;
  673. this.subview.redrawOrRefetch(o3).catch((e5) => {
  674. g(e5) || m3.error(e5);
  675. }), this.notifyChange("updating");
  676. }), l(() => this.layer.blendMode ?? "normal", (e4) => {
  677. this.subview.container.blendMode = e4;
  678. }, w), l(() => this.layer.effect ?? null, (e4) => {
  679. this.subview.container.effect = e4;
  680. }, w), l(() => this.timeExtent, () => {
  681. this.subview.timeExtent = this.timeExtent, this.subview.redrawOrRefetch(true).catch((e4) => {
  682. g(e4) || m3.error(e4);
  683. });
  684. }, h)], "attach");
  685. }
  686. detach() {
  687. this.handles.remove("attach"), this.layer.decreaseRasterJobHandlerUsage(), this._detachSubview(this.subview), this.subview?.destroy(), this.subview = null;
  688. }
  689. moveStart() {
  690. this.requestUpdate();
  691. }
  692. viewChange() {
  693. this.requestUpdate();
  694. }
  695. moveEnd() {
  696. this.subview.moveEnd();
  697. }
  698. async hitTest(e4, i5) {
  699. return [{ type: "graphic", layer: this.layer, mapPoint: e4, graphic: new g4({ attributes: {}, geometry: e4.clone() }) }];
  700. }
  701. doRefresh() {
  702. return this.subview.doRefresh();
  703. }
  704. _updateSubview() {
  705. const e4 = this.layer.renderer.type === "vector-field" ? "rasterVF" : this.layer.renderer.type === "flow" ? "flow" : "raster";
  706. if (this.subview) {
  707. if (this.subview.type === e4)
  708. return void this._attachSubview(this.subview);
  709. this._detachSubview(this.subview), this.subview?.destroy(), this.subview = null;
  710. }
  711. const { layer: s6 } = this;
  712. let i5;
  713. i5 = e4 === "rasterVF" ? new n4({ layer: s6, layerView: this }) : e4 === "flow" ? new d3({ layer: s6, layerView: this }) : new n3({ layer: s6, 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();
  714. }
  715. _attachSubview(e4) {
  716. 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);
  717. }
  718. _detachSubview(e4) {
  719. e4?.attached && (this.container.removeChild(e4.container), e4.detach(), e4.attached = false);
  720. }
  721. };
  722. e([d()], y2.prototype, "subview", void 0), e([d()], y2.prototype, "useWebGLForProcessing", null), e([d()], y2.prototype, "useProgressiveUpdate", null), y2 = e([n("esri.views.2d.layers.ImageryTileLayerView2D")], y2);
  723. var g5 = y2;
  724. export {
  725. g5 as default
  726. };
  727. //# sourceMappingURL=ImageryTileLayerView2D-D6NZZS4Z.js.map