@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 1.28 kB
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
*/
import{set as t,multiply as e}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{DisplayObject as i}from"../DisplayObject.js";import s from"../../tiling/TileKey.js";class r extends i{constructor(t,e,i,r,n,o,h=n,l=o){super(),this.tileDebugInfoTexture=null,this.debugInfo={display:{length:0,minOrderedLength:0,minUnorderedLength:0,triangleCount:0},memory:{bytesUsed:0,bytesReserved:0}},this._destroyed=!1,this.key=new s(t),this.resolution=e,this.x=i,this.y=r,this.width=n,this.height=o,this.rangeX=h,this.rangeY=l}destroy(){this.tileDebugInfoTexture&&(this.tileDebugInfoTexture.dispose(),this.tileDebugInfoTexture=null),this._destroyed=!0}get debugSlot(){let t=this;for(;t.parent!==this._stage;){if(!t.parent)return 0;t=t.parent}return this._stage.children.indexOf(t)}setTransform(i){const s=this.resolution/(i.resolution*i.pixelRatio),r=this.transforms.tileMat3,[n,o]=i.toScreenNoRotation([0,0],[this.x,this.y]),h=this.width/this.rangeX*s,l=this.height/this.rangeY*s;t(r,h,0,0,0,l,0,n,o,1),e(this.transforms.displayViewScreenMat3,i.displayViewMat3,r)}get destroyed(){return this._destroyed}}export{r as TiledDisplayObject};