UNPKG

@doegis/core

Version:

DOE GIS API

3 lines (1 loc) 756 B
import{s as t,m as s}from"../../../../chunks/mat3.js";import{DisplayObject as i}from"../DisplayObject.js";import e from"../../tiling/TileKey.js";class r extends i{constructor(t,s,i,r,h,o,n=h,a=o){super(),this.triangleCountReportedInDebug=0,this.triangleCount=0,this.texture=null,this.key=new e(t),this.resolution=s,this.x=i,this.y=r,this.width=h,this.height=o,this.rangeX=n,this.rangeY=a}destroy(){this.texture&&(this.texture.dispose(),this.texture=null)}setTransform(i){const e=this.resolution/(i.resolution*i.pixelRatio),r=this.transforms.tileMat3,[h,o]=i.toScreenNoRotation([0,0],[this.x,this.y]),n=this.width/this.rangeX*e,a=this.height/this.rangeY*e;t(r,n,0,0,0,a,0,h,o,1),s(this.transforms.dvs,i.displayViewMat3,r)}}export{r as TiledDisplayObject};