Custom Gis Application with Arcgis Javascript API with modern layouting
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

10 lines
3.5 KiB

// All material copyright Esri, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.30/esri/copyright.txt for details.
//>>built
define("exports ../../../core/Error ../../../renderers/support/AuthoringInfo ../../../renderers/support/AuthoringInfoVisualVariable ../../../renderers/support/rasterRendererHelper ../../../renderers/visualVariables/ColorVariable ../../../renderers/visualVariables/OpacityVariable ../../../renderers/visualVariables/SizeVariable ../../../renderers/visualVariables/support/ColorStop ../../../renderers/visualVariables/support/OpacityStop ../../../renderers/visualVariables/support/SizeStop ../support/utils ../../renderers/support/utils ../../symbology/flow".split(" "),
function(r,l,w,p,t,x,y,z,A,u,v,B,m,q){async function C(a){a={...a};a.theme||(a.theme="flow-line");return B.processRasterRendererParameters(a)}async function D(a){let d=a.flowScheme,f=null;var b=null;b=await m.getBasemapInfo(null,a.view);f=null!=b.basemapId?b.basemapId:null;b=null!=b.basemapTheme?b.basemapTheme:null;if(d)return{scheme:q.cloneScheme(d),basemapId:f,basemapTheme:b};if(a=q.getSchemes({basemapTheme:b,theme:a.theme,hasSizeVariable:a.hasSizeVariable}))d=a.primaryScheme,f=a.basemapId,b=a.basemapTheme;
return{scheme:d,basemapId:f,basemapTheme:b}}async function E(a,d){d.flowRepresentation&&(a.flowRepresentation=d.flowRepresentation);const f=await D({theme:d.theme,flowScheme:d.flowScheme,view:d.view,hasSizeVariable:d.includeSizeVariable}),b=f.scheme;if(!b)throw new l("flow-renderer:insufficient-info","Unable to find flow scheme");a.flowSpeed=b.flowSpeed;a.density=b.density;a.trailLength=b.trailLength;a.trailWidth=b.trailWidth;a.trailCap=b.trailCap;a.color=b.color;const h=[];var g=[],c=d.layer.rasterInfo;
c=null==c?.statistics||"vector-magdir"!==c.dataType&&"vector-uv"!==c.dataType?{minMagnitude:0,maxMagnitude:10}:t.estimateMagnitudeRange(c.dataType,c.statistics);if(null==c?.minMagnitude||null==c.maxMagnitude)throw new l("flow-renderer:insufficient-info","stats not available");c={min:c.minMagnitude,max:c.maxMagnitude};var e={min:c.min,max:null!=c.max?c.max/2:null},k=m.getDataRange(e,null,null);e=m.createDataValues(k,e,null);if(d.includeColorVariable){const n=m.createColors(b.colors,5);if(5>n.length)throw new l("flow-renderer:insufficient-info",
"Flow scheme does not have enough colors");k=new x({field:"Magnitude",stops:e.map((F,G)=>new A({value:F,color:n[G]}))});h.push(k);k=new p({type:"color",minSliderValue:c.min,maxSliderValue:c.max,theme:"high-to-low"});g.push(k)}d.includeOpacityVariable&&(e=new y({field:"Magnitude",stops:[new u({value:e[0],opacity:b.minOpacity}),new u({value:e[4],opacity:b.maxOpacity})]}),h.push(e),e=new p({type:"opacity",minSliderValue:c.min,maxSliderValue:c.max}),g.push(e));d.includeSizeVariable&&(e=new z({field:"Magnitude",
stops:[new v({value:c.min,size:b.minSize}),new v({value:c.max,size:b.maxSize})]}),h.push(e),e=new p({type:"size",minSliderValue:c.min,maxSliderValue:c.max,theme:"high-to-low"}),g.push(e));g=new w({type:"flow",visualVariables:g.length?g:void 0,flowTheme:b.theme});a.visualVariables=h;a.authoringInfo=g;a.legendOptions=d.legendOptions;return{renderer:a,visualVariables:h.map(n=>n.clone()),flowScheme:q.cloneScheme(b),basemapId:f.basemapId,basemapTheme:f.basemapTheme,layerEffect:b.layerEffect,statistics:c}}
r.createRenderer=async function(a){a=await C(a);const d=t.createFlowRenderer(a.layer.rasterInfo);if(null==d)throw new l("flow-renderer:not-supported","Only vector data is supported");return E(d,a)};Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});