@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
3 lines (2 loc) • 1.21 kB
JavaScript
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */
import{getOpacity as t,getColor as e,getForegroundColor as o}from"./utils.js";import{Imagery as a}from"./styles/Imagery.js";import{Particles as l}from"./styles/Particles.js";import{Stack as r}from"./styles/Stack.js";import s from"./styles/Streamlines.js";import{getFlowSimulationSettings as n,getSize as i,getMax as c}from"../../../support/flow/utils.js";const m=4,p=1,u=.5,f=!0,d=!0,y=2.3;function g(g,w){const{flowSpeed:h,trailLength:j}=g,v=n(g);let S=null;const k={opacity:t(g),size:i(g)};let x=e(g);if("none"===g.background)k.color=x;else{"constant"===x.kind&&(x={kind:"ramp",stops:[0,1],values:[0,0,0,1,x.value[0],x.value[1],x.value[2],x.value[3]],count:2});const t={loadImagery:w.loadImagery,timeExtent:w.timeExtent,color:x,opacity:{kind:"constant",value:[1]}};S=new a(t),k.color=o()}const I={loadImagery:w.loadImagery,createFlowMesh:w.createFlowMesh,simulationSettings:v,timeExtent:w.timeExtent,trailLength:j,flowSpeed:h,featheringSize:p,featheringOffset:u,introFade:f,fadeToZero:d,decayRate:y,color:k.color,opacity:k.opacity,size:k.size},z="butt"===g.trailCap||c(i(g))<=m?new s(I):new l(I);return null!=S?new r([S,z]):z}export{g as default};