UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 2.5 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{_ as t}from"../../../../chunks/tslib.es6.js";import e from"../../../../Graphic.js";import i from"../../../../core/Accessor.js";import{watch as o}from"../../../../core/reactiveUtils.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.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 h=class extends i{constructor(){super(...arguments),this._loadImagery=(t,e,i,o,r)=>n(this.layer,t,e,i,o,r),this._createFlowMesh=(t,e,i,o)=>this.layer.createFlowMesh({meshType:t,flowData:i,simulationSettings:e},{signal:o}),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,o,r,s)=>n(t,e,i,o,r,s),this._updateVisualization()};"multidimensionalDefinition"in t?this.addHandles(o((()=>t.multidimensionalDefinition),e)):this.addHandles([o((()=>t.mosaicRule),e),o((()=>t.rasterFunction),e),o((()=>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([r()],h.prototype,"_strategy",void 0),t([r()],h.prototype,"attached",void 0),t([r()],h.prototype,"container",void 0),t([r()],h.prototype,"layer",void 0),t([r()],h.prototype,"layerView",void 0),t([r()],h.prototype,"type",void 0),t([r()],h.prototype,"updating",null),t([r()],h.prototype,"timeExtent",void 0),h=t([s("esri.views.2d.engine.flow.FlowView2D")],h);export{h as default};