123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- import {
- n as n2,
- r as r2
- } from "./chunk-22J3OQXH.js";
- import "./chunk-W4JJD2VH.js";
- import "./chunk-6G6XHVK2.js";
- import "./chunk-TWB5CT7V.js";
- import "./chunk-H3QCF24A.js";
- import {
- i
- } from "./chunk-EAUVYZHD.js";
- import {
- f,
- u
- } from "./chunk-MNZXIBJ7.js";
- import "./chunk-YJKEIUMW.js";
- import "./chunk-JH3PLIM6.js";
- import "./chunk-FCDUTNBY.js";
- import "./chunk-LL6JU3GU.js";
- import "./chunk-ZIWBDWEW.js";
- import "./chunk-IQNZZCQJ.js";
- import "./chunk-Q4LKAPDF.js";
- import "./chunk-TODU7HVH.js";
- import "./chunk-23ONSYIH.js";
- import "./chunk-3T4BXU2T.js";
- import "./chunk-YLVXZ2PS.js";
- import "./chunk-EE6TL7XD.js";
- import "./chunk-GDB2KX4Y.js";
- import "./chunk-546QCRS4.js";
- import "./chunk-QXZVBSBH.js";
- import "./chunk-773XI6MQ.js";
- import "./chunk-WFSV2B2I.js";
- import "./chunk-J525NRN3.js";
- import "./chunk-MI7HWWFL.js";
- import "./chunk-ZHRMTKME.js";
- import {
- r
- } from "./chunk-PCGDLSZ4.js";
- import {
- p
- } from "./chunk-CAYFEZCR.js";
- import "./chunk-MFFE4I2S.js";
- import "./chunk-LMCIAW5S.js";
- import {
- h
- } from "./chunk-OTS3UE5B.js";
- import "./chunk-6RAL4JPQ.js";
- import "./chunk-LGW7TID4.js";
- import "./chunk-3OHML7FO.js";
- import "./chunk-G5AI6ZNE.js";
- import {
- e as e2
- } from "./chunk-FIYKFRB2.js";
- import "./chunk-FYNVVMWY.js";
- import "./chunk-Q52DVFYK.js";
- import "./chunk-HBMVUVZX.js";
- import "./chunk-CRGVDJI6.js";
- import "./chunk-6P6NA7JB.js";
- import "./chunk-XLV7RUSE.js";
- import "./chunk-NTUXR253.js";
- import "./chunk-RMX2AZ4P.js";
- import "./chunk-NE3ESGA6.js";
- import {
- l
- } from "./chunk-YIS6BAC3.js";
- import "./chunk-7XXXCK2A.js";
- import "./chunk-WJW5DUN6.js";
- import "./chunk-PJ7ZQ4VD.js";
- import "./chunk-WDLTDV2L.js";
- import "./chunk-TERAW6FT.js";
- import "./chunk-N2663GRX.js";
- import "./chunk-WEMIK25H.js";
- import "./chunk-7N4X6GF3.js";
- import "./chunk-JXW4QTJA.js";
- import "./chunk-UXF37FQ4.js";
- import "./chunk-ZOEK6QHJ.js";
- import "./chunk-XNLG7T2T.js";
- import "./chunk-IR4PV7VK.js";
- import "./chunk-2Z6LERTI.js";
- import "./chunk-OWVBLVP3.js";
- import "./chunk-AFZ7XSEW.js";
- import "./chunk-YBSUITLL.js";
- import "./chunk-ALDCDSPV.js";
- import "./chunk-DT6EAZQ5.js";
- import "./chunk-HNOZUNJ4.js";
- import "./chunk-PDKDCAAD.js";
- import "./chunk-ECW2QABR.js";
- import "./chunk-GCDJLKH4.js";
- import {
- E
- } from "./chunk-MRJEICT6.js";
- import {
- d,
- e,
- n2 as n
- } from "./chunk-Y3WMVFTW.js";
- import "./chunk-SAS7RONY.js";
- import "./chunk-WSRBH7BF.js";
- import "./chunk-IHXECKQQ.js";
- import {
- g
- } from "./chunk-ULGDPLM2.js";
- import {
- s
- } from "./chunk-EMJ4ZSM2.js";
- import "./chunk-IKP3YN53.js";
- import "./chunk-GZT4BVFP.js";
- import "./chunk-A5ICIBVI.js";
- // node_modules/@arcgis/core/views/2d/layers/WMTSLayerView2D.js
- var y = [102113, 102100, 3857, 3785, 900913];
- var _ = [0, 0];
- var w = s.getLogger("esri.views.2d.layers.WMTSLayerView2D");
- var g2 = class extends i(r2(f(u))) {
- constructor() {
- super(...arguments), this._tileStrategy = null, this._fetchQueue = null, this._tileRequests = new Map(), this.layer = null;
- }
- get tileMatrixSet() {
- const e3 = this._getTileMatrixSetBySpatialReference(this.layer.activeLayer);
- return e3 ? (e3.id !== this.layer.activeLayer.tileMatrixSetId && (this.layer.activeLayer.tileMatrixSetId = e3.id), e3) : null;
- }
- update(e3) {
- this._fetchQueue.pause(), this._fetchQueue.state = e3.state, this._tileStrategy.update(e3), this._fetchQueue.resume();
- }
- attach() {
- if (!this.tileMatrixSet)
- return;
- const { tileInfo: e3 } = this.tileMatrixSet;
- this._tileInfoView = new h(e3), this._fetchQueue = new p({ tileInfoView: this._tileInfoView, concurrency: 16, process: (e4, t) => this.fetchTile(e4, t) }), this._tileStrategy = new r({ cachePolicy: "keep", resampling: true, acquireTile: (e4) => this.acquireTile(e4), releaseTile: (e4) => this.releaseTile(e4), tileInfoView: this._tileInfoView }), this.handles.add(l(() => [this.layer?.activeLayer?.styleId, this.tileMatrixSet], () => this._refresh()), this.declaredClass), super.attach();
- }
- detach() {
- super.detach(), this.handles.remove(this.declaredClass), this._tileStrategy?.destroy(), this._fetchQueue?.destroy(), this._fetchQueue = this._tileStrategy = this._tileInfoView = null;
- }
- moveStart() {
- this.requestUpdate();
- }
- viewChange() {
- this.requestUpdate();
- }
- moveEnd() {
- this.requestUpdate();
- }
- releaseTile(e3) {
- this._fetchQueue.abort(e3.key.id), this._bitmapView.removeChild(e3), e3.once("detach", () => e3.destroy()), this.requestUpdate();
- }
- acquireTile(e3) {
- const t = this._bitmapView.createTile(e3), i2 = t.bitmap;
- return [i2.x, i2.y] = this._tileInfoView.getTileCoords(_, t.key), i2.resolution = this._tileInfoView.getTileResolution(t.key), [i2.width, i2.height] = this._tileInfoView.tileInfo.size, this._enqueueTileFetch(t), this._bitmapView.addChild(t), this.requestUpdate(), t;
- }
- async doRefresh() {
- this.updateRequested || this.suspended || this._refresh();
- }
- isUpdating() {
- return this._fetchQueue?.updating ?? false;
- }
- async fetchTile(e3, t = {}) {
- const s2 = "tilemapCache" in this.layer ? this.layer.tilemapCache : null, { signal: r3, resamplingLevel: a = 0 } = t;
- if (!s2)
- return this._fetchImage(e3, r3);
- const l2 = new e2(0, 0, 0, 0);
- let o;
- try {
- await s2.fetchAvailabilityUpsample(e3.level, e3.row, e3.col, l2, { signal: r3 }), o = await this._fetchImage(l2, r3);
- } catch (h2) {
- if (g(h2))
- throw h2;
- if (a < 3) {
- const i2 = this._tileInfoView.getTileParentId(e3.id);
- if (i2) {
- const s3 = new e2(i2), r4 = await this.fetchTile(s3, { ...t, resamplingLevel: a + 1 });
- return n2(this._tileInfoView, r4, s3, e3);
- }
- }
- throw h2;
- }
- return n2(this._tileInfoView, o, l2, e3);
- }
- canResume() {
- const e3 = super.canResume();
- return e3 ? this.tileMatrixSet !== null : e3;
- }
- supportsSpatialReference(e3) {
- return this.layer.activeLayer.tileMatrixSets.some((t) => E(t.tileInfo.spatialReference, e3));
- }
- async _enqueueTileFetch(e3) {
- if (!this._fetchQueue.has(e3.key.id)) {
- try {
- const t = await this._fetchQueue.push(e3.key);
- 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());
- } catch (t) {
- g(t) || w.error(t);
- }
- this.requestUpdate();
- }
- }
- async _fetchImage(e3, t) {
- return this.layer.fetchTile(e3.level, e3.row, e3.col, { signal: t });
- }
- _refresh() {
- this._fetchQueue.reset(), this._tileStrategy.tiles.forEach((e3) => {
- if (!e3.bitmap.source)
- return;
- const t = { id: e3.key.id, fulfilled: false, promise: this._fetchQueue.push(e3.key).then((t2) => {
- e3.bitmap.source = t2;
- }).catch((t2) => {
- g(t2) || (e3.bitmap.source = null);
- }).finally(() => {
- e3.requestRender(), t.fulfilled = true;
- }) };
- this._tileRequests.set(e3, t);
- });
- }
- _getTileMatrixSetBySpatialReference(e3) {
- const t = this.view.spatialReference;
- if (!e3.tileMatrixSets)
- return null;
- let i2 = e3.tileMatrixSets.find((e4) => E(e4.tileInfo.spatialReference, t));
- return !i2 && t.isWebMercator && (i2 = e3.tileMatrixSets.find((e4) => y.includes(e4.tileInfo.spatialReference.wkid))), i2;
- }
- };
- e([d()], g2.prototype, "_fetchQueue", void 0), e([d({ readOnly: true })], g2.prototype, "tileMatrixSet", null), g2 = e([n("esri.views.2d.layers.WMTSLayerView2D")], g2);
- var S = g2;
- export {
- S as default
- };
- //# sourceMappingURL=WMTSLayerView2D-6YJOJ6Y7.js.map
|