import { n as n2 } from "./chunk-TJ4DVYZ7.js"; import { e, n5 as n } from "./chunk-2Z2TG5CU.js"; // node_modules/@arcgis/core/views/2d/layers/BitmapTileLayerView2D.js var t = (t3) => { let s = class extends t3 { attach() { this.view.timeline.record(`${this.layer.title} (BitmapTileLayer) Attach`), this._bitmapView = new n2(this._tileInfoView), this.container.addChild(this._bitmapView); } detach() { var _a; this.container.removeChild(this._bitmapView), (_a = this._bitmapView) == null ? void 0 : _a.removeAllChildren(); } }; return s = e([n("esri.views.2d.layers.BitmapTileLayerView2D")], s), s; }; // node_modules/@arcgis/core/views/2d/layers/support/imageUtils.js function e2(e3) { return e3 instanceof HTMLImageElement ? e3.naturalWidth : e3.width; } function t2(e3) { return e3 instanceof HTMLImageElement ? e3.naturalHeight : e3.height; } function n3(n4, l, r, u) { if (r.level === u.level) return l; const i = n4.tileInfo.size, a = n4.getTileResolution(r.level), c = n4.getTileResolution(u.level); let g = n4.getLODInfoAt(u.level); const h = g.getXForColumn(u.col), d = g.getYForRow(u.row); g = n4.getLODInfoAt(r.level); const f = g.getXForColumn(r.col), s = g.getYForRow(r.row), m = e2(l) / i[0], v = t2(l) / i[1], w = Math.round(m * ((h - f) / a)), I = Math.round(v * (-(d - s) / a)), M = Math.round(m * i[0] * (c / a)), F = Math.round(v * i[1] * (c / a)), L = o(i); return L.getContext("2d").drawImage(l, w, I, M, F, 0, 0, i[0], i[1]), L; } function o(e3) { const t3 = document.createElement("canvas"); return [t3.width, t3.height] = e3, t3; } export { t, n3 as n, o }; //# sourceMappingURL=chunk-PVFGZTPJ.js.map