@doegis/core
Version:
DOE GIS API
3 lines (1 loc) • 1.01 kB
JavaScript
import{deg2rad as t}from"../../../../core/mathUtils.js";import{isSome as s,isNone as a}from"../../../../core/maybe.js";import{j as e,d as i,h as r,r as o}from"../../../../chunks/mat3.js";import{c as n}from"../../../../chunks/mat3f32.js";import{DisplayObject as l}from"../DisplayObject.js";class m extends l{constructor(){super(...arguments),this._displayData=null}get displayData(){return this._displayData}set displayData(t){this._displayData=t,this.requestRender()}clear(){s(this._displayData)&&(this._displayData.detach(),this._displayData=null,this.requestRender())}setTransform(s){const{displayData:n}=this;if(a(n))return;const l=n.extent.xmin,m=n.extent.ymax,p=[0,0];s.toScreen(p,[l,m]);const c=(n.extent.xmax-n.extent.xmin)/n.size[0]/s.resolution,d=t(s.rotation),{dvs:h}=this.transforms;e(h,[-1,1,0]),i(h,h,[2/(s.size[0]*s.pixelRatio),-2/(s.size[1]*s.pixelRatio),1]),r(h,h,[p[0],p[1],0]),o(h,h,d),i(h,h,[c*s.pixelRatio,c*s.pixelRatio,1])}_createTransforms(){return{dvs:n()}}}export{m as FlowDisplayObject};