@doegis/core
Version:
DOE GIS API
3 lines (1 loc) • 2.35 kB
JavaScript
import{_ as t}from"../../../../chunks/tslib.es6.js";import e from"../../../../Graphic.js";import i from"../../../../core/Accessor.js";import{watch as r}from"../../../../core/reactiveUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import a from"./createFlowStyle.js";import{loadImagery as n}from"./dataUtils.js";import l from"./FlowContainer.js";import p from"./FlowStrategy.js";let d=class extends i{constructor(){super(...arguments),this._loadImagery=(t,e,i,r,o)=>n(this.layer,t,e,i,r,o),this._createFlowMesh=(t,e,i,r)=>this.layer.createFlowMesh({meshType:t,flowData:i,simulationSettings:e},{signal:r}),this.attached=!1,this.type="flow",this.timeExtent=null,this.redrawOrRefetch=async()=>{this._updateVisualization()}}get updating(){return!this.attached||this._strategy.updating}attach(){const{layer:t}=this,e=()=>{this._loadImagery=(e,i,r,o,s)=>n(t,e,i,r,o,s),this._updateVisualization()};"multidimensionalDefinition"in t?this.addHandles(r((()=>t.multidimensionalDefinition),e)):this.addHandles([r((()=>t.mosaicRule),e),r((()=>t.renderingRule),e),r((()=>t.definitionExpression),e)]),this.container=new l,this._strategy=new p({flowContainer:this.container}),this._updateVisualization()}detach(){this._strategy.destroy(),this.container?.removeAllChildren(),this.container=null,this.removeHandles()}update(t){t.stationary?this._strategy.update(t):this.layerView.requestUpdate()}hitTest(t){return new e({attributes:{},geometry:t.clone(),layer:this.layer})}moveEnd(){}async doRefresh(){}_updateVisualization(){const t=this.layer.renderer;if(null==t||"flow"!==t.type)return;const e=a(t,{loadImagery:this._loadImagery,createFlowMesh:this._createFlowMesh,timeExtent:this.timeExtent});this.container.flowStyle=e,this.layerView.requestUpdate()}};t([o()],d.prototype,"_strategy",void 0),t([o()],d.prototype,"attached",void 0),t([o()],d.prototype,"container",void 0),t([o()],d.prototype,"layer",void 0),t([o()],d.prototype,"layerView",void 0),t([o()],d.prototype,"type",void 0),t([o()],d.prototype,"updating",null),t([o()],d.prototype,"timeExtent",void 0),d=t([s("esri.views.2d.engine.flow.FlowView2D")],d);const h=d;export{h as default};