UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

3 lines (2 loc) 1.21 kB
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */ import{set as t,multiply as e}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{DisplayObject as s}from"../DisplayObject.js";import i from"../../tiling/TileKey.js";class r extends s{constructor(t,e,s,r,o,n,h=o,d=n){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 i(t),this.resolution=e,this.x=s,this.y=r,this.width=o,this.height=n,this.rangeX=h,this.rangeY=d}destroy(){super.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(s){const i=this.resolution/(s.resolution*s.pixelRatio),r=this.transforms.tileMat3,[o,n]=s.toScreenNoRotation([0,0],[this.x,this.y]),h=this.width/this.rangeX*i,d=this.height/this.rangeY*i;t(r,h,0,0,0,d,0,o,n,1),e(this.transforms.displayViewScreenMat3,s.displayViewMat3,r)}get destroyed(){return this._destroyed}}export{r as TiledDisplayObject};