@doegis/core
Version:
DOE GIS API
3 lines (1 loc) • 1.03 kB
JavaScript
import{d as s,m as t}from"../../../../chunks/mat2d.js";import{c as r}from"../../../../chunks/mat2df32.js";import{s as e,m as a}from"../../../../chunks/mat3.js";import{c as i}from"../../../../chunks/mat3f32.js";import{TILE_SIZE as o}from"./definitions.js";import{TiledDisplayObject as n}from"./TiledDisplayObject.js";class h{acquire(s){return{refCount:1,version:-1,labelMat2d:r(),tileMat3:i(),dvs:i()}}release(s){}}class m extends n{constructor(s,t,r,e){super(s,t,r,e,o,o)}destroy(){super.destroy(),this._transforms&&m.TransformCache.release(this.key.hash)}setTransform(i){const o=this.resolution/i.resolution,n=this.transforms.tileMat3,[h,m]=i.toScreenNoRotation([0,0],[this.x,this.y]),c=this.width/this.rangeX*o,f=this.height/this.rangeY*o;e(n,c,0,0,0,f,0,h,m,1),a(this.transforms.dvs,i.displayViewMat3,n);const d=this.transforms.labelMat2d,l=window.devicePixelRatio,u=s(r(),c*l,0,0,f*l,h*l,m*l);t(d,i.viewMat2d,u)}_createTransforms(){return m.TransformCache.acquire(this.key.hash)}}m.TransformCache=new h;export{m as WGLTile};