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.
248 lines
126 KiB
248 lines
126 KiB
// All material copyright Esri, All Rights Reserved, unless otherwise specified. |
|
// See https://js.arcgis.com/4.30/esri/copyright.txt for details. |
|
//>>built |
|
require({cache:{"esri/views/2d/engine/flow/FlowView2D":function(){define("../../../../chunks/tslib.es6 ../../../../Graphic ../../../../core/Accessor ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ./createFlowStyle ./dataUtils ./FlowContainer ./FlowStrategy".split(" "),function(m,H,B,v,I,L,U,D,R,T,M,t,A){B=class extends B{constructor(){super(...arguments); |
|
this._loadImagery=(J,q,r,p,y)=>M.loadImagery(this.layer,J,q,r,p,y);this._createFlowMesh=(J,q,r,p)=>this.layer.createFlowMesh({meshType:J,flowData:r,simulationSettings:q},{signal:p});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:J}=this,q=()=>{this._loadImagery=(r,p,y,Q,a)=>M.loadImagery(J,r,p,y,Q,a);this._updateVisualization()};"multidimensionalDefinition"in |
|
J?this.addHandles(v.watch(()=>J.multidimensionalDefinition,q)):this.addHandles([v.watch(()=>J.mosaicRule,q),v.watch(()=>J.rasterFunction,q),v.watch(()=>J.definitionExpression,q)]);this.container=new t;this._strategy=new A({flowContainer:this.container});this._updateVisualization()}detach(){this._strategy.destroy();this.container?.removeAllChildren();this.container=null;this.removeHandles()}update(J){J.stationary?this._strategy.update(J):this.layerView.requestUpdate()}hitTest(J){return new H({attributes:{}, |
|
geometry:J.clone(),layer:this.layer})}moveEnd(){}async doRefresh(){}_updateVisualization(){var J=this.layer.renderer;null!=J&&"flow"===J.type&&(J=T(J,{loadImagery:this._loadImagery,createFlowMesh:this._createFlowMesh,timeExtent:this.timeExtent}),this.container.flowStyle=J,this.layerView.requestUpdate())}};m.__decorate([I.property()],B.prototype,"_strategy",void 0);m.__decorate([I.property()],B.prototype,"attached",void 0);m.__decorate([I.property()],B.prototype,"container",void 0);m.__decorate([I.property()], |
|
B.prototype,"layer",void 0);m.__decorate([I.property()],B.prototype,"layerView",void 0);m.__decorate([I.property()],B.prototype,"type",void 0);m.__decorate([I.property()],B.prototype,"updating",null);m.__decorate([I.property()],B.prototype,"timeExtent",void 0);return B=m.__decorate([R.subclass("esri.views.2d.engine.flow.FlowView2D")],B)})},"esri/views/2d/engine/flow/createFlowStyle":function(){define(["./utils","./styles/Imagery","./styles/Particles","./styles/Stack","./styles/Streamlines"],function(m, |
|
H,B,v,I){return function(L,U){const {flowSpeed:D,trailLength:R}=L,T=m.getFlowSimulationSettings(L);let M=null;const t={opacity:m.getOpacity(L),size:m.getSize(L)};let A=m.getColor(L);"none"===L.background?t.color=A:("constant"===A.kind&&(A={kind:"ramp",stops:[0,1],values:[0,0,0,1,A.value[0],A.value[1],A.value[2],A.value[3]],count:2}),M=new H.Imagery({loadImagery:U.loadImagery,timeExtent:U.timeExtent,color:A,opacity:{kind:"constant",value:[1]}}),t.color=m.getForegroundColor());U={loadImagery:U.loadImagery, |
|
createFlowMesh:U.createFlowMesh,simulationSettings:T,timeExtent:U.timeExtent,trailLength:R,flowSpeed:D,featheringSize:1,featheringOffset:.5,introFade:!0,fadeToZero:!0,decayRate:2.3,color:t.color,opacity:t.opacity,size:t.size};L="butt"===L.trailCap||4>=m.getMax(m.getSize(L))?new I(U):new B.Particles(U);return null!=M?new v.Stack([M,L]):L}})},"esri/views/2d/engine/flow/utils":function(){define(["exports","../../../../core/screenUtils"],function(m,H){function B(D){return"constant"===D.kind?D.value[0]: |
|
D.values[D.values.length-1]}function v(D){D=D.toRgba();return[D[0]/255,D[1]/255,D[2]/255,D[3]]}function I(D){if(!D.hasVisualVariables("size"))return{kind:"constant",value:[H.pt2px(D.trailWidth)]};const R=D.getVisualVariablesForType("size")[0];D=[];const T=[];if(R.stops){for(M of R.stops)D.push(M.value),T.push(H.pt2px(M.size));var M=R.stops.length}else D.push(R.minDataValue,R.maxDataValue),T.push(H.pt2px(R.minSize),H.pt2px(R.maxSize)),M=2;return{kind:"ramp",stops:D,values:T,count:M}}function L(D,R, |
|
T,M){switch(R){case "int":D.setUniform1iv(T,M);break;case "float":D.setUniform1fv(T,M);break;case "vec2":D.setUniform2fv(T,M);break;case "vec3":D.setUniform3fv(T,M);break;case "vec4":D.setUniform4fv(T,M)}}function U(D,R){return D===R?!0:null!=D&&null!=R?D.equals(R):!1}m.areStreamlinesCompatible=function(D,R){var T=D.simulationSettings,M=R.simulationSettings;let t;t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=T.collisions===M.collisions)&&T.density===M.density)&&T.interpolate===M.interpolate)&&T.lineCollisionWidth=== |
|
M.lineCollisionWidth)&&T.lineSpacing===M.lineSpacing)&&T.maxTurnAngle===M.maxTurnAngle)&&T.minSpeedThreshold===M.minSpeedThreshold)&&T.segmentLength===M.segmentLength)&&T.smoothing===M.smoothing)&&T.velocityScale===M.velocityScale)&&T.verticesPerLine===M.verticesPerLine;return t&&U(D.timeExtent,R.timeExtent)?T=(T=(T=(T=(T=D.loadImagery===R.loadImagery)&&D.createFlowMesh===R.createFlowMesh)&&D.color.kind===R.color.kind)&&D.opacity.kind===R.opacity.kind)&&D.size.kind===R.size.kind:!1};m.getColor=function(D){if(!D.hasVisualVariables("color"))return{kind:"constant", |
|
value:v(D.color)};D=D.getVisualVariablesForType("color")[0];const R=[],T=[];for(const M of D.stops)R.push(M.value),Array.prototype.push.apply(T,v(M.color));return{kind:"ramp",stops:R,values:T,count:D.stops.length}};m.getFlowSimulationSettings=function(D){var R=I(D);R=B(R);const T=Math.max(R/2,5),M=Math.round(H.pt2px(D.maxPathLength)/T)+1,{density:t}=D;return{smoothing:H.pt2px(D.smoothing),interpolate:!0,velocityScale:"flow-from"===D.flowRepresentation?1:-1,verticesPerLine:M,minSpeedThreshold:.001, |
|
segmentLength:T,maxTurnAngle:1,collisions:!0,lineCollisionWidth:R,lineSpacing:10,density:t}};m.getForegroundColor=function(D){return{kind:"constant",value:[.1,.1,.1,1]}};m.getMax=B;m.getOpacity=function(D){if(!D.hasVisualVariables("opacity"))return{kind:"constant",value:[1]};D=D.getVisualVariablesForType("opacity")[0];const R=[],T=[];for(const M of D.stops)R.push(M.value),T.push(M.opacity);return{kind:"ramp",stops:R,values:T,count:D.stops.length}};m.getSize=I;m.setUniform=L;m.setUniforms=function(D, |
|
R,T,M){"constant"===M.kind?L(D,T,`u_${R}`,M.value):(L(D,"float",`u_${R}_stops`,M.stops),L(D,T,`u_${R}_values`,M.values),D.setUniform1i(`u_${R}_count`,M.count))};m.timeExtentsEqual=U;m.toRgba=v;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/flow/styles/Imagery":function(){define("exports ../../../../../core/promiseUtils ../utils ../../../../webgl/BufferObject ../../../../webgl/enums ../../../../webgl/Texture ../../../../webgl/TextureDescriptor ../../../../webgl/VertexArrayObject ../../../../webgl/VertexElementDescriptor".split(" "), |
|
function(m,H,B,v,I,L,U,D,R){class T{constructor(q){this._params=q;this.animated=!1}isCompatible(q){if(!(q instanceof T&&B.timeExtentsEqual(this._params.timeExtent,q._params.timeExtent)))return!1;let r;return r=(r=(r=this._params.loadImagery===q._params.loadImagery)&&this._params.color.kind===q._params.color.kind)&&this._params.opacity.kind===q._params.opacity.kind}async load(q,r){const {extent:p,size:y}=q;H.throwIfAborted(r);q=await this._params.loadImagery(p,y[0],y[1],this._params.timeExtent,r); |
|
return new J(q,{color:this._params.color,opacity:this._params.opacity})}render(q,r,p){({context:q}=q);const {program:y}=p;q.setFaceCullingEnabled(!1);q.setBlendingEnabled(!0);q.setBlendFunction(I.BlendFactor.ONE,I.BlendFactor.ONE_MINUS_SRC_ALPHA);q.useProgram(y);y.setUniformMatrix3fv("u_dvsMat3",r.dvsMat3);q.bindTexture(p.texture,0);y.setUniform1i("u_texture",0);y.setUniform1f("u_Min",p.min);y.setUniform1f("u_Max",p.max);B.setUniforms(y,"color","vec4",this._params.color);B.setUniforms(y,"opacity", |
|
"float",this._params.opacity);q.bindVAO(p.vertexArray);q.drawArrays(I.PrimitiveType.TRIANGLE_STRIP,0,4)}}const M=new Map;M.set("a_position",0);M.set("a_texcoord",1);const t={geometry:[new R.VertexElementDescriptor("a_position",2,I.DataType.UNSIGNED_SHORT,0,8),new R.VertexElementDescriptor("a_texcoord",2,I.DataType.UNSIGNED_SHORT,4,8)]},A={vsPath:"raster/flow/imagery",fsPath:"raster/flow/imagery",attributes:M};class J{constructor(q,r){this._flowData=q;this._values=r}attach(q){var {context:r}=q;const {width:p, |
|
height:y}=this._flowData;var Q={geometry:v.BufferObject.createVertex(r,I.Usage.STATIC_DRAW,new Uint16Array([0,0,0,1,p,0,1,1,0,y,0,0,p,y,1,0]))};Q=new D.VertexArrayObject(r,M,t,Q);var a=[];"ramp"===this._values.color.kind&&a.push("vvColor");"ramp"===this._values.opacity.kind&&a.push("vvOpacity");q=q.painter.materialManager.getProgram(A,a);a=1E6;let b=-1E6;for(var d=0;d<y;d++)for(var g=0;g<p;g++)if(0!==this._flowData.mask[d*p+g]){var e=this._flowData.data[2*(d*p+g)],f=this._flowData.data[2*(d*p+g)+ |
|
1];e=Math.sqrt(e*e+f*f);a=Math.min(a,e);b=Math.max(b,e)}d=new Uint8Array(4*p*y);for(g=0;g<y;g++)for(e=0;e<p;e++)if(0!==this._flowData.mask[g*p+e]){f=this._flowData.data[2*(g*p+e)];const h=this._flowData.data[2*(g*p+e)+1];d[4*(g*p+e)]=(Math.sqrt(f*f+h*h)-a)/(b-a)*255;d[4*(g*p+e)+1]=0;d[4*(g*p+e)+2]=0;d[4*(g*p+e)+3]=255}else d[4*(g*p+e)]=0,d[4*(g*p+e)+1]=0,d[4*(g*p+e)+2]=0,d[4*(g*p+e)+3]=0;g=new U.TextureDescriptor;g.internalFormat=I.PixelFormat.RGBA;g.wrapMode=I.TextureWrapMode.CLAMP_TO_EDGE;g.flipped= |
|
!0;g.width=p;g.height=y;r=new L.Texture(r,g,d);this.vertexArray=Q;this.program=q;this.texture=r;this.min=a;this.max=b;this._flowData=null}detach(){this.vertexArray.dispose();this.texture.dispose()}get ready(){return this.program.compiled}}m.Imagery=T;m.ImageryResources=J;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/flow/styles/Particles":function(){define("exports ../../../../../core/promiseUtils ../utils ../../../../webgl/BufferObject ../../../../webgl/enums ../../../../webgl/VertexArrayObject ../../../../webgl/VertexElementDescriptor".split(" "), |
|
function(m,H,B,v,I,L,U){class D{constructor(A){this._params=A}get animated(){return 0<this._params.flowSpeed}isCompatible(A){return A instanceof D?B.areStreamlinesCompatible(this._params,A._params):!1}async load(A,J){const {extent:q,size:r}=A;H.throwIfAborted(J);A=await this._params.loadImagery(q,r[0],r[1],this._params.timeExtent,J);const {vertexData:p,indexData:y}=await this._params.createFlowMesh("Particles",this._params.simulationSettings,A,J);return new t(p,y,{color:this._params.color,opacity:this._params.opacity, |
|
size:this._params.size})}render(A,J,q){({context:A}=A);const {program:r}=q;A.setFaceCullingEnabled(!1);A.setBlendingEnabled(!0);A.setBlendFunction(I.BlendFactor.ONE,I.BlendFactor.ONE_MINUS_SRC_ALPHA);A.useProgram(r);r.setUniform1f("u_time",J.time);r.setUniform1f("u_trailLength",this._params.trailLength);r.setUniform1f("u_flowSpeed",this._params.flowSpeed);r.setUniform1f("u_featheringSize",this._params.featheringSize);r.setUniform1f("u_featheringOffset",this._params.featheringOffset);r.setUniform1f("u_introFade", |
|
this._params.introFade?1:0);r.setUniform1f("u_fadeToZero",this._params.fadeToZero?1:0);r.setUniform1f("u_decayRate",this._params.decayRate);r.setUniformMatrix3fv("u_dvsMat3",J.dvsMat3);r.setUniformMatrix3fv("u_displayViewMat3",J.displayViewMat3);B.setUniforms(r,"color","vec4",this._params.color);B.setUniforms(r,"opacity","float",this._params.opacity);B.setUniforms(r,"size","float",this._params.size);A.bindVAO(q.vertexArray);A.drawElements(I.PrimitiveType.TRIANGLES,q.indexCount,I.DataType.UNSIGNED_INT, |
|
0)}}const R=new Map;R.set("a_xyts0",0);R.set("a_xyts1",1);R.set("a_typeIdDurationSeed",2);R.set("a_extrudeInfo",3);const T={geometry:[new U.VertexElementDescriptor("a_xyts0",4,I.DataType.FLOAT,0,64),new U.VertexElementDescriptor("a_xyts1",4,I.DataType.FLOAT,16,64),new U.VertexElementDescriptor("a_typeIdDurationSeed",4,I.DataType.FLOAT,32,64),new U.VertexElementDescriptor("a_extrudeInfo",4,I.DataType.FLOAT,48,64)]},M={vsPath:"raster/flow/particles",fsPath:"raster/flow/particles",attributes:R};class t{constructor(A, |
|
J,q){this._vertexData=A;this._indexData=J;this._values=q}attach(A){var {context:J}=A,q=v.BufferObject.createVertex(J,I.Usage.STATIC_DRAW,this._vertexData);const r=v.BufferObject.createIndex(J,I.Usage.STATIC_DRAW,this._indexData);J=new L.VertexArrayObject(J,R,T,{geometry:q},r);q=[];"ramp"===this._values.color.kind&&q.push("vvColor");"ramp"===this._values.opacity.kind&&q.push("vvOpacity");"ramp"===this._values.size.kind&&q.push("vvSize");A=A.painter.materialManager.getProgram(M,q);this.vertexArray= |
|
J;this.program=A;this.indexCount=this._indexData.length;this._indexData=this._vertexData=null}detach(){this.vertexArray.dispose()}get ready(){return this.program.compiled}}m.Particles=D;m.ParticlesResources=t;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/flow/styles/Stack":function(){define(["exports"],function(m){class H{constructor(v){this._styles=v}get animated(){return this._styles.reduce((v,I)=>v||I.animated,!1)}isCompatible(v){if(!(v instanceof H)||this._styles.length!== |
|
v._styles.length)return!1;const I=this._styles.length;for(let L=0;L<I;L++)if(!this._styles[L].isCompatible(v._styles[L]))return!1;return!0}async load(v,I){const L=await Promise.all(this._styles.map(U=>U.load(v,I)));return new B(L)}render(v,I,L){for(let U=0;U<this._styles.length;U++)this._styles[U].render(v,I,L.resources[U])}}class B{constructor(v){this.resources=v}attach(v){for(const I of this.resources)I.attach(v)}detach(){for(const v of this.resources)v.detach()}get ready(){return this.resources.reduce((v, |
|
I)=>v&&I.ready,!0)}}m.Stack=H;m.StackResources=B;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/flow/styles/Streamlines":function(){define("../../../../../core/promiseUtils ../utils ../../../../webgl/BufferObject ../../../../webgl/enums ../../../../webgl/VertexArrayObject ../../../../webgl/VertexElementDescriptor".split(" "),function(m,H,B,v,I,L){class U{constructor(t){this._params=t}get animated(){return 0<this._params.flowSpeed}isCompatible(t){return t instanceof |
|
U?H.areStreamlinesCompatible(this._params,t._params):!1}async load(t,A){const {extent:J,size:q}=t;m.throwIfAborted(A);t=await this._params.loadImagery(J,q[0],q[1],this._params.timeExtent,A);const {vertexData:r,indexData:p}=await this._params.createFlowMesh("Streamlines",this._params.simulationSettings,t,A);return new M(r,p,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(t,A,J){({context:t}=t);const {program:q}=J;t.setFaceCullingEnabled(!1);t.setBlendingEnabled(!0); |
|
t.setBlendFunction(v.BlendFactor.ONE,v.BlendFactor.ONE_MINUS_SRC_ALPHA);t.useProgram(q);q.setUniform1f("u_time",A.time);q.setUniform1f("u_trailLength",this._params.trailLength);q.setUniform1f("u_flowSpeed",this._params.flowSpeed);q.setUniform1f("u_featheringSize",this._params.featheringSize);q.setUniform1f("u_featheringOffset",this._params.featheringOffset);q.setUniform1f("u_introFade",this._params.introFade?1:0);q.setUniform1f("u_fadeToZero",this._params.fadeToZero?1:0);q.setUniform1f("u_decayRate", |
|
this._params.decayRate);q.setUniformMatrix3fv("u_dvsMat3",A.dvsMat3);q.setUniformMatrix3fv("u_displayViewMat3",A.displayViewMat3);H.setUniforms(q,"color","vec4",this._params.color);H.setUniforms(q,"opacity","float",this._params.opacity);H.setUniforms(q,"size","float",this._params.size);t.bindVAO(J.vertexArray);t.drawElements(v.PrimitiveType.TRIANGLES,J.indexCount,v.DataType.UNSIGNED_INT,0)}}const D=new Map;D.set("a_positionAndSide",0);D.set("a_timeInfo",1);D.set("a_extrude",2);D.set("a_speed",3); |
|
const R={geometry:[new L.VertexElementDescriptor("a_positionAndSide",3,v.DataType.FLOAT,0,36),new L.VertexElementDescriptor("a_timeInfo",3,v.DataType.FLOAT,12,36),new L.VertexElementDescriptor("a_extrude",2,v.DataType.FLOAT,24,36),new L.VertexElementDescriptor("a_speed",1,v.DataType.FLOAT,32,36)]},T={vsPath:"raster/flow/streamlines",fsPath:"raster/flow/streamlines",attributes:D};class M{constructor(t,A,J){this._vertexData=t;this._indexData=A;this._values=J}attach(t){var {context:A}=t,J=B.BufferObject.createVertex(A, |
|
v.Usage.STATIC_DRAW,this._vertexData);const q=B.BufferObject.createIndex(A,v.Usage.STATIC_DRAW,this._indexData);A=new I.VertexArrayObject(A,D,R,{geometry:J},q);J=[];"ramp"===this._values.color.kind&&J.push("vvColor");"ramp"===this._values.opacity.kind&&J.push("vvOpacity");"ramp"===this._values.size.kind&&J.push("vvSize");t=t.painter.materialManager.getProgram(T,J);this.vertexArray=A;this.program=t;this.indexCount=this._indexData.length;this._indexData=this._vertexData=null}detach(){this.vertexArray.dispose()}get ready(){return this.program.compiled}} |
|
return U})},"esri/views/2d/engine/flow/dataUtils":function(){define("exports ../../../../geometry ../../../../core/has ../../../../core/Logger ../../../../core/mathUtils ../../../../core/promiseUtils ../../../../core/RandomLCG ../../../../geometry/support/spatialReferenceUtils ../../../../geometry/Extent".split(" "),function(m,H,B,v,I,L,U,D,R){function T(a,b){const d=A(b.data,b.width,b.height,a.smoothing);return a.interpolate?(g,e)=>{const f=Math.floor(g),h=Math.floor(e);if(0>f||f>=b.width||0>h|| |
|
h>=b.height)return[0,0];g-=f;e-=h;const k=f<b.width-1?f+1:f,n=h<b.height-1?h+1:h;return[(d[2*(h*b.width+f)]*(1-e)+d[2*(n*b.width+f)]*e)*(1-g)+(d[2*(h*b.width+k)]*(1-e)+d[2*(n*b.width+k)]*e)*g,(d[2*(h*b.width+f)+1]*(1-e)+d[2*(n*b.width+f)+1]*e)*(1-g)+(d[2*(h*b.width+k)+1]*(1-e)+d[2*(n*b.width+k)+1]*e)*g]}:(g,e)=>{g=Math.round(g);e=Math.round(e);return 0>g||g>=b.width||0>e||e>=b.height?[0,0]:[d[2*(e*b.width+g)],d[2*(e*b.width+g)+1]]}}function M(a,b,d,g,e,f,h,k,n){const u=[];let x=0,[w,C]=b(d,g);w*= |
|
a.velocityScale;C*=a.velocityScale;u.push({x:d,y:g,t:x,speed:Math.sqrt(w*w+C*C)});for(let S=0;S<a.verticesPerLine;S++){let [N,Y]=b(d,g);N*=a.velocityScale;Y*=a.velocityScale;const X=Math.sqrt(N*N+Y*Y);if(X<a.minSpeedThreshold)break;const da=N/X,ba=Y/X;d+=da*a.segmentLength;g+=ba*a.segmentLength;x+=a.segmentLength/X;if(Math.acos(da*E+ba*O)>a.maxTurnAngle)break;if(a.collisions){var E=Math.round(d*n);var O=Math.round(g*n);if(0>E||E>h-1||0>O||O>k-1)break;const aa=f[O*h+E];if(-1!==aa&&aa!==e)break;f[O* |
|
h+E]=e}u.push({x:d,y:g,t:x,speed:X});E=da;O=ba}return u}function t(a,b,d,g){const e=[],f=new U,h=1/Math.max(a.lineCollisionWidth,1),k=Math.round(d*h),n=Math.round(g*h),u=new Int32Array(k*n);for(var x=0;x<u.length;x++)u[x]=-1;x=[];for(let w=0;w<g;w+=a.lineSpacing)for(let C=0;C<d;C+=a.lineSpacing)x.push({x:C,y:w,sort:f.getFloat()});x.sort((w,C)=>w.sort-C.sort);for(const {x:w,y:C}of x)f.getFloat()<a.density&&(d=M(a,b,w,C,e.length,u,k,n,h),2>d.length||e.push(d));return e}function A(a,b,d,g){if(0===g)return a; |
|
const e=Math.round(3*g),f=Array(2*e+1);var h=0;for(var k=-e;k<=e;k++){var n=Math.exp(-k*k/(g*g));f[k+e]=n;h+=n}for(g=-e;g<=e;g++)f[g+e]/=h;h=new Float32Array(a.length);for(g=0;g<d;g++)for(k=0;k<b;k++){var u=n=0;for(var x=-e;x<=e;x++)if(!(0>k+x||k+x>=b)){var w=f[x+e];n+=w*a[2*(g*b+(k+x))];u+=w*a[2*(g*b+(k+x))+1]}h[2*(g*b+k)]=n;h[2*(g*b+k)+1]=u}a=new Float32Array(a.length);for(g=0;g<b;g++)for(k=0;k<d;k++){u=n=0;for(x=-e;x<=e;x++)0>k+x||k+x>=d||(w=f[x+e],n+=w*h[2*((k+x)*b+g)],u+=w*h[2*((k+x)*b+g)+1]); |
|
a[2*(k*b+g)]=n;a[2*(k*b+g)+1]=u}return a}function J(a,b){const d=new U;var g=a.reduce((k,n)=>k+n.length,0);g=new Float32Array(4*g);const e=Array(a.length);let f=0,h=0;for(const k of a){a=f;for(const n of k)g[4*f]=n.x,g[4*f+1]=n.y,g[4*f+2]=n.t,g[4*f+3]=n.speed,f++;e[h++]={startVertex:a,numberOfVertices:k.length,totalTime:k[k.length-1].t,timeSeed:b?d.getFloat():0}}return{lineVertices:g,lineDescriptors:e}}function q(a,b){function d(E,O,S,N,Y,X,da,ba){const aa=9*n;let ea=0;k[aa+ea++]=E;k[aa+ea++]=O;k[aa+ |
|
ea++]=1;k[aa+ea++]=S;k[aa+ea++]=X;k[aa+ea++]=da;k[aa+ea++]=N/2;k[aa+ea++]=Y/2;k[aa+ea++]=ba;n++;k[aa+ea++]=E;k[aa+ea++]=O;k[aa+ea++]=-1;k[aa+ea++]=S;k[aa+ea++]=X;k[aa+ea++]=da;k[aa+ea++]=-N/2;k[aa+ea++]=-Y/2;k[aa+ea++]=ba;n++}const {lineVertices:g,lineDescriptors:e}=a;var f=a=0;for(var h of e)a+=2*h.numberOfVertices,f+=6*(h.numberOfVertices-1);const k=new Float32Array(9*a);h=new Uint32Array(f);let n=0;a=0;for(const E of e){const {totalTime:O,timeSeed:S}=E;let N=f=null,Y=null;var u=null,x=null,w=null; |
|
for(let X=0;X<E.numberOfVertices;X++){u=g[4*(E.startVertex+X)];const da=g[4*(E.startVertex+X)+1],ba=g[4*(E.startVertex+X)+2],aa=g[4*(E.startVertex+X)+3];let ea=null,ka=null;var C=null;let c=null;0<X&&(ea=u-f,ka=da-N,C=Math.sqrt(ea*ea+ka*ka),ea/=C,ka/=C,1<X?(x=ea+x,w=ka+w,C=Math.sqrt(x*x+w*w),x/=C,w/=C,C=Math.min(1/(x*ea+w*ka),b),x*=C,w*=C,C=-w,c=x):(C=-ka,c=ea),null!==C&&null!==c&&(d(f,N,Y,C,c,O,S,aa),h[a++]=n-2,h[a++]=n,h[a++]=n-1,h[a++]=n,h[a++]=n+1,h[a++]=n-1));f=u;N=da;Y=ba;x=ea;w=ka;u=aa}d(f, |
|
N,Y,-w,x,O,S,u)}return{vertexData:k,indexData:h}}function r(a){function b(z,F){var P=ba+ea,G=aa+ka,V=Math.sqrt(P*P+G*G);P/=V;G/=V;var W=ba*P+aa*G,K=ea+c,ca=ka+l;V=Math.sqrt(K*K+ca*ca);K/=V;ca/=V;var Z=ea*K+ka*ca;V=C;var ja=E,ia=O,ha=S;G=-(G/W);P/=W;W=N;var la=Y,ma=X,na=da;ca=-(ca/Z);K/=Z;Z=16*x;let fa=0;for(const pa of[1,2])for(const qa of[1,2,3,4])n[Z+fa++]=V,n[Z+fa++]=ja,n[Z+fa++]=ia,n[Z+fa++]=ha,n[Z+fa++]=W,n[Z+fa++]=la,n[Z+fa++]=ma,n[Z+fa++]=na,n[Z+fa++]=pa,n[Z+fa++]=qa,n[Z+fa++]=z,n[Z+fa++]= |
|
F,n[Z+fa++]=G/2,n[Z+fa++]=P/2,n[Z+fa++]=ca/2,n[Z+fa++]=K/2,x++;u[w++]=x-8;u[w++]=x-7;u[w++]=x-6;u[w++]=x-7;u[w++]=x-5;u[w++]=x-6;u[w++]=x-4;u[w++]=x-3;u[w++]=x-2;u[w++]=x-3;u[w++]=x-1;u[w++]=x-2}function d(z,F,P,G,V,W){ba=ea;aa=ka;ea=c;ka=l;null==ba&&null==aa&&(ba=ea,aa=ka);if(null!=N&&null!=Y){c=z-N;l=F-Y;const K=Math.sqrt(c*c+l*l);c/=K;l/=K}null!=ba&&null!=aa&&b(V,W);C=N;E=Y;O=X;S=da;N=z;Y=F;X=P;da=G}function g(z,F){ba=ea;aa=ka;ea=c;ka=l;null==ba&&null==aa&&(ba=ea,aa=ka);null!=ba&&null!=aa&&b(z, |
|
F)}const {lineVertices:e,lineDescriptors:f}=a;let h=a=0;for(var k of f){const z=k.numberOfVertices-1;a+=8*z;h+=12*z}const n=new Float32Array(16*a),u=new Uint32Array(h);let x=0,w=0,C,E,O,S,N,Y,X,da,ba,aa,ea,ka,c,l;for(const z of f){l=c=ka=ea=aa=ba=da=X=Y=N=S=O=E=C=null;const {totalTime:F,timeSeed:P}=z;for(k=0;k<z.numberOfVertices;k++)d(e[4*(z.startVertex+k)],e[4*(z.startVertex+k)+1],e[4*(z.startVertex+k)+2],e[4*(z.startVertex+k)+3],F,P);g(F,P)}return{vertexData:n,indexData:u}}function p(a,b){const d= |
|
b.pixels,{width:g,height:e}=b,f=new Float32Array(g*e*2),h=b.mask||new Uint8Array(g*e*2);b.mask||h.fill(255);if("vector-uv"===a)for(a=0;a<g*e;a++)f[2*a]=d[0][a],f[2*a+1]=-d[1][a];else if("vector-magdir"===a)for(a=0;a<g*e;a++){b=d[0][a];const k=I.deg2rad(d[1][a]),n=Math.sin(k-Math.PI/2);f[2*a]=Math.cos(k-Math.PI/2)*b;f[2*a+1]=n*b}return{data:f,mask:h,width:g,height:e}}async function y(a,b,d,g,e,f){const h={requestProjectedLocalDirections:!0,signal:f};null!=e&&(h.timeExtent=e);if("imagery"===a.type)return await a.load({signal:f}), |
|
e=a.rasterInfo.dataType,a=await a.fetchImage(b,d,g,h),null==a?.pixelData?.pixelBlock?{data:new Float32Array(d*g*2),mask:new Uint8Array(d*g),width:d,height:g}:p(e,a.pixelData.pixelBlock);await a.load({signal:f});e=a.serviceRasterInfo.dataType;a=await a.fetchPixels(b,d,g,h);return null==a?.pixelBlock?{data:new Float32Array(d*g*2),mask:new Uint8Array(d*g),width:d,height:g}:p(e,a.pixelBlock)}const Q=()=>v.getLogger("esri.views.2d.engine.flow.dataUtils");m.createAnimatedLinesData=J;m.createFlowMesh=async function(a, |
|
b,d,g){const e=performance.now();var f=T(b,d);const h=performance.now();d=t(b,f,d.width,d.height);b=performance.now();f=J(d,!0);d=performance.now();a="Streamlines"===a?q(f,10):r(f);f=performance.now();B("esri-2d-profiler")&&(Q().info("I.1","_createFlowFieldFromData (ms)",Math.round(h-e)),Q().info("I.2","_getStreamlines (ms)",Math.round(b-h)),Q().info("I.3","createAnimatedLinesData (ms)",Math.round(d-b)),Q().info("I.4","create{Streamlines|Particles}Mesh (ms)",Math.round(f-d)),Q().info("I.5","createFlowMesh (ms)", |
|
Math.round(f-e)),Q().info("I.6","Mesh size (bytes)",a.vertexData.buffer.byteLength+a.indexData.buffer.byteLength));await Promise.resolve();L.throwIfAborted(g);return a};m.createParticlesMesh=r;m.createStreamlinesMesh=q;m.loadImagery=async function(a,b,d,g,e,f){const h=performance.now();var k=D.getInfo(b.spatialReference);if(!k)return d=await y(a,b,d,g,e,f),B("esri-2d-profiler")&&Q().info("I.7","loadImagery, early exit (ms)",Math.round(performance.now()-h)),B("esri-2d-profiler")&&Q().info("I.9","Number of parts", |
|
1),d;const [n,u]=k.valid,x=Math.ceil(b.width/(u-n)),w=b.width/x,C=Math.round(d/x);let E=b.xmin;const O=[];k=performance.now();for(let S=0;S<x;S++){const N=new R({xmin:E,xmax:E+w,ymin:b.ymin,ymax:b.ymax,spatialReference:b.spatialReference});O.push(y(a,N,C,g,e,f));E+=w}a=await Promise.all(O);B("esri-2d-profiler")&&Q().info("I.8","All calls to _fetchPart (ms)",Math.round(performance.now()-k));B("esri-2d-profiler")&&Q().info("I.9","Number of parts",a.length);g={data:new Float32Array(d*g*2),mask:new Uint8Array(d* |
|
g),width:d,height:g};b=0;for(const S of a){for(a=0;a<S.height;a++)for(e=0;e<S.width;e++)b+e>=d||(g.data[2*(a*d+b+e)]=S.data[2*(a*S.width+e)],g.data[2*(a*d+b+e)+1]=S.data[2*(a*S.width+e)+1],g.mask[a*d+b+e]=S.mask[a*S.width+e]);b+=S.width}B("esri-2d-profiler")&&Q().info("I.10","loadImagery, general exit (ms)",Math.round(performance.now()-h));return g};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/flow/FlowContainer":function(){define(["./BrushFlow","../webgl/enums", |
|
"../webgl/WGLContainer"],function(m,H,B){class v extends B{constructor(){super(...arguments);this.flowStyle=null}doRender(I){super.doRender(I)}prepareRenderPasses(I){const L=I.registerRenderPass({name:"flow",brushes:[m],target:()=>this.children,drawPhase:H.WGLDrawPhase.MAP});return[...super.prepareRenderPasses(I),L]}}return v})},"esri/views/2d/engine/flow/BrushFlow":function(){define(["../../../../core/libs/gl-matrix-2/factories/mat3f32","../webgl/brushes/WGLBrush","../../../webgl/enums"],function(m, |
|
H,B){class v extends H{constructor(){super(...arguments);this._visualState={time:0,dvsMat3:m.create(),displayViewMat3:m.create()}}dispose(){}prepareState(I){({context:I}=I);I.setColorMask(!0,!0,!0,!0);I.setStencilFunction(B.CompareFunction.EQUAL,0,255)}draw(I,L){const {requestRender:U,allowDelayedRender:D}=I,{displayData:R}=L;if(null!=R&&("loaded"===R.state.name&&R.attach(I),"attached"===R.state.name)){var T=R.state.resources;D&&!T.ready&&null!=U?U():(this._visualState.time=I.time/1E3,this._visualState.dvsMat3= |
|
L.transforms.displayViewScreenMat3,this._visualState.displayViewMat3=I.state.displayViewMat3,R.flowStyle.render(I,this._visualState,T),R.flowStyle.animated&&null!=U&&U())}}}return v})},"esri/views/2d/engine/flow/FlowStrategy":function(){define("../../../../chunks/tslib.es6 ../../../../geometry ../../../../core/Accessor ../../../../core/Logger ../../../../core/mathUtils ../../../../core/promiseUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../geometry/Point ./FlowDisplayData ./FlowDisplayObject ../../../../geometry/Extent".split(" "), |
|
function(m,H,B,v,I,L,U,D,R,T,M,t,A,J){function q(r,p){const y=new M({x:(r.xmax+r.xmin)/2,y:(r.ymax+r.ymin)/2,spatialReference:r.spatialReference});var Q=r.xmax-r.xmin;const a=r.ymax-r.ymin,b=Math.abs(Math.cos(I.deg2rad(p))),d=Math.abs(Math.sin(I.deg2rad(p)));p=b*Q+d*a;Q=d*Q+b*a;r=new J({xmin:y.x-p/2,ymin:y.y-Q/2,xmax:y.x+p/2,ymax:y.y+Q/2,spatialReference:r.spatialReference});r.centerAt(y);return r}H=class extends B{constructor(r){super(r);this._flowDisplayObject=new A.FlowDisplayObject;this._loading= |
|
null}initialize(){this.flowContainer.addChild(this._flowDisplayObject)}destroy(){this._clear();this.flowContainer.removeAllChildren()}get updating(){return null!=this._loading}update(r){var {flowStyle:p}=this.flowContainer;if(null==p)this._clear();else{var {extent:y,rotation:Q,resolution:a,pixelRatio:b}=r.state;r=q(y,Q);r.expand(1.15);p=new t(p,r,[Math.round((r.xmax-r.xmin)/a),Math.round((r.ymax-r.ymin)/a)],b);if(null!=this._loading){if(this._loading.update(p))return;this._loading.detach();this._loading= |
|
null}null!=this._flowDisplayObject.displayData&&this._flowDisplayObject.displayData.update(p)||(p.load().then(()=>{this._flowDisplayObject.clear();this._flowDisplayObject.displayData=this._loading;this._loading=null},d=>{L.isAbortError(d)||(v.getLogger(this).error("A resource failed to load.",d),this._loading=null)}),this._loading=p)}}_clear(){this._flowDisplayObject.clear();null!=this._loading&&(this._loading.detach(),this._loading=null)}};m.__decorate([U.property()],H.prototype,"_loading",void 0); |
|
m.__decorate([U.property()],H.prototype,"flowContainer",void 0);m.__decorate([U.property()],H.prototype,"updating",null);return H=m.__decorate([T.subclass("esri.views.2d.engine.flow.FlowStrategy")],H)})},"esri/views/2d/engine/flow/FlowDisplayData":function(){define(["../../../../core/Logger"],function(m){class H{constructor(B,v,I,L){this.state={name:"created"};this.flowStyle=B;this.extent=v;this.size=I;this.pixelRatio=L}async load(){const B=new AbortController;this.state={name:"loading",abortController:B}; |
|
this.state={name:"loaded",resources:await this.flowStyle.load({extent:this.extent,size:this.size,pixelRatio:this.pixelRatio},B.signal)}}attach(B){if("loaded"!==this.state.name)m.getLogger("esri.views.2d.engine.flow.FlowDisplayData").error("Only loaded resources can be attached.");else{var v=this.state.resources;v.attach(B);this.state={name:"attached",resources:v}}}detach(){"loading"===this.state.name?(this.state.abortController.abort(),this.state={name:"detached"}):"attached"===this.state.name&&(this.state.resources.detach(), |
|
this.state={name:"detached"})}update(B){if(!this.flowStyle.isCompatible(B.flowStyle)||!this.extent.equals(B.extent)||this.size[0]!==B.size[0]||this.size[1]!==B.size[1]||this.pixelRatio!==B.pixelRatio)return!1;this.flowStyle=B.flowStyle;return!0}}return H})},"esri/views/2d/engine/flow/FlowDisplayObject":function(){define(["exports","../../../../core/mathUtils","../../../../core/libs/gl-matrix-2/math/mat3","../../../../core/libs/gl-matrix-2/factories/mat3f32","../DisplayObject"],function(m,H,B,v,I){class L extends I.DisplayObject{constructor(){super(...arguments); |
|
this._displayData=null}get displayData(){return this._displayData}set displayData(U){this._displayData=U;this.requestRender()}clear(){null!=this._displayData&&(this._displayData.detach(),this._displayData=null,this.requestRender())}setTransform(U){var {displayData:D}=this;if(null!=D){var R=[0,0];U.toScreen(R,[D.extent.xmin,D.extent.ymax]);D=(D.extent.xmax-D.extent.xmin)/D.size[0]/U.resolution;var T=H.deg2rad(U.rotation),{displayViewScreenMat3:M}=this.transforms;B.fromTranslation(M,[-1,1,0]);B.scale(M, |
|
M,[2/(U.size[0]*U.pixelRatio),-2/(U.size[1]*U.pixelRatio),1]);B.translate(M,M,[R[0],R[1],0]);B.rotate(M,M,T);B.scale(M,M,[D*U.pixelRatio,D*U.pixelRatio,1])}}_createTransforms(){return{displayViewScreenMat3:v.create()}}}m.FlowDisplayObject=L;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/layers/LayerView2D":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Collection ../../../core/collectionUtils ../../../core/Error ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../engine/Container ../support/HighlightOptions ../../layers/support/ClipRect ../../layers/support/Geometry ../../layers/support/Path ../../support/layerViewUtils".split(" "), |
|
function(m,H,B,v,I,L,U,D,R,T,M,t,A,J,q,r,p){const y=B.ofType({key:"type",base:null,typeMap:{rect:J,path:r,geometry:q}});m.LayerView2DMixin=Q=>{Q=class extends Q{constructor(){super(...arguments);this.attached=!1;this.clips=new y;this.highlightOptions=null;this.lastUpdateId=-1;this.updateRequested=this.moving=!1;this._visibleAtCurrentScale=!0}initialize(){const a=this.view?.spatialReferenceLocked??!0;this.view?.spatialReference&&a&&!this.spatialReferenceSupported?this.addResolvingPromise(Promise.reject(new I("layerview:spatial-reference-incompatible", |
|
"The spatial reference of this layer does not meet the requirements of the view",{layer:this.layer}))):(this.container||(this.container=new t.Container),this.container.fadeTransitionEnabled=!0,this.container.visible=!1,this.container.endTransitions(),this.addHandles([L.watch(()=>this.suspended,b=>{this.container&&(this.container.visible=!b)},L.syncAndInitial),L.watch(()=>this.updateSuspended,b=>{this.view&&!b&&this.updateRequested&&this.view.requestUpdate()},L.syncAndInitial),L.watch(()=>this.layer?.opacity?? |
|
1,b=>{this.container&&(this.container.opacity=b)},L.syncAndInitial),L.watch(()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal",b=>{this.container&&(this.container.blendMode=b)},L.syncAndInitial),L.watch(()=>this.layer&&"effect"in this.layer?this.layer.effect:null,b=>{this.container&&(this.container.effect=b)},L.syncAndInitial),L.watch(()=>this.highlightOptions,b=>this.container.highlightOptions=b,L.syncAndInitial),L.on(()=>this.clips,"change",()=>{this.container&&(this.container.clips= |
|
this.clips)},L.syncAndInitial),L.watch(()=>({scale:this.view?.scale,scaleRange:this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null}),({scale:b,scaleRange:d})=>{b=p.isInEffectiveScaleRange(d,b);b!==this._visibleAtCurrentScale&&(this._visibleAtCurrentScale=b)},L.syncAndInitial)],"constructor"),this.view?.whenLayerView?this.view.whenLayerView(this.layer).then(b=>{b===this&&this.processAttach()},()=>{}):this.when().then(()=>{this.processAttach()},()=>{}))}destroy(){this.processDetach(); |
|
this.updateRequested=!1}get spatialReferenceSupported(){const a=this.view?.spatialReference;return null==a||this.supportsSpatialReference(a)}get updating(){return this.spatialReferenceSupported&&(!this.attached||!this.suspended&&(this.updateRequested||this.isUpdating())||!!this._updatingHandles?.updating)}get visibleAtCurrentScale(){return this._visibleAtCurrentScale}processAttach(){this.isResolved()&&!this.attached&&!this.destroyed&&this.spatialReferenceSupported&&(this.attach(),this.attached=!0, |
|
this.requestUpdate())}processDetach(){this.attached&&(this.attached=!1,this.removeHandles("attach"),this.detach(),this.updateRequested=!1)}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.updateSuspended||this.view.requestUpdate())}processUpdate(a){this.isFulfilled()&&!this.isResolved()?this.updateRequested=!1:(this._set("updateParameters",a),this.updateRequested&&!this.updateSuspended&&(this.updateRequested=!1,this.update(a)))}hitTest(a,b){return Promise.resolve(null)}supportsSpatialReference(a){return!0}canResume(){return this.spatialReferenceSupported? |
|
super.canResume()?this.visibleAtCurrentScale:!1:!1}getSuspendInfo(){const a=super.getSuspendInfo(),b=!this.spatialReferenceSupported;b&&(a.spatialReferenceNotSupported=b);return a}addAttachHandles(a){this.addHandles(a,"attach")}};H.__decorate([U.property()],Q.prototype,"attached",void 0);H.__decorate([U.property({type:y,set(a){a=v.referenceSetter(a,this._get("clips"),y);this._set("clips",a)}})],Q.prototype,"clips",void 0);H.__decorate([U.property()],Q.prototype,"container",void 0);H.__decorate([U.property({type:A})], |
|
Q.prototype,"highlightOptions",void 0);H.__decorate([U.property()],Q.prototype,"moving",void 0);H.__decorate([U.property({readOnly:!0})],Q.prototype,"spatialReferenceSupported",null);H.__decorate([U.property({readOnly:!0})],Q.prototype,"updateParameters",void 0);H.__decorate([U.property()],Q.prototype,"updateRequested",void 0);H.__decorate([U.property()],Q.prototype,"updating",null);H.__decorate([U.property()],Q.prototype,"view",void 0);H.__decorate([U.property()],Q.prototype,"_visibleAtCurrentScale", |
|
void 0);H.__decorate([U.property({readOnly:!0})],Q.prototype,"visibleAtCurrentScale",null);return Q=H.__decorate([M.subclass("esri.views.2d.layers.LayerView2D")],Q)};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/layers/support/ClipRect":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./ClipArea".split(" "),function(m, |
|
H,B,v,I,L,U){var D;B=D=class extends U{constructor(R){super(R);this.type="rect";this.bottom=this.top=this.right=this.left=null}clone(){return new D({left:this.left,right:this.right,top:this.top,bottom:this.bottom})}commitVersionProperties(){this.commitProperty("left");this.commitProperty("right");this.commitProperty("top");this.commitProperty("bottom")}};m.__decorate([H.property({type:[Number,String],json:{write:!0}})],B.prototype,"left",void 0);m.__decorate([H.property({type:[Number,String],json:{write:!0}})], |
|
B.prototype,"right",void 0);m.__decorate([H.property({type:[Number,String],json:{write:!0}})],B.prototype,"top",void 0);m.__decorate([H.property({type:[Number,String],json:{write:!0}})],B.prototype,"bottom",void 0);return B=D=m.__decorate([L.subclass("esri.views.layers.support.ClipRect")],B)})},"esri/views/layers/support/ClipArea":function(){define("../../../chunks/tslib.es6 ../../../core/JSONSupport ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass".split(" "), |
|
function(m,H,B,v,I,L,U){H=class extends H.JSONSupport{get version(){this.commitVersionProperties();return(this._get("version")||0)+1}};m.__decorate([B.property({readOnly:!0})],H.prototype,"version",null);return H=m.__decorate([U.subclass("esri.views.layers.support.ClipArea")],H)})},"esri/views/layers/support/Geometry":function(){define("../../../chunks/tslib.es6 ../../../geometry ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../geometry/Geometry ../../../geometry/support/jsonUtils ./ClipArea ../../../geometry/Extent ../../../geometry/Polygon".split(" "), |
|
function(m,H,B,v,I,L,U,D,R,T,M,t){var A;H={base:D,key:"type",typeMap:{extent:M,polygon:t}};T=A=class extends T{constructor(J){super(J);this.type="geometry";this.geometry=null}clone(){return new A({geometry:this.geometry?.clone()??null})}commitVersionProperties(){this.commitProperty("geometry")}};m.__decorate([B.property({types:H,json:{read:R.fromJSON,write:!0}})],T.prototype,"geometry",void 0);return T=A=m.__decorate([U.subclass("esri.views.layers.support.Geometry")],T)})},"esri/views/layers/support/Path":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./ClipArea".split(" "), |
|
function(m,H,B,v,I,L,U){B=class extends U{constructor(D){super(D);this.type="path";this.path=[]}commitVersionProperties(){this.commitProperty("path")}};m.__decorate([H.property({type:[[[Number]]],json:{write:!0}})],B.prototype,"path",void 0);return B=m.__decorate([L.subclass("esri.views.layers.support.Path")],B)})},"esri/views/2d/layers/graphics/HighlightGraphicContainer":function(){define("../../../../chunks/tslib.es6 ../../../../core/Logger ../../../../core/has ../../../../core/RandomLCG ../../../../core/Error ../../../../core/accessorSupport/decorators/subclass ../../engine/webgl/enums ./AGraphicContainer ../support/util".split(" "), |
|
function(m,H,B,v,I,L,U,D,R){H=class extends D.AGraphicContainer{get hasHighlight(){return this.children.some(T=>T.hasData)}renderChildren(T){this.attributeView.update();T.drawPhase===U.WGLDrawPhase.HIGHLIGHT&&this.children.some(M=>M.hasData)&&(super.renderChildren(T),T.context.setColorMask(!0,!0,!0,!0),R.renderHighlight(T,!0,M=>{this._renderChildren(M,U.FeatureSelection.All)}))}};return H=m.__decorate([L.subclass("esri.views.2d.layers.graphics.HighlightGraphicContainer")],H)})},"esri/views/2d/layers/imagery/ImageryView2D":function(){define("../../../../chunks/tslib.es6 ../../../../Graphic ../../../../core/Accessor ../../../../core/Logger ../../../../core/promiseUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../layers/support/rasterFunctions/pixelUtils ../../engine/BitmapContainer ../../engine/Container ../../engine/ImageryBitmapSource ../support/ExportStrategy".split(" "), |
|
function(m,H,B,v,I,L,U,D,R,T,M,t,A,J){B=class extends B{constructor(){super(...arguments);this.attached=!1;this.container=new t.Container;this.updateRequested=!1;this.type="imagery";this._bitmapView=new M.BitmapContainer}destroy(){this.attached&&(this.detach(),this.attached=!1);this.updateRequested=!1}get updating(){return!this.attached||this.isUpdating()}update(q){this.strategy.update(q).catch(r=>{I.isAbortError(r)||v.getLogger(this).error(r)})}hitTest(q){return new H({attributes:{},geometry:q.clone(), |
|
layer:this.layer})}attach(){this.container.addChild(this._bitmapView);this.strategy=new J({container:this._bitmapView,imageNormalizationSupported:10<=this.layer.version,imageMaxHeight:10.1<=this.layer.version?this.layer.imageMaxHeight:2048,imageMaxWidth:10.1<=this.layer.version?this.layer.imageMaxWidth:2048,fetchSource:this._fetchImage.bind(this),requestUpdate:()=>this.requestUpdate()})}detach(){this.strategy.destroy();this._bitmapView.removeAllChildren();this.container.removeAllChildren();this.updateRequested= |
|
!1}redraw(){this.strategy.updateExports(async q=>{const {source:r}=q;if(r&&!(r instanceof ImageBitmap)){var p=await this.layer.applyRenderer({extent:r.extent,pixelBlock:r.originalPixelBlock??r.pixelBlock});r.filter=y=>this.layer.pixelFilter?this.layer.applyFilter(y):{...p,extent:r.extent}}}).catch(q=>{I.isAbortError(q)||v.getLogger(this).error(q)})}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view.requestUpdate())}isUpdating(){return this.strategy.updating||this.updateRequested}getPixelData(){if(this.updating)return null; |
|
var q=this.strategy.bitmaps;if(1===q.length&&q[0].source)return{extent:q[0].source.extent,pixelBlock:q[0].source.originalPixelBlock};if(1<q.length){const r=this.view.extent;q=q.map(p=>p.source).filter(p=>p.extent&&p.extent.intersects(r)).map(p=>({extent:p.extent,pixelBlock:p.originalPixelBlock}));q=T.mosaicPixelData(q,r);return null!=q?{extent:q.extent,pixelBlock:q.pixelBlock}:null}return null}async _fetchImage(q,r,p,y){y=y||{};y.timeExtent=this.timeExtent;y.requestAsImageElement=!0;y.returnImageBitmap= |
|
!0;q=await this.layer.fetchImage(q,r,p,y);if(q.imageBitmap)return q.imageBitmap;y=await this.layer.applyRenderer(q.pixelData,{signal:y.signal});y=new A(y.pixelBlock,y.extent?.clone(),q.pixelData.pixelBlock);y.filter=Q=>this.layer.applyFilter(Q);return y}};m.__decorate([L.property()],B.prototype,"attached",void 0);m.__decorate([L.property()],B.prototype,"container",void 0);m.__decorate([L.property()],B.prototype,"layer",void 0);m.__decorate([L.property()],B.prototype,"strategy",void 0);m.__decorate([L.property()], |
|
B.prototype,"timeExtent",void 0);m.__decorate([L.property()],B.prototype,"view",void 0);m.__decorate([L.property()],B.prototype,"updateRequested",void 0);m.__decorate([L.property()],B.prototype,"updating",null);m.__decorate([L.property()],B.prototype,"type",void 0);return B=m.__decorate([R.subclass("esri.views.2d.layers.imagery.ImageryView2D")],B)})},"esri/layers/support/rasterFunctions/pixelUtils":function(){define(["exports","../PixelBlock","../rasterFormats/pixelRangeUtils"],function(m,H,B){function v(a){return null!= |
|
a&&"esri.layers.support.PixelBlock"===a.declaredClass&&a.pixels&&0<a.pixels.length}function I(a,b,d,g,e){const f=a.length;e=H.createEmptyBand(e,f);if(b)for(let h=0;h<f;h++)b[h]&&(e[h]=d[a[h]-g]);else for(b=0;b<f;b++)e[b]=d[a[b]-g];return e}function L(a,b,d,g){const e=null!=d&&2<=d.length?new Set(d):null;d=1===d?.length?d[0]:null;const f=!!b?.length;for(let h=0;h<a.length;h++)if(g[h]){const k=a[h];if(f){let n=!1;for(let u=0;u<b.length;u+=2)if(k>=b[u]&&k<=b[u+1]){n=!0;break}n||(g[h]=0)}g[h]&&(k===d|| |
|
e?.has(k))&&(g[h]=0)}}function U(a,b){const d=a[0].length;for(let g=0;g<d;g++)if(b[g]){let e=!1;for(let f=0;f<a.length;f++)if(a[f][g]){e=!0;break}e||(b[g]=0)}}function D(a,b){const d=a[0].length;for(let g=0;g<d;g++)if(b[g]){let e=!1;for(let f=0;f<a.length;f++)if(0===a[f][g]){e=!0;break}e&&(b[g]=0)}}function R(a,b,d,g,e,f,h,k){return{xmin:e<=d*a?0:e<d*a+a?e-d*a:a,ymin:f<=g*b?0:f<g*b+b?f-g*b:b,xmax:e+h<=d*a?0:e+h<d*a+a?e+h-d*a:a,ymax:f+k<=g*b?0:f+k<g*b+b?f+k-g*b:b}}function T(a,b,d,g,e,f){const {width:h, |
|
height:k}=d.block,{x:n,y:u}=d.offset,{width:x,height:w}=d.mosaic;d=R(h,k,g,e,n,u,x,w);let C=0;var E=0;if(f){var O=f.hasGCSSShiftTransform?360:f.halfWorldWidth??0,S=h*f.resolutionX;const N=f.startX+g*S;N<O&&N+S>O?E=f.rightPadding:N>=O&&(C=f.leftMargin-f.rightPadding,E=0)}d.xmax-=E;if("number"===typeof b)for(f=d.ymin;f<d.ymax;f++)for(E=(e*k+f-u)*x+(g*h-n)+C,O=d.xmin;O<d.xmax;O++)a[E+O]=b;else for(f=d.ymin;f<d.ymax;f++)for(E=(e*k+f-u)*x+(g*h-n)+C,O=f*h,S=d.xmin;S<d.xmax;S++)a[E+S]=b[O+S]}function M(a, |
|
b,d={}){const {clipOffset:g,clipSize:e,alignmentInfo:f,blockWidths:h}=d;if(h)return t(a,b,{blockWidths:h});var k=a.find(da=>v(da));if(null==k)return null;d=e?e.width:b.width;const n=e?e.height:b.height;var u=k.width,x=k.height;const w=b.width/u,C=b.height/x;b={offset:g||{x:0,y:0},mosaic:e||b,block:{width:u,height:x}};u=k.pixelType;var E=H.getPixelArrayConstructor(u);k=k.pixels.length;x=[];for(var O=0;O<k;O++){var S=new E(d*n);for(var N=0;N<C;N++)for(var Y=0;Y<w;Y++){var X=a[N*w+Y];v(X)&&(X=X.pixels[O], |
|
T(S,X,b,Y,N,f))}x.push(S)}E=a.some(da=>null==da||null!=da.mask&&0<da.mask.length);S=a.some(da=>da?.bandMasks&&1<da.bandMasks.length);E=E?new Uint8Array(d*n):void 0;S=S?[]:void 0;if(E){for(O=0;O<C;O++)for(N=0;N<w;N++)Y=a[O*w+N],X=null!=Y?Y.mask:null,null!=X?T(E,X,b,N,O,f):Y?T(E,255,b,N,O,f):T(E,0,b,N,O,f);if(S)for(O=0;O<k;O++){N=new Uint8Array(d*n);for(Y=0;Y<C;Y++)for(X=0;X<w;X++){const da=a[Y*w+X],ba=da?.bandMasks?.[O]??da?.mask;null!=ba?T(N,ba,b,X,Y,f):da?T(N,255,b,X,Y,f):T(N,0,b,X,Y,f)}S.push(N)}}a= |
|
new H({width:d,height:n,pixels:x,pixelType:u,bandMasks:S,mask:E});a.updateStatistics();return a}function t(a,b,d){const g=a.find(N=>null!=N);if(null==g)return null;var e=a.some(N=>null!=N?!!N.mask:!0);const {width:f,height:h}=b;b=e?new Uint8Array(f*h):null;({blockWidths:d}=d);const k=[],n=g.getPlaneCount(),u=H.getPixelArrayConstructor(g.pixelType);if(e)for(let N=0,Y=0;N<a.length;Y+=d[N],N++)if(e=a[N],v(e)){var x=e.mask;for(var w=0;w<h;w++)for(var C=0;C<d[N];C++)b[w*f+C+Y]=null==x?255:x[w*e.width+ |
|
C]}x=(e=a.some(N=>N?.bandMasks&&1<N.bandMasks.length))?[]:void 0;w=f*h;for(C=0;C<n;C++){const N=new u(w),Y=e?new Uint8Array(w):void 0;for(let X=0,da=0;X<a.length;da+=d[X],X++){const ba=a[X];if(v(ba)){var E=ba.pixels[C];if(null!=E){for(var O=0;O<h;O++)for(var S=0;S<d[X];S++)N[O*f+S+da]=E[O*ba.width+S];if(Y)for(E=ba.bandMasks?.[C]??ba.mask,O=0;O<h;O++)for(S=0;S<d[X];S++)Y[O*f+S+da]=E?E[O*ba.width+S]:255}}}k.push(N);x&&Y&&x.push(Y)}a=new H({width:f,height:h,mask:b,bandMasks:x,pixels:k,pixelType:g.pixelType}); |
|
a.updateStatistics();return a}function A(a){if(!v(a))return null;const b=a.clone(),{width:d,height:g,pixels:e}=a;var f=e[0];const h=b.pixels[0];a=a.mask;for(let u=2;u<g-1;u++){const x=new Map;for(var k=u-2;k<u+2;k++)for(var n=0;4>n;n++){const w=k*d+n;r(x,f[w],a?a[w]:1)}h[u*d]=J(x);h[u*d+1]=h[u*d+2]=h[u*d];for(k=3;k<d-1;k++)n=(u-2)*d+k+1,r(x,f[n],a?a[n]:1),n=(u-1)*d+k+1,r(x,f[n],a?a[n]:1),n=u*d+k+1,r(x,f[n],a?a[n]:1),n=(u+1)*d+k+1,r(x,f[n],a?a[n]:1),n=(u-2)*d+k-3,q(x,f[n],a?a[n]:1),n=(u-1)*d+k-3,q(x, |
|
f[n],a?a[n]:1),n=u*d+k-3,q(x,f[n],a?a[n]:1),n=(u+1)*d+k-3,q(x,f[n],a?a[n]:1),h[u*d+k]=J(x);h[u*d+k+1]=h[u*d+k]}for(f=0;f<d;f++)h[f]=h[d+f]=h[2*d+f],h[(g-1)*d+f]=h[(g-2)*d+f];b.updateStatistics();return b}function J(a){if(0===a.size)return 0;let b=0,d=-1,g=0;const e=a.keys();let f=e.next();for(;!f.done;)g=a.get(f.value),g>b&&(d=f.value,b=g),f=e.next();return d}function q(a,b,d){0!==d&&(d=a.get(b),1===d?a.delete(b):a.set(b,d-1))}function r(a,b,d){0!==d&&a.set(b,a.has(b)?a.get(b)+1:1)}function p(a,b, |
|
d){let {x:g,y:e}=b;const {width:f,height:h}=d;if(0===g&&0===e&&h===a.height&&f===a.width)return a;const {width:k,height:n}=a;b=Math.max(0,e);const u=Math.max(0,g),x=Math.min(g+f,k),w=Math.min(e+h,n);if(0>x||0>w||!v(a))return null;g=Math.max(0,-g);e=Math.max(0,-e);var {pixels:C}=a,E=f*h,O=C.length;const S=[];for(var N=0;N<O;N++){var Y=C[N],X=H.createEmptyBand(a.pixelType,E);for(let da=b;da<w;da++){const ba=da*k;let aa=(da+e-b)*f+g;for(let ea=u;ea<x;ea++)X[aa++]=Y[ba+ea]}S.push(X)}C=new Uint8Array(E); |
|
E=a.mask;for(O=b;O<w;O++)for(N=O*k,Y=(O+e-b)*f+g,X=u;X<x;X++)C[Y++]=E?E[N+X]:1;a=new H({width:d.width,height:d.height,pixelType:a.pixelType,pixels:S,mask:C});a.updateStatistics();return a}function y(a,b=!0){if(!v(a))return null;const {pixels:d,width:g,height:e,mask:f,pixelType:h}=a;a=[];const k=Math.round(g/2),n=Math.round(e/2),u=e-1,x=g-1;for(var w=0;w<d.length;w++){var C=d[w],E=H.createEmptyBand(h,k*n),O=0;for(var S=0;S<e;S+=2)for(var N=0;N<g;N+=2){var Y=C[S*g+N];if(b){var X=N===x?Y:C[S*g+N+1]; |
|
const da=S===u?Y:C[S*g+N+g],ba=N===x?da:S===u?X:C[S*g+N+g+1];E[O++]=(Y+X+da+ba)/4}else E[O++]=Y}a.push(E)}w=null;if(null!=f)for(w=new Uint8Array(k*n),C=0,E=0;E<e;E+=2)for(O=0;O<g;O+=2)S=f[E*g+O],b?(N=O===x?S:f[E*g+O+1],Y=E===u?S:f[E*g+O+g],X=O===x?Y:E===u?N:f[E*g+O+g+1],w[C++]=S*N*Y*X?1:0):w[C++]=S;return new H({width:k,height:n,pixelType:h,pixels:a,mask:w})}function Q(a,b,d,g,e=0){const {width:f,height:h}=a,{width:k,height:n}=b;a=g.cols;g=g.rows;b=Math.ceil(k/a-.1/a);const u=Math.ceil(n/g-.1/g); |
|
let x,w,C,E,O;const S=b*a;var N=S*u*g;const Y=new Float32Array(N),X=new Float32Array(N),da=new Uint32Array(N),ba=new Uint32Array(N);let aa=0,ea,ka;for(let z=0;z<u;z++)for(let F=0;F<b;F++){var c=12*(z*b+F);N=d[c];x=d[c+1];w=d[c+2];C=d[c+3];E=d[c+4];O=d[c+5];for(var l=0;l<g;l++){aa=(z*g+l)*S+F*a;ka=(l+.5)/g;for(let P=0;P<l;P++)ea=(P+.5)/a,Y[aa+P]=(N*ea+x*ka+w)*f+e,X[aa+P]=(C*ea+E*ka+O)*h+e,da[aa+P]=Math.floor(Y[aa+P]),ba[aa+P]=Math.floor(X[aa+P])}c+=6;N=d[c];x=d[c+1];w=d[c+2];C=d[c+3];E=d[c+4];O=d[c+ |
|
5];for(c=0;c<g;c++)for(aa=(z*g+c)*S+F*a,ka=(c+.5)/g,l=c;l<a;l++)ea=(l+.5)/a,Y[aa+l]=(N*ea+x*ka+w)*f+e,X[aa+l]=(C*ea+E*ka+O)*h+e,da[aa+l]=Math.floor(Y[aa+l]),ba[aa+l]=Math.floor(X[aa+l])}return{offsets_x:Y,offsets_y:X,offsets_xi:da,offsets_yi:ba,gridWidth:S}}m.NoDataInterpretation=void 0;(function(a){a[a.matchAny=0]="matchAny";a[a.matchAll=1]="matchAll"})(m.NoDataInterpretation||(m.NoDataInterpretation={}));m.MissingBandAction=void 0;(function(a){a[a.bestMatch=0]="bestMatch";a[a.fail=1]="fail"})(m.MissingBandAction|| |
|
(m.MissingBandAction={}));m.approximateTransform=function(a,b,d,g,e="nearest"){if(!v(a))return null;"majority"===e&&(a=A(a));const {pixels:f,mask:h,bandMasks:k,pixelType:n}=a,u=a.width;var x=a.height;const w=H.getPixelArrayConstructor(n),C=f.length,{width:E,height:O}=b;a=!1;for(var S=0;S<d.length;S+=3)-1===d[S]&&-1===d[S+1]&&-1===d[S+2]&&(a=!0);const {offsets_x:N,offsets_y:Y,offsets_xi:X,offsets_yi:da,gridWidth:ba}=Q({width:u,height:x},b,d,g,"majority"===e?.5:0);let aa;b=(ka,c,l,z)=>{const F=ka instanceof |
|
Float32Array||ka instanceof Float64Array?0:.5;for(let P=0;P<O;P++){aa=P*ba;for(let G=0;G<E;G++){if(0>N[aa]||0>Y[aa])ka[P*E+G]=0;else if(z)ka[P*E+G]=c[X[aa]+da[aa]*u];else{const V=Math.floor(N[aa]),W=Math.floor(Y[aa]),K=Math.ceil(N[aa]),ca=Math.ceil(Y[aa]),Z=N[aa]-V,ja=Y[aa]-W;ka[P*E+G]=!l||l[V+W*u]&&l[K+W*u]&&l[V+ca*u]&&l[K+ca*u]?(1-ja)*((1-Z)*c[V+W*u]+Z*c[K+W*u])+ja*((1-Z)*c[V+ca*u]+Z*c[K+ca*u])+F:c[X[aa]+da[aa]*u]}aa++}}};d=[];g=k?.length===C;x=[];for(S=0;S<C;S++){if(g){var ea=new Uint8Array(E* |
|
O);b(ea,k[S],k[S],!0);x.push(ea)}ea=new w(E*O);b(ea,f[S],g?k[S]:h,"nearest"===e||"majority"===e);d.push(ea)}e=new H({width:E,height:O,pixelType:n,pixels:d,bandMasks:g?x:void 0});if(null!=h)e.mask=new Uint8Array(E*O),b(e.mask,h,h,!0);else if(a)for(e.mask=new Uint8Array(E*O),a=0;a<E*O;a++)e.mask[a]=0>N[a]||0>Y[a]?0:1;e.updateStatistics();return e};m.clip=p;m.clipTile=function(a){const {pixelBlock:b,tileSize:d,level:g,row:e,col:f,useBilinear:h}=a;if(!v(b))return null;const {width:k,height:n}=d;var u= |
|
2**g;a=u*k;u*=n;a=p(b,{y:e*u,x:f*a},{width:a,height:u});if(!a)return null;for(u=g;0<u;u--)a=y(a,h);return a};m.colorize=function(a,b){if(!v(a)||!b||!b.indexedColormap&&!b.indexed2DColormap)return a;const d=a.clone();var g=d.pixels;let e=d.mask;const f=d.width*d.height;if(1!==g.length)return a;const {indexedColormap:h,indexed2DColormap:k,offset:n,alphaSpecified:u}=b;a=0;g=g[0];b=new Uint8Array(g.length);const x=new Uint8Array(g.length),w=new Uint8Array(g.length);var C=0;if(h){const E=h.length-1;if(null!= |
|
e)for(a=0;a<f;a++)e[a]&&(C=4*(g[a]-n),C<n||C>E?e[a]=0:(b[a]=h[C],x[a]=h[C+1],w[a]=h[C+2],e[a]=h[C+3]));else{e=new Uint8Array(f);for(a=0;a<f;a++)C=4*(g[a]-n),C<n||C>E?e[a]=0:(b[a]=h[C],x[a]=h[C+1],w[a]=h[C+2],e[a]=h[C+3]);d.mask=e}}else if(k)if(null!=e)for(a=0;a<f;a++)e[a]&&(C=k[g[a]],b[a]=C[0],x[a]=C[1],w[a]=C[2],e[a]=C[3]);else{e=new Uint8Array(f);for(a=0;a<f;a++)C=k[g[a]],b[a]=C[0],x[a]=C[1],w[a]=C[2],e[a]=C[3];d.mask=e}d.pixels=[b,x,w];d.statistics=null;d.pixelType="u8";d.maskIsAlpha=u;return d}; |
|
m.compositeBands=function(a){if(!a?.length||a.some(n=>!v(n)))return null;if(1===a.length)return a[0]?.clone()??null;const {width:b,height:d,pixelType:g}=a[0];if(a.some(n=>n.width!==b||n.height!==d))return null;const e=a.map(({mask:n})=>n).filter(n=>null!=n);let f=null;e.length&&(f=new Uint8Array(b*d),f.set(e[0]),1<e.length&&D(e.slice(1),f));const h=[];a.forEach(({pixels:n})=>h.push(...n));const k=[];a.map(({statistics:n})=>n).filter(n=>n?.length).forEach(n=>k.push(...n));return new H({pixelType:g, |
|
width:b,height:d,mask:f,pixels:h,statistics:k.length?k:null})};m.createColormapLUT=function(a){if(a){var b=a.colormap;if(b&&0!==b.length){b=b.sort((u,x)=>u[0]-x[0]);var d=0;0>b[0][0]&&(d=b[0][0]);var g=Math.max(256,b[b.length-1][0]-d+1),e=new Uint8Array(4*g),f=[],h=0,k=0,n=5===b[0].length;if(65536<g)return b.forEach(u=>{f[u[0]-d]=n?u.slice(1):u.slice(1).concat([255])}),{indexed2DColormap:f,offset:d,alphaSpecified:n};if(a.fillUnspecified)for(a=b[k],h=a[0]-d;h<g;h++)e[4*h]=a[1],e[4*h+1]=a[2],e[4*h+ |
|
2]=a[3],e[4*h+3]=n?a[4]:255,h===a[0]-d&&(a=k===b.length-1?a:b[++k]);else for(h=0;h<b.length;h++)a=b[h],k=4*(a[0]-d),e[k]=a[1],e[k+1]=a[2],e[k+2]=a[3],e[k+3]=n?a[4]:255;return{indexedColormap:e,offset:d,alphaSpecified:n}}}};m.createMaskLUT=function(a,b,d){if("u8"!==a&&"s8"!==a&&"u16"!==a&&"s16"!==a)return null;var g=a.includes("16")?65536:256;a=a.includes("s")?-g/2:0;g=new Uint8Array(g);if(b)for(let f=0;f<b.length;f++){var e=Math.ceil(b[2*f]-a);const h=Math.floor(b[2*f+1]-a);for(;e<=h;e++)g[e]=255}else g.fill(255); |
|
if(d)for(b=0;b<d.length;b++)g[d[b]-a]=0;return{lut:g,offset:a}};m.createRemapLUT=function(a){const {srcPixelType:b,inputRanges:d,outputValues:g,allowUnmatched:e,noDataRanges:f,isLastInputRangeInclusive:h,outputPixelType:k}=a;if("u8"!==b&&"s8"!==b&&"u16"!==b&&"s16"!==b)return null;var n=b.includes("16")?65536:256;a=b.includes("s")?-n/2:0;const u=H.createEmptyBand(k,n);n=new Uint8Array(n);e&&n.fill(255);const [x,w]=B.getPixelValueRange(k);if(d?.length&&g?.length){var C=d.map(N=>N-1E-6);C[0]=d[0];h&& |
|
(C[C.length-1]=d[d.length-1]);for(var E=0;E<C.length;E++){var O=g[E]>w?w:g[E]<x?x:g[E],S=Math.ceil(C[2*E]-a);const N=Math.floor(C[2*E+1]-a);for(;S<=N;S++)u[S]=O,n[S]=255}}if(f?.length)for(C=0;C<f.length;C++)for(O=Math.ceil(f[2*C]-a),E=Math.floor(f[2*C+1]-a);O<=E;O++)n[O]=0;return{lut:u,offset:a,mask:n}};m.extractBands=function(a,b){return b?.length&&v(a)?a.extractBands(b):a};m.getClipBounds=R;m.getLocalArithmeticNorthRotations=function(a,b){const {coefficients:d,spacing:g}=b,{offsets_x:e,offsets_y:f, |
|
gridWidth:h}=Q(a,a,d,{rows:g[0],cols:g[1]}),{width:k,height:n}=a;a=new Float32Array(k*n);b=180/Math.PI;for(let w=0;w<n;w++)for(let C=0;C<k;C++){var u=w*h+C,x=0===w?u:u-h;const E=w===n-1?u:u+h;u=e[x]-e[E];x=f[E]-f[x];isNaN(u)||isNaN(x)?a[w*k+C]=90:(x=Math.atan2(x,u)*b,x=(360+x)%360,a[w*k+C]=x)}return a};m.interpolateOffsets=Q;m.isValidPixelBlock=v;m.lookupBandValues=I;m.lookupPixels=function(a,b){if(!v(a))return null;const {pixels:d,mask:g}=a,e=d.length;let f=b.lut;const {offset:h}=b;f&&1===f[0].length&& |
|
(f=d.map(()=>f));const k=[];b=b.outputPixelType||"u8";for(let n=0;n<e;n++){const u=I(d[n],g,f[n],h||0,b);k.push(u)}a=new H({width:a.width,height:a.height,pixels:k,mask:g,pixelType:b});a.updateStatistics();return a};m.mask=function(a,b){if(!v(a))return null;const {width:d,height:g,pixels:e}=a;var f=d*g;const h=new Uint8Array(f);a.mask?h.set(a.mask):h.fill(255);a=e.length;const {includedRanges:k,noDataValues:n,outputPixelType:u,matchAll:x,lookups:w}=b;if(w){f=[];for(b=0;b<a;b++){var C=w[b];C=I(e[b], |
|
h,C.lut,C.offset||0,"u8");f.push(C)}1===f.length?h.set(f[0]):x?U(f,h):D(f,h)}else if(x){b=[];for(C=0;C<a;C++){const E=new Uint8Array(f);E.set(h);L(e[C],k?.slice(2*C,2*C+2),n?.[C],E);b.push(E)}1===b.length?h.set(b[0]):U(b,h)}else for(f=0;f<a;f++)L(e[f],k?.slice(2*f,2*f+2),n?.[f],h);return new H({width:d,height:g,pixelType:u,pixels:e,mask:h})};m.maxMapSizeGpu=6;m.mosaic=M;m.mosaicPixelData=function(a,b){if(!a||0===a.length)return null;var d=a.find(w=>w.pixelBlock);if(null==d?.pixelBlock)return null; |
|
var g=(d.extent.xmax-d.extent.xmin)/d.pixelBlock.width;const e=(d.extent.ymax-d.extent.ymin)/d.pixelBlock.height,f=.01*Math.min(g,e),h=a.sort((w,C)=>Math.abs(w.extent.ymax-C.extent.ymax)>f?C.extent.ymax-w.extent.ymax:Math.abs(w.extent.xmin-C.extent.xmin)>f?w.extent.xmin-C.extent.xmin:0);var k=Math.min.apply(null,h.map(w=>w.extent.xmin));const n=Math.min.apply(null,h.map(w=>w.extent.ymin)),u=Math.max.apply(null,h.map(w=>w.extent.xmax)),x=Math.max.apply(null,h.map(w=>w.extent.ymax));a={x:Math.round((b.xmin- |
|
k)/g),y:Math.round((x-b.ymax)/e)};k={width:Math.round((u-k)/g),height:Math.round((x-n)/e)};g={width:Math.round((b.xmax-b.xmin)/g),height:Math.round((b.ymax-b.ymin)/e)};if(Math.round(k.width/d.pixelBlock.width)*Math.round(k.height/d.pixelBlock.height)!==h.length||0>a.x||0>a.y||k.width<g.width||k.height<g.height)return null;d=h.map(w=>w.pixelBlock);d=M(d,k,{clipOffset:a,clipSize:g});return{extent:b,pixelBlock:d}};m.remap=function(a,b){if(!v(a))return null;const {width:d,height:g}=a,{inputRanges:e,outputValues:f, |
|
outputPixelType:h,noDataRanges:k,allowUnmatched:n,isLastInputRangeInclusive:u}=b;b=a.pixels[0];const x=H.createEmptyBand(h,b.length),w=a.mask,C=new Uint8Array(d*g);w?C.set(w):C.fill(255);const E=a.pixelType.startsWith("f")?1E-6:0;a=e.map(aa=>aa-E);a[0]=e[0];a[a.length-1]=e[e.length-1]+(u?1E-6:0);var O=e.length/2;const [S,N]=B.getPixelValueRange(h);for(var Y=0;Y<g;Y++)for(var X=0;X<d;X++){var da=Y*d+X;if(C[da]){var ba=b[da];let aa=!1;for(let ea=O-1;0<=ea;ea--)if(ba===a[2*ea]||ba>a[2*ea]&&ba<a[2*ea+ |
|
1]){x[da]=f[ea];aa=!0;break}aa||(n?x[da]=ba>N?N:ba<S?S:ba:C[da]=0)}}if(a=k?.length)for(O=0;O<g;O++)for(Y=0;Y<d;Y++)if(X=O*d+Y,!w||w[X])for(da=b[X],ba=0;ba<a;ba+=2)if(da>=k[ba]&&da<=k[ba+1]){x[X]=0;C[X]=0;break}return new H({width:d,height:g,pixelType:h,pixels:[x],mask:C})};m.remapColor=function(a,b){if(!v(a))return null;a=a.clone();var {pixels:d}=a;const g=a.width*a.height,e=b.length,f=Math.floor(e/2),h=b[Math.floor(f)];d=d[0];let k,n,u,x,w,C,E=!1;const O=new Uint8Array(g),S=new Uint8Array(g),N=new Uint8Array(g); |
|
let Y=a.mask;const X=4===b[0].mappedColor.length;Y||(Y=new Uint8Array(g),Y.fill(X?255:1),a.mask=Y);for(w=0;w<g;w++)if(Y[w]){k=d[w];E=!1;C=f;n=h;u=0;for(x=e-1;1<x-u;){if(k===n.value){E=!0;break}k>n.value?u=C:x=C;C=Math.floor((u+x)/2);n=b[Math.floor(C)]}E||(k===b[u].value?(n=b[u],E=!0):k===b[x].value?(n=b[x],E=!0):k<b[u].value?(E=!1,n=null):k>b[u].value&&(k<b[x].value?(n=b[u],E=!0):x===e-1?(E=!1,n=null):(n=b[x],E=!0)));E?(O[w]=n.mappedColor[0],S[w]=n.mappedColor[1],N[w]=n.mappedColor[2],Y[w]=n.mappedColor[3]): |
|
O[w]=S[w]=N[w]=Y[w]=0}a.pixels=[O,S,N];a.mask=Y;a.pixelType="u8";a.maskIsAlpha=X;return a};m.resampleByMajority=A;m.setValidBoundary=function(a,b,d){if(!v(a))return null;const {width:g,height:e}=a,f=b.x;b=b.y;const h=d.width+f;d=d.height+b;if(0>f||0>b||h>g||d>e||0===f&&0===b&&h===g&&d===e)return a;a.mask||(a.mask=new Uint8Array(g*e));const k=a.mask;for(let n=0;n<e;n++){const u=n*g;for(let x=0;x<g;x++)k[u+x]=n<b||n>=d||x<f||x>=h?0:1}a.updateStatistics();return a};m.split=function(a,b,d=0,g=!0){if(!v(a))return null; |
|
const {width:e,height:f}=b;let {width:h,height:k}=a;const n=new Map,u={x:0,y:0};d=1+d;for(let x=0;x<d;x++){const w=Math.ceil(h/e),C=Math.ceil(k/f);for(let E=0;E<C;E++){u.y=E*f;for(let O=0;O<w;O++){u.x=O*e;const S=p(a,u,b);n.set(`${x}/${E}/${O}`,S)}}x<d-1&&(a=y(a,g));h=Math.round(h/2);k=Math.round(k/2)}return n};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/PixelBlock":function(){define("../../chunks/tslib.es6 ../../core/Error ../../core/JSONSupport ../../core/lang ../../core/Logger ../../core/accessorSupport/decorators/property ../../core/accessorSupport/decorators/cast ../../core/accessorSupport/decorators/subclass ./SimpleBandStatistics ./rasterFormats/pixelRangeUtils".split(" "), |
|
function(m,H,B,v,I,L,U,D,R,T){var M;B=M=class extends B.JSONSupport{static createEmptyBand(t,A){return new (M.getPixelArrayConstructor(t))(A)}static combineBandMasks(t){if(2>t.length)return t[0];const A=t[0].length,J=(new Uint8Array(A)).fill(255);for(let q=0;q<t.length;q++){const r=t[q];for(let p=0;p<A;p++)r[p]||(J[p]=0)}return J}static getPixelArrayConstructor(t){let A;switch(t){case "u1":case "u2":case "u4":case "u8":A=Uint8Array;break;case "u16":A=Uint16Array;break;case "u32":A=Uint32Array;break; |
|
case "s8":A=Int8Array;break;case "s16":A=Int16Array;break;case "s32":A=Int32Array;break;case "f32":A=Float32Array;break;case "f64":A=Float64Array;break;case "c64":case "c128":case "unknown":A=Float32Array}return A}constructor(t){super(t);this.height=this.width=null;this.pixelType="f32";this.mask=this.validPixelCount=null;this.premultiplyAlpha=this.maskIsAlpha=!1;this.statistics=null;this.depthCount=1}castPixelType(t){if(!t)return"f32";t=t.toLowerCase();["u1","u2","u4"].includes(t)?t="u8":"unknown u8 s8 u16 s16 u32 s32 f32 f64".split(" ").includes(t)|| |
|
(t="f32");return t}getPlaneCount(){return this.pixels?.length}addData(t){if(!t.pixels||t.pixels.length!==this.width*this.height)throw new H("pixelblock:invalid-or-missing-pixels","add data requires valid pixels array that has same length defined by pixel block width * height");this.pixels||(this.pixels=[]);this.statistics||(this.statistics=[]);this.pixels.push(t.pixels);this.statistics.push(t.statistics??new R.SimpleBandStatistics)}getAsRGBA(){const t=new ArrayBuffer(this.width*this.height*4);switch(this.pixelType){case "s8":case "s16":case "u16":case "s32":case "u32":case "f32":case "f64":this._fillFromNon8Bit(t); |
|
break;default:this._fillFrom8Bit(t)}return new Uint8ClampedArray(t)}getAsRGBAFloat(){const t=new Float32Array(this.width*this.height*4);this._fillFrom32Bit(t);return t}updateStatistics(){if(this.pixels){this.statistics=this.pixels.map(J=>{var q=this.mask;let r=Infinity,p=-Infinity;const y=J.length;let Q,a=0;if(null!=q)for(Q=0;Q<y;Q++)q[Q]&&(a=J[Q],r=a<r?a:r,p=a>p?a:p);else for(Q=0;Q<y;Q++)a=J[Q],r=a<r?a:r,p=a>p?a:p;return new R.SimpleBandStatistics(r,p)});var t=this.mask,A=0;if(null!=t)for(let J= |
|
0;J<t.length;J++)t[J]&&A++;else A=this.width*this.height;this.validPixelCount=A}}clamp(t){if(t&&"f64"!==t&&"f32"!==t&&this.pixels){var [A,J]=T.getPixelValueRange(t),q=this.pixels,r=this.width*this.height,p=q.length,y=[];for(let d=0;d<p;d++){var Q=M.createEmptyBand(t,r);var a=q[d];for(let g=0;g<r;g++){var b=a[g];Q[g]=b>J?J:b<A?A:b}y.push(Q)}this.pixels=y;this.pixelType=t}}extractBands(t){const {pixels:A,statistics:J}=this;if(null==t||0===t.length||!A||0===A.length)return this;var q=A.length;const r= |
|
t.some(d=>d>=A.length),p=q===t.length&&!t.some((d,g)=>d!==g);if(r||p)return this;q=this.bandMasks?.length===q?t.map(d=>this.bandMasks[d]):void 0;let {mask:y,validPixelCount:Q}=this;const {width:a,height:b}=this;q?.length&&(y=M.combineBandMasks(q),Q=y.filter(d=>!!d).length);return new M({pixelType:this.pixelType,width:a,height:b,mask:y,bandMasks:q,validPixelCount:Q,maskIsAlpha:this.maskIsAlpha,pixels:t.map(d=>A[d]),statistics:J&&t.map(d=>J[d])})}clone(){const t=new M({width:this.width,height:this.height, |
|
pixelType:this.pixelType,maskIsAlpha:this.maskIsAlpha,validPixelCount:this.validPixelCount});null!=this.mask&&(t.mask=new Uint8Array(this.mask));this.bandMasks&&(t.bandMasks=this.bandMasks.map(q=>new Uint8Array(q)));let A;const J=M.getPixelArrayConstructor(this.pixelType);if(this.pixels&&0<this.pixels.length){t.pixels=[];const q=!!this.pixels[0].slice;for(A=0;A<this.pixels.length;A++)t.pixels[A]=q?this.pixels[A].slice(0,this.pixels[A].length):new J(this.pixels[A])}if(this.statistics)for(t.statistics= |
|
[],A=0;A<this.statistics.length;A++)t.statistics[A]=v.clone(this.statistics[A]);t.premultiplyAlpha=this.premultiplyAlpha;return t}_fillFrom8Bit(t){const {mask:A,maskIsAlpha:J,premultiplyAlpha:q,pixels:r}=this;if(t&&r?.length){var p,y;var Q=p=y=r[0];3<=r.length?(p=r[1],y=r[2]):2===r.length&&(p=r[1]);var a=new Uint32Array(t),b=this.width*this.height;if(Q.length!==b)I.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.");else if(null!=A&&A.length===b)if(J)for(t= |
|
0;t<b;t++){const d=A[t];if(d){const g=d/255;a[t]=q?d<<24|y[t]*g<<16|p[t]*g<<8|Q[t]*g:d<<24|y[t]<<16|p[t]<<8|Q[t]}}else for(t=0;t<b;t++)A[t]&&(a[t]=-16777216|y[t]<<16|p[t]<<8|Q[t]);else for(t=0;t<b;t++)a[t]=-16777216|y[t]<<16|p[t]<<8|Q[t]}else I.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The input pixel block is empty.")}_fillFromNon8Bit(t){const {pixels:A,mask:J,statistics:q}=this;if(t&&A?.length){var r=this.pixelType,p=1,y=0;p=1;if(q&&0<q.length){for(var Q of q)null!=Q.minValue&& |
|
(y=Math.min(y,Q.minValue)),null!=Q.maxValue&&null!=Q.minValue&&(p=Math.max(p,Q.maxValue-Q.minValue));p=255/p}else p=255,"s8"===r?(y=-128,p=127):"u16"===r?p=65535:"s16"===r?(y=-32768,p=32767):"u32"===r?p=4294967295:"s32"===r?(y=-2147483648,p=2147483647):"f32"===r?(y=-3.4*1E39,p=3.4*1E39):"f64"===r&&(y=-Number.MAX_VALUE,p=Number.MAX_VALUE),p=255/(p-y);t=new Uint32Array(t);r=this.width*this.height;var a,b,d;Q=a=b=A[0];if(Q.length!==r)return I.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid."); |
|
if(2<=A.length)if(a=A[1],3<=A.length&&(b=A[2]),null!=J&&J.length===r)for(d=0;d<r;d++)J[d]&&(t[d]=-16777216|(b[d]-y)*p<<16|(a[d]-y)*p<<8|(Q[d]-y)*p);else for(d=0;d<r;d++)t[d]=-16777216|(b[d]-y)*p<<16|(a[d]-y)*p<<8|(Q[d]-y)*p;else if(null!=J&&J.length===r)for(d=0;d<r;d++)a=(Q[d]-y)*p,J[d]&&(t[d]=-16777216|a<<16|a<<8|a);else for(d=0;d<r;d++)a=(Q[d]-y)*p,t[d]=-16777216|a<<16|a<<8|a}else I.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The input pixel block is empty.")}_fillFrom32Bit(t){const {pixels:A, |
|
mask:J}=this;if(!t||!A?.length)return I.getLogger(this).error("getAsRGBAFloat()","Unable to convert to RGBA. The input pixel block is empty.");let q,r,p,y;q=r=p=A[0];3<=A.length?(r=A[1],p=A[2]):2===A.length&&(r=A[1]);const Q=this.width*this.height;if(q.length!==Q)return I.getLogger(this).error("getAsRGBAFloat()","Unable to convert to RGBA. The pixelblock is invalid.");let a=0;if(null!=J&&J.length===Q)for(y=0;y<Q;y++)t[a++]=q[y],t[a++]=r[y],t[a++]=p[y],t[a++]=J[y]&1;else for(y=0;y<Q;y++)t[a++]=q[y], |
|
t[a++]=r[y],t[a++]=p[y],t[a++]=1}};m.__decorate([L.property({json:{write:!0}})],B.prototype,"width",void 0);m.__decorate([L.property({json:{write:!0}})],B.prototype,"height",void 0);m.__decorate([L.property({json:{write:!0}})],B.prototype,"pixelType",void 0);m.__decorate([U.cast("pixelType")],B.prototype,"castPixelType",null);m.__decorate([L.property({json:{write:!0}})],B.prototype,"validPixelCount",void 0);m.__decorate([L.property({json:{write:!0}})],B.prototype,"mask",void 0);m.__decorate([L.property({json:{write:!0}})], |
|
B.prototype,"maskIsAlpha",void 0);m.__decorate([L.property({json:{write:!0}})],B.prototype,"pixels",void 0);m.__decorate([L.property()],B.prototype,"premultiplyAlpha",void 0);m.__decorate([L.property({json:{write:!0}})],B.prototype,"statistics",void 0);m.__decorate([L.property({json:{write:!0}})],B.prototype,"depthCount",void 0);m.__decorate([L.property({json:{write:!0}})],B.prototype,"noDataValues",void 0);m.__decorate([L.property({json:{write:!0}})],B.prototype,"bandMasks",void 0);return B=M=m.__decorate([D.subclass("esri.layers.support.PixelBlock")], |
|
B)})},"esri/layers/support/SimpleBandStatistics":function(){define(["exports"],function(m){class H{constructor(B=null,v=null,I=null){this.minValue=B;this.maxValue=v;this.noDataValue=I}}m.SimpleBandStatistics=H;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterFormats/pixelRangeUtils":function(){define(["exports"],function(m){function H(v){return B[v]??[-3.4028234663852886E38,3.4028234663852886E38]}const B={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127], |
|
u16:[0,65535],s16:[-32768,32767],u32:[0,4294967295],s32:[-2147483648,2147483647],f32:[-3.4028234663852886E38,3.4028234663852886E38],f64:[-Number.MAX_VALUE,Number.MAX_VALUE],unknown:void 0,c64:void 0,c128:void 0};m.convertNoDataToMask=function(v,I,L){if(!(v.depthCount&&1<v.depthCount)){var {pixels:U,statistics:D,pixelType:R}=v,T=U[0].length,M=v.bandMasks??[];T=v.mask??(new Uint8Array(T)).fill(255);var t="f32"===R||"f64"===R,A=H(R),J=!1;for(let p=0;p<U.length;p++){const y="number"===typeof I?I:I[p]; |
|
if(null==y)continue;var q=D?.[p]?.maxValue??A[1];if((D?.[p]?.minValue??A[0])>y+Number.EPSILON||q<y-Number.EPSILON)continue;q=M[p]||T.slice();const Q=U[p];var r=L?.customFloatTolerance;if(t&&0!==r){r||=9.999999E37<=Math.abs(y)?2E-7*Math.abs(y):"f32"===R?2**-23:Number.EPSILON;for(let a=0;a<Q.length;a++)q[a]&&Math.abs(Q[a]-y)<r&&(Q[a]=0,q[a]=0,T[a]=0,J=!0)}else for(r=0;r<Q.length;r++)q[r]&&Q[r]===y&&(Q[r]=0,q[r]=0,T[r]=0,J=!0);M[p]=q}J&&(v.bandMasks=v.bandMasks||1<v.pixels.length?M:null,v.mask=T);J&& |
|
"updateStatistics"in v&&v.updateStatistics()}};m.getIntegerPixelType=function(v,I){return null==v||null==I?"s32":0>v?-128<=v&&128>I?"s8":-32768<=v&&32768>I?"s16":"s32":256>I?"u8":65536>I?"u16":"u32"};m.getPixelValueRange=H;m.isIntegerPixelType=function(v){return(v?.startsWith("s")||v?.startsWith("u"))??!1};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/layers/support/ExportStrategy":function(){define("../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/has ../../../../core/promiseUtils ../../../../core/accessorSupport/decorators/property ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../geometry/support/aaBoundingRect ../../../../geometry/support/spatialReferenceUtils ../../../../layers/support/TileInfo ../../viewStateUtils ../../engine/Bitmap ../../tiling/TileInfoView ../../tiling/TileKey".split(" "), |
|
function(m,H,B,v,I,L,U,D,R,T,M,t,A,J,q){const r=R.create(),p=[0,0],y=new q(0,0,0,0);H=class extends H{constructor(Q){super(Q);this._imagePromise=null;this.bitmaps=[];this.hidpi=!1;this.imageMaxHeight=this.imageMaxWidth=2048;this.imageNormalizationSupported=this.imageRotationSupported=!1;this.update=v.debounce(async(a,b)=>{v.throwIfAborted(b);if(a.stationary&&!this.destroyed){var d=a.state,g=T.getInfo(d.spatialReference);a=this.hidpi?a.pixelRatio:1;var e=0<d.worldScreenWidth,f=e&&this.imageNormalizationSupported&& |
|
d.worldScreenWidth<d.size[0],h=Math.round((this.imageMaxWidth??0)/a),k=Math.round((this.imageMaxHeight??0)/a);f?(p[0]=d.worldScreenWidth,p[1]=d.size[1]):this.imageRotationSupported?(p[0]=d.size[0],p[1]=d.size[1]):t.getOuterSize(p,d);g=g&&(d.extent.xmin<g.valid[0]||d.extent.xmax>g.valid[1]);g=!this.imageNormalizationSupported&&g;var n=!(Math.floor(p[0])>h||Math.floor(p[1])>k)&&!g,u=this.imageRotationSupported?d.rotation:0;g=this.container.children.slice();n?this._imagePromise=this._singleExport(d, |
|
p,f?d.paddedViewState.center:d.center,d.resolution,u,a,b):(f=Math.min(h,k),e&&(f=Math.min(d.worldScreenWidth,f),f=Math.round(d.worldScreenWidth/Math.ceil(d.worldScreenWidth/f))),this._imagePromise=this._tiledExport(d,f,a,b));try{const x=await this._imagePromise??[];v.throwIfAborted(b);b=[];this._imagePromise=null;if(!this.destroyed){this.bitmaps=x;for(const w of g)x.includes(w)||b.push(w.fadeOut().then(()=>{w.remove();w.destroy()}));for(const w of x)b.push(w.fadeIn());await Promise.all(b)}}catch(x){this._imagePromise= |
|
null,v.throwIfAbortError(x)}}},5E3);this.updateExports=v.debounce(async a=>{const b=[];for(const d of this.container.children){if(!d.visible||!d.stage)return;b.push(a(d).then(()=>{d.invalidateTexture();d.requestRender()}))}this._imagePromise=v.eachAlways(b).then(()=>this._imagePromise=null);await this._imagePromise})}destroy(){this.bitmaps.forEach(Q=>Q.destroy());this.bitmaps=[]}get updating(){return!this.destroyed&&null!==this._imagePromise}async _export(Q,a,b,d,g,e){b=await this.fetchSource(Q,Math.floor(a* |
|
g),Math.floor(b*g),{rotation:d,pixelRatio:g,signal:e});v.throwIfAborted(e);const f=new A.Bitmap(null,!0);f.x=Q.xmin;f.y=Q.ymax;f.resolution=Q.width/a;f.rotation=d;f.pixelRatio=g;f.opacity=0;this.container.addChild(f);await f.setSourceAsync(b,e);v.throwIfAborted(e);return f}async _singleExport(Q,a,b,d,g,e,f){t.getBBox(r,b,d,a);Q=R.toExtent(r,Q.spatialReference);return[await this._export(Q,a[0],a[1],g,e,f)]}_tiledExport(Q,a,b,d){var g=M.create({size:a,spatialReference:Q.spatialReference,scales:[Q.scale]}); |
|
const e=new J(g);g=e.getTileCoverage(Q);if(!g)return null;const f=[];g.forEach((h,k,n,u)=>{y.set(h,k,n,0);e.getTileBounds(r,y);const x=R.toExtent(r,Q.spatialReference);f.push(this._export(x,a,a,0,b,d).then(w=>{0!==u&&(y.set(h,k,n,u),e.getTileBounds(r,y),w.x=r[0],w.y=r[3]);return w}))});return Promise.all(f)}};m.__decorate([I.property()],H.prototype,"_imagePromise",void 0);m.__decorate([I.property()],H.prototype,"bitmaps",void 0);m.__decorate([I.property()],H.prototype,"container",void 0);m.__decorate([I.property()], |
|
H.prototype,"fetchSource",void 0);m.__decorate([I.property()],H.prototype,"hidpi",void 0);m.__decorate([I.property()],H.prototype,"imageMaxWidth",void 0);m.__decorate([I.property()],H.prototype,"imageMaxHeight",void 0);m.__decorate([I.property()],H.prototype,"imageRotationSupported",void 0);m.__decorate([I.property()],H.prototype,"imageNormalizationSupported",void 0);m.__decorate([I.property()],H.prototype,"requestUpdate",void 0);m.__decorate([I.property()],H.prototype,"updating",null);return H=m.__decorate([D.subclass("esri.views.2d.layers.support.ExportStrategy")], |
|
H)})},"esri/views/2d/viewStateUtils":function(){define(["exports"],function(m){const H=Math.PI/180;m.getBBox=function(B,v,I,L){const [U,D]=v,[R,T]=L;v=.5*I;B[0]=U-v*R;B[1]=D-v*T;B[2]=U+v*R;B[3]=D+v*T;return B};m.getOuterSize=function(B,v){var I=v.rotation*H;const L=Math.abs(Math.cos(I));I=Math.abs(Math.sin(I));const [U,D]=v.size;B[0]=Math.round(D*I+U*L);B[1]=Math.round(D*L+U*I);return B};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/layers/imagery/VectorFieldView2D":function(){define("../../../../chunks/tslib.es6 ../../../../Graphic ../../../../request ../../../../core/Accessor ../../../../core/Logger ../../../../core/promiseUtils ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../geometry/Extent ../../../../geometry/support/spatialReferenceUtils ../../../../layers/support/rasterFunctions/rasterProjectionHelper ../../../../layers/support/rasterFunctions/vectorFieldUtils ../../engine/imagery/RasterVFContainer ./ImageryVFStrategy".split(" "), |
|
function(m,H,B,v,I,L,U,D,R,T,M,t,A,J,q,r,p){v=class extends v{constructor(){super(...arguments);this.attached=!1;this.container=new r.RasterVFContainer;this.type="imageryVF";this._dataParameters={exportParametersVersion:0,bbox:"",symbolTileSize:0,time:""};this._fetchpixels=async(y,Q,a,b)=>{const d=await this._projectFullExtentPromise,{symbolTileSize:g}=this.layer.renderer,{extent:e,width:f,height:h}=q.snapImageToSymbolTile(y,Q,a,g,d);if(null!=d&&!d.intersects(y))return{extent:e,pixelBlock:null};y= |
|
{bbox:`${e.xmin}, ${e.ymin}, ${e.xmax}, ${e.ymax}`,exportParametersVersion:this.layer.exportImageServiceParameters.version,symbolTileSize:g,time:JSON.stringify(this.timeExtent||"")};if(this._canReuseVectorFieldData(y)&&(Q=this.getPixelData(),null!=Q&&`${Q.extent.xmin}, ${Q.extent.ymin}, ${Q.extent.xmax}, ${Q.extent.ymax}`===y.bbox))return Q;({pixelData:b}=await this.layer.fetchImage(e,f,h,{timeExtent:this.timeExtent,requestAsImageElement:!1,signal:b}));this._dataParameters=y;b=b?.pixelBlock;if(null== |
|
b)return{extent:e,pixelBlock:null};b="vector-uv"===this.layer.rasterInfo.dataType?q.convertVectorFieldData(b,"vector-uv"):b;return{extent:e,pixelBlock:b}}}get updating(){return!this.attached||this._strategy.updating}attach(){this._projectFullExtentPromise=this._getProjectedFullExtent(this.view.spatialReference);this._strategy=new p({container:this.container,fetchPixels:this._fetchpixels});this.addHandles(U.watch(()=>this.layer.renderer,y=>this._updateSymbolizerParams(y),U.syncAndInitial),"attach")}detach(){this._strategy.destroy(); |
|
this.container.children.forEach(y=>y.destroy());this.container.removeAllChildren();this.removeHandles("attach");this._strategy=this.container=this._projectFullExtentPromise=null}getPixelData(){const y=this.container.children[0]?.rawPixelData;if(this.updating||!y)return null;const {extent:Q,pixelBlock:a}=y;return{extent:Q,pixelBlock:a}}hitTest(y){return new H({attributes:{},geometry:y.clone(),layer:this.layer})}update(y){this._strategy.update(y,this._symbolizerParams).catch(Q=>{L.isAbortError(Q)|| |
|
I.getLogger(this).error(Q)})}redraw(){const {renderer:y}=this.layer;y&&(this._updateSymbolizerParams(y),this._strategy.redraw(this._symbolizerParams))}_canReuseVectorFieldData(y){const Q=this._dataParameters.time===y.time,a=this._dataParameters.symbolTileSize===y.symbolTileSize,b=this._dataParameters.bbox===y.bbox;return this._dataParameters.exportParametersVersion===y.exportParametersVersion&&Q&&a&&b}async _getProjectedFullExtent(y){try{return J.projectExtent(this.layer.fullExtent,y)}catch(Q){try{const a= |
|
(await B(this.layer.url,{query:{option:"footprints",outSR:A.srToRESTValue(y),f:"json"}})).data.featureCollection.layers[0].layerDefinition.extent;return a?t.fromJSON(a):null}catch{return null}}}_updateSymbolizerParams(y){"vector-field"===y.type&&(this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null}))}};m.__decorate([D.property()],v.prototype,"attached",void 0);m.__decorate([D.property()],v.prototype,"container",void 0);m.__decorate([D.property()],v.prototype,"layer", |
|
void 0);m.__decorate([D.property()],v.prototype,"timeExtent",void 0);m.__decorate([D.property()],v.prototype,"type",void 0);m.__decorate([D.property()],v.prototype,"view",void 0);m.__decorate([D.property()],v.prototype,"updating",null);return v=m.__decorate([M.subclass("esri.views.2d.layers.imagery.VectorFieldView2D")],v)})},"esri/layers/support/rasterFunctions/rasterProjectionHelper":function(){define("exports ../../../geometry ../../../core/arrayUtils ../../../core/Error ../../../core/unitUtils ../../../chunks/pe ../../../geometry/projection ../../../geometry/support/spatialReferenceUtils ../../../geometry/Extent ../../../geometry/Point ../../../geometry/Polygon ../../../geometry/SpatialReference".split(" "), |
|
function(m,H,B,v,I,L,U,D,R,T,M,t){function A(c,l,z){return!U.canProjectWithoutEngine(c,l,z)}function J(c,l,z){if((c=A(c,l,z))&&!U.isLoaded())throw new v("rasterprojectionhelper-project","projection engine is not loaded");return c}function q(c,l,z){J(c.spatialReference,l);return z?U.getTransformation(l,c.spatialReference,c):U.getTransformation(c.spatialReference,l,c)}function r(c,l,z,F=null){const P=c.spatialReference;if(P.equals(l))return c;J(P,l,F);z=z.center;z=new R({xmin:z.x-c.x/2,xmax:z.x+c.x/ |
|
2,ymin:z.y-c.y/2,ymax:z.y+c.y/2,spatialReference:P});F=U.project(z,l,F);z=w(l);null==F||null!=z&&F.width>=z?(l=I.getMetersPerUnitForSR(P)/I.getMetersPerUnitForSR(l),c={x:c.x*l,y:c.y*l}):c={x:F.width,y:F.height};return c}function p(c,l=.01){return I.getMetersPerUnitForSR(c)?l/I.getMetersPerUnitForSR(c):0}function y(c,l,z=null,F=!0){const P=c.spatialReference;if(P.equals(l))return c;J(P,l,z);z=U.project(c,l,z);if(!F||!z)return z;Q([c],[z],P,l);return z}function Q(c,l,z,F){const P=C(z,!0),G=C(F,!0); |
|
z=p(z,500);F=p(F,500);if(z&&null!=P&&null!=G)for(let V=0;V<c.length;V++){const W=l[V];if(!W)continue;const {x:K}=c[V],{x:ca}=W;ca>=G[1]-F&&Math.abs(K-P[0])<z?W.x-=G[1]-G[0]:ca<=G[0]+F&&Math.abs(K-P[1])<z&&(W.x+=G[1]-G[0])}}function a(c){const {inSR:l,outSR:z,datumTransformation:F,preferPE:P}=c;if(l.equals(z))return{points:c}=f(c,null),c;if(l.isWebMercator&&z.isWGS84||l.isWGS84&&z.isWebMercator){const {cols:K,rows:ca,xres:Z,yres:ja,usePixelCenter:ia,inSR:ha,outSR:la}=c;let {xmin:ma,ymax:na}=c;ia&& |
|
(ma+=Z/2,na-=ja/2);c=[];const fa=[];var G=Math.max(K,ca);for(var V=0;V<G;V++){var W=U.project(new T({x:ma+Z*Math.min(K,V),y:na-ja*Math.min(ca,V),spatialReference:ha}),la);V<=K&&c.push(W.x);V<=ca&&fa.push(W.y)}G=[];for(V=0;V<K;V++)for(W=0;W<ca;W++)G.push([c[V],fa[W]]);return G}return J(l,z,F)&&P&&(l.isGeographic||null!=g(l))?d(c):b(c)}function b(c){var {points:l}=f(c,null);const {inSR:z,outSR:F,datumTransformation:P}=c;c=l.map(G=>new T(G[0],G[1],z));l=U.project(c,F,P);P&&Q(c,l,z,F);return l.map(G=> |
|
G?[G.x,G.y]:[NaN,NaN])}function d(c){const {inSR:l,outSR:z,datumTransformation:F}=c;var P=g(l);const {points:G,mask:V}=f(c,P);l.isGeographic||(c=l.wkid?L.PeFactory.coordsys(l.wkid):L.PeFactory.fromString(l.isGeographic?L.PeDefs.PE_TYPE_GEOGCS:L.PeDefs.PE_TYPE_PROJCS,l.wkt2||l.wkt),L.PeCSTransformations.projToGeog(c,G.length,G));if(null!=F&&F.steps.length){var W;z.isGeographic&&(W=G.map(([K])=>179.9955<K?1:-179.9955>K?-1:0));F.steps.forEach(K=>{const ca=K.wkid?L.PeFactory.geogtran(K.wkid):L.PeFactory.fromString(L.PeDefs.PE_TYPE_GEOGTRAN, |
|
K.wkt);L.PeGTTransformations.geogToGeog(ca,G.length,G,null,K.isInverse?L.PeDefs.PE_TRANSFORM_2_TO_1:L.PeDefs.PE_TRANSFORM_1_TO_2)});if(W)for(c=0;c<G.length;c++){P=W[c];const K=G[c][0],ca=179.9955<K?1:-179.9955>K?-1:0;P&&ca&&P!==ca&&(G[c][0]=0<P?K+360:K-360)}}z.isGeographic||(W=g(z,!0),h(G,null!=W&&W.isEnvelope?[W.bbox[1],W.bbox[3]]:[-90,90]),W=z.wkid?L.PeFactory.coordsys(z.wkid):L.PeFactory.fromString(z.isGeographic?L.PeDefs.PE_TYPE_GEOGCS:L.PeDefs.PE_TYPE_PROJCS,z.wkt2||z.wkt),L.PeCSTransformations.geogToProj(W, |
|
G.length,G));W=G;if(V&&G.length!==V.length){W=[];for(let K=0,ca=0;K<V.length;K++)V[K]?W.push(G[ca++]):W.push([NaN,NaN])}return W}function g(c,l=!1){var z=c.wkid||c.wkt2||c.wkt;if(!z||c.isGeographic)return null;z=String(z);if(ea.has(z))return z=ea.get(z),l?z?.gcs:z?.pcs;var F=c.wkid?L.PeFactory.coordsys(c.wkid):L.PeFactory.fromString(c.isGeographic?L.PeDefs.PE_TYPE_GEOGCS:L.PeDefs.PE_TYPE_PROJCS,c.wkt2||c.wkt);c=p(c,1E-4);c=e(F,c);F=e(F,0,!0);ea.set(z,{pcs:c,gcs:F});return l?F:c}function e(c,l=0,z= |
|
!1){var F=L.PePCSInfo.generate(c),P=z?c.horizonGcsGenerate():c.horizonPcsGenerate();if(!F||!P?.length)return null;c=!1;var G=P.find(Z=>1===Z.getInclusive()&&1===Z.getKind());if(!G){G=P.find(Z=>1===Z.getInclusive()&&0===Z.getKind());if(!G)return null;c=!0}z=z?0:(2===F.getNorthPoleLocation()?1:0)|(2===F.getSouthPoleLocation()?2:0);F=F.isPannableRectangle();G=G.getCoord();if(c)return{isEnvelope:c,isPannable:F,vertices:G,coef:null,bbox:[G[0][0]-l,G[0][1]-l,G[1][0]+l,G[1][1]+l],poleLocation:z};l=0;c=[]; |
|
let [V,W]=G[0],[K,ca]=G[0];for(let Z=0,ja=G.length;Z<ja;Z++){l++;l===ja&&(l=0);const [ia,ha]=G[Z],[la,ma]=G[l];if(ma===ha)c.push([ia,la,ha,ma,2]);else{P=(la-ia)/(ma-ha||1E-4);const na=ia-P*ha;ha<ma?c.push([P,na,ha,ma,0]):c.push([P,na,ma,ha,1])}V=V<ia?V:ia;W=W<ha?W:ha;K=K>ia?K:ia;ca=ca>ha?ca:ha}return{isEnvelope:!1,isPannable:F,vertices:G,coef:c,bbox:[V,W,K,ca],poleLocation:z}}function f(c,l){const z=[],{cols:F,rows:P,xres:G,yres:V,usePixelCenter:W}=c;let {xmin:K,ymax:ca}=c;W&&(K+=G/2,ca-=V/2);if(null== |
|
l){for(c=0;c<F;c++)for(l=0;l<P;l++)z.push([K+G*c,ca-V*l]);return{points:z}}c=new Uint8Array(F*P);if(l.isEnvelope){const {bbox:[na,fa,pa,qa]}=l;for(let ra=0,sa=0;ra<F;ra++){var Z=K+G*ra,ja=l.isPannable||Z>=na&&Z<=pa;for(var ia=0;ia<P;ia++,sa++){var ha=ca-V*ia;ja&&ha>=fa&&ha<=qa&&(z.push([Z,ha]),c[sa]=1)}}return{points:z,mask:c}}Z=l.coef;l=[];for(ja=0;ja<P;ja++){var la=ca-V*ja;ia=[];ha=[];for(var ma=0;ma<Z.length;ma++){const [na,fa,pa,qa,ra]=Z[ma];la===pa&&pa===qa?(ia.push(na),ia.push(fa),ha.push(2), |
|
ha.push(2)):la>=pa&&la<=qa&&(ia.push(na*la+fa),ha.push(ra))}la=ia;if(2<ia.length){ma=2===ha[0]?0:ha[0];let na=ia[0];la=[];for(let fa=1;fa<ha.length;fa++)if(2!==ha[fa]||fa===ha.length-1)ha[fa]!==ma&&(la.push(0===ma?Math.min(na,ia[fa-1]):Math.max(na,ia[fa-1])),ma=ha[fa],na=ia[fa]),fa===ha.length-1&&la.push(0===ha[fa]?Math.min(na,ia[fa]):Math.max(na,ia[fa]));la.sort((fa,pa)=>fa-pa)}else ia[0]>ia[1]&&(la=[ia[1],ia[0]]);l.push(la)}for(let na=0,fa=0;na<F;na++)for(Z=K+G*na,ja=0;ja<P;ja++,fa++)if(ia=ca-V* |
|
ja,ha=l[ja],2===ha.length)Z>=ha[0]&&Z<=ha[1]&&(z.push([Z,ia]),c[fa]=1);else if(2<ha.length){la=!1;for(ma=0;ma<ha.length;ma+=2)if(Z>=ha[ma]&&Z<=ha[ma+1]){la=!0;break}la&&(z.push([Z,ia]),c[fa]=1)}return{points:z,mask:c}}function h(c,l){const [z,F]=l;for(l=0;l<c.length;l++){const P=c[l][1];if(P<z||P>F)c[l]=[NaN,NaN]}}function k(c,l){const z=w(c[0].spatialReference);if(2>c.length||null==z)return c[0];l=l??p(c[0].spatialReference);c=c.filter(W=>W.width>l);if(1===c.length)return c[0];let {xmin:F,xmax:P, |
|
ymin:G,ymax:V}=c[0];for(let W=1;W<c.length;W++){const K=c[W];P=K.xmax+z*W;G=Math.min(G,K.ymin);V=Math.max(V,K.ymax)}return new R({xmin:F,xmax:P,ymin:G,ymax:V,spatialReference:c[0].spatialReference})}function n(c,l,z=null,F=!0){var P=c.spatialReference;if(P.equals(l))return c;var G=O(c);const V=w(P,!0);var W=w(l);if(0===G||null==V||null==W)return G=x(c,l,z,F),null==V&&null!=W&&Math.abs(G.width-W)<p(l)&&U.isLoaded()&&(P=g(P),null!=P&&P.poleLocation===da.None&&c.width<(P.bbox[2]-P.bbox[0])/2)?u(c,l)|| |
|
G:G;W=c.clone().normalize();if(1===W.length&&c.xmax<V&&c.xmax-V/2>p(P)){const {xmin:K,xmax:ca}=c;for(let Z=0;Z<=G;Z++)W[Z]=new R({xmin:0===Z?K:-V/2,xmax:Z===G?ca-V*Z:V/2,ymin:c.ymin,ymax:c.ymax,spatialReference:P})}c=W.map(K=>x(K,l,z,F));return k(c.filter(B.isSome))}function u(c,l){const z=w(l);if(null==z)return null;let {xmin:F,ymin:P,xmax:G,ymax:V}=c;var W=c.spatialReference;c=new M({spatialReference:W,rings:[[[F,P],[G,P],[G,V],[F,V],[F,P]]]});c=U.project(c,l);if(2!==c.rings.length||!c.rings[0].length|| |
|
!c.rings[1].length)return null;({rings:c}=c);W=p(W);l=new R({spatialReference:l});for(let K=0;2>K;K++){F=G=c[K][0][0];P=V=c[K][0][1];for(let ca=0;ca<c[K].length;ca++)F=F>c[K][ca][0]?c[K][ca][0]:F,G=G<c[K][ca][0]?c[K][ca][0]:G,P=P>c[K][ca][1]?c[K][ca][1]:P,V=V<c[K][ca][1]?c[K][ca][1]:V;if(0===K)l.ymin=P,l.ymax=V,l.xmin=F,l.xmax=G;else if(l.ymin=Math.min(l.ymin,P),l.ymax=Math.max(l.ymax,V),Math.abs(G-z/2)<W)l.xmin=F,l.xmax+=z;else if(Math.abs(F+z/2)<W)l.xmax=G+z;else return null}return l}function x(c, |
|
l,z=null,F=!0,P=!0){const G=c.spatialReference;if(G.equals(l)||!l)return c;J(G,l,z);const V=U.project(c,l,z);if(P&&l.isWebMercator&&V&&(V.ymax=Math.min(2.0037508342787E7,V.ymax),V.ymin=Math.max(-2.0037508342787E7,V.ymin),V.ymin>=V.ymax))return null;if(!F||!V)return V;var W=C(G,!0);F=C(l,!0);if(null==W||null==F)return V;P=p(G,.001);const K=p(G,500);var ca=p(l,.001);if(Math.abs(V.xmin-F[0])<ca&&Math.abs(V.xmax-F[1])<ca){ca=Math.abs(c.xmin-W[0]);W=Math.abs(W[1]-c.xmax);if(ca<P&&W>K){V.xmin=F[0];var Z= |
|
[];Z.push(new T(c.xmax,c.ymin,G));Z.push(new T(c.xmax,(c.ymin+c.ymax)/2,G));Z.push(new T(c.xmax,c.ymax,G));Z=Z.map(ja=>y(ja,l,z)).filter(ja=>!isNaN(ja?.x)).map(ja=>ja.x);V.xmax=Math.max.apply(null,Z)}W<P&&ca>K&&(V.xmax=F[1],F=[],F.push(new T(c.xmin,c.ymin,G)),F.push(new T(c.xmin,(c.ymin+c.ymax)/2,G)),F.push(new T(c.xmin,c.ymax,G)),c=F.map(ja=>y(ja,l,z)).filter(ja=>!isNaN(ja?.x)).map(ja=>ja.x),V.xmin=Math.min.apply(null,c))}else c=p(l,.001),Math.abs(V.xmin-F[0])<c&&(V.xmin=F[0]),Math.abs(V.xmax-F[1])< |
|
c&&(V.xmax=F[1]);return V}function w(c,l=!1){return c?c.isWebMercator?2*(l?2.0037508342787E7:2.0037508342788905E7):c.wkid&&c.isGeographic?360:2*aa[c.wkid]||null:null}function C(c,l=!1){if(c.isGeographic)return[-180,180];c=w(c,l);return null!=c?[-c/2,c/2]:null}function E(c,l,z,F){c=(c-l)/z;0!==c-Math.floor(c)?c=Math.floor(c):F&&--c;return c}function O(c,l=!1){var z=w(c.spatialReference);if(null==z)return 0;const F=l?0:-(z/2),P=p(c.spatialReference),G=!l&&Math.abs(c.xmin+z/2)<P?-z/2:c.xmin;c=E(!l&& |
|
Math.abs(c.xmax-z/2)<P?z/2:c.xmax,F,z,!0);z=E(G,F,z,!1);return c-z}function S(c){const {projectedExtent:l,srcBufferExtent:z,pixelSize:F,datumTransformation:P,rasterTransform:G}=c;var V=l.spatialReference;const W=z.spatialReference;var K=J(V,W);const {xmin:ca,ymin:Z,xmax:ja,ymax:ia}=l,ha=w(W),la=null!=ha&&(c.hasWrapAround||"gcs-shift"===G?.type);c=c.spacing||[32,32];var ma=c[0]*F.x,na=c[1]*F.y;const fa=1===c[0],pa=Math.ceil((ja-ca)/ma-.1/c[0])+(fa?0:1),qa=Math.ceil((ia-Z)/na-.1/c[1])+(fa?0:1);ma=a({cols:pa, |
|
rows:qa,xmin:ca,ymax:ia,xres:ma,yres:na,inSR:V,outSR:W,datumTransformation:P,preferPE:4>=c[0],usePixelCenter:fa});na=[];let ra,sa=0;const wa=fa?-1:NaN,{xmin:xa,xmax:va,ymax:ya,width:za,height:Aa}=z,Ba=p(W,500),Ca=null!=ha&&0<xa&&va>ha/2;var ta=!1;K&&(ta=g(V),ta=null!=ta&&0<ta.poleLocation);for(V=0;V<pa;V++){K=[];for(let ua=0;ua<qa;ua++){var oa=ma[V*qa+ua];la&&oa[0]>va&&oa[0]>ha/2-Ba?oa[0]-=ha:la&&0===V&&0>oa[0]&&Ca&&!G&&(oa[0]+=ha);!oa||isNaN(oa[0])||isNaN(oa[1])?(na.push(wa),na.push(wa),K.push(null), |
|
sa++):(G&&(oa=G.inverseTransform(new T({x:oa[0],y:oa[1],spatialReference:W})),oa=[oa.x,oa.y]),K.push(oa),0<V&&la&&ra[ua]&&oa[0]<ra[ua][0]&&(oa[0]+=ha,ta&&oa[0]>va&&oa[0]>ha&&(oa[0]-=ha)),na.push((oa[0]-xa)/za),na.push((ya-oa[1])/Aa))}ra=K}return{offsets:na,error:null,coefficients:null,outofBoundPointCount:sa,spacing:c,size:fa?[pa,qa]:[pa-1,qa-1]}}function N(c,l,z){const {cols:F,rows:P}=l;l=new Float32Array((F-1)*(P-1)*12);const G=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),V=new Float32Array([-1, |
|
1,0,0,-1,1,1,0,0]);for(let ia=0;ia<F-1;ia++){for(var W=0;W<P-1;W++){var K=ia*P*2+2*W,ca=c[K];const ha=c[K+1];var Z=c[K+2],ja=c[K+3];K+=2*P;const la=c[K],ma=c[K+1],na=c[K+2];K=c[K+3];let fa=0,pa=12*(W*(F-1)+ia);for(let qa=0;3>qa;qa++)l[pa++]=G[fa++]*ca+G[fa++]*Z+G[fa++]*na;fa=0;for(Z=0;3>Z;Z++)l[pa++]=G[fa++]*ha+G[fa++]*ja+G[fa++]*K;fa=0;for(ja=0;3>ja;ja++)l[pa++]=V[fa++]*ca+V[fa++]*la+V[fa++]*na;fa=0;for(ca=0;3>ca;ca++)l[pa++]=V[fa++]*ha+V[fa++]*ma+V[fa++]*K}if(z)for(W=0;W<l.length;W++)isNaN(l[W])&& |
|
(l[W]=-1)}return l}function Y(c,l){c=c.clone().normalize();return 1===c.length?c[0]:k(c,l)}function X(c,l){const {pixelSize:z,extent:F}=c;c=q(F,l,!1);const P=Y(F,(z.x+z.y)/16);return n(P,l,c)}var da;(function(c){c[c.None=0]="None";c[c.North=1]="North";c[c.South=2]="South";c[c.Both=3]="Both"})(da||={});const ba=(c,l,z,F=0)=>{if(1===z[0])return[0,0];var P=1,G=-1,V=1,W=-1;for(var K=0;K<c.length;K+=2)isNaN(c[K])||(P=P>c[K]?c[K]:P,G=G>c[K]?G:c[K],V=V>c[K+1]?c[K+1]:V,W=W>c[K+1]?W:c[K+1]);const {cols:ca, |
|
rows:Z}=l;l=(G-P)/ca/z[0];z=(W-V)/Z/z[1];F*=2;V=0;W=!1;P=[0,0];for(G=0;G<ca-3;G++){for(K=0;K<Z-3;K++){var ja=G*Z*2+2*K;const ia=Math.abs(((c[ja]+c[ja+4]+c[ja+4*Z]+c[ja+4*Z+4])/4-c[ja+2*Z+2])/l);ja=Math.abs(((c[ja+1]+c[ja+5]+c[ja+4*Z+1]+c[ja+4*Z+5])/4-c[ja+2*Z+3])/z);ia+ja>V&&(V=ia+ja,P=[ia,ja]);if(F&&V>F){W=!0;break}}if(W)break}return P},aa={3395:2.0037508342789244E7,3410:1.7334193943686873E7,3857:2.0037508342788905E7,3975:1.7367530445161372E7,4087:2.0037508342789244E7,4088:2.0015108787169147E7,6933:1.7367530445161372E7, |
|
32662:2.0037508342789244E7,53001:2.001508679602057E7,53002:1.000754339801029E7,53003:2.001508679602057E7,53004:2.001508679602057E7,53016:1.4152803599503474E7,53017:1.7333573624304302E7,53034:2.001508679602057E7,53079:2.0015114352186374E7,53080:2.0015114352186374E7,54001:2.0037508342789244E7,54002:1.0018754171394624E7,54003:2.0037508342789244E7,54004:2.0037508342789244E7,54016:1.4168658027268292E7,54017:1.736753044516137E7,54034:2.0037508342789244E7,54079:2.0037508342789244E7,54080:2.0037508342789244E7, |
|
54100:2.0037508342789244E7,54101:2.0037508342789244E7},ea=new Map,ka=new Map;m.computeProjectedScales=function(c,l,z){var F=z?.tileSize??512,P=z?.alignGlobalDatasetWithAGOL??!0,G=!!z?.limitToSrcResolution;const {extent:V,spatialReference:W,pixelSize:K}=c;z=r(new T({x:K.x,y:K.y,spatialReference:W}),l,V);if(null==z)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const ca=(z.x+z.y)/2,Z=I.getMetersPerUnitForSR(l);var ja=ca*Z*96*39.37,ia=l.isGeographic?256/F*2.958287637958547E8: |
|
256/F*5.91657527591555E8,ha="vector-magdir"===c.dataType||"vector-uv"===c.dataType,la=X(c,l),ma=Math.min(Math.ceil(Math.log(Math.min(c.width,c.height)/32)/Math.LN2),Math.ceil(Math.log(ia/2/ja)/Math.LN2));if(!ha&&P&&(l.isGeographic||l.isWebMercator)&&(P=w(l),ha=0<O(la)||null!=P&&la.width>P/4,!ha&&null!=P)){ha=-1;if(3>ma)ha=2**ma*ca*F;else if(c.storageInfo){const {maximumPyramidLevel:na=0,pyramidScalingFactor:fa=2}=c.storageInfo;ha=fa**na*ca*F}F=Math.ceil(P/ha);ha=1===F||2===F&&P/2-la.xmax<ha}F=ja; |
|
c=Math.min(2,Math.max(1.414,c.storageInfo?.pyramidScalingFactor||2));if(ha)F=ia,ia=l.isGeographic?1.341104507446289E-6:.29858214164761665,ma=96*ia*Z*39.37,l=r(new T({x:ia,y:ia,spatialReference:{wkid:l.isGeographic?4326:3857}}),W,la),l.x*=F/ma,l.y*=F/ma;else{l={x:K.x,y:K.y};for(la=0;F<.5005*ia&&la<ma;)la++,F*=c,l.x*=c,l.y*=c;1.001>=Math.max(F,ia)/Math.min(F,ia)&&(F=ia)}ia=[F];la=[{x:l.x,y:l.y}];for(ja=Math.min(70.5310735,ja)/1.001;F>=ja;)F/=c,l.x/=c,l.y/=c,ia.push(F),la.push({x:l.x,y:l.y});if(G){const na= |
|
.001*K.x;G=la.findIndex(fa=>fa.x>=K.x-na&&fa.x<=K.x+na);-1<G?(la.length=G+1,ia.length=G+1):(G=la.findIndex(fa=>fa.x<=K.x+na),0<G&&(la.length=G,ia.length=G))}return{projectedPixelSize:z,scales:ia,srcResolutions:la,isCustomTilingScheme:!ha}};m.defaultGridSpacing=32;m.defaultProjectionToleranceInPixels=4;m.getDefaultDatumTransformationForDataset=q;m.getProjectedGridPoints=a;m.getProjectionOffsetGrid=function(c){var l=c.isAdaptive&&null==c.spacing;let z=c.spacing||[32,32],F=S(c);var P={cols:F.size[0]+ |
|
1,rows:F.size[1]+1};const G=0<F.outofBoundPointCount&&F.outofBoundPointCount<F.offsets.length/2;let V=F.outofBoundPointCount===F.offsets.length/2||l&&G?[0,0]:ba(F.offsets,P,z,4);const W=(V[0]+V[1])/2;var K=c.projectedExtent.spatialReference;const ca=c.srcBufferExtent.spatialReference;l&&(G||4<W)&&(A(K,ca,c.datumTransformation)&&(K.isGeographic||null!=g(K)),z=[4,4],F=S({...c,spacing:z}),P={cols:F.size[0]+1,rows:F.size[1]+1},V=ba(F.offsets,P,z,4));F.error=V;1<z[0]&&(F.coefficients=N(F.offsets,P,G)); |
|
!c.includeGCSGrid||K.isGeographic||K.isWebMercator||(ca.isGeographic?F.gcsGrid={offsets:F.offsets,coefficients:F.coefficients,spacing:z}:(l=g(K),null==l||l.isEnvelope||(K&&!K.isGeographic&&(l=String(K.wkid||K.wkt2||K.wkt),ka.has(l)?K=ka.get(l):(K=(K.wkid?L.PeFactory.coordsys(K.wkid):L.PeFactory.fromString(L.PeDefs.PE_TYPE_PROJCS,K.wkt2||K.wkt)).getGeogcs().getCode(),ka.set(l,K)),K=new t({wkid:K})),K=n(c.projectedExtent,K),{offsets:c}=S({...c,srcBufferExtent:K,spacing:z}),P=N(c,P,G),F.gcsGrid={offsets:c, |
|
coefficients:P,spacing:z})));return F};m.getRasterDatasetAlignmentInfo=function(c){const l=c.storageInfo.origin.x;var z=w(c.spatialReference,!0);if(null==z)return{originX:l,halfWorldWidth:null,pyramidsInfo:null};const F=z/2,{nativePixelSize:P,storageInfo:G,extent:V}=c,{maximumPyramidLevel:W,blockWidth:K,pyramidScalingFactor:ca}=G;let Z=P.x;const ja=[];c=null!=c.transform&&"gcs-shift"===c.transform.type;const ia=l+(c?0:F);z=c?z-l:F-l;for(let ha=0;ha<=W;ha++){const la=(V.xmax-l)/Z/K,ma=z/Z/K;ja.push({resolutionX:Z, |
|
blockWidth:K,datasetColumnCount:0===la-Math.floor(la)?la:Math.ceil(la),worldColumnCountFromOrigin:0===ma-Math.floor(ma)?ma:Math.ceil(ma),leftMargin:Math.round(ia/Z)%K,rightPadding:(K-Math.round(z/Z)%K)%K,originColumnOffset:Math.floor(ia/Z/K)});Z*=ca}return{originX:l,halfWorldWidth:F,pyramidsInfo:ja,hasGCSSShiftTransform:c}};m.getWorldWidth=w;m.getWorldWrapCount=O;m.load=async function(){U.isLoaded()||await U.load()};m.minimumGridSpacing=4;m.projectDatasetExtent=X;m.projectExtent=n;m.projectPoint= |
|
y;m.projectPolygon=function(c,l,z){if("extent"===c.type){const {xmin:F,ymin:P,xmax:G,ymax:V,spatialReference:W}=c;c=new M({rings:[[[F,V],[G,V],[G,P],[F,P],[F,V]]],spatialReference:W})}if(c.spatialReference.equals(l))return c;J(c.spatialReference,l,z);return U.project(c,l,z)};m.projectResolution=r;m.requirePE=A;m.shiftExtent=function(c){var {spatialReference:l}=c;l=D.getInfo(l);if(!l)return c;const [z,F]=l.valid;l=F-z;let P=0;c.xmin<z?P=Math.ceil((z-c.xmin)/l):c.xmin>F&&(P=-Math.ceil((c.xmin-F)/l)); |
|
return new R({spatialReference:c.spatialReference,xmin:c.xmin+P*l,ymin:c.ymin,xmax:c.xmax+P*l,ymax:c.ymax})};m.snapExtent=Y;m.snapPyramid=function(c,l,z){const {storageInfo:F,pixelSize:P}=l;var G=0;let V=!1;var {pyramidResolutions:W}=F,K="mixed"===F.tileInfo.format?.toLowerCase()?Math.max(1,Math.min(3,F.tileInfo.dpi/96)):1;K=(c.x+c.y)/2/K;if(null!=W&&W.length){c=W[W.length-1];c=(c.x+c.y)/2;var ca=(P.x+P.y)/2;if(K<=ca)G=0;else if(K>=c)G=W.length,V=8<K/c;else{c=ca;for(let Z=1;Z<=W.length;Z++){ca=(W[Z- |
|
1].x+W[Z-1].y)/2;if(K<=ca){K===ca?G=Z:"down"===z?(G=Z-1,V=8<K/c):G="up"===z?Z:K-c>ca-K||2<K/c?Z:Z-1;break}c=ca}}z=0===G?P:W[G-1];V&&(W=Math.min(z.x,z.y),K=I.getMetersPerUnitForSR(l.spatialReference),19567<W*K&&(V=!1));return{pyramidLevel:G,pyramidResolution:new T({x:z.x,y:z.y,spatialReference:l.spatialReference}),excessiveReading:V}}G=Math.log(c.x/P.x)/Math.LN2;K=Math.log(c.y/P.y)/Math.LN2;W=l.storageInfo.maximumPyramidLevel||0;G="down"===z?Math.floor(Math.min(G,K)):"up"===z?Math.ceil(Math.max(G, |
|
K)):Math.round((G+K)/2);0>G?G=0:G>W&&(V=G>W+3,G=W);z=2**G;l=new T({x:z*l.nativePixelSize.x,y:z*l.nativePixelSize.y,spatialReference:l.spatialReference});return{pyramidLevel:G,pyramidResolution:l,excessiveReading:V}};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterFunctions/vectorFieldUtils":function(){define(["exports","../../../core/jsonMap","../PixelBlock","./pixelUtils"],function(m,H,B,v){function I(e,f){return r.get(e)/r.get(f)||1}function L(e,f="geographic"){const [h, |
|
k]=e;e=Math.sqrt(h*h+k*k);let n=Math.atan2(k,h)*p;n=(360+n)%360;"geographic"===f&&(n=(450-n)%360);return[e,n]}function U(e,f="geographic"){let h=e[1];"geographic"===f&&(h=(450-h)%360);h%=360;e=e[0];return[e*Math.cos(h/p),e*Math.sin(h/p)]}function D(e,f,h="geographic",k=1){if(!v.isValidPixelBlock(e))return e;const {pixels:n,width:u,height:x}=e;var w=u*x;const C=n[0],E=n[1],O=e.pixelType.startsWith("f")?e.pixelType:"f32",S=B.createEmptyBand(O,w);w=B.createEmptyBand(O,w);let N=0;for(let Y=0;Y<x;Y++)for(let X= |
|
0;X<u;X++)"vector-uv"===f?([S[N],w[N]]=L([C[N],E[N]],h),S[N]*=k):([S[N],w[N]]=U([C[N],E[N]],h),S[N]*=k,w[N]*=k),N++;e=new B({pixelType:O,width:e.width,height:e.height,mask:e.mask,validPixelCount:e.validPixelCount,maskIsAlpha:e.maskIsAlpha,pixels:[S,w]});e.updateStatistics();return e}function R(e=0,f=0,h=Math.PI,k=!0){k&&(h=(2*Math.PI-h)%(2*Math.PI));k=k?-1:1;const n=-7*k,u=-2*k,x=-16*k,[w,C]=M(0,f+13*k,h,21.75),[E,O]=M(e-5.5,f+n,h,21.75),[S,N]=M(e+5.5,f+n,h,21.75),[Y,X]=M(e-1.5,f+u,h,21.75),[da,ba]= |
|
M(e+1.5,f+u,h,21.75),[aa,ea]=M(e-1.5,f+x,h,21.75),[ka,c]=M(e+1.5,f+x,h,21.75);return[w,C,E,O,Y,X,da,ba,S,N,aa,ea,ka,c]}function T(e=0,f=Math.PI,h=!0){h&&(f=(2*Math.PI-f)%(2*Math.PI));var k=h?-1:1,n=5*k;const u=20*k,x=25*k;k*=2;const w=h?1:-1;h=5*w;let [C,E]=[0+h,0-u],[O,S]=[C+2*w,E],[N,Y]=[O-0*w,S+k],[X,da]=[0-h,0-x],[ba,aa]=[X+0*w,da-k],ea=Math.ceil(e/5),ka=Math.floor(ea/10);ea-=8*ka;e=[];const c=[];for(let ca=0;ca<ea/2;ca++,ka--){0>=ka&&1===ea%2&&ca===(ea-1)/2&&(X=0,ba=X+0*w,da=(da+E)/2,aa=da-k); |
|
const [Z,ja]=M(X,da,f,45);if(0<ka){const [ia,ha]=M(O,da,f,45),[la,ma]=M(C,E,f,45);e.push(ia);e.push(ha);e.push(Z);e.push(ja);e.push(la);e.push(ma)}else{const [ia,ha]=M(O,S,f,45),[la,ma]=M(N,Y,f,45),[na,fa]=M(ba,aa,f,45);c.push(Z);c.push(ja);c.push(na);c.push(fa);c.push(la);c.push(ma);c.push(ia);c.push(ha)}da+=n;E+=n;S+=n;Y+=n;aa+=n}const [l,z]=M(0+h,0+u,f,45);n=7*w;const [F,P]=M(0+n,0+u,f,45),[G,V]=M(0+h,0-x,f,45),[W,K]=M(0+n,0-x,f,45);return{pennants:e,barbs:c,shaft:[l,z,F,P,G,V,W,K]}}function M(e, |
|
f,h,k=1){return[Math.sqrt(e*e+f*f)/k,(2*Math.PI+(2*Math.PI+Math.atan2(f,e))%(2*Math.PI)-h)%(2*Math.PI)]}function t(e,f,h,k){h=I(k||"knots",h);for(k=1;k<f.length;k++)if(k===f.length-1){if(e<f[k]*h)break}else if(e<=f[k]*h)break;return Math.min(k-1,f.length-2)}function A(e,f,h,k,n){let u=0;switch(f){case "beaufort_kn":u=t(e,a,"knots",h);break;case "beaufort_km":u=t(e,a,"kilometer-per-hour",h);break;case "beaufort_ft":u=t(e,a,"feet-per-second",h);break;case "beaufort_m":u=t(e,a,"meter-per-second",h); |
|
break;case "classified_arrow":u=t(e,n??[],k,h);break;case "ocean_current_m":u=t(e,b,"meter-per-second",h);break;case "ocean_current_kn":u=t(e,d,"knots",h)}return u}function J(e,f){const {style:h,inputUnit:k,outputUnit:n,breakValues:u}=f,x=y.fromJSON(k),w=y.fromJSON(n);let C=0,E=0;const {width:O,height:S,mask:N}=e,Y=e.pixels[0];e=e.pixels[1];var X=null!=N?N.filter(aa=>0<aa).length:O*S;const da=new Float32Array(42*X);X=new Uint32Array(15*X);f=f.invertDirection?R(0,0,0,!1):Q;for(let aa=0;aa<S;aa++)for(let ea= |
|
0;ea<O;ea++){var ba=aa*O+ea;if(!N||N[aa*O+ea]){const ka=(e[ba]+360)%360/180*Math.PI,c=A(Y[ba],h,x,w,u);for(let l=0;l<f.length;l+=2)da[C++]=(ea+.5)/O,da[C++]=(aa+.5)/S,da[C++]=f[l],da[C++]=f[l+1]+ka,da[C++]=c,da[C++]=Y[ba];ba=7*(C/42-1);X[E++]=ba;X[E++]=ba+1;X[E++]=ba+2;X[E++]=ba+0;X[E++]=ba+4;X[E++]=ba+3;X[E++]=ba+0;X[E++]=ba+2;X[E++]=ba+3;X[E++]=ba+2;X[E++]=ba+5;X[E++]=ba+3;X[E++]=ba+5;X[E++]=ba+6;X[E++]=ba+3}}return{vertexData:da,indexData:X}}function q(e,f){let h=0,k=0;const {width:n,height:u, |
|
mask:x}=e;e=e.pixels[0];const w=[],C=[];var E=y.fromJSON(f.inputUnit);E=I(E,"knots");f="wind_speed"===f.style?5:Number.MAX_VALUE;for(let S=0;S<u;S++)for(let N=0;N<n;N++){var O=e[S*n+N]*E;if((!x||x[S*n+N])&&O<f){for(let Y=0;4>Y;Y++)w[h++]=(N+.5)/n,w[h++]=(S+.5)/u,w[h++]=2>Y?-.5:.5,w[h++]=0===Y%2?-.5:.5,w[h++]=0,w[h++]=O;O=4*(h/24-1);C[k++]=O;C[k++]=O+1;C[k++]=O+2;C[k++]=O+1;C[k++]=O+2;C[k++]=O+3}}return{vertexData:new Float32Array(w),indexData:new Uint32Array(C)}}const r=new Map;r.set("meter-per-second", |
|
1);r.set("kilometer-per-hour",.277778);r.set("knots",.514444);r.set("feet-per-second",.3048);r.set("mile-per-hour",.44704);const p=180/Math.PI,y=new H.JSONMap({esriMetersPerSecond:"meter-per-second",esriKilometersPerHour:"kilometer-per-hour",esriKnots:"knots",esriFeetPerSecond:"feet-per-second",esriMilesPerHour:"mile-per-hour"}),Q=R(0,0,0),a=[0,1,3,6,10,16,21,27,33,40,47,55,63],b=[0,.5,1,1.5,2],d=[0,.25,.5,1,1.5,2,2.5,3,3.5,4],g=[];m.convertToLocalDirections=function(e,f,h,k="geographic"){if(!v.isValidPixelBlock(e)|| |
|
null==h)return e;e="vector-magdir"===f?e.clone():D(e,f);const n=e.pixels[1];for(let u=0;u<n.length;u++)n[u]="geographic"===k?(n[u]+h[u]+270)%360:(n[u]+360-h[u])%360;return"vector-magdir"===f?e:D(e,"vector-magdir")};m.convertVectorFieldData=D;m.convertVectorFieldUnit=function(e,f,h=1){if(1===h||!v.isValidPixelBlock(e))return e;e=e.clone();const {pixels:k,width:n,height:u}=e,x=k[0],w=k[1];let C=0;for(let E=0;E<u;E++)for(let O=0;O<n;O++)"vector-uv"===f?(x[C]*=h,w[C]*=h):x[C]*=h,C++;e.updateStatistics(); |
|
return e};m.createVFMesh=function(e,f){if("simple_scalar"===f.style)f=q(e,f);else if("wind_speed"===f.style){if(0===g.length)for(var h=0;30>h;h++)g.push(T(5*h,0,!f.invertDirection));f=y.fromJSON(f.inputUnit);f=I(f,"knots");const {width:x,height:w,mask:C}=e;h=e.pixels[0];e=e.pixels[1];const E=[],O=[];let S=0,N=0;for(let Y=0;Y<w;Y++)for(let X=0;X<x;X++){var k=Y*x+X,n=h[k]*f;if((!C||C[Y*x+X])&&5<=n){const da=(e[k]+360)%360/180*Math.PI,{pennants:ba,barbs:aa,shaft:ea}=g[Math.min(Math.floor(n/5),29)];if(0=== |
|
ba.length+aa.length)continue;k=E.length/6;const ka=(X+.5)/x,c=(Y+.5)/w;for(var u=0;u<ba.length;u+=2)E[S++]=ka,E[S++]=c,E[S++]=ba[u],E[S++]=ba[u+1]+da,E[S++]=0,E[S++]=n;for(u=0;u<aa.length;u+=2)E[S++]=ka,E[S++]=c,E[S++]=aa[u],E[S++]=aa[u+1]+da,E[S++]=0,E[S++]=n;for(u=0;u<ea.length;u+=2)E[S++]=ka,E[S++]=c,E[S++]=ea[u],E[S++]=ea[u+1]+da,E[S++]=0,E[S++]=n;for(n=0;n<ba.length/6;n++)O[N++]=k,O[N++]=k+1,O[N++]=k+2,k+=3;for(n=0;n<aa.length/8;n++)O[N++]=k,O[N++]=k+1,O[N++]=k+2,O[N++]=k+1,O[N++]=k+2,O[N++]= |
|
k+3,k+=4;O[N++]=k+0;O[N++]=k+1;O[N++]=k+2;O[N++]=k+1;O[N++]=k+3;O[N++]=k+2;k+=4}}f={vertexData:new Float32Array(E),indexData:new Uint32Array(O)}}else f=J(e,f);return f};m.createVFMeshScalar=q;m.getUnitConversionFactor=I;m.sampleVectorField=function(e,f,h,k=[0,0],n=.5){const {width:u,height:x,mask:w}=e,[C,E]=e.pixels,[O,S]=k;e=Math.round((u-O)/h);k=Math.round((x-S)/h);var N=e*k;const Y=new Float32Array(N),X=new Float32Array(N);N=new Uint8Array(N);f="vector-uv"===f;for(let ba=0;ba<k;ba++)for(let aa= |
|
0;aa<e;aa++){let ea=0;const ka=ba*e+aa,c=Math.max(0,ba*h+S),l=Math.max(0,aa*h+O),z=Math.min(x,c+h),F=Math.min(u,l+h);for(let P=c;P<z;P++)for(let G=l;G<F;G++){var da=P*u+G;if(!w||w[da]){ea++;da=f?[C[da],E[da]]:[C[da],(360+E[da])%360];const [V,W]=f?da:U(da);Y[ka]+=V;X[ka]+=W}}if(ea>=(z-c)*(F-l)*(1-n)){N[ka]=1;const [P,G]=L([Y[ka]/ea,X[ka]/ea]);Y[ka]=P;X[ka]=G}else N[ka]=0,Y[ka]=0,X[ka]=0}h=new B({width:e,height:k,pixels:[Y,X],mask:N});h.updateStatistics();return h};m.snapImageToSymbolTile=function(e, |
|
f,h,k,n){if(null==n||!n.spatialReference.equals(e.spatialReference))return{extent:e,width:Math.round(f/k),height:Math.round(h/k),resolution:e.width/f};const u=n.xmin;n=n.ymax;f=(e.xmax-e.xmin)/f*k;h=(e.ymax-e.ymin)/h*k;e.xmin=u+Math.floor((e.xmin-u)/f)*f;e.xmax=u+Math.ceil((e.xmax-u)/f)*f;e.ymin=n+Math.floor((e.ymin-n)/h)*h;e.ymax=n+Math.ceil((e.ymax-n)/h)*h;return{extent:e,width:Math.round(e.width/f),height:Math.round(e.height/h),resolution:(f+h)/2}};m.unitKebabDict=y;m.uvComponentToVector=L;Object.defineProperty(m, |
|
Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/imagery/RasterVFContainer":function(){define(["exports","./BrushVectorField","../webgl/enums","../webgl/WGLContainer"],function(m,H,B,v){class I extends v{constructor(){super(...arguments);this.symbolTypes=["triangle"]}prepareRenderPasses(L){const U=L.registerRenderPass({name:"imagery (vf)",brushes:[H],target:()=>this.children,drawPhase:B.WGLDrawPhase.MAP});return[...super.prepareRenderPasses(L),U]}doRender(L){this.visible&&L.drawPhase=== |
|
B.WGLDrawPhase.MAP&&this.symbolTypes.forEach(U=>{L.renderPass=U;super.doRender(L)})}}m.RasterVFContainer=I;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/imagery/BrushVectorField":function(){define(["../webgl/brushes/WGLBrush","../../../webgl/enums"],function(m,H){const B=new Float32Array([.27058823529411763,.4588235294117647,.7098039215686275,1,.396078431372549,.5372549019607843,.7215686274509804,1,.5176470588235295,.6196078431372549,.7294117647058823,1,.6352941176470588, |
|
.7058823529411765,.7411764705882353,1,.7529411764705882,.8,.7450980392156863,1,.8705882352941177,.8901960784313725,.7490196078431373,1,1,1,.7490196078431373,1,1,.8627450980392157,.6313725490196078,1,.9803921568627451,.7254901960784313,.5176470588235295,1,.9607843137254902,.596078431372549,.4117647058823529,1,.9294117647058824,.4588235294117647,.3176470588235294,1,.9098039215686274,.08235294117647059,.08235294117647059,1]),v=new Float32Array([0,92/255,230/255,1]),I={beaufort_ft:B,beaufort_m:B,beaufort_km:B, |
|
beaufort_mi:B,beaufort_kn:new Float32Array([.1568627450980392,.5725490196078431,.7803921568627451,1,.34901960784313724,.6352941176470588,.7294117647058823,1,.5058823529411764,.7019607843137254,.6705882352941176,1,.6274509803921569,.7607843137254902,.6078431372549019,1,.7490196078431373,.8313725490196079,.5411764705882353,1,.8549019607843137,.9019607843137255,.4666666666666667,1,.9803921568627451,.9803921568627451,.39215686274509803,1,.9882352941176471,.8352941176470589,.3254901960784314,1,.9882352941176471, |
|
.7019607843137254,.4,1,.9803921568627451,.5529411764705883,.20392156862745098,1,.9686274509803922,.43137254901960786,.16470588235294117,1,.9411764705882353,.2784313725490196,.11372549019607843,1]),classified_arrow:new Float32Array([.2196078431372549,.6588235294117647,0,1,.5450980392156862,1.2117647058823529,0,1,1,1,0,1,1,.5019607843137255,0,1,1,0,0,1]),ocean_current_m:new Float32Array([.3058823529411765,.10196078431372549,.6,1,.7019607843137254,.10588235294117647,.10196078431372549,1,.792156862745098, |
|
.5019607843137255,.10196078431372549,1,.6941176470588235,.6941176470588235,.6941176470588235,1]),ocean_current_kn:new Float32Array([0,0,0,1,0,.1450980392156863,.39215686274509803,1,.3058823529411765,.10196078431372549,.6,1,.592156862745098,0,.39215686274509803,1,.7019607843137254,.10588235294117647,.10196078431372549,1,.6941176470588235,.3058823529411765,.10196078431372549,1,.792156862745098,.5019607843137255,.10196078431372549,1,.6941176470588235,.7019607843137254,.20392156862745098,1,.6941176470588235, |
|
.6941176470588235,.6941176470588235,1]),simple_scalar:v,single_arrow:v,wind_speed:new Float32Array([0,0,0,1])},L=[0,20];class U extends m{constructor(){super(...arguments);this._desc={magdir:{vsPath:"raster/magdir",fsPath:"raster/magdir",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])},scalar:{vsPath:"raster/scalar",fsPath:"raster/scalar",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])}}}dispose(){}prepareState({context:D}){D.setBlendingEnabled(!0);D.setBlendFunctionSeparate(H.BlendFactor.ONE, |
|
H.BlendFactor.ONE_MINUS_SRC_ALPHA,H.BlendFactor.ONE,H.BlendFactor.ONE_MINUS_SRC_ALPHA);D.setColorMask(!0,!0,!0,!0);D.setStencilWriteMask(0);D.setStencilTestEnabled(!0);D.setStencilOp(H.StencilOperation.KEEP,H.StencilOperation.KEEP,H.StencilOperation.REPLACE)}draw(D,R){if(null!=R.source&&0!==R.source.validPixelCount){var {context:T,timeline:M}=D;M.begin(this.name);T.setStencilFunction(H.CompareFunction.EQUAL,R.stencilRef,255);R.updateVectorFieldVAO(D);if("scalar"===D.renderPass){var t=R.vaoData.scalar; |
|
t&&this._drawScalars(D,R,t.vao,t.elementCount)}else(t=R.vaoData.magdir)&&this._drawTriangles(D,R,t.vao,t.elementCount);M.end(this.name)}}_drawTriangles(D,R,T,M){const {context:t,painter:A,requestRender:J,allowDelayedRender:q}=D,{symbolizerParameters:r}=R;var p=r.dataRange?["dataRange"]:[];"geographic"===r.rotationType&&p.push("rotationGeographic");p=A.materialManager.getProgram(this._desc.magdir,p);if(q&&null!=J&&!p.compiled)J();else{t.useProgram(p);var {coordScale:y,opacity:Q,transforms:a}=R;p.setUniform2fv("u_coordScale", |
|
y);p.setUniform1f("u_opacity",Q);p.setUniformMatrix3fv("u_dvsMat3",a.displayViewScreenMat3);var {style:b,dataRange:d,rotation:g,symbolPercentRange:e}=r;p.setUniform4fv("u_colors",I[b]);p.setUniform2fv("u_dataRange",d||L);p.setUniform1f("u_rotation",g);p.setUniform2fv("u_symbolPercentRange",e);D=this._getSymbolSize(D,R);p.setUniform2fv("u_symbolSize",D);t.bindVAO(T);t.drawElements(H.PrimitiveType.TRIANGLES,M,H.DataType.UNSIGNED_INT,0)}}_drawScalars(D,R,T,M){const {context:t,painter:A,requestRender:J, |
|
allowDelayedRender:q}=D,{symbolizerParameters:r}=R;var p=[];"wind_speed"===r.style?p.push("innerCircle"):r.dataRange&&p.push("dataRange");"geographic"===r.rotationType&&p.push("rotationGeographic");p=A.materialManager.getProgram(this._desc.scalar,p);if(q&&null!=J&&!p.compiled)J();else{t.useProgram(p);var {coordScale:y,opacity:Q,transforms:a}=R;p.setUniform2fv("u_coordScale",y);p.setUniform1f("u_opacity",Q);p.setUniformMatrix3fv("u_dvsMat3",a.displayViewScreenMat3);var {dataRange:b,symbolPercentRange:d}= |
|
r;p.setUniform2fv("u_dataRange",b||L);p.setUniform2fv("u_symbolPercentRange",d);D=this._getSymbolSize(D,R);p.setUniform2fv("u_symbolSize",D);t.bindVAO(T);t.drawElements(H.PrimitiveType.TRIANGLES,M,H.DataType.UNSIGNED_INT,0)}}_getSymbolSize(D,R){D=R.key?2**(D.displayLevel-R.key.level):R.resolution/D.state.resolution;const {symbolTileSize:T}=R.symbolizerParameters;return[T/(Math.round((R.width-R.offset[0])/T)*T)/D,T/(Math.round((R.height-R.offset[1])/T)*T)/D]}}return U})},"esri/views/2d/layers/imagery/ImageryVFStrategy":function(){define("../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/Logger ../../../../core/promiseUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../geometry/Extent ../../engine/imagery/RasterVFDisplayObject".split(" "), |
|
function(m,H,B,v,I,L,U,D,R,T){H=class extends H{constructor(M){super(M);this._loading=null;this.update=v.debounce((t,A)=>this._update(t,A).catch(J=>{v.isAbortError(J)||B.getLogger(this).error(J)}))}get updating(){return!!this._loading}redraw(M){if(this.container.children.length){var t=this.container.children[0];t.symbolizerParameters=M;t.invalidateVAO();this.container.symbolTypes="wind_speed"===M.style?["scalar","triangle"]:"simple_scalar"===M.style?["scalar"]:["triangle"];this.container.requestRender()}}async _update(M, |
|
t,A){if(M.stationary){var {extent:J,spatialReference:q}=M.state,r=new R({xmin:J.xmin,ymin:J.ymin,xmax:J.xmax,ymax:J.ymax,spatialReference:q}),[p,y]=M.state.size;this._loading=this.fetchPixels(r,p,y,A);A=await this._loading;this._addToDisplay(A,t,M.state);this._loading=null}}_addToDisplay(M,t,A){if(null==M.pixelBlock)this.container.children.forEach(p=>p.destroy()),this.container.removeAllChildren();else{var {extent:J,pixelBlock:q}=M,r=new T.RasterVFDisplayObject(q);r.offset=[0,0];r.symbolizerParameters= |
|
t;r.rawPixelData=M;r.invalidateVAO();r.x=J.xmin;r.y=J.ymax;r.pixelRatio=A.pixelRatio;r.rotation=A.rotation;r.resolution=A.resolution;r.width=q.width*t.symbolTileSize;r.height=q.height*t.symbolTileSize;this.container.children.forEach(p=>p.destroy());this.container.removeAllChildren();this.container.symbolTypes="wind_speed"===t.style?["scalar","triangle"]:"simple_scalar"===t.style?["scalar"]:["triangle"];this.container.addChild(r)}}};m.__decorate([I.property()],H.prototype,"fetchPixels",void 0);m.__decorate([I.property()], |
|
H.prototype,"container",void 0);m.__decorate([I.property()],H.prototype,"_loading",void 0);m.__decorate([I.property()],H.prototype,"updating",null);return H=m.__decorate([D.subclass("esri.views.2d.layers.imagery.ImageryVFStrategy")],H)})},"esri/views/2d/engine/imagery/RasterVFDisplayObject":function(){define("exports ../../../../core/has ../../../../core/libs/gl-matrix-2/math/mat3 ../../../../core/libs/gl-matrix-2/factories/mat3f32 ../../../../core/libs/gl-matrix-2/factories/vec2f32 ../../../../layers/support/rasterFunctions/vectorFieldUtils ../DisplayObject ../webgl/Utils ../../../webgl/BufferObject ../../../webgl/enums ../../../webgl/VertexArrayObject".split(" "), |
|
function(m,H,B,v,I,L,U,D,R,T,M){class t extends U.DisplayObject{constructor(A=null){super();this._symbolizerParameters=this._source=null;this._vaoInvalidated=!0;this.coordScale=[1,1];this.offset=this.key=this.height=null;this.stencilRef=0;this.resolution=null;this.pixelRatio=1;this.rotation=this.y=this.x=0;this.width=this.vaoData=this.rawPixelData=null;this.source=A}destroy(){null!=this.vaoData&&(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null)}get symbolizerParameters(){return this._symbolizerParameters}set symbolizerParameters(A){JSON.stringify(this._symbolizerParameters)!== |
|
JSON.stringify(A)&&(this._symbolizerParameters=A,this.invalidateVAO())}get source(){return this._source}set source(A){this._source=A;this.invalidateVAO()}invalidateVAO(){this._vaoInvalidated||null==this.vaoData||(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null,this._vaoInvalidated=!0,this.requestRender())}updateVectorFieldVAO(A){if(this._vaoInvalidated){this._vaoInvalidated=!1;if(null!=this.source&&null==this.vaoData){var {style:J}=this.symbolizerParameters; |
|
switch(J){case "beaufort_ft":case "beaufort_km":case "beaufort_kn":case "beaufort_m":case "beaufort_mi":case "classified_arrow":case "ocean_current_kn":case "ocean_current_m":case "single_arrow":J=L.createVFMesh(this.source,this.symbolizerParameters);this.vaoData={magdir:this._createVectorFieldVAO(A.context,J)};break;case "simple_scalar":J=L.createVFMeshScalar(this.source,this.symbolizerParameters);this.vaoData={scalar:this._createVectorFieldVAO(A.context,J)};break;case "wind_speed":J=L.createVFMesh(this.source, |
|
this.symbolizerParameters);J=this._createVectorFieldVAO(A.context,J);const q=L.createVFMeshScalar(this.source,this.symbolizerParameters);A=this._createVectorFieldVAO(A.context,q);this.vaoData={magdir:J,scalar:A}}}this.ready();this.requestRender()}}_createTransforms(){return{displayViewScreenMat3:v.create()}}setTransform(A){const J=B.identity(this.transforms.displayViewScreenMat3),[q,r]=A.toScreenNoRotation([0,0],[this.x,this.y]);var p=this.resolution/this.pixelRatio/A.resolution;const y=p*this.width; |
|
p*=this.height;const Q=Math.PI*this.rotation/180;B.translate(J,J,I.fromValues(q,r));B.translate(J,J,I.fromValues(y/2,p/2));B.rotate(J,J,-Q);B.translate(J,J,I.fromValues(-y/2,-p/2));B.scaleByVec2(J,J,I.fromValues(y,p));B.multiply(this.transforms.displayViewScreenMat3,A.displayViewMat3,J)}onAttach(){this.invalidateVAO()}onDetach(){this.invalidateVAO()}_createVectorFieldVAO(A,J){const {vertexData:q,indexData:r}=J;J=R.BufferObject.createVertex(A,T.Usage.STATIC_DRAW,new Float32Array(q));const p=R.BufferObject.createIndex(A, |
|
T.Usage.STATIC_DRAW,new Uint32Array(r)),y=D.createProgramDescriptor("vector-field",{geometry:[{location:0,name:"a_pos",count:2,type:T.DataType.FLOAT,normalized:!1},{location:1,name:"a_offset",count:2,type:T.DataType.FLOAT,normalized:!1},{location:2,name:"a_vv",count:2,type:T.DataType.FLOAT,normalized:!1}]});return{vao:new M.VertexArrayObject(A,y.attributes,y.bufferLayouts,{geometry:J},p),elementCount:r.length}}}m.RasterVFDisplayObject=t;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})}, |
|
"esri/views/layers/ImageryLayerView":function(){define("../../chunks/tslib.es6 ../../core/Error ../../core/promiseUtils ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ../../geometry/Point ../../layers/support/timeSupport ../../rest/support/Query ./support/popupUtils".split(" "),function(m,H,B,v,I,L,U,D,R,T,M,t){return A=>{A=class extends A{constructor(){super(...arguments);this.view=null}get timeExtent(){return T.combineTimeExtent(this.layer, |
|
this.view?.timeExtent,this._get("timeExtent"))}async fetchPopupFeaturesAtLocation(J,q){const {layer:r}=this;if(!J)throw new H("imagerylayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:r});var {popupEnabled:p}=r;const y=t.getFetchPopupTemplate(r,q);if(!p||null==y)return[];const Q=await y.getRequiredFields();B.throwIfAborted(q);p=new M;p.timeExtent=this.timeExtent;p.geometry=J;p.outFields=Q;p.outSpatialReference=J.spatialReference;const {resolution:a,spatialReference:b}=this.view; |
|
J="2d"===this.view.type?new R(a,a,b):new R(.5*a,.5*a,b);const {returnTopmostRaster:d,showNoDataRecords:g}=y.layerOptions||{returnTopmostRaster:!0,showNoDataRecords:!1};return r.queryVisibleRasters(p,{returnDomainValues:!0,returnTopmostRaster:d,pixelSize:J,showNoDataRecords:g,signal:q?.signal}).then(e=>e)}canResume(){return!super.canResume()||this.timeExtent?.isEmpty?!1:!0}};m.__decorate([v.property()],A.prototype,"layer",void 0);m.__decorate([v.property()],A.prototype,"suspended",void 0);m.__decorate([v.property({readOnly:!0})], |
|
A.prototype,"timeExtent",null);m.__decorate([v.property()],A.prototype,"view",void 0);return A=m.__decorate([D.subclass("esri.views.layers.ImageryLayerView")],A)}})},"esri/layers/support/timeSupport":function(){define(["exports","../../support/timeUtils"],function(m,H){m.combineTimeExtent=function(B,v,I){if(null==B?.timeInfo)return null;const {datesInUnknownTimezone:L=!1,timeOffset:U,useViewTime:D}=B;B=B.timeExtent;L&&(B=H.toLocalTimeExtent(B));v=D?v&&B?v.intersection(B):v||B:B;if(!v||v.isEmpty|| |
|
v.isAllTime)return v;U&&(v=v.offset(-U.value,U.unit));L&&(v=H.toUTCTimeExtent(v));return v.equals(I)?I:v};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/support/timeUtils":function(){define("exports ../TimeExtent ../core/arrayUtils ../core/deprecate ../core/lang ../core/Logger ../core/timeUtils ../webmap/utils ../webscene/utils".split(" "),function(m,H,B,v,I,L,U,D,R){function T(q){return void 0!==q.timeInfo}async function M(q,r){return q.widgets?.timeSlider?.fullTimeExtent?? |
|
t(q.allLayers,r)}async function t(q,r){if(0===q.length)return H.allTime;await Promise.all(q.map(a=>a.load({signal:r})));var p=q.filter(T),y=q.filter(a=>!T(a)&&null!=a.visibilityTimeExtent);if(0===p.length&&0===y.length)return H.allTime;q=[];const Q=[];for(const a of p)"feature"!==a?.type&&"map-image"!==a?.type||!a.timeInfo?.hasLiveData?Q.push(a):q.push(a);p=a=>null==a||a.isAllTime;y=[...Q.map(a=>{const b=a.timeInfo?.fullTimeExtent;({visibilityTimeExtent:a}=a);return b?.intersection(a)??a}),...y.map(a=> |
|
a.visibilityTimeExtent)];if(y.some(p))return H.allTime;q=q.map(async a=>{const b=(await a.fetchRecomputedExtents({signal:r}))?.timeExtent??a.timeInfo?.fullTimeExtent;({visibilityTimeExtent:a}=a);return b?.intersection(a)??a});q=(await Promise.allSettled(q)).map(a=>"fulfilled"===a.status?a.value:null);if(q.some(p))return H.allTime;q=[...q,...y].filter(B.isSome);return 0===q.length?H.allTime:q.reduce((a,b)=>a.union(b))}function A(q,r){q=q.currentTimeExtent;if(!q)return null;const {start:p,end:y}=q; |
|
q=p??y??null;switch(r){case "time-window":return new H({start:p,end:y});case "cumulative-from-start":return new H({start:null,end:q});case "cumulative-from-end":return new H({start:q,end:null});case "instant":return new H({start:q,end:q})}}async function J(q,r){if(!D.isWebMap(q)&&!R.isWebScene(q))return null;await q.load({signal:r});var p=q?.widgets?.timeSlider;if(!p)return null;q=await M(q,r);r=p.loop;var y=p.numThumbs??2;var Q=p.currentTimeExtent;if(Q){const {start:b,end:d}=Q;y=null!=b&&null!=d&& |
|
b.getTime()===d.getTime()?"instant":2===y?"time-window":null==b||0===b.getTime()?"cumulative-from-start":"cumulative-from-end"}else y=2===y?"time-window":"cumulative-from-start";Q=p.stopDelay??2E3;{const {numStops:b,stopInterval:d,stops:g}=p;var a=g?{dates:I.clone(g)}:d?{interval:d.clone()}:{count:b??5}}p=A(p,y);return{fullTimeExtent:q,loop:r,mode:y,playRate:Q,stops:a,timeExtent:p}}m.getTimeExtentFromLayers=t;m.getTimeSliderSettingsFromWebDocument=J;m.getTimeSliderSettingsFromWebMap=async function(q, |
|
r){v.deprecatedFunction(L.getLogger("esri.support.timeUtils.getTimeSliderSettingsFromWebMap"),"`timeUtils.getTimeSliderSettingsFromWebMap` is deprecated in favor of 'timeUtils.getTimeSliderSettingsFromWebDocument'",{replacement:"timeUtils.getTimeSliderSettingsFromWebDocument",version:"4.30",see:"https://developers.arcgis.com/javascript/latest/api-reference/esri-support-timeUtils.html#getTimeSliderSettingsFromWebDocument",warnOnce:!0});return null!=q&&D.isWebMap(q)?await J(q,r):null};m.toLocalTimeExtent= |
|
function(q){if(!q)return q;const {start:r,end:p}=q;return new H({start:null!=r?U.offsetDate(r,r.getTimezoneOffset(),"minutes"):r,end:null!=p?U.offsetDate(p,p.getTimezoneOffset(),"minutes"):p})};m.toUTCTimeExtent=function(q){if(!q)return q;const {start:r,end:p}=q;return new H({start:null!=r?U.offsetDate(r,-r.getTimezoneOffset(),"minutes"):r,end:null!=p?U.offsetDate(p,-p.getTimezoneOffset(),"minutes"):p})};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/webscene/utils":function(){define(["exports", |
|
"../support/tagSymbols"],function(m,H){m.isWebScene=function(B){return null!=B&&"object"===typeof B&&H.WebSceneTag in B};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/support/tagSymbols":function(){define(["exports"],function(m){const H=Symbol("WebScene");m.WebSceneTag=H;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/layers/support/popupUtils":function(){define(["exports","../../../layers/support/fieldUtils"],function(m,H){function B(v,I){return v.popupTemplate? |
|
v.popupTemplate:null!=I&&I.defaultPopupTemplateEnabled&&null!=v.defaultPopupTemplate?v.defaultPopupTemplate:null}m.getFetchPopupTemplate=B;m.getRequiredFields=async function(v,I=v.popupTemplate){if(null==I)return[];const L=await I.getRequiredFields(v.fieldsIndex);({lastEditInfoEnabled:I}=I);const {objectIdField:U,typeIdField:D,globalIdField:R,relationships:T}=v;if(L.includes("*"))return["*"];I=I?H.getFeatureEditFields(v):[];const M=H.fixFields(v.fieldsIndex,[...L,...I]);D&&M.push(D);M&&U&&v.fieldsIndex?.has(U)&& |
|
!M.includes(U)&&M.push(U);M&&R&&v.fieldsIndex?.has(R)&&!M.includes(R)&&M.push(R);T&&T.forEach(t=>{({keyField:t}=t);M&&t&&v.fieldsIndex?.has(t)&&!M.includes(t)&&M.push(t)});return M};m.hasPopupTemplate=function(v,I){return null!=B(v,{defaultPopupTemplateEnabled:I})};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/layers/RefreshableLayerView":function(){define("../../chunks/tslib.es6 ../../core/Logger ../../core/promiseUtils ../../core/reactiveUtils ../../core/has ../../core/RandomLCG ../../core/Error ../../core/accessorSupport/decorators/subclass".split(" "), |
|
function(m,H,B,v,I,L,U,D){return R=>{R=class extends R{initialize(){this.addHandles(v.on(()=>this.layer,"refresh",T=>{this.doRefresh(T.dataChanged).catch(M=>{B.isAbortError(M)||H.getLogger(this).error(M)})}),"RefreshableLayerView")}};return R=m.__decorate([D.subclass("esri.views.layers.RefreshableLayerView")],R)}})},"*noref":1}}); |
|
define("../../../chunks/tslib.es6 ../../../Graphic ../../../core/Collection ../../../core/handleUtils ../../../core/has ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../support/GraphicsCollection ../engine/flow/FlowView2D ./LayerView2D ./graphics/GraphicsView2D ./graphics/HighlightGraphicContainer ./imagery/ImageryView2D ./imagery/VectorFieldView2D ../../layers/ImageryLayerView ../../layers/LayerView ../../layers/RefreshableLayerView".split(" "),function(m, |
|
H,B,v,I,L,U,D,R,T,M,t,A,J,q,r,p,y,Q,a){D=class extends y(a(A.LayerView2DMixin(Q))){constructor(){super(...arguments);this._exportImageVersion=-1;this._highlightGraphics=new M.GraphicsCollection;this._highlightView=void 0;this.subview=this.layer=null}get pixelData(){const {subview:b}=this;return this.updating||!b?null:"getPixelData"in b?b.getPixelData():null}update(b){this.subview?.update(b)}attach(){this.layer.increaseRasterJobHandlerUsage();this._setSubView();this.view&&(this._highlightView=new J({view:this.view, |
|
graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new q(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container));this.addAttachHandles([L.watch(()=>this.layer.exportImageServiceParameters.version,b=>{b&&this._exportImageVersion!==b&&(this._exportImageVersion=b,this.requestUpdate())},L.sync),L.watch(()=>this.timeExtent,b=>{const {subview:d}=this;d&&(d.timeExtent=b,"redraw"in d?this.requestUpdate():d.redrawOrRefetch())},L.sync), |
|
this.layer.on("redraw",()=>{const {subview:b}=this;b&&("redraw"in b?b.redraw():b.redrawOrRefetch())}),L.watch(()=>this.layer.renderer,()=>this._setSubView())])}detach(){this.layer.decreaseRasterJobHandlerUsage();this.container.removeAllChildren();this._detachSubview(this.subview);this.subview?.destroy();this.subview=null;this._highlightView?.destroy();this._exportImageVersion=-1}viewChange(){}moveEnd(){this.requestUpdate()}highlight(b,d){if(!((Array.isArray(b)?b[0]:B.isCollection(b)?b.at(0):b)instanceof |
|
H))return v.makeHandle();let g=[];Array.isArray(b)||B.isCollection(b)?g=b.map(e=>e.clone()):b instanceof H&&(g=[b.clone()]);this._highlightGraphics.addMany(g);return v.makeHandle(()=>this._highlightGraphics.removeMany(g))}async doRefresh(){this.requestUpdate()}isUpdating(){const b=!this.subview||this.subview.updating||!!this._highlightView?.updating;I("esri-2d-log-updating")&&console.log(`Updating ImageryLayerView2D (${this.layer.id}): ${b}\n-> subview ${!this.subview||this.subview.updating}\n-> higlightView ${this._highlightView?.updating}\n`); |
|
return b}_setSubView(){if(this.view){var b=this.layer.renderer?.type,d="imagery";"vector-field"===b?d="imageryVF":"flow"===b&&(d="flow");if(this.subview){({type:b}=this.subview);if(b===d){this._attachSubview(this.subview);"flow"===b?this.subview.redrawOrRefetch():"imagery"===b&&"lerc"===this.layer.format?this.subview.redraw():this.requestUpdate();return}this._detachSubview(this.subview);this.subview?.destroy()}this.subview="imagery"===d?new r({layer:this.layer,view:this.view,timeExtent:this.timeExtent}): |
|
"imageryVF"===d?new p({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new t({layer:this.layer,layerView:this});this._attachSubview(this.subview);this.requestUpdate()}}_attachSubview(b){b&&!b.attached&&(b.attach(),b.attached=!0,this.container.addChildAt(b.container,0))}_detachSubview(b){b?.attached&&(this.container.removeChild(b.container),b.detach(),b.attached=!1)}};m.__decorate([U.property()],D.prototype,"pixelData",null);m.__decorate([U.property()],D.prototype,"subview",void 0);return D= |
|
m.__decorate([T.subclass("esri.views.2d.layers.ImageryLayerView2D")],D)}); |