chunk-22J3OQXH.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import {
  2. n as n2
  3. } from "./chunk-W4JJD2VH.js";
  4. import {
  5. e,
  6. n2 as n
  7. } from "./chunk-Y3WMVFTW.js";
  8. // node_modules/@arcgis/core/views/2d/layers/BitmapTileLayerView2D.js
  9. var r = (r2) => {
  10. let s = class extends r2 {
  11. attach() {
  12. this.view.timeline.record(`${this.layer.title} (BitmapTileLayer) Attach`), this._bitmapView = new n2(this._tileInfoView), this.container.addChild(this._bitmapView);
  13. }
  14. detach() {
  15. this.container.removeChild(this._bitmapView), this._bitmapView?.removeAllChildren();
  16. }
  17. };
  18. return s = e([n("esri.views.2d.layers.BitmapTileLayerView2D")], s), s;
  19. };
  20. // node_modules/@arcgis/core/views/2d/layers/support/imageUtils.js
  21. function e2(e3) {
  22. return e3 instanceof HTMLImageElement ? e3.naturalWidth : e3.width;
  23. }
  24. function t(e3) {
  25. return e3 instanceof HTMLImageElement ? e3.naturalHeight : e3.height;
  26. }
  27. function n3(n4, l, r2, u) {
  28. if (r2.level === u.level)
  29. return l;
  30. const i = n4.tileInfo.size, a = n4.getTileResolution(r2.level), c = n4.getTileResolution(u.level);
  31. let g = n4.getLODInfoAt(u.level);
  32. const h = g.getXForColumn(u.col), d = g.getYForRow(u.row);
  33. g = n4.getLODInfoAt(r2.level);
  34. 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);
  35. return L.getContext("2d").drawImage(l, w, I, M, F, 0, 0, i[0], i[1]), L;
  36. }
  37. function o(e3) {
  38. const t2 = document.createElement("canvas");
  39. return [t2.width, t2.height] = e3, t2;
  40. }
  41. export {
  42. r,
  43. n3 as n,
  44. o
  45. };
  46. //# sourceMappingURL=chunk-22J3OQXH.js.map