12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- import {
- n as n2
- } from "./chunk-W4JJD2VH.js";
- import {
- e,
- n2 as n
- } from "./chunk-Y3WMVFTW.js";
- // node_modules/@arcgis/core/views/2d/layers/BitmapTileLayerView2D.js
- var r = (r2) => {
- let s = class extends r2 {
- attach() {
- this.view.timeline.record(`${this.layer.title} (BitmapTileLayer) Attach`), this._bitmapView = new n2(this._tileInfoView), this.container.addChild(this._bitmapView);
- }
- detach() {
- this.container.removeChild(this._bitmapView), this._bitmapView?.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 t(e3) {
- return e3 instanceof HTMLImageElement ? e3.naturalHeight : e3.height;
- }
- function n3(n4, l, r2, u) {
- if (r2.level === u.level)
- return l;
- const i = n4.tileInfo.size, a = n4.getTileResolution(r2.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(r2.level);
- const f = g.getXForColumn(r2.col), s = g.getYForRow(r2.row), m = e2(l) / i[0], v = t(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 t2 = document.createElement("canvas");
- return [t2.width, t2.height] = e3, t2;
- }
- export {
- r,
- n3 as n,
- o
- };
- //# sourceMappingURL=chunk-22J3OQXH.js.map
|