chunk-PVFGZTPJ.js 1.7 KB

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