16 lines
77 KiB
JavaScript
16 lines
77 KiB
JavaScript
/**
|
||
* Mars3D平台插件,支持气象 风向图 功能插件 mars3d-wind
|
||
*
|
||
* 版本信息:v3.9.2
|
||
* 编译日期:2025-03-03 16:59
|
||
* 版权所有:Copyright by 火星科技 http://mars3d.cn
|
||
* 使用单位:江苏飞睿得科技有限公司 ,2025-03-03
|
||
*/
|
||
(function (global, factory) {
|
||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, (window.mars3d || require('mars3d'))) :
|
||
typeof define === 'function' && define.amd ? define(['exports', 'mars3d'], factory) :
|
||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["mars3d-wind"] = {}, global.mars3d));
|
||
})(this, (function (exports, mars3d) {
|
||
'use strict';const _0x2a4b80=_0xa8c1;(function(_0xc9273c,_0xbe5f5b){const _0x24e7a7=_0xa8c1,_0x4a318f=_0xc9273c();while(!![]){try{const _0x31c558=-parseInt(_0x24e7a7(0x168))/0x1+parseInt(_0x24e7a7(0x1bb))/0x2*(parseInt(_0x24e7a7(0x16a))/0x3)+parseInt(_0x24e7a7(0x19a))/0x4*(parseInt(_0x24e7a7(0x12e))/0x5)+parseInt(_0x24e7a7(0x15e))/0x6*(parseInt(_0x24e7a7(0x185))/0x7)+-parseInt(_0x24e7a7(0x17f))/0x8+-parseInt(_0x24e7a7(0x16f))/0x9+parseInt(_0x24e7a7(0x1e0))/0xa;if(_0x31c558===_0xbe5f5b)break;else _0x4a318f['push'](_0x4a318f['shift']());}catch(_0xd6cc8b){_0x4a318f['push'](_0x4a318f['shift']());}}}(_0x1f16,0x7ba11));function _interopNamespace(_0x3dbe22){const _0x42a631=_0xa8c1;if(_0x3dbe22&&_0x3dbe22['__esModule'])return _0x3dbe22;var _0x23b0b4=Object[_0x42a631(0x1c5)](null);return _0x3dbe22&&Object[_0x42a631(0x153)](_0x3dbe22)['forEach'](function(_0x518423){const _0x85a1aa=_0x42a631;if(_0x518423!==_0x85a1aa(0x139)){var _0x2ae4d6=Object['getOwnPropertyDescriptor'](_0x3dbe22,_0x518423);Object['defineProperty'](_0x23b0b4,_0x518423,_0x2ae4d6[_0x85a1aa(0x150)]?_0x2ae4d6:{'enumerable':!![],'get':function(){return _0x3dbe22[_0x518423];}});}}),_0x23b0b4[_0x42a631(0x139)]=_0x3dbe22,_0x23b0b4;}var mars3d__namespace=_interopNamespace(mars3d);const Cesium$2=mars3d__namespace['Cesium'];function getU(_0x5176f0,_0x28762e){const _0x2761e0=_0xa8c1,_0x573ac4=_0x5176f0*Math['cos'](Cesium$2[_0x2761e0(0x10d)]['toRadians'](_0x28762e));return _0x573ac4;}function getV(_0x24a012,_0x228f3e){const _0x3ed058=_0x24a012*Math['sin'](Cesium$2['Math']['toRadians'](_0x228f3e));return _0x3ed058;}function getSpeed(_0x29a9a8,_0x2667dd){const _0x18b89d=Math['sqrt'](Math['pow'](_0x29a9a8,0x2)+Math['pow'](_0x2667dd,0x2));return _0x18b89d;}function getDirection(_0x270799,_0x853271){const _0x3ff6c3=_0xa8c1;let _0x360426=Cesium$2[_0x3ff6c3(0x10d)]['toDegrees'](Math['atan2'](_0x853271,_0x270799));return _0x360426+=_0x360426<0x0?0x168:0x0,_0x360426;}var WindUtil={'__proto__':null,'getU':getU,'getV':getV,'getSpeed':getSpeed,'getDirection':getDirection},updatePositionShader='#version\x20300\x20es\x0aprecision\x20highp\x20float;\x0a\x0auniform\x20sampler2D\x20currentParticlesPosition;\x0auniform\x20sampler2D\x20particlesSpeed;\x0a\x0ain\x20vec2\x20v_textureCoordinates;\x0a\x0aout\x20vec4\x20fragColor;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20\x20\x20//\x20获取当前粒子的位置\x0a\x20\x20vec2\x20currentPos\x20=\x20texture(currentParticlesPosition,\x20v_textureCoordinates).rg;\x0a\x20\x20\x20\x20//\x20获取粒子的速度\x0a\x20\x20vec2\x20speed\x20=\x20texture(particlesSpeed,\x20v_textureCoordinates).rg;\x0a\x20\x20\x20\x20//\x20计算下一个位置\x0a\x20\x20vec2\x20nextPos\x20=\x20currentPos\x20+\x20speed;\x0a\x0a\x20\x20\x20\x20//\x20将新的位置写入\x20fragColor\x0a\x20\x20fragColor\x20=\x20vec4(nextPos,\x200.0f,\x201.0f);\x0a}\x0a',calculateSpeedShader='#version\x20300\x20es\x0a\x0a//\x20the\x20size\x20of\x20UV\x20textures:\x20width\x20=\x20lon,\x20height\x20=\x20lat\x0auniform\x20sampler2D\x20U;\x20//\x20eastward\x20wind\x0auniform\x20sampler2D\x20V;\x20//\x20northward\x20wind\x0auniform\x20sampler2D\x20currentParticlesPosition;\x20//\x20(lon,\x20lat,\x20lev)\x0a\x0auniform\x20vec2\x20uRange;\x20//\x20(min,\x20max)\x0auniform\x20vec2\x20vRange;\x20//\x20(min,\x20max)\x0auniform\x20vec2\x20speedRange;\x20//\x20(min,\x20max)\x0auniform\x20vec2\x20dimension;\x20//\x20(lon,\x20lat)\x0auniform\x20vec2\x20minimum;\x20//\x20minimum\x20of\x20each\x20dimension\x0auniform\x20vec2\x20maximum;\x20//\x20maximum\x20of\x20each\x20dimension\x0a\x0auniform\x20float\x20speedScaleFactor;\x0auniform\x20float\x20frameRateAdjustment;\x0a\x0ain\x20vec2\x20v_textureCoordinates;\x0a\x0avec2\x20getInterval(vec2\x20maximum,\x20vec2\x20minimum,\x20vec2\x20dimension)\x20{\x0a\x20\x20return\x20(maximum\x20-\x20minimum)\x20/\x20(dimension\x20-\x201.0f);\x0a}\x0a\x0avec2\x20mapPositionToNormalizedIndex2D(vec2\x20lonLat)\x20{\x0a\x20\x20\x20\x20//\x20ensure\x20the\x20range\x20of\x20longitude\x20and\x20latitude\x0a\x20\x20lonLat.x\x20=\x20clamp(lonLat.x,\x20minimum.x,\x20maximum.x);\x0a\x20\x20lonLat.y\x20=\x20clamp(lonLat.y,\x20minimum.y,\x20maximum.y);\x0a\x0a\x20\x20vec2\x20interval\x20=\x20getInterval(maximum,\x20minimum,\x20dimension);\x0a\x0a\x20\x20vec2\x20index2D\x20=\x20vec2(0.0f);\x0a\x20\x20index2D.x\x20=\x20(lonLat.x\x20-\x20minimum.x)\x20/\x20interval.x;\x0a\x20\x20index2D.y\x20=\x20(lonLat.y\x20-\x20minimum.y)\x20/\x20interval.y;\x0a\x0a\x20\x20vec2\x20normalizedIndex2D\x20=\x20vec2(index2D.x\x20/\x20dimension.x,\x20index2D.y\x20/\x20dimension.y);\x0a\x20\x20return\x20normalizedIndex2D;\x0a}\x0a\x0afloat\x20getWindComponent(sampler2D\x20componentTexture,\x20vec2\x20lonLat)\x20{\x0a\x20\x20vec2\x20normalizedIndex2D\x20=\x20mapPositionToNormalizedIndex2D(lonLat);\x0a\x20\x20float\x20result\x20=\x20texture(componentTexture,\x20normalizedIndex2D).r;\x0a\x20\x20return\x20result;\x0a}\x0a\x0avec2\x20getWindComponents(vec2\x20lonLat)\x20{\x0a\x20\x20vec2\x20normalizedIndex2D\x20=\x20mapPositionToNormalizedIndex2D(lonLat);\x0a\x20\x20float\x20u\x20=\x20texture(U,\x20normalizedIndex2D).r;\x0a\x20\x20float\x20v\x20=\x20texture(V,\x20normalizedIndex2D).r;\x0a\x20\x20return\x20vec2(u,\x20v);\x0a}\x0a\x0avec2\x20bilinearInterpolation(vec2\x20lonLat)\x20{\x0a\x20\x20float\x20lon\x20=\x20lonLat.x;\x0a\x20\x20float\x20lat\x20=\x20lonLat.y;\x0a\x0a\x20\x20vec2\x20interval\x20=\x20getInterval(maximum,\x20minimum,\x20dimension);\x0a\x0a\x20\x20\x20\x20//\x20Calculate\x20grid\x20cell\x20coordinates\x0a\x20\x20float\x20lon0\x20=\x20floor(lon\x20/\x20interval.x)\x20*\x20interval.x;\x0a\x20\x20float\x20lon1\x20=\x20lon0\x20+\x20interval.x;\x0a\x20\x20float\x20lat0\x20=\x20floor(lat\x20/\x20interval.y)\x20*\x20interval.y;\x0a\x20\x20float\x20lat1\x20=\x20lat0\x20+\x20interval.y;\x0a\x0a\x20\x20\x20\x20//\x20Get\x20wind\x20vectors\x20at\x20four\x20corners\x0a\x20\x20vec2\x20v00\x20=\x20getWindComponents(vec2(lon0,\x20lat0));\x0a\x20\x20vec2\x20v10\x20=\x20getWindComponents(vec2(lon1,\x20lat0));\x0a\x20\x20vec2\x20v01\x20=\x20getWindComponents(vec2(lon0,\x20lat1));\x0a\x20\x20vec2\x20v11\x20=\x20getWindComponents(vec2(lon1,\x20lat1));\x0a\x0a\x20\x20\x20\x20//\x20Check\x20if\x20all\x20wind\x20vectors\x20are\x20zero\x0a\x20\x20if(length(v00)\x20==\x200.0f\x20&&\x20length(v10)\x20==\x200.0f\x20&&\x20length(v01)\x20==\x200.0f\x20&&\x20length(v11)\x20==\x200.0f)\x20{\x0a\x20\x20\x20\x20return\x20vec2(0.0f,\x200.0f);\x0a\x20\x20}\x0a\x0a\x20\x20\x20\x20//\x20Calculate\x20interpolation\x20weights\x0a\x20\x20float\x20s\x20=\x20(lon\x20-\x20lon0)\x20/\x20interval.x;\x0a\x20\x20float\x20t\x20=\x20(lat\x20-\x20lat0)\x20/\x20interval.y;\x0a\x0a\x20\x20\x20\x20//\x20Perform\x20bilinear\x20interpolation\x20on\x20vector\x20components\x0a\x20\x20vec2\x20v0\x20=\x20mix(v00,\x20v10,\x20s);\x0a\x20\x20vec2\x20v1\x20=\x20mix(v01,\x20v11,\x20s);\x0a\x20\x20return\x20mix(v0,\x20v1,\x20t);\x0a}\x0a\x0avec2\x20lengthOfLonLat(vec2\x20lonLat)\x20{\x0a\x20\x20\x20\x20//\x20unit\x20conversion:\x20meters\x20->\x20longitude\x20latitude\x20degrees\x0a\x20\x20\x20\x20//\x20see\x20https://en.wikipedia.org/wiki/Geographic_coordinate_system#Length_of_a_degree\x20for\x20detail\x0a\x0a\x20\x20\x20\x20//\x20Calculate\x20the\x20length\x20of\x20a\x20degree\x20of\x20latitude\x20and\x20longitude\x20in\x20meters\x0a\x20\x20float\x20latitude\x20=\x20radians(lonLat.y);\x0a\x0a\x20\x20float\x20term1\x20=\x20111132.92f;\x0a\x20\x20float\x20term2\x20=\x20559.82f\x20*\x20cos(2.0f\x20*\x20latitude);\x0a\x20\x20float\x20term3\x20=\x201.175f\x20*\x20cos(4.0f\x20*\x20latitude);\x0a\x20\x20float\x20term4\x20=\x200.0023f\x20*\x20cos(6.0f\x20*\x20latitude);\x0a\x20\x20float\x20latLength\x20=\x20term1\x20-\x20term2\x20+\x20term3\x20-\x20term4;\x0a\x0a\x20\x20float\x20term5\x20=\x20111412.84f\x20*\x20cos(latitude);\x0a\x20\x20float\x20term6\x20=\x2093.5f\x20*\x20cos(3.0f\x20*\x20latitude);\x0a\x20\x20float\x20term7\x20=\x200.118f\x20*\x20cos(5.0f\x20*\x20latitude);\x0a\x20\x20float\x20longLength\x20=\x20term5\x20-\x20term6\x20+\x20term7;\x0a\x0a\x20\x20return\x20vec2(longLength,\x20latLength);\x0a}\x0a\x0avec2\x20convertSpeedUnitToLonLat(vec2\x20lonLat,\x20vec2\x20speed)\x20{\x0a\x20\x20vec2\x20lonLatLength\x20=\x20lengthOfLonLat(lonLat);\x0a\x20\x20float\x20u\x20=\x20speed.x\x20/\x20lonLatLength.x;\x0a\x20\x20float\x20v\x20=\x20speed.y\x20/\x20lonLatLength.y;\x0a\x20\x20vec2\x20windVectorInLonLat\x20=\x20vec2(u,\x20v);\x0a\x0a\x20\x20return\x20windVectorInLonLat;\x0a}\x0a\x0avec2\x20calculateSpeedByRungeKutta2(vec2\x20lonLat)\x20{\x0a\x20\x20\x20\x20//\x20see\x20https://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods#Second-order_methods_with_two_stages\x20for\x20detail\x0a\x20\x20const\x20float\x20h\x20=\x200.5f;\x0a\x0a\x20\x20vec2\x20y_n\x20=\x20lonLat;\x0a\x20\x20vec2\x20f_n\x20=\x20bilinearInterpolation(lonLat);\x0a\x20\x20vec2\x20midpoint\x20=\x20y_n\x20+\x200.5f\x20*\x20h\x20*\x20convertSpeedUnitToLonLat(y_n,\x20f_n)\x20*\x20speedScaleFactor;\x0a\x20\x20vec2\x20speed\x20=\x20h\x20*\x20bilinearInterpolation(midpoint)\x20*\x20speedScaleFactor;\x0a\x0a\x20\x20return\x20speed;\x0a}\x0a\x0avec2\x20calculateWindNorm(vec2\x20speed)\x20{\x0a\x20\x20float\x20speedLength\x20=\x20length(speed.xy);\x0a\x20\x20if(speedLength\x20==\x200.0f)\x20{\x0a\x20\x20\x20\x20return\x20vec2(0.0f);\x0a\x20\x20}\x0a\x0a\x20\x20\x20\x20//\x20Clamp\x20speedLength\x20to\x20range\x0a\x20\x20float\x20clampedSpeed\x20=\x20clamp(speedLength,\x20speedRange.x,\x20speedRange.y);\x0a\x20\x20float\x20normalizedSpeed\x20=\x20(clampedSpeed\x20-\x20speedRange.x)\x20/\x20(speedRange.y\x20-\x20speedRange.x);\x0a\x20\x20return\x20vec2(speedLength,\x20normalizedSpeed);\x0a}\x0a\x0aout\x20vec4\x20fragColor;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20\x20\x20//\x20texture\x20coordinate\x20must\x20be\x20normalized\x0a\x20\x20vec2\x20lonLat\x20=\x20texture(currentParticlesPosition,\x20v_textureCoordinates).rg;\x0a\x20\x20vec2\x20speedOrigin\x20=\x20bilinearInterpolation(lonLat);\x0a\x20\x20vec2\x20speed\x20=\x20calculateSpeedByRungeKutta2(lonLat)\x20*\x20frameRateAdjustment;\x0a\x20\x20vec2\x20speedInLonLat\x20=\x20convertSpeedUnitToLonLat(lonLat,\x20speed);\x0a\x0a\x20\x20fragColor\x20=\x20vec4(speedInLonLat,\x20calculateWindNorm(speedOrigin));\x0a}\x0a',postProcessingPositionFragmentShader='#version\x20300\x20es\x0aprecision\x20highp\x20float;\x0a\x0auniform\x20sampler2D\x20nextParticlesPosition;\x0auniform\x20sampler2D\x20particlesSpeed;\x20//\x20(u,\x20v,\x20norm)\x0a\x0a//\x20range\x20(min,\x20max)\x0auniform\x20vec2\x20lonRange;\x0auniform\x20vec2\x20latRange;\x0a\x0a//\x20range\x20(min,\x20max)\x0auniform\x20vec2\x20dataLonRange;\x0auniform\x20vec2\x20dataLatRange;\x0a\x0auniform\x20float\x20randomCoefficient;\x0auniform\x20float\x20dropRate;\x0auniform\x20float\x20dropRateBump;\x0a\x0a//\x20添加新的\x20uniform\x20变量\x0auniform\x20bool\x20useViewerBounds;\x0a\x0ain\x20vec2\x20v_textureCoordinates;\x0a\x0a//\x20pseudo-random\x20generator\x0aconst\x20vec3\x20randomConstants\x20=\x20vec3(12.9898f,\x2078.233f,\x204375.85453f);\x0aconst\x20vec2\x20normalRange\x20=\x20vec2(0.0f,\x201.0f);\x0afloat\x20rand(vec2\x20seed,\x20vec2\x20range)\x20{\x0a\x20\x20vec2\x20randomSeed\x20=\x20randomCoefficient\x20*\x20seed;\x0a\x20\x20float\x20temp\x20=\x20dot(randomConstants.xy,\x20randomSeed);\x0a\x20\x20temp\x20=\x20fract(sin(temp)\x20*\x20(randomConstants.z\x20+\x20temp));\x0a\x20\x20return\x20temp\x20*\x20(range.y\x20-\x20range.x)\x20+\x20range.x;\x0a}\x0a\x0avec2\x20generateRandomParticle(vec2\x20seed)\x20{\x0a\x20\x20vec2\x20range;\x0a\x20\x20float\x20randomLon,\x20randomLat;\x0a\x0a\x20\x20if(useViewerBounds)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20在当前视域范围内生成粒子\x0a\x20\x20\x20\x20randomLon\x20=\x20rand(seed,\x20lonRange);\x0a\x20\x20\x20\x20randomLat\x20=\x20rand(-seed,\x20latRange);\x0a\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20在数据范围内生成粒子\x0a\x20\x20\x20\x20randomLon\x20=\x20rand(seed,\x20dataLonRange);\x0a\x20\x20\x20\x20randomLat\x20=\x20rand(-seed,\x20dataLatRange);\x0a\x20\x20}\x0a\x0a\x20\x20return\x20vec2(randomLon,\x20randomLat);\x0a}\x0a\x0abool\x20particleOutbound(vec2\x20particle)\x20{\x0a\x20\x20return\x20particle.y\x20<\x20dataLatRange.x\x20||\x20particle.y\x20>\x20dataLatRange.y\x20||\x20particle.x\x20<\x20dataLonRange.x\x20||\x20particle.x\x20>\x20dataLonRange.y;\x0a}\x0a\x0aout\x20vec4\x20fragColor;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20vec2\x20nextParticle\x20=\x20texture(nextParticlesPosition,\x20v_textureCoordinates).rg;\x0a\x20\x20vec4\x20nextSpeed\x20=\x20texture(particlesSpeed,\x20v_textureCoordinates);\x0a\x20\x20float\x20speedNorm\x20=\x20nextSpeed.a;\x0a\x20\x20float\x20particleDropRate\x20=\x20dropRate\x20+\x20dropRateBump\x20*\x20speedNorm;\x0a\x0a\x20\x20vec2\x20seed1\x20=\x20nextParticle.xy\x20+\x20v_textureCoordinates;\x0a\x20\x20vec2\x20seed2\x20=\x20nextSpeed.rg\x20+\x20v_textureCoordinates;\x0a\x20\x20vec2\x20randomParticle\x20=\x20generateRandomParticle(seed1);\x0a\x20\x20float\x20randomNumber\x20=\x20rand(seed2,\x20normalRange);\x0a\x0a\x20\x20if(randomNumber\x20<\x20particleDropRate\x20||\x20particleOutbound(nextParticle))\x20{\x0a\x20\x20\x20\x20fragColor\x20=\x20vec4(randomParticle,\x200.0f,\x201.0f);\x20//\x201.0\x20means\x20this\x20is\x20a\x20random\x20particle\x0a\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20fragColor\x20=\x20vec4(nextParticle,\x200.0f,\x200.0f);\x0a\x20\x20}\x0a}\x0a',renderParticlesFragmentShader='#version\x20300\x20es\x0aprecision\x20highp\x20float;\x0a\x0ain\x20vec4\x20speed;\x0ain\x20float\x20v_segmentPosition;\x0ain\x20vec2\x20textureCoordinate;\x0a\x0auniform\x20vec2\x20domain;\x0auniform\x20vec2\x20displayRange;\x0auniform\x20sampler2D\x20colorTable;\x0auniform\x20sampler2D\x20segmentsDepthTexture;\x0a\x0aout\x20vec4\x20fragColor;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20const\x20float\x20zero\x20=\x200.0f;\x0a\x20\x20if(speed.a\x20>\x20zero\x20&&\x20speed.b\x20>\x20displayRange.x\x20&&\x20speed.b\x20<\x20displayRange.y)\x20{\x0a\x20\x20\x20\x20float\x20speedLength\x20=\x20clamp(speed.b,\x20domain.x,\x20domain.y);\x0a\x20\x20\x20\x20float\x20normalizedSpeed\x20=\x20(speedLength\x20-\x20domain.x)\x20/\x20(domain.y\x20-\x20domain.x);\x0a\x20\x20\x20\x20vec4\x20baseColor\x20=\x20texture(colorTable,\x20vec2(normalizedSpeed,\x20zero));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20使用更平滑的渐变效果\x0a\x20\x20\x20\x20float\x20alpha\x20=\x20smoothstep(0.0f,\x201.0f,\x20v_segmentPosition);\x0a\x20\x20\x20\x20alpha\x20=\x20pow(alpha,\x201.5f);\x20//\x20调整透明度渐变曲线\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20根据速度调整透明度\x0a\x20\x20\x20\x20float\x20speedAlpha\x20=\x20mix(0.3f,\x201.0f,\x20speed.a);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20组合颜色和透明度\x0a\x20\x20\x20\x20fragColor\x20=\x20vec4(baseColor.rgb,\x20baseColor.a\x20*\x20alpha\x20*\x20speedAlpha);\x0a\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20fragColor\x20=\x20vec4(zero);\x0a\x20\x20}\x0a\x0a\x20\x20float\x20segmentsDepth\x20=\x20texture(segmentsDepthTexture,\x20textureCoordinate).r;\x0a\x20\x20float\x20globeDepth\x20=\x20czm_unpackDepth(texture(czm_globeDepthTexture,\x20textureCoordinate));\x0a\x20\x20if(segmentsDepth\x20<\x20globeDepth)\x20{\x0a\x20\x20\x20\x20fragColor\x20=\x20vec4(zero);\x0a\x20\x20}\x0a}\x0a',renderParticlesVertexShader=_0x2a4b80(0x193);const {ShaderSource:ShaderSource$1}=mars3d__namespace[_0x2a4b80(0x1d3)];class ShaderManager{static['getCalculateSpeedShader'](){return new ShaderSource$1({'sources':[calculateSpeedShader]});}static['getUpdatePositionShader'](){return new ShaderSource$1({'sources':[updatePositionShader]});}static['getSegmentDrawVertexShader'](){return new ShaderSource$1({'sources':[renderParticlesVertexShader]});}static['getSegmentDrawFragmentShader'](){return new ShaderSource$1({'sources':[renderParticlesFragmentShader]});}static['getPostProcessingPositionShader'](){return new ShaderSource$1({'sources':[postProcessingPositionFragmentShader]});}}const {BufferUsage:BufferUsage$1,ClearCommand:ClearCommand$1,Color:Color$2,ComputeCommand,DrawCommand,Geometry:Geometry$1,Matrix4,Pass:Pass$1,PrimitiveType:PrimitiveType$1,RenderState,ShaderProgram,ShaderSource,VertexArray:VertexArray$1,defaultValue,defined,destroyObject}=mars3d__namespace['Cesium'];class CustomPrimitive{constructor(_0x6c3f95){const _0x584b12=_0x2a4b80;this['commandType']=_0x6c3f95['commandType'],this[_0x584b12(0x192)]=_0x6c3f95['geometry'],this['attributeLocations']=_0x6c3f95['attributeLocations'],this['primitiveType']=_0x6c3f95['primitiveType'],this[_0x584b12(0x1db)]=_0x6c3f95['uniformMap']||{},this[_0x584b12(0x112)]=_0x6c3f95['vertexShaderSource'],this['fragmentShaderSource']=_0x6c3f95['fragmentShaderSource'],this['rawRenderState']=_0x6c3f95['rawRenderState'],this[_0x584b12(0x1a1)]=_0x6c3f95['framebuffer'],this['outputTexture']=_0x6c3f95[_0x584b12(0x116)],this['autoClear']=defaultValue(_0x6c3f95[_0x584b12(0x114)],![]),this['preExecute']=_0x6c3f95[_0x584b12(0x187)],this['show']=!![],this[_0x584b12(0x1cd)]=undefined,this['clearCommand']=undefined,this['isDynamic']=_0x6c3f95[_0x584b12(0x1de)]??(()=>!![]),this[_0x584b12(0x114)]&&(this['clearCommand']=new ClearCommand$1({'color':new Color$2(0x0,0x0,0x0,0x0),'depth':0x1,'framebuffer':this['framebuffer'],'pass':Pass$1[_0x584b12(0x148)]}));}['createCommand'](_0x51646a){const _0x42da0d=_0x2a4b80;if(this[_0x42da0d(0x16b)]==='Draw'){const _0x5464c3=VertexArray$1['fromGeometry']({'context':_0x51646a,'geometry':this[_0x42da0d(0x192)],'attributeLocations':this['attributeLocations'],'bufferUsage':BufferUsage$1['STATIC_DRAW']}),_0x3ef2dc=ShaderProgram[_0x42da0d(0x15d)]({'context':_0x51646a,'vertexShaderSource':this['vertexShaderSource'],'fragmentShaderSource':this['fragmentShaderSource'],'attributeLocations':this['attributeLocations']}),_0x23009d=RenderState[_0x42da0d(0x15d)](this['rawRenderState']);return new DrawCommand({'owner':this,'vertexArray':_0x5464c3,'primitiveType':this['primitiveType'],'modelMatrix':Matrix4['IDENTITY'],'renderState':_0x23009d,'shaderProgram':_0x3ef2dc,'framebuffer':this['framebuffer'],'uniformMap':this['uniformMap'],'pass':Pass$1[_0x42da0d(0x148)]});}else{if(this[_0x42da0d(0x16b)]==='Compute')return new ComputeCommand({'owner':this,'fragmentShaderSource':this['fragmentShaderSource'],'uniformMap':this['uniformMap'],'outputTexture':this[_0x42da0d(0x116)],'persists':!![]});else throw new Error('Unknown\x20command\x20type');}}['setGeometry'](_0x426524,_0x453fb0){const _0x49def5=_0x2a4b80;this['geometry']=_0x453fb0,defined(this[_0x49def5(0x1cd)])&&(this['commandToExecute'][_0x49def5(0x12d)]=VertexArray$1['fromGeometry']({'context':_0x426524,'geometry':this[_0x49def5(0x192)],'attributeLocations':this['attributeLocations'],'bufferUsage':BufferUsage$1['STATIC_DRAW']}));}[_0x2a4b80(0x1af)](_0x248aaf){const _0x2347cd=_0x2a4b80;if(!this['isDynamic']())return;if(!this['show']||!defined(_0x248aaf))return;!defined(this['commandToExecute'])&&(this['commandToExecute']=this['createCommand'](_0x248aaf['context']));defined(this['preExecute'])&&this['preExecute']();if(!_0x248aaf['commandList']){console[_0x2347cd(0x126)]('frameState.commandList\x20is\x20undefined');return;}defined(this['clearCommand'])&&_0x248aaf['commandList']['push'](this[_0x2347cd(0x190)]),defined(this['commandToExecute'])&&_0x248aaf['commandList'][_0x2347cd(0x1b6)](this['commandToExecute']);}['isDestroyed'](){return![];}['destroy'](){const _0x3b2957=_0x2a4b80;if(defined(this[_0x3b2957(0x1cd)])){var _0x4bea43;(_0x4bea43=this['commandToExecute'][_0x3b2957(0x10f)])===null||_0x4bea43===void 0x0||_0x4bea43[_0x3b2957(0x174)](),this['commandToExecute'][_0x3b2957(0x10f)]=undefined;}return destroyObject(this);}}function deepMerge(_0x566631,_0x23f4f1){const _0x417986=_0x2a4b80;if(!_0x566631)return _0x23f4f1;if(!_0x23f4f1)return _0x566631;const _0x211245={..._0x23f4f1};for(const _0x32edb6 in _0x566631){if(Object[_0x417986(0x14b)][_0x417986(0x159)]['call'](_0x566631,_0x32edb6)){const _0xfe92d7=_0x566631[_0x32edb6],_0x5ef9c6=_0x23f4f1[_0x32edb6];if(Array[_0x417986(0x166)](_0xfe92d7)){_0x211245[_0x32edb6]=_0xfe92d7['slice']();continue;}if(_0xfe92d7&&typeof _0xfe92d7===_0x417986(0x17a)){_0x211245[_0x32edb6]=deepMerge(_0xfe92d7,_0x5ef9c6||{});continue;}_0xfe92d7!==undefined&&(_0x211245[_0x32edb6]=_0xfe92d7);}}return _0x211245;}function _0xa8c1(_0x4b0602,_0x6fc8d7){const _0x1f1604=_0x1f16();return _0xa8c1=function(_0xa8c188,_0x35ca47){_0xa8c188=_0xa8c188-0x10b;let _0x3e8a17=_0x1f1604[_0xa8c188];return _0x3e8a17;},_0xa8c1(_0x4b0602,_0x6fc8d7);}const {Cartesian2:Cartesian2$1,FrameRateMonitor,PixelDatatype:PixelDatatype$1,PixelFormat:PixelFormat$1,Sampler:Sampler$1,Texture:Texture$1,TextureMagnificationFilter:TextureMagnificationFilter$1,TextureMinificationFilter:TextureMinificationFilter$1}=mars3d__namespace['Cesium'];class WindParticlesComputing{constructor(_0x4d2ac8,_0x514dd2,_0x46b6f6,_0x256b68,_0x175bb7){this['context']=_0x4d2ac8,this['options']=_0x46b6f6,this['viewerParameters']=_0x256b68,this['windData']=_0x514dd2,this['frameRate']=0x3c,this['frameRateAdjustment']=0x1,this['frameRateMonitor']=new FrameRateMonitor({'scene':_0x175bb7,'samplingWindow':0x1,'quietPeriod':0x0}),this['initFrameRate'](),this['createWindTextures'](),this['createParticlesTextures'](),this['createComputingPrimitives']();}['initFrameRate'](){const _0x3dda5f=_0x2a4b80,_0x1f8fb8=()=>{this['frameRateMonitor']['lastFramesPerSecond']>0x14&&(this['frameRate']=this['frameRateMonitor']['lastFramesPerSecond'],this['frameRateAdjustment']=0x3c/Math['max'](this['frameRate'],0x1));};_0x1f8fb8();const _0xfba087=setInterval(_0x1f8fb8,0x3e8),_0x4d27a3=this['destroy'][_0x3dda5f(0x10b)](this);this['destroy']=()=>{clearInterval(_0xfba087),_0x4d27a3();};}['createWindTextures'](){const _0x401126=_0x2a4b80,_0x919f33={'context':this['context'],'width':this[_0x401126(0x19f)]['width'],'height':this['windData']['height'],'pixelFormat':PixelFormat$1['RED'],'pixelDatatype':PixelDatatype$1['FLOAT'],'flipY':this[_0x401126(0x152)]['flipY']??![],'sampler':new Sampler$1({'minificationFilter':TextureMinificationFilter$1[_0x401126(0x161)],'magnificationFilter':TextureMagnificationFilter$1[_0x401126(0x161)]})};this['windTextures']={'U':new Texture$1({..._0x919f33,'source':{'arrayBufferView':new Float32Array(this['windData']['u']['array'])}}),'V':new Texture$1({..._0x919f33,'source':{'arrayBufferView':new Float32Array(this[_0x401126(0x19f)]['v']['array'])}})};}['createParticlesTextures'](){const _0x1a51b3=_0x2a4b80,_0x401086={'context':this['context'],'width':this['options']['particlesTextureSize'],'height':this['options'][_0x1a51b3(0x1a8)],'pixelFormat':PixelFormat$1['RGBA'],'pixelDatatype':PixelDatatype$1['FLOAT'],'flipY':![],'source':{'arrayBufferView':new Float32Array(this['options']['particlesTextureSize']*this['options']['particlesTextureSize']*0x4)['fill'](0x0)},'sampler':new Sampler$1({'minificationFilter':TextureMinificationFilter$1['NEAREST'],'magnificationFilter':TextureMagnificationFilter$1['NEAREST']})};this['particlesTextures']={'previousParticlesPosition':new Texture$1(_0x401086),'currentParticlesPosition':new Texture$1(_0x401086),'nextParticlesPosition':new Texture$1(_0x401086),'postProcessingPosition':new Texture$1(_0x401086),'particlesSpeed':new Texture$1(_0x401086)};}['destroyParticlesTextures'](){const _0x88271d=_0x2a4b80;Object['values'](this['particlesTextures'])['forEach'](_0x3a9e7f=>_0x3a9e7f[_0x88271d(0x174)]());}['createComputingPrimitives'](){const _0x1a8d86=_0x2a4b80;this['primitives']={'calculateSpeed':new CustomPrimitive({'commandType':'Compute','uniformMap':{'U':()=>this['windTextures']['U'],'V':()=>this['windTextures']['V'],'uRange':()=>new Cartesian2$1(this['windData']['u']['min'],this['windData']['u'][_0x1a8d86(0x1cf)]),'vRange':()=>new Cartesian2$1(this[_0x1a8d86(0x19f)]['v']['min'],this['windData']['v'][_0x1a8d86(0x1cf)]),'speedRange':()=>new Cartesian2$1(this['windData']['speed']['min'],this['windData'][_0x1a8d86(0x14d)]['max']),'currentParticlesPosition':()=>this[_0x1a8d86(0x137)][_0x1a8d86(0x157)],'speedScaleFactor':()=>{return(this['viewerParameters']['pixelSize']+0x32)*this['options']['speedFactor'];},'frameRateAdjustment':()=>this['frameRateAdjustment'],'dimension':()=>new Cartesian2$1(this['windData'][_0x1a8d86(0x1bd)],this[_0x1a8d86(0x19f)]['height']),'minimum':()=>new Cartesian2$1(this['windData']['bounds']['west'],this['windData']['bounds']['south']),'maximum':()=>new Cartesian2$1(this['windData']['bounds']['east'],this['windData'][_0x1a8d86(0x18c)][_0x1a8d86(0x171)])},'fragmentShaderSource':ShaderManager['getCalculateSpeedShader'](),'outputTexture':this['particlesTextures']['particlesSpeed'],'preExecute':()=>{const _0x2916c3=_0x1a8d86,_0x216fb0=this['particlesTextures']['previousParticlesPosition'];this[_0x2916c3(0x137)]['previousParticlesPosition']=this['particlesTextures'][_0x2916c3(0x157)],this['particlesTextures']['currentParticlesPosition']=this['particlesTextures']['postProcessingPosition'],this['particlesTextures']['postProcessingPosition']=_0x216fb0,this['primitives']['calculateSpeed']['commandToExecute']&&(this['primitives']['calculateSpeed']['commandToExecute'][_0x2916c3(0x116)]=this['particlesTextures'][_0x2916c3(0x164)]);},'isDynamic':()=>this['options']['dynamic']}),'updatePosition':new CustomPrimitive({'commandType':'Compute','uniformMap':{'currentParticlesPosition':()=>this['particlesTextures']['currentParticlesPosition'],'particlesSpeed':()=>this['particlesTextures']['particlesSpeed']},'fragmentShaderSource':ShaderManager['getUpdatePositionShader'](),'outputTexture':this[_0x1a8d86(0x137)]['nextParticlesPosition'],'preExecute':()=>{const _0x22fbaf=_0x1a8d86;this['primitives']['updatePosition']['commandToExecute']&&(this['primitives']['updatePosition']['commandToExecute']['outputTexture']=this[_0x22fbaf(0x137)][_0x22fbaf(0x11c)]);},'isDynamic':()=>this['options']['dynamic']}),'postProcessingPosition':new CustomPrimitive({'commandType':'Compute','uniformMap':{'nextParticlesPosition':()=>this[_0x1a8d86(0x137)]['nextParticlesPosition'],'particlesSpeed':()=>this['particlesTextures']['particlesSpeed'],'lonRange':()=>this['viewerParameters']['lonRange'],'latRange':()=>this['viewerParameters']['latRange'],'dataLonRange':()=>new Cartesian2$1(this[_0x1a8d86(0x19f)]['bounds'][_0x1a8d86(0x1ae)],this['windData']['bounds']['east']),'dataLatRange':()=>new Cartesian2$1(this['windData']['bounds']['south'],this[_0x1a8d86(0x19f)]['bounds']['north']),'randomCoefficient':function(){return Math['random']();},'dropRate':()=>this[_0x1a8d86(0x152)]['dropRate'],'dropRateBump':()=>this['options'][_0x1a8d86(0x173)],'useViewerBounds':()=>this['options']['useViewerBounds']},'fragmentShaderSource':ShaderManager[_0x1a8d86(0x1ab)](),'outputTexture':this[_0x1a8d86(0x137)]['postProcessingPosition'],'preExecute':()=>{const _0xb5e2d8=_0x1a8d86;this['primitives']['postProcessingPosition']['commandToExecute']&&(this['primitives'][_0xb5e2d8(0x1cb)][_0xb5e2d8(0x1cd)][_0xb5e2d8(0x116)]=this[_0xb5e2d8(0x137)]['postProcessingPosition']);},'isDynamic':()=>this['options']['dynamic']})};}['reCreateWindTextures'](){this['windTextures']['U']['destroy'](),this['windTextures']['V']['destroy'](),this['createWindTextures']();}[_0x2a4b80(0x1a6)](_0x4fc059){this['windData']=_0x4fc059,this['reCreateWindTextures']();}[_0x2a4b80(0x1d0)](_0x2c63c9){const _0x2ae34d=_0x2a4b80,_0x4e4048=_0x2c63c9['flipY']!==undefined&&_0x2c63c9['flipY']!==this['options']['flipY'];this['options']=deepMerge(_0x2c63c9,this['options']),_0x4e4048&&this[_0x2ae34d(0x19e)]();}['processWindData'](_0x180877){const _0x1a1808=_0x2a4b80,{array:_0x5d4cd9}=_0x180877;let {min:_0x520bd8,max:_0x4bd24c}=_0x180877;const _0x4a4066=new Float32Array(_0x5d4cd9[_0x1a1808(0x186)]);_0x520bd8===undefined&&(console[_0x1a1808(0x126)]('min\x20is\x20undefined,\x20calculate\x20min'),_0x520bd8=Math['min'](..._0x5d4cd9));_0x4bd24c===undefined&&(console['warn'](_0x1a1808(0x1b4)),_0x4bd24c=Math[_0x1a1808(0x1cf)](..._0x5d4cd9));const _0x34ee86=Math['max'](Math['abs'](_0x520bd8),Math['abs'](_0x4bd24c));for(let _0x53a802=0x0;_0x53a802<_0x5d4cd9['length'];_0x53a802++){const _0x1daf6a=_0x5d4cd9[_0x53a802]/_0x34ee86;_0x4a4066[_0x53a802]=_0x1daf6a;}return _0x4a4066;}[_0x2a4b80(0x174)](){const _0x3b7869=_0x2a4b80;Object['values'](this['windTextures'])['forEach'](_0x54420c=>_0x54420c['destroy']()),Object['values'](this['particlesTextures'])['forEach'](_0x691f23=>_0x691f23['destroy']()),Object['values'](this['primitives'])['forEach'](_0x5cc18d=>_0x5cc18d['destroy']()),this[_0x3b7869(0x1b0)][_0x3b7869(0x174)]();}}function _0x1f16(){const _0x319c3e=['particlesSpeed','_updateIng2','isArray','setOptions','195111EJhFkR','frameRateAdjustment','30963SKaheh','commandType','camera','grid','Cartesian2','6157188GQuPrS','requestAnimationFrame','north','particlesNumber','dropRateBump','destroy','add','Rectangle','CanvasWindField','now','getDataAtLonLat','object','maxAge','scene','_removedHook','talt','4119280gfNeWG','frameTime','style','rows','mouse_move','defineProperty','7HxYFJv','length','preExecute','STATIC_DRAW','pointerEvents','createRenderingTextures','layer','bounds','lonRange','colorTable','createColorTableTexture','clearCommand','onParticlesTextureSizeChange','geometry','#version\x20300\x20es\x0aprecision\x20highp\x20float;\x0a\x0ain\x20vec2\x20st;\x0ain\x20vec3\x20normal;\x0a\x0auniform\x20sampler2D\x20previousParticlesPosition;\x0auniform\x20sampler2D\x20currentParticlesPosition;\x0auniform\x20sampler2D\x20postProcessingPosition;\x0auniform\x20sampler2D\x20particlesSpeed;\x0a\x0auniform\x20float\x20frameRateAdjustment;\x0auniform\x20float\x20particleHeight;\x0auniform\x20float\x20aspect;\x0auniform\x20float\x20pixelSize;\x0auniform\x20vec2\x20lineWidth;\x0auniform\x20vec2\x20lineLength;\x0auniform\x20vec2\x20domain;\x0auniform\x20bool\x20is3D;\x0a\x0a//\x20添加输出变量传递给片元着色器\x0aout\x20vec4\x20speed;\x0aout\x20float\x20v_segmentPosition;\x0aout\x20vec2\x20textureCoordinate;\x0a\x0a//\x20添加结构体定义\x0astruct\x20adjacentPoints\x20{\x0a\x20\x20vec4\x20previous;\x0a\x20\x20vec4\x20current;\x0a\x20\x20vec4\x20next;\x0a};\x0a\x0avec3\x20convertCoordinate(vec2\x20lonLat)\x20{\x0a\x20\x20\x20\x20//\x20WGS84\x20(lon,\x20lat,\x20lev)\x20->\x20ECEF\x20(x,\x20y,\x20z)\x0a\x20\x20\x20\x20//\x20read\x20https://en.wikipedia.org/wiki/Geographic_coordinate_conversion#From_geodetic_to_ECEF_coordinates\x20for\x20detail\x0a\x0a\x20\x20\x20\x20//\x20WGS\x2084\x20geometric\x20constants\x0a\x20\x20float\x20a\x20=\x206378137.0f;\x20//\x20Semi-major\x20axis\x0a\x20\x20float\x20b\x20=\x206356752.3142f;\x20//\x20Semi-minor\x20axis\x0a\x20\x20float\x20e2\x20=\x206.69437999014e-3f;\x20//\x20First\x20eccentricity\x20squared\x0a\x0a\x20\x20float\x20latitude\x20=\x20radians(lonLat.y);\x0a\x20\x20float\x20longitude\x20=\x20radians(lonLat.x);\x0a\x0a\x20\x20float\x20cosLat\x20=\x20cos(latitude);\x0a\x20\x20float\x20sinLat\x20=\x20sin(latitude);\x0a\x20\x20float\x20cosLon\x20=\x20cos(longitude);\x0a\x20\x20float\x20sinLon\x20=\x20sin(longitude);\x0a\x0a\x20\x20float\x20N_Phi\x20=\x20a\x20/\x20sqrt(1.0f\x20-\x20e2\x20*\x20sinLat\x20*\x20sinLat);\x0a\x20\x20float\x20h\x20=\x20particleHeight;\x20//\x20it\x20should\x20be\x20high\x20enough\x20otherwise\x20the\x20particle\x20may\x20not\x20pass\x20the\x20terrain\x20depth\x20test\x0a\x20\x20vec3\x20cartesian\x20=\x20vec3(0.0f);\x0a\x20\x20cartesian.x\x20=\x20(N_Phi\x20+\x20h)\x20*\x20cosLat\x20*\x20cosLon;\x0a\x20\x20cartesian.y\x20=\x20(N_Phi\x20+\x20h)\x20*\x20cosLat\x20*\x20sinLon;\x0a\x20\x20cartesian.z\x20=\x20((b\x20*\x20b)\x20/\x20(a\x20*\x20a)\x20*\x20N_Phi\x20+\x20h)\x20*\x20sinLat;\x0a\x20\x20return\x20cartesian;\x0a}\x0a\x0avec4\x20calculateProjectedCoordinate(vec2\x20lonLat)\x20{\x0a\x20\x20if(is3D)\x20{\x0a\x20\x20\x20\x20vec3\x20particlePosition\x20=\x20convertCoordinate(lonLat);\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20使用\x20modelViewProjection\x20矩阵进行投影变换\x0a\x20\x20\x20\x20vec4\x20projectedPosition\x20=\x20czm_modelViewProjection\x20*\x20vec4(particlePosition,\x201.0f);\x0a\x20\x20\x20\x20return\x20projectedPosition;\x0a\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20vec3\x20position2D\x20=\x20vec3(radians(lonLat.x),\x20radians(lonLat.y),\x200.0f);\x0a\x20\x20\x20\x20return\x20czm_modelViewProjection\x20*\x20vec4(position2D,\x201.0f);\x0a\x20\x20}\x0a}\x0a\x0avec4\x20calculateOffsetOnNormalDirection(vec4\x20pointA,\x20vec4\x20pointB,\x20float\x20offsetSign,\x20float\x20widthFactor)\x20{\x0a\x20\x20vec2\x20aspectVec2\x20=\x20vec2(aspect,\x201.0f);\x0a\x20\x20vec2\x20pointA_XY\x20=\x20(pointA.xy\x20/\x20pointA.w)\x20*\x20aspectVec2;\x0a\x20\x20vec2\x20pointB_XY\x20=\x20(pointB.xy\x20/\x20pointB.w)\x20*\x20aspectVec2;\x0a\x0a\x20\x20\x20\x20//\x20计算方向向量\x0a\x20\x20vec2\x20direction\x20=\x20normalize(pointB_XY\x20-\x20pointA_XY);\x0a\x0a\x20\x20\x20\x20//\x20计算法向量\x0a\x20\x20vec2\x20normalVector\x20=\x20vec2(-direction.y,\x20direction.x);\x0a\x20\x20normalVector.x\x20=\x20normalVector.x\x20/\x20aspect;\x0a\x0a\x20\x20\x20\x20//\x20使用\x20widthFactor\x20调整宽度\x0a\x20\x20float\x20offsetLength\x20=\x20widthFactor\x20*\x20lineWidth.y;\x0a\x20\x20normalVector\x20=\x20offsetLength\x20*\x20normalVector;\x0a\x0a\x20\x20vec4\x20offset\x20=\x20vec4(offsetSign\x20*\x20normalVector,\x200.0f,\x200.0f);\x0a\x20\x20return\x20offset;\x0a}\x0a\x0avoid\x20main()\x20{\x0a\x20\x20\x20\x20//\x20翻转\x20Y\x20轴坐标\x0a\x20\x20vec2\x20flippedIndex\x20=\x20vec2(st.x,\x201.0f\x20-\x20st.y);\x0a\x0a\x20\x20vec2\x20particleIndex\x20=\x20flippedIndex;\x0a\x20\x20speed\x20=\x20texture(particlesSpeed,\x20particleIndex);\x0a\x0a\x20\x20vec2\x20previousPosition\x20=\x20texture(previousParticlesPosition,\x20particleIndex).rg;\x0a\x20\x20vec2\x20currentPosition\x20=\x20texture(currentParticlesPosition,\x20particleIndex).rg;\x0a\x20\x20vec2\x20nextPosition\x20=\x20texture(postProcessingPosition,\x20particleIndex).rg;\x0a\x0a\x20\x20float\x20isAnyRandomPointUsed\x20=\x20texture(postProcessingPosition,\x20particleIndex).a\x20+\x0a\x20\x20\x20\x20texture(currentParticlesPosition,\x20particleIndex).a\x20+\x0a\x20\x20\x20\x20texture(previousParticlesPosition,\x20particleIndex).a;\x0a\x0a\x20\x20adjacentPoints\x20projectedCoordinates;\x0a\x20\x20if(isAnyRandomPointUsed\x20>\x200.0f)\x20{\x0a\x20\x20\x20\x20projectedCoordinates.previous\x20=\x20calculateProjectedCoordinate(previousPosition);\x0a\x20\x20\x20\x20projectedCoordinates.current\x20=\x20projectedCoordinates.previous;\x0a\x20\x20\x20\x20projectedCoordinates.next\x20=\x20projectedCoordinates.previous;\x0a\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20projectedCoordinates.previous\x20=\x20calculateProjectedCoordinate(previousPosition);\x0a\x20\x20\x20\x20projectedCoordinates.current\x20=\x20calculateProjectedCoordinate(currentPosition);\x0a\x20\x20\x20\x20projectedCoordinates.next\x20=\x20calculateProjectedCoordinate(nextPosition);\x0a\x20\x20}\x0a\x0a\x20\x20int\x20pointToUse\x20=\x20int(normal.x);\x0a\x20\x20float\x20offsetSign\x20=\x20normal.y;\x0a\x20\x20vec4\x20offset\x20=\x20vec4(0.0f);\x0a\x0a\x20\x20\x20\x20//\x20计算速度相关的宽度和长度因子\x0a\x20\x20float\x20speedLength\x20=\x20clamp(speed.b,\x20domain.x,\x20domain.y);\x0a\x20\x20float\x20normalizedSpeed\x20=\x20(speedLength\x20-\x20domain.x)\x20/\x20(domain.y\x20-\x20domain.x);\x0a\x0a\x20\x20\x20\x20//\x20根据速度计算宽度\x0a\x20\x20float\x20widthFactor\x20=\x20mix(lineWidth.x,\x20lineWidth.y,\x20normalizedSpeed);\x0a\x20\x20widthFactor\x20*=\x20(pointToUse\x20<\x200\x20?\x201.0f\x20:\x200.5f);\x20//\x20头部更宽,尾部更窄\x0a\x0a\x20\x20\x20\x20//\x20Calculate\x20length\x20based\x20on\x20speed\x0a\x20\x20float\x20lengthFactor\x20=\x20mix(lineLength.x,\x20lineLength.y,\x20normalizedSpeed)\x20*\x20pixelSize;\x0a\x0a\x20\x20if(pointToUse\x20==\x201)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20头部位置\x0a\x20\x20\x20\x20offset\x20=\x20pixelSize\x20*\x20calculateOffsetOnNormalDirection(projectedCoordinates.previous,\x20projectedCoordinates.current,\x20offsetSign,\x20widthFactor);\x0a\x20\x20\x20\x20gl_Position\x20=\x20projectedCoordinates.previous\x20+\x20offset;\x0a\x20\x20\x20\x20v_segmentPosition\x20=\x200.0f;\x20//\x20头部\x0a\x20\x20}\x20else\x20if(pointToUse\x20==\x20-1)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20Get\x20direction\x20and\x20normalize\x20it\x20to\x20length\x201.0\x0a\x20\x20\x20\x20vec4\x20direction\x20=\x20normalize(projectedCoordinates.next\x20-\x20projectedCoordinates.current);\x0a\x20\x20\x20\x20vec4\x20extendedPosition\x20=\x20projectedCoordinates.current\x20+\x20direction\x20*\x20lengthFactor;\x0a\x0a\x20\x20\x20\x20offset\x20=\x20pixelSize\x20*\x20calculateOffsetOnNormalDirection(projectedCoordinates.current,\x20extendedPosition,\x20offsetSign,\x20widthFactor);\x0a\x20\x20\x20\x20gl_Position\x20=\x20extendedPosition\x20+\x20offset;\x0a\x20\x20\x20\x20v_segmentPosition\x20=\x201.0f;\x20//\x20尾部\x0a\x20\x20}\x0a\x0a\x20\x20textureCoordinate\x20=\x20st;\x0a}\x0a','primitives','mode','cols','south','framebuffers','postMessage','116JoKIGy','createRenderingFramebuffers','show','xmax','reCreateWindTextures','windData','_onMouseMoveEvent','framebuffer','createPrimitives','FUNC_ADD','LayerUtil','createSegmentsGeometry','updateWindData','toDegrees','particlesTextureSize','context','setDate','getPostProcessingPositionShader','lineWidth','_drawLines','west','update','frameRateMonitor','_randomParticle','_tomap','getPrimitives','max\x20is\x20undefined,\x20calculate\x20max','Draw','push','rectangle','data','toGridXY','_createCanvas','138IoCLdm','morphComplete','width','particles','xmin','lineTo','requestRender','getColor','clientHeight','_onMouseDownEvent','create','unbindEvent','ymax','FLOAT','_bilinearInterpolation','visibility','postProcessingPosition','particleSystem','commandToExecute','_maxAge','max','updateOptions','_onMouseUpEvent','resize','Cesium','_animateFrame','wheel','windField','_speedRate','random','umax','array','uniformMap','_mountedHook','mars3d-canvasWind','isDynamic','getUVByXY','1719530yFwgiG','globe','bind','abs','Math','register','shaderProgram','clear','onColorTableChange','vertexShaderSource','getUVByPoint','autoClear','processWindData','outputTexture','segments','sceneMode','lighter','updateViewerParameters','canvasHeight','nextParticlesPosition','getContext','tlat','_pointerEvents','sqrt','age','getSegmentDrawFragmentShader','redraw','_addedHook','_calcUV','warn','canvasContext','previousParticlesPosition','_onMapWhellEvent','updatePosition','pixelSize','_colorRamp','vertexArray','5065oUgEbR','blue','off','canvas','ColorRamp','worker','mouseMove','visible','canvasWidth','particlesTextures','strokeStyle','default','Cartesian3','textures','mouseHidden','ellipsoid','zIndex','getParticles','domain','removeEventListener','canvasWind','clientWidth','rendering','SCENE3D','min','colors','OPAQUE','east','mouse_down','prototype','_map','speed','viewerParameters','speedRate','get','destroyParticlesTextures','options','keys','container','toWindowCoordinates','ymin','currentParticlesPosition','lat','hasOwnProperty','none','EventType','computing','fromCache','5922354ORCTnD','_setOptionsHook','pickEllipsoid','LINEAR','fixedHeight','floor'];_0x1f16=function(){return _0x319c3e;};return _0x1f16();}const {Appearance,BufferUsage,Cartesian2,Color:Color$1,ComponentDatatype,Framebuffer,Geometry,GeometryAttribute,GeometryAttributes,PixelDatatype,PixelFormat,PrimitiveType,Sampler,SceneMode,Texture,TextureMagnificationFilter,TextureMinificationFilter,TextureWrap,VertexArray}=mars3d__namespace[_0x2a4b80(0x1d3)];class WindParticlesRendering{constructor(_0x290b3e,_0x26a90b,_0x5a8de2,_0x10fd8c){const _0x4f273c=_0x2a4b80;this['context']=_0x290b3e,this[_0x4f273c(0x152)]=_0x26a90b,this['viewerParameters']=_0x5a8de2,this[_0x4f273c(0x15c)]=_0x10fd8c,(typeof this[_0x4f273c(0x152)]['particlesTextureSize']!=='number'||this[_0x4f273c(0x152)]['particlesTextureSize']<=0x0)&&(console['error']('Invalid\x20particlesTextureSize.\x20Using\x20default\x20value\x20of\x20256.'),this[_0x4f273c(0x152)]['particlesTextureSize']=0x100),this['colorTable']=this['createColorTableTexture'](),this['textures']=this[_0x4f273c(0x18a)](),this[_0x4f273c(0x198)]=this[_0x4f273c(0x19b)](),this['primitives']=this[_0x4f273c(0x1a2)]();}['createRenderingTextures'](){const _0x4d6652=_0x2a4b80,_0x14070e={'context':this['context'],'width':this[_0x4d6652(0x1a9)]['drawingBufferWidth'],'height':this['context']['drawingBufferHeight'],'pixelFormat':PixelFormat['RGBA'],'pixelDatatype':PixelDatatype['UNSIGNED_BYTE']},_0x155277={'context':this['context'],'width':this[_0x4d6652(0x1a9)]['drawingBufferWidth'],'height':this[_0x4d6652(0x1a9)]['drawingBufferHeight'],'pixelFormat':PixelFormat['DEPTH_COMPONENT'],'pixelDatatype':PixelDatatype['UNSIGNED_INT']};return{'segmentsColor':new Texture(_0x14070e),'segmentsDepth':new Texture(_0x155277)};}['createRenderingFramebuffers'](){return{'segments':new Framebuffer({'context':this['context'],'colorTextures':[this['textures']['segmentsColor']],'depthTexture':this['textures']['segmentsDepth']})};}['destoryRenderingFramebuffers'](){Object['values'](this['framebuffers'])['forEach'](_0x3956ce=>{_0x3956ce['destroy']();});}[_0x2a4b80(0x18f)](){const _0x541817=_0x2a4b80,_0x8e2c5a=new Float32Array(this[_0x541817(0x152)]['colors']['flatMap'](_0x40f4cb=>{const _0x20149c=_0x541817,_0xaf4bc2=Color$1['fromCssColorString'](_0x40f4cb);return[_0xaf4bc2['red'],_0xaf4bc2['green'],_0xaf4bc2[_0x20149c(0x12f)],_0xaf4bc2['alpha']];}));return new Texture({'context':this['context'],'width':this[_0x541817(0x152)]['colors']['length'],'height':0x1,'pixelFormat':PixelFormat['RGBA'],'pixelDatatype':PixelDatatype[_0x541817(0x1c8)],'sampler':new Sampler({'minificationFilter':TextureMinificationFilter[_0x541817(0x161)],'magnificationFilter':TextureMagnificationFilter['LINEAR'],'wrapS':TextureWrap['CLAMP_TO_EDGE'],'wrapT':TextureWrap['CLAMP_TO_EDGE']}),'source':{'width':this['options']['colors']['length'],'height':0x1,'arrayBufferView':_0x8e2c5a}});}[_0x2a4b80(0x1a5)](){const _0x3ce8de=_0x2a4b80,_0xecab97=0x4,_0x2fb384=this[_0x3ce8de(0x152)]['particlesTextureSize'];let _0x2e7eef=[];for(let _0xf07421=0x0;_0xf07421<_0x2fb384;_0xf07421++){for(let _0x80feb1=0x0;_0x80feb1<_0x2fb384;_0x80feb1++){for(let _0x28c2e9=0x0;_0x28c2e9<_0xecab97;_0x28c2e9++){_0x2e7eef['push'](_0xf07421/_0x2fb384),_0x2e7eef['push'](_0x80feb1/_0x2fb384);}}}_0x2e7eef=new Float32Array(_0x2e7eef);const _0x3887ba=this['options'][_0x3ce8de(0x1a8)]**0x2;let _0x26a6f5=[];for(let _0x23b469=0x0;_0x23b469<_0x3887ba;_0x23b469++){_0x26a6f5['push'](-0x1,-0x1,0x0,-0x1,0x1,0x0,0x1,-0x1,0x0,0x1,0x1,0x0);}_0x26a6f5=new Float32Array(_0x26a6f5);let _0x28f38d=[];for(let _0x274386=0x0,_0x1b9dc9=0x0;_0x274386<_0x3887ba;_0x274386++){_0x28f38d['push'](_0x1b9dc9+0x0,_0x1b9dc9+0x1,_0x1b9dc9+0x2,_0x1b9dc9+0x2,_0x1b9dc9+0x1,_0x1b9dc9+0x3),_0x1b9dc9+=_0xecab97;}_0x28f38d=new Uint32Array(_0x28f38d);const _0x4f282c=new Geometry({'attributes':new GeometryAttributes({'st':new GeometryAttribute({'componentDatatype':ComponentDatatype['FLOAT'],'componentsPerAttribute':0x2,'values':_0x2e7eef}),'normal':new GeometryAttribute({'componentDatatype':ComponentDatatype[_0x3ce8de(0x1c8)],'componentsPerAttribute':0x3,'values':_0x26a6f5})}),'indices':_0x28f38d});return _0x4f282c;}['createRawRenderState'](_0x3415ea){return Appearance['getDefaultRenderState'](!![],![],{'viewport':undefined,'depthTest':undefined,'depthMask':undefined,'blending':undefined,..._0x3415ea});}['createPrimitives'](){const _0x2c37f3=_0x2a4b80,_0x3eb1d4=new CustomPrimitive({'commandType':_0x2c37f3(0x1b5),'attributeLocations':{'st':0x0,'normal':0x1},'geometry':this[_0x2c37f3(0x1a5)](),'primitiveType':PrimitiveType['TRIANGLES'],'uniformMap':{'previousParticlesPosition':()=>this[_0x2c37f3(0x15c)]['particlesTextures'][_0x2c37f3(0x128)],'currentParticlesPosition':()=>this[_0x2c37f3(0x15c)]['particlesTextures']['currentParticlesPosition'],'postProcessingPosition':()=>this[_0x2c37f3(0x15c)]['particlesTextures']['postProcessingPosition'],'particlesSpeed':()=>this[_0x2c37f3(0x15c)]['particlesTextures']['particlesSpeed'],'frameRateAdjustment':()=>this[_0x2c37f3(0x15c)][_0x2c37f3(0x169)],'colorTable':()=>this[_0x2c37f3(0x18e)],'domain':()=>{const _0xce0c9f=_0x2c37f3;var _0x71e5e4,_0xd7edb8;const _0x15521f=new Cartesian2(((_0x71e5e4=this['options']['domain'])===null||_0x71e5e4===void 0x0?void 0x0:_0x71e5e4[_0xce0c9f(0x146)])??this[_0xce0c9f(0x15c)][_0xce0c9f(0x19f)]['speed']['min'],((_0xd7edb8=this['options'][_0xce0c9f(0x140)])===null||_0xd7edb8===void 0x0?void 0x0:_0xd7edb8[_0xce0c9f(0x1cf)])??this['computing'][_0xce0c9f(0x19f)]['speed'][_0xce0c9f(0x1cf)]);return _0x15521f;},'displayRange':()=>{const _0x564d67=_0x2c37f3;var _0x4579f9,_0x31c164;const _0x1b8bfd=new Cartesian2(((_0x4579f9=this['options']['displayRange'])===null||_0x4579f9===void 0x0?void 0x0:_0x4579f9[_0x564d67(0x146)])??this['computing'][_0x564d67(0x19f)][_0x564d67(0x14d)]['min'],((_0x31c164=this['options']['displayRange'])===null||_0x31c164===void 0x0?void 0x0:_0x31c164['max'])??this['computing']['windData']['speed']['max']);return _0x1b8bfd;},'particleHeight':()=>this['options'][_0x2c37f3(0x162)]||0x0,'aspect':()=>this[_0x2c37f3(0x1a9)]['drawingBufferWidth']/this['context']['drawingBufferHeight'],'pixelSize':()=>this['viewerParameters'][_0x2c37f3(0x12b)],'lineWidth':()=>{const _0x5c6fd3=this['options']['lineWidth']||{'min':0x1,'max':0x2};return new Cartesian2(_0x5c6fd3['min'],_0x5c6fd3['max']);},'lineLength':()=>{const _0x23b91f=_0x2c37f3,_0x2f5ad0=this['options']['lineLength']||{'min':0x14,'max':0x64};return new Cartesian2(_0x2f5ad0[_0x23b91f(0x146)],_0x2f5ad0['max']);},'is3D':()=>this['viewerParameters'][_0x2c37f3(0x118)]===SceneMode[_0x2c37f3(0x145)],'segmentsDepthTexture':()=>this[_0x2c37f3(0x13b)]['segmentsDepth']},'vertexShaderSource':ShaderManager['getSegmentDrawVertexShader'](),'fragmentShaderSource':ShaderManager[_0x2c37f3(0x122)](),'rawRenderState':this['createRawRenderState']({'viewport':undefined,'depthTest':{'enabled':!![]},'depthMask':!![],'blending':{'enabled':!![],'blendEquation':WebGLRenderingContext[_0x2c37f3(0x1a3)],'blendFuncSource':WebGLRenderingContext['SRC_ALPHA'],'blendFuncDestination':WebGLRenderingContext['ONE_MINUS_SRC_ALPHA']}})});return{'segments':_0x3eb1d4};}['onParticlesTextureSizeChange'](){const _0x394270=_0x2a4b80,_0x19dced=this['createSegmentsGeometry']();this[_0x394270(0x194)][_0x394270(0x117)][_0x394270(0x192)]=_0x19dced;const _0xb12c9e=VertexArray['fromGeometry']({'context':this['context'],'geometry':_0x19dced,'attributeLocations':this['primitives']['segments']['attributeLocations'],'bufferUsage':BufferUsage[_0x394270(0x188)]});this['primitives']['segments']['commandToExecute']&&(this['primitives'][_0x394270(0x117)][_0x394270(0x1cd)][_0x394270(0x12d)]=_0xb12c9e);}[_0x2a4b80(0x111)](){this['colorTable']['destroy'](),this['colorTable']=this['createColorTableTexture']();}[_0x2a4b80(0x1d0)](_0x1da688){const _0x32681e=_0x2a4b80,_0x429701=_0x1da688['colors']&&JSON['stringify'](_0x1da688['colors'])!==JSON['stringify'](this['options']['colors']);this['options']=deepMerge(_0x1da688,this[_0x32681e(0x152)]),_0x429701&&this['onColorTableChange']();}[_0x2a4b80(0x174)](){const _0x32b9df=_0x2a4b80;Object['values'](this[_0x32b9df(0x198)])['forEach'](_0x2594e6=>{_0x2594e6['destroy']();}),Object['values'](this['primitives'])['forEach'](_0x956c80=>{const _0x5c649a=_0x32b9df;_0x956c80[_0x5c649a(0x174)]();}),this['colorTable'][_0x32b9df(0x174)]();}}const {ClearCommand,Color,Pass}=mars3d__namespace['Cesium'];class WindParticleSystem{constructor(_0x17248c,_0x3dd197,_0x43ab44,_0x35cd43,_0x23e6a6){const _0x356137=_0x2a4b80;this['context']=_0x17248c,this[_0x356137(0x152)]=_0x43ab44,this['viewerParameters']=_0x35cd43,this['computing']=new WindParticlesComputing(_0x17248c,_0x3dd197,_0x43ab44,_0x35cd43,_0x23e6a6),this['rendering']=new WindParticlesRendering(_0x17248c,_0x43ab44,_0x35cd43,this[_0x356137(0x15c)]),this['clearFramebuffers']();}[_0x2a4b80(0x1b3)](){const _0x1f527d=_0x2a4b80,_0x23b97b=[this[_0x1f527d(0x15c)]['primitives']['calculateSpeed'],this[_0x1f527d(0x15c)]['primitives'][_0x1f527d(0x12a)],this['computing']['primitives']['postProcessingPosition'],this['rendering'][_0x1f527d(0x194)]['segments']];return _0x23b97b;}['clearFramebuffers'](){const _0x68da2a=_0x2a4b80,_0x4e83b6=new ClearCommand({'color':new Color(0x0,0x0,0x0,0x0),'depth':0x1,'framebuffer':undefined,'pass':Pass[_0x68da2a(0x148)]});Object['keys'](this['rendering']['framebuffers'])['forEach'](_0x2164ec=>{const _0x626980=_0x68da2a;_0x4e83b6['framebuffer']=this[_0x626980(0x144)]['framebuffers'][_0x2164ec],_0x4e83b6['execute'](this['context']);});}['changeOptions'](_0x504fe4){const _0x15de15=_0x2a4b80;let _0xe1778c=![];_0x504fe4[_0x15de15(0x1a8)]&&this['options'][_0x15de15(0x1a8)]!==_0x504fe4['particlesTextureSize']&&(_0xe1778c=!![]);const _0x5d7744=deepMerge(_0x504fe4,this[_0x15de15(0x152)]);if(_0x5d7744[_0x15de15(0x1a8)]<0x1)throw new Error('particlesTextureSize\x20must\x20be\x20greater\x20than\x200');this['options']=_0x5d7744,this['rendering'][_0x15de15(0x1d0)](_0x504fe4),this[_0x15de15(0x15c)]['updateOptions'](_0x504fe4),_0xe1778c&&(this['computing'][_0x15de15(0x151)](),this[_0x15de15(0x15c)]['createParticlesTextures'](),this[_0x15de15(0x144)][_0x15de15(0x191)]());}['applyViewerParameters'](_0x55daf0){const _0x5ad690=_0x2a4b80;this[_0x5ad690(0x14e)]=_0x55daf0,this[_0x5ad690(0x15c)][_0x5ad690(0x14e)]=_0x55daf0,this['rendering']['viewerParameters']=_0x55daf0;}['destroy'](){const _0x2568be=_0x2a4b80;this['computing']['destroy'](),this[_0x2568be(0x144)]['destroy']();}}const Cesium$1=mars3d__namespace['Cesium'],BaseLayer$1=mars3d__namespace['layer']['BaseLayer'],DEF_OPTIONS={'particlesTextureSize':0x64,'fixedHeight':0x0,'lineWidth':{'min':0x1,'max':0x2},'lineLength':{'min':0x14,'max':0x64},'speedFactor':0x1,'dropRate':0.003,'dropRateBump':0.001,'colors':['rgb(206,255,255)'],'flipY':![],'dynamic':!![]};class WindLayer extends BaseLayer$1{constructor(_0x2f5bf9={}){_0x2f5bf9={...DEF_OPTIONS,..._0x2f5bf9},super(_0x2f5bf9),this['_setOptionsHook'](_0x2f5bf9,_0x2f5bf9);}get['layer'](){return this['primitives'];}get['data'](){return this['options']['data'];}set['data'](_0x12d34f){this['options']['data']=_0x12d34f,this['setData'](_0x12d34f);}get['colors'](){return this['options']['colors'];}set['colors'](_0x51fbe4){const _0x2167d1=_0x2a4b80;this['options'][_0x2167d1(0x147)]=_0x51fbe4,this['_setOptionsHook'](this[_0x2167d1(0x152)],{'colors':_0x51fbe4});}[_0x2a4b80(0x1dc)](){}['_addedHook'](){const _0x2b0da4=_0x2a4b80;this['scene']=this[_0x2b0da4(0x14c)]['scene'],this['camera']=this['_map']['camera'];this[_0x2b0da4(0x152)]['data']&&this['setData'](this['options'][_0x2b0da4(0x1b8)]);if(!this[_0x2b0da4(0x19f)])return;this[_0x2b0da4(0x14e)]={'lonRange':new Cesium$1['Cartesian2'](-0xb4,0xb4),'latRange':new Cesium$1['Cartesian2'](-0x5a,0x5a),'pixelSize':0x3e8,'sceneMode':this[_0x2b0da4(0x17c)][_0x2b0da4(0x195)]},this['updateViewerParameters'](),this['particleSystem']=new WindParticleSystem(this[_0x2b0da4(0x17c)]['context'],this['windData'],this[_0x2b0da4(0x152)],this['viewerParameters'],this['scene']),this[_0x2b0da4(0x194)]=this['particleSystem']['getPrimitives'](),this['primitives']['forEach'](_0x1ed634=>{const _0x7ff8c5=_0x2b0da4;this['scene']['primitives'][_0x7ff8c5(0x175)](_0x1ed634);}),this['camera']['percentageChanged']=0.01,this['camera']['changed']['addEventListener'](this['updateViewerParameters']['bind'](this)),this['scene'][_0x2b0da4(0x1bc)]['addEventListener'](this['updateViewerParameters'][_0x2b0da4(0x10b)](this)),window['addEventListener']('resize',this['updateViewerParameters'][_0x2b0da4(0x10b)](this));}['_removedHook'](){const _0x5c04a4=_0x2a4b80;this[_0x5c04a4(0x16c)]['changed']['removeEventListener'](this['updateViewerParameters']['bind'](this)),this['scene'][_0x5c04a4(0x1bc)]['removeEventListener'](this[_0x5c04a4(0x11a)]['bind'](this)),window['removeEventListener']('resize',this['updateViewerParameters']['bind'](this)),this['primitives']&&(this['primitives']['forEach'](_0x145871=>{this['scene']['primitives']['remove'](_0x145871);}),delete this[_0x5c04a4(0x194)]),this['particleSystem']&&(this['particleSystem']['destroy'](),delete this['particleSystem']);}['setData'](_0x2b213e,_0x372ae0){const _0x360621=_0x2a4b80;this['windData']=this[_0x360621(0x115)](_0x2b213e);if(_0x372ae0){this['_removedHook'](),this[_0x360621(0x124)]();return;}this['particleSystem']?(this[_0x360621(0x1cc)]['computing'][_0x360621(0x1a6)](this['windData']),this['scene'][_0x360621(0x1c1)]()):this[_0x360621(0x124)]();}[_0x2a4b80(0x15f)](_0x2e9c92,_0x49512c){const _0x43351e=_0x2a4b80;this['particleSystem']&&(this['particleSystem']['changeOptions'](_0x49512c),this['scene'][_0x43351e(0x1c1)]());}[_0x2a4b80(0x115)](_0x597884){const _0x2cb93d=_0x2a4b80;var _0x418e69,_0x25a709;const _0x4e3958={..._0x597884};!_0x4e3958['height']&&_0x4e3958['rows']&&(_0x4e3958['height']=_0x4e3958['rows']);!_0x4e3958['width']&&_0x4e3958['cols']&&(_0x4e3958['width']=_0x4e3958[_0x2cb93d(0x196)]);!_0x4e3958['bounds']&&(_0x4e3958['bounds']={'west':_0x4e3958['xmin'],'south':_0x4e3958[_0x2cb93d(0x156)],'east':_0x4e3958['xmax'],'north':_0x4e3958['ymax']});!_0x4e3958['u']&&(_0x4e3958['u']={'array':_0x597884['udata'],'min':_0x597884['umin'],'max':_0x597884[_0x2cb93d(0x1d9)]});!_0x4e3958['v']&&(_0x4e3958['v']={'array':_0x597884['vdata'],'min':_0x597884['vmin'],'max':_0x597884['vmax']});if(((_0x418e69=_0x4e3958[_0x2cb93d(0x14d)])===null||_0x418e69===void 0x0?void 0x0:_0x418e69['min'])===undefined||((_0x25a709=_0x4e3958['speed'])===null||_0x25a709===void 0x0?void 0x0:_0x25a709[_0x2cb93d(0x1cf)])===undefined||_0x4e3958['speed']['array']===undefined){const _0x376503={'array':new Float32Array(_0x4e3958['u'][_0x2cb93d(0x1da)]['length']),'min':Number['MAX_VALUE'],'max':Number['MIN_VALUE']};for(let _0x191007=0x0;_0x191007<_0x4e3958['u']['array']['length'];_0x191007++){_0x376503['array'][_0x191007]=Math['sqrt'](_0x4e3958['u']['array'][_0x191007]*_0x4e3958['u']['array'][_0x191007]+_0x4e3958['v']['array'][_0x191007]*_0x4e3958['v']['array'][_0x191007]),_0x376503['array'][_0x191007]!==0x0&&(_0x376503[_0x2cb93d(0x146)]=Math['min'](_0x376503['min'],_0x376503['array'][_0x191007]),_0x376503[_0x2cb93d(0x1cf)]=Math[_0x2cb93d(0x1cf)](_0x376503[_0x2cb93d(0x1cf)],_0x376503['array'][_0x191007]));}_0x4e3958['speed']=_0x376503;}return _0x4e3958;}['updateViewerParameters'](){const _0x1b773a=_0x2a4b80;var _0x170f81;const _0x4783e9=this['scene'],_0x21732e=_0x4783e9['canvas'],_0x1763bc=[{'x':0x0,'y':0x0},{'x':0x0,'y':_0x21732e['clientHeight']},{'x':_0x21732e['clientWidth'],'y':0x0},{'x':_0x21732e[_0x1b773a(0x143)],'y':_0x21732e['clientHeight']}];let _0x206a84=0xb4,_0x2eb85e=-0xb4,_0x414151=0x5a,_0x39b743=-0x5a,_0x42dc8e=![];for(const _0x465bb5 of _0x1763bc){const _0x5a1b77=_0x4783e9['camera'][_0x1b773a(0x160)](new Cesium$1['Cartesian2'](_0x465bb5['x'],_0x465bb5['y']),_0x4783e9[_0x1b773a(0x1e1)]['ellipsoid']);if(!_0x5a1b77){_0x42dc8e=!![];break;}const _0x6eb6ca=_0x4783e9['globe'][_0x1b773a(0x13d)]['cartesianToCartographic'](_0x5a1b77),_0x9017fc=Cesium$1['Math']['toDegrees'](_0x6eb6ca['longitude']),_0x2872a0=Cesium$1[_0x1b773a(0x10d)][_0x1b773a(0x1a7)](_0x6eb6ca['latitude']);_0x206a84=Math[_0x1b773a(0x146)](_0x206a84,_0x9017fc),_0x2eb85e=Math['max'](_0x2eb85e,_0x9017fc),_0x414151=Math[_0x1b773a(0x146)](_0x414151,_0x2872a0),_0x39b743=Math['max'](_0x39b743,_0x2872a0);}if(!_0x42dc8e){const _0x43cacd=new Cesium$1[(_0x1b773a(0x16e))](Math['max'](this['windData']['bounds'][_0x1b773a(0x1ae)],_0x206a84),Math['min'](this['windData']['bounds'][_0x1b773a(0x149)],_0x2eb85e)),_0x20d7de=new Cesium$1['Cartesian2'](Math['max'](this['windData']['bounds']['south'],_0x414151),Math['min'](this['windData']['bounds']['north'],_0x39b743)),_0x8f42cb=(_0x43cacd['y']-_0x43cacd['x'])*0.05,_0x130d22=(_0x20d7de['y']-_0x20d7de['x'])*0.05;_0x43cacd['x']=Math[_0x1b773a(0x1cf)](this[_0x1b773a(0x19f)]['bounds'][_0x1b773a(0x1ae)],_0x43cacd['x']-_0x8f42cb),_0x43cacd['y']=Math['min'](this['windData'][_0x1b773a(0x18c)]['east'],_0x43cacd['y']+_0x8f42cb),_0x20d7de['x']=Math['max'](this['windData']['bounds'][_0x1b773a(0x197)],_0x20d7de['x']-_0x130d22),_0x20d7de['y']=Math['min'](this['windData'][_0x1b773a(0x18c)]['north'],_0x20d7de['y']+_0x130d22),this['viewerParameters'][_0x1b773a(0x18d)]=_0x43cacd,this[_0x1b773a(0x14e)]['latRange']=_0x20d7de;const _0x13f908=this[_0x1b773a(0x19f)][_0x1b773a(0x18c)]['east']-this['windData']['bounds'][_0x1b773a(0x1ae)],_0x32786d=this[_0x1b773a(0x19f)]['bounds']['north']-this[_0x1b773a(0x19f)]['bounds'][_0x1b773a(0x197)],_0x1d4b5f=(_0x43cacd['y']-_0x43cacd['x'])/_0x13f908,_0x1591c9=(_0x20d7de['y']-_0x20d7de['x'])/_0x32786d,_0x4df943=Math['min'](_0x1d4b5f,_0x1591c9),_0xa36c23=0x3e8*_0x4df943;_0xa36c23>0x0&&(this[_0x1b773a(0x14e)]['pixelSize']=Math['max'](0x0,Math['min'](0x3e8,_0xa36c23)));}this[_0x1b773a(0x14e)]['sceneMode']=this[_0x1b773a(0x17c)]['mode'],(_0x170f81=this['particleSystem'])===null||_0x170f81===void 0x0||_0x170f81['applyViewerParameters'](this['viewerParameters']);}[_0x2a4b80(0x179)](_0x2e62a8,_0x1f5269){const _0x2f0e9d=_0x2a4b80,{bounds:_0x3261a0,width:_0x325725,height:_0x599d67,u:_0x263d8f,v:_0x353e1c,speed:_0x4123a2}=this['windData'],{flipY:_0x38bf5c}=this[_0x2f0e9d(0x152)];if(_0x2e62a8<_0x3261a0['west']||_0x2e62a8>_0x3261a0['east']||_0x1f5269<_0x3261a0['south']||_0x1f5269>_0x3261a0['north'])return null;const _0x5f2f56=(_0x2e62a8-_0x3261a0[_0x2f0e9d(0x1ae)])/(_0x3261a0[_0x2f0e9d(0x149)]-_0x3261a0[_0x2f0e9d(0x1ae)])*(_0x325725-0x1);let _0x4acf3e=(_0x1f5269-_0x3261a0['south'])/(_0x3261a0['north']-_0x3261a0['south'])*(_0x599d67-0x1);_0x38bf5c&&(_0x4acf3e=_0x599d67-0x1-_0x4acf3e);const _0x149af6=Math['floor'](_0x5f2f56),_0x25405f=Math['floor'](_0x4acf3e),_0x44b1c0=Math['floor'](_0x5f2f56),_0x2302a3=Math['min'](_0x44b1c0+0x1,_0x325725-0x1),_0x565614=Math['floor'](_0x4acf3e),_0xc57c9=Math['min'](_0x565614+0x1,_0x599d67-0x1),_0x534a74=_0x5f2f56-_0x44b1c0,_0x5e7643=_0x4acf3e-_0x565614,_0x23d752=_0x25405f*_0x325725+_0x149af6,_0x31a2ff=_0x565614*_0x325725+_0x44b1c0,_0x3391ba=_0x565614*_0x325725+_0x2302a3,_0x57c378=_0xc57c9*_0x325725+_0x44b1c0,_0x4104b3=_0xc57c9*_0x325725+_0x2302a3,_0x3d1438=_0x263d8f[_0x2f0e9d(0x1da)][_0x31a2ff],_0xadae=_0x263d8f['array'][_0x3391ba],_0x33d58f=_0x263d8f[_0x2f0e9d(0x1da)][_0x57c378],_0x4d6471=_0x263d8f['array'][_0x4104b3],_0x4ac3bd=(0x1-_0x534a74)*(0x1-_0x5e7643)*_0x3d1438+_0x534a74*(0x1-_0x5e7643)*_0xadae+(0x1-_0x534a74)*_0x5e7643*_0x33d58f+_0x534a74*_0x5e7643*_0x4d6471,_0x1b7743=_0x353e1c['array'][_0x31a2ff],_0x5db06f=_0x353e1c['array'][_0x3391ba],_0x547109=_0x353e1c[_0x2f0e9d(0x1da)][_0x57c378],_0x365bdc=_0x353e1c['array'][_0x4104b3],_0x11ab35=(0x1-_0x534a74)*(0x1-_0x5e7643)*_0x1b7743+_0x534a74*(0x1-_0x5e7643)*_0x5db06f+(0x1-_0x534a74)*_0x5e7643*_0x547109+_0x534a74*_0x5e7643*_0x365bdc,_0x2a0d06=Math[_0x2f0e9d(0x120)](_0x4ac3bd*_0x4ac3bd+_0x11ab35*_0x11ab35);return{'original':{'u':_0x263d8f['array'][_0x23d752],'v':_0x353e1c['array'][_0x23d752],'speed':_0x4123a2['array'][_0x23d752]},'interpolated':{'u':_0x4ac3bd,'v':_0x11ab35,'speed':_0x2a0d06}};}}mars3d__namespace['LayerUtil']['register']('wind',WindLayer),mars3d__namespace['layer']['WindLayer']=WindLayer;class CanvasParticle{constructor(){this['lng']=null,this['lat']=null,this['tlng']=null,this['tlat']=null,this['age']=null,this['speed']=null;}[_0x2a4b80(0x174)](){for(const _0x36ac4f in this){delete this[_0x36ac4f];}}}class CanvasWindField{constructor(_0x24cb06){this['setOptions'](_0x24cb06);}get['speedRate'](){return this['_speedRate'];}set['speedRate'](_0x115b98){const _0x314b13=_0x2a4b80;this[_0x314b13(0x1d7)]=(0x64-(_0x115b98>0x63?0x63:_0x115b98))*0x64,this['_calc_speedRate']=[(this[_0x314b13(0x19d)]-this['xmin'])/this[_0x314b13(0x1d7)],(this['ymax']-this['ymin'])/this['_speedRate']];}get[_0x2a4b80(0x17b)](){return this['_maxAge'];}set['maxAge'](_0x5e0f35){const _0x3b55e1=_0x2a4b80;this[_0x3b55e1(0x1ce)]=_0x5e0f35;}['setOptions'](_0x4eac63){const _0x2f06a6=_0x2a4b80;this['options']=_0x4eac63,this['maxAge']=_0x4eac63['maxAge']||0x78,this['speedRate']=_0x4eac63[_0x2f06a6(0x14f)]||0x32,this['particles']=[];const _0x1c9bbd=_0x4eac63[_0x2f06a6(0x172)]||0x1000;for(let _0x4969c4=0x0;_0x4969c4<_0x1c9bbd;_0x4969c4++){const _0x52ebc3=this['_randomParticle'](new CanvasParticle());this[_0x2f06a6(0x1be)][_0x2f06a6(0x1b6)](_0x52ebc3);}}[_0x2a4b80(0x1aa)](_0x2ee158){const _0x2d04f4=_0x2a4b80;this[_0x2d04f4(0x182)]=_0x2ee158['rows'],this['cols']=_0x2ee158['cols'],this['xmin']=_0x2ee158[_0x2d04f4(0x1bf)],this['xmax']=_0x2ee158['xmax'],this['ymin']=_0x2ee158['ymin'],this['ymax']=_0x2ee158['ymax'],this['grid']=[];const _0x228335=_0x2ee158['udata'],_0x13806d=_0x2ee158['vdata'];let _0xa0b895=![];_0x228335['length']===this['rows']&&_0x228335[0x0]['length']===this[_0x2d04f4(0x196)]&&(_0xa0b895=!![]);let _0x217e83=0x0,_0x1f5b12=null,_0x297873=null;for(let _0x46c168=0x0;_0x46c168<this[_0x2d04f4(0x182)];_0x46c168++){_0x1f5b12=[];for(let _0x2b8c1f=0x0;_0x2b8c1f<this['cols'];_0x2b8c1f++,_0x217e83++){_0xa0b895?_0x297873=this['_calcUV'](_0x228335[_0x46c168][_0x2b8c1f],_0x13806d[_0x46c168][_0x2b8c1f]):_0x297873=this['_calcUV'](_0x228335[_0x217e83],_0x13806d[_0x217e83]),_0x1f5b12[_0x2d04f4(0x1b6)](_0x297873);}this[_0x2d04f4(0x16d)]['push'](_0x1f5b12);}!this[_0x2d04f4(0x152)]['flipY']&&this['grid']['reverse']();}[_0x2a4b80(0x110)](){const _0x1e34de=_0x2a4b80;delete this[_0x1e34de(0x182)],delete this['cols'],delete this['xmin'],delete this[_0x1e34de(0x19d)],delete this['ymin'],delete this['ymax'],delete this['grid'],delete this['particles'];}['toGridXY'](_0x537649,_0x1609ec){const _0x5c8bd1=_0x2a4b80,_0x994c94=(_0x537649-this['xmin'])/(this['xmax']-this['xmin'])*(this[_0x5c8bd1(0x196)]-0x1),_0x3d05d0=(this[_0x5c8bd1(0x1c7)]-_0x1609ec)/(this['ymax']-this['ymin'])*(this[_0x5c8bd1(0x182)]-0x1);return[_0x994c94,_0x3d05d0];}['getUVByXY'](_0x3d6eda,_0x4d5b6e){const _0x4954dc=_0x2a4b80;if(_0x3d6eda<0x0||_0x3d6eda>=this['cols']||_0x4d5b6e>=this[_0x4954dc(0x182)])return[0x0,0x0,0x0];const _0x5f03b9=Math[_0x4954dc(0x163)](_0x3d6eda),_0xc0af76=Math['floor'](_0x4d5b6e);if(_0x5f03b9===_0x3d6eda&&_0xc0af76===_0x4d5b6e)return this['grid'][_0x4d5b6e][_0x3d6eda];const _0x1a6475=_0x5f03b9+0x1,_0x2e92b2=_0xc0af76+0x1,_0x33e31f=this['getUVByXY'](_0x5f03b9,_0xc0af76),_0x4a3a46=this[_0x4954dc(0x1df)](_0x1a6475,_0xc0af76),_0x43778e=this['getUVByXY'](_0x5f03b9,_0x2e92b2),_0x229cba=this['getUVByXY'](_0x1a6475,_0x2e92b2);let _0x44687b=null;try{_0x44687b=this[_0x4954dc(0x1c9)](_0x3d6eda-_0x5f03b9,_0x4d5b6e-_0xc0af76,_0x33e31f,_0x4a3a46,_0x43778e,_0x229cba);}catch(_0x5238d0){console['log'](_0x3d6eda,_0x4d5b6e);}return _0x44687b;}['_bilinearInterpolation'](_0x2be89a,_0x2b7d48,_0x2a9e1e,_0x2ca9d3,_0x363252,_0x160121){const _0x19791f=_0x2a4b80,_0x338cdf=0x1-_0x2be89a,_0x4769bd=0x1-_0x2b7d48,_0x5eed19=_0x338cdf*_0x4769bd,_0xf29a24=_0x2be89a*_0x4769bd,_0x489c00=_0x338cdf*_0x2b7d48,_0x34681c=_0x2be89a*_0x2b7d48,_0x11e965=_0x2a9e1e[0x0]*_0x5eed19+_0x2ca9d3[0x0]*_0xf29a24+_0x363252[0x0]*_0x489c00+_0x160121[0x0]*_0x34681c,_0x1f2367=_0x2a9e1e[0x1]*_0x5eed19+_0x2ca9d3[0x1]*_0xf29a24+_0x363252[0x1]*_0x489c00+_0x160121[0x1]*_0x34681c;return this[_0x19791f(0x125)](_0x11e965,_0x1f2367);}['_calcUV'](_0x501523,_0x5ef2ba){return[+_0x501523,+_0x5ef2ba,Math['sqrt'](_0x501523*_0x501523+_0x5ef2ba*_0x5ef2ba)];}[_0x2a4b80(0x113)](_0x5d2197,_0x2e53f4){const _0x2c6e1f=_0x2a4b80;if(!this['isInExtent'](_0x5d2197,_0x2e53f4))return null;const _0x1b485e=this[_0x2c6e1f(0x1b9)](_0x5d2197,_0x2e53f4),_0x2edab2=this[_0x2c6e1f(0x1df)](_0x1b485e[0x0],_0x1b485e[0x1]);return _0x2edab2;}['isInExtent'](_0x43a04b,_0x202ea2){const _0x39a9f9=_0x2a4b80;return _0x43a04b>=this[_0x39a9f9(0x1bf)]&&_0x43a04b<=this['xmax']&&_0x202ea2>=this[_0x39a9f9(0x156)]&&_0x202ea2<=this[_0x39a9f9(0x1c7)]?!![]:![];}['getRandomLatLng'](){const _0x44b8c1=_0x2a4b80,_0x5ad825=fRandomByfloat(this[_0x44b8c1(0x1bf)],this['xmax']),_0x2b454e=fRandomByfloat(this['ymin'],this['ymax']);return{'lat':_0x2b454e,'lng':_0x5ad825};}['getParticles'](){const _0x182857=_0x2a4b80;let _0x30aca4,_0x1489da,_0x3c93fe;for(let _0x75faf4=0x0,_0x67c36d=this['particles'][_0x182857(0x186)];_0x75faf4<_0x67c36d;_0x75faf4++){let _0xf99b83=this['particles'][_0x75faf4];_0xf99b83[_0x182857(0x121)]<=0x0&&(_0xf99b83=this['_randomParticle'](_0xf99b83));if(_0xf99b83[_0x182857(0x121)]>0x0){const _0x5d09f8=_0xf99b83['tlng'],_0x34a564=_0xf99b83[_0x182857(0x11e)];_0x3c93fe=this['getUVByPoint'](_0x5d09f8,_0x34a564),_0x3c93fe?(_0x30aca4=_0x5d09f8+this['_calc_speedRate'][0x0]*_0x3c93fe[0x0],_0x1489da=_0x34a564+this['_calc_speedRate'][0x1]*_0x3c93fe[0x1],_0xf99b83['lng']=_0x5d09f8,_0xf99b83['lat']=_0x34a564,_0xf99b83['tlng']=_0x30aca4,_0xf99b83['tlat']=_0x1489da,_0xf99b83['speed']=_0x3c93fe[0x2],_0xf99b83['age']--):_0xf99b83[_0x182857(0x121)]=0x0;}}return this['particles'];}[_0x2a4b80(0x1b1)](_0x17f0bd){const _0x7152bf=_0x2a4b80;let _0x422dfb,_0x4a3ea8;for(let _0x52ee01=0x0;_0x52ee01<0x1e;_0x52ee01++){_0x422dfb=this['getRandomLatLng'](),_0x4a3ea8=this[_0x7152bf(0x113)](_0x422dfb['lng'],_0x422dfb['lat']);if(_0x4a3ea8&&_0x4a3ea8[0x2]>0x0)break;}if(!_0x4a3ea8)return _0x17f0bd;const _0x10a428=_0x422dfb['lng']+this['_calc_speedRate'][0x0]*_0x4a3ea8[0x0],_0x1098db=_0x422dfb['lat']+this['_calc_speedRate'][0x1]*_0x4a3ea8[0x1];return _0x17f0bd['lng']=_0x422dfb['lng'],_0x17f0bd[_0x7152bf(0x158)]=_0x422dfb['lat'],_0x17f0bd['tlng']=_0x10a428,_0x17f0bd['tlat']=_0x1098db,_0x17f0bd[_0x7152bf(0x121)]=Math['round'](0xa+Math['random']()*this['maxAge']),_0x17f0bd[_0x7152bf(0x14d)]=_0x4a3ea8[0x2],_0x17f0bd;}['destroy'](){for(const _0x388be1 in this){delete this[_0x388be1];}}}function fRandomByfloat(_0x261413,_0x1a8865){const _0x24a526=_0x2a4b80;return _0x261413+Math[_0x24a526(0x1d8)]()*(_0x1a8865-_0x261413);}const Cesium=mars3d__namespace[_0x2a4b80(0x1d3)],BaseLayer=mars3d__namespace['layer']['BaseLayer'];class CanvasWindLayer extends BaseLayer{constructor(_0x42e6a7={}){const _0x42c6ac=_0x2a4b80;super(_0x42e6a7),this[_0x42c6ac(0x15f)](_0x42e6a7),this['canvas']=null,_0x42e6a7[_0x42c6ac(0x147)]&&_0x42e6a7['steps']&&(this[_0x42c6ac(0x12c)]=new mars3d__namespace[(_0x42c6ac(0x132))](_0x42e6a7));}['_setOptionsHook'](_0x466ad8,_0x21ed67){const _0x40b964=_0x2a4b80;this[_0x40b964(0x180)]=0x3e8/(_0x466ad8['frameRate']||0xa),this[_0x40b964(0x11f)]=this['options']['pointerEvents']??![],this['color']=_0x466ad8['color']||'#ffffff',this['lineWidth']=_0x466ad8[_0x40b964(0x1ac)]||0x1,this[_0x40b964(0x162)]=_0x466ad8[_0x40b964(0x162)]??0x0,this['flipY']=_0x466ad8['flipY']??![],this['windField']&&this['windField'][_0x40b964(0x167)](_0x466ad8);}get[_0x2a4b80(0x18b)](){const _0x516782=_0x2a4b80;return this[_0x516782(0x131)];}get['canvasWidth'](){const _0x3e5d24=_0x2a4b80;return this['_map']['scene'][_0x3e5d24(0x131)][_0x3e5d24(0x143)];}get[_0x2a4b80(0x11b)](){const _0x229b7d=_0x2a4b80;return this['_map']['scene']['canvas'][_0x229b7d(0x1c3)];}get['pointerEvents'](){return this['_pointerEvents'];}set[_0x2a4b80(0x189)](_0x5f27a9){const _0x5d76e3=_0x2a4b80;this[_0x5d76e3(0x11f)]=_0x5f27a9;if(!this['canvas'])return;_0x5f27a9?this[_0x5d76e3(0x131)]['style']['pointer-events']='all':this[_0x5d76e3(0x131)]['style']['pointer-events']='none';}get['particlesNumber'](){const _0x56544d=_0x2a4b80;return this['options'][_0x56544d(0x172)];}set['particlesNumber'](_0x4e5015){const _0x15aadf=_0x2a4b80;this[_0x15aadf(0x152)][_0x15aadf(0x172)]=_0x4e5015,clearTimeout(this['_canrefresh']),this['_canrefresh']=setTimeout(()=>{const _0x1845b=_0x15aadf;this[_0x1845b(0x123)]();},0x1f4);}get[_0x2a4b80(0x14f)](){const _0x1b2f81=_0x2a4b80;return this['options'][_0x1b2f81(0x14f)];}set['speedRate'](_0x176b23){this['options']['speedRate']=_0x176b23,this['windField']&&(this['windField']['speedRate']=_0x176b23);}get[_0x2a4b80(0x17b)](){const _0x304254=_0x2a4b80;return this['options'][_0x304254(0x17b)];}set['maxAge'](_0x3cd3e8){const _0x2713f1=_0x2a4b80;this['options'][_0x2713f1(0x17b)]=_0x3cd3e8,this[_0x2713f1(0x1d6)]&&(this[_0x2713f1(0x1d6)][_0x2713f1(0x17b)]=_0x3cd3e8);}get['data'](){return this['windData'];}set['data'](_0x21e32a){this['setData'](_0x21e32a);}get[_0x2a4b80(0x1b7)](){const _0x31068d=_0x2a4b80;let _0x4f045f=this['windData']['xmin'],_0x27c8e0=this['windData']['xmax'],_0x57f74c=this['windData']['ymin'],_0x8068a6=this[_0x31068d(0x19f)][_0x31068d(0x1c7)];return _0x27c8e0>=0x167&&_0x4f045f===0x0&&(_0x4f045f=-0xb4,_0x27c8e0=0xb4),_0x4f045f=Math['max'](_0x4f045f,-0xb4),_0x27c8e0=Math['min'](_0x27c8e0,0xb4),_0x57f74c=Math['max'](_0x57f74c,-0x5a),_0x8068a6=Math['min'](_0x8068a6,0x5a),Cesium[_0x31068d(0x176)]['fromDegrees'](_0x4f045f,_0x57f74c,_0x27c8e0,_0x8068a6);}['_showHook'](_0x2c7ed1){const _0x5380b6=_0x2a4b80;_0x2c7ed1?this['_addedHook']():(this['windData']&&(this['options']['data']=this['windData']),this[_0x5380b6(0x17d)]());}['_mountedHook'](){const _0x1bb3b0=_0x2a4b80;this[_0x1bb3b0(0x152)]['worker']?this['initWorker']():this['windField']=new CanvasWindField(this[_0x1bb3b0(0x152)]);}['_addedHook'](){const _0xd98bf6=_0x2a4b80;this[_0xd98bf6(0x131)]=this[_0xd98bf6(0x1ba)](),this['canvasContext']=this[_0xd98bf6(0x131)][_0xd98bf6(0x11d)]('2d',{'willReadFrequently':!![]}),this['bindEvent'](),this['options'][_0xd98bf6(0x1b8)]&&this['setData'](this[_0xd98bf6(0x152)]['data']);}['_removedHook'](){const _0x434a3b=_0x2a4b80;this[_0x434a3b(0x110)](),this[_0x434a3b(0x1c6)](),this['canvas']&&(this['_map']['container']['removeChild'](this['canvas']),delete this['canvas']);}[_0x2a4b80(0x1ba)](){const _0x4eefc0=_0x2a4b80,_0x20f9ec=mars3d__namespace['DomUtil']['create']('canvas',_0x4eefc0(0x1dd),this['_map'][_0x4eefc0(0x154)]);return _0x20f9ec['style']['position']='absolute',_0x20f9ec[_0x4eefc0(0x181)]['top']='0px',_0x20f9ec['style']['left']='0px',_0x20f9ec['style']['width']=this['_map']['scene']['canvas']['clientWidth']+'px',_0x20f9ec['style']['height']=this[_0x4eefc0(0x14c)]['scene']['canvas']['clientHeight']+'px',_0x20f9ec['style']['pointerEvents']=this['_pointerEvents']?'auto':_0x4eefc0(0x15a),_0x20f9ec['style']['zIndex']=this['options'][_0x4eefc0(0x13e)]??0x9,_0x20f9ec['width']=this['_map']['scene']['canvas']['clientWidth'],_0x20f9ec['height']=this['_map']['scene']['canvas']['clientHeight'],_0x20f9ec;}['resize'](){const _0x1c25e9=_0x2a4b80;this['canvas']&&(this[_0x1c25e9(0x131)][_0x1c25e9(0x181)]['width']=this['_map'][_0x1c25e9(0x17c)][_0x1c25e9(0x131)]['clientWidth']+'px',this[_0x1c25e9(0x131)]['style']['height']=this['_map'][_0x1c25e9(0x17c)][_0x1c25e9(0x131)]['clientHeight']+'px',this['canvas'][_0x1c25e9(0x1bd)]=this[_0x1c25e9(0x14c)]['scene']['canvas']['clientWidth'],this['canvas']['height']=this['_map'][_0x1c25e9(0x17c)]['canvas']['clientHeight']);}['bindEvent'](){const _0x505c83=_0x2a4b80,_0x2ca405=this;let _0x3e6851=Date[_0x505c83(0x178)]();(function _0x35e882(){const _0x1dc743=_0x505c83;if(_0x2ca405['isDestroy'])return;_0x2ca405[_0x1dc743(0x1d4)]=window[_0x1dc743(0x170)](_0x35e882);if(_0x2ca405['show']&&_0x2ca405['windField']){const _0x299106=Date['now'](),_0xbb1be2=_0x299106-_0x3e6851;_0xbb1be2>_0x2ca405['frameTime']&&(_0x3e6851=_0x299106-_0xbb1be2%_0x2ca405['frameTime'],_0x2ca405[_0x1dc743(0x1af)]());}}(),window['addEventListener']('resize',this[_0x505c83(0x1d2)]['bind'](this),![]),this[_0x505c83(0x14a)]=![],this['mouse_move']=![],this['options'][_0x505c83(0x13c)]&&(this[_0x505c83(0x14c)]['on'](mars3d__namespace['EventType']['wheel'],this['_onMapWhellEvent'],this),this['_map']['on'](mars3d__namespace['EventType']['mouseDown'],this['_onMouseDownEvent'],this),this[_0x505c83(0x14c)]['on'](mars3d__namespace[_0x505c83(0x15b)]['mouseUp'],this['_onMouseUpEvent'],this)));}['unbindEvent'](){const _0xc1a1d=_0x2a4b80;window['cancelAnimationFrame'](this['_animateFrame']),delete this[_0xc1a1d(0x1d4)],window[_0xc1a1d(0x141)](_0xc1a1d(0x1d2),this['resize']),this[_0xc1a1d(0x152)]['mouseHidden']&&(this['_map'][_0xc1a1d(0x130)](mars3d__namespace['EventType'][_0xc1a1d(0x1d5)],this[_0xc1a1d(0x129)],this),this['_map']['off'](mars3d__namespace['EventType']['mouseDown'],this[_0xc1a1d(0x1c4)],this),this['_map'][_0xc1a1d(0x130)](mars3d__namespace['EventType']['mouseUp'],this[_0xc1a1d(0x1d1)],this),this[_0xc1a1d(0x14c)]['off'](mars3d__namespace['EventType'][_0xc1a1d(0x134)],this['_onMouseMoveEvent'],this));}['_onMapWhellEvent'](_0x428999){const _0x988aae=_0x2a4b80;clearTimeout(this['refreshTimer']);if(!this['show']||!this['canvas'])return;this[_0x988aae(0x131)][_0x988aae(0x181)][_0x988aae(0x1ca)]='hidden',this['refreshTimer']=setTimeout(()=>{const _0x3b68be=_0x988aae;if(!this['show'])return;this['redraw'](),this['canvas'][_0x3b68be(0x181)][_0x3b68be(0x1ca)]=_0x3b68be(0x135);},0xc8);}['_onMouseDownEvent'](_0xb0f9b6){const _0x4889b4=_0x2a4b80;this[_0x4889b4(0x14a)]=!![],this['_map'][_0x4889b4(0x130)](mars3d__namespace[_0x4889b4(0x15b)]['mouseMove'],this[_0x4889b4(0x1a0)],this),this['_map']['on'](mars3d__namespace[_0x4889b4(0x15b)]['mouseMove'],this[_0x4889b4(0x1a0)],this);}[_0x2a4b80(0x1a0)](_0xa7b627){const _0x51b1a5=_0x2a4b80;if(!this[_0x51b1a5(0x19c)]||!this['canvas'])return;this['mouse_down']&&(this[_0x51b1a5(0x131)]['style']['visibility']='hidden',this['mouse_move']=!![]);}['_onMouseUpEvent'](_0x265662){const _0x5df30b=_0x2a4b80;if(!this['show']||!this[_0x5df30b(0x131)])return;this[_0x5df30b(0x14c)]['off'](mars3d__namespace['EventType']['mouseMove'],this[_0x5df30b(0x1a0)],this),this['mouse_down']&&this['mouse_move']&&this['redraw'](),this['canvas']['style']['visibility']='visible',this['mouse_down']=![],this[_0x5df30b(0x183)]=![];}['setData'](_0x17f0cc){const _0x4fb3ef=_0x2a4b80;this['clear'](),this[_0x4fb3ef(0x19f)]=_0x17f0cc,this['windField'][_0x4fb3ef(0x1aa)](_0x17f0cc),this['redraw']();}['redraw'](){const _0xc3fdd5=_0x2a4b80;if(!this['show'])return;this['windField'][_0xc3fdd5(0x167)](this[_0xc3fdd5(0x152)]),this['update']();}[_0x2a4b80(0x1af)](){const _0x3fc115=_0x2a4b80;if(this['_updateIng'])return;this['_updateIng']=!![];if(this[_0x3fc115(0x133)])this['windField']['update']();else{const _0x5af00d=this['windField'][_0x3fc115(0x13f)]();this['_drawLines'](_0x5af00d);}this['_updateIng']=![];}['_drawLines'](_0x1726f2){const _0x40a38b=_0x2a4b80;this['_canvasParticles']=_0x1726f2,this[_0x40a38b(0x127)]['globalCompositeOperation']='destination-in',this['canvasContext']['fillRect'](0x0,0x0,this['canvasWidth'],this['canvasHeight']),this[_0x40a38b(0x127)]['globalCompositeOperation']=_0x40a38b(0x119),this['canvasContext']['globalAlpha']=0.9;const _0x5e1661=this['_map'][_0x40a38b(0x17c)][_0x40a38b(0x195)]!==Cesium['SceneMode']['SCENE3D'],_0x32702c=this[_0x40a38b(0x136)]*0.25;if(this['_colorRamp'])for(let _0x38de5f=0x0,_0x417462=_0x1726f2['length'];_0x38de5f<_0x417462;_0x38de5f++){const _0x44a329=_0x1726f2[_0x38de5f],_0x47bf26=this[_0x40a38b(0x1b2)](_0x44a329,_0x44a329['lng'],_0x44a329['lat'],_0x44a329['alt']),_0x1b0e57=this['_tomap'](_0x44a329,_0x44a329['tlng'],_0x44a329['tlat'],_0x44a329[_0x40a38b(0x17e)]);if(!_0x47bf26||!_0x1b0e57)continue;if(_0x5e1661&&Math['abs'](_0x47bf26[0x0]-_0x1b0e57[0x0])>=_0x32702c)continue;this[_0x40a38b(0x127)]['beginPath'](),this['canvasContext']['lineWidth']=this[_0x40a38b(0x1ac)],this['canvasContext']['strokeStyle']=this['_colorRamp'][_0x40a38b(0x1c2)](_0x44a329[_0x40a38b(0x14d)]),this[_0x40a38b(0x127)]['moveTo'](_0x47bf26[0x0],_0x47bf26[0x1]),this['canvasContext'][_0x40a38b(0x1c0)](_0x1b0e57[0x0],_0x1b0e57[0x1]),this['canvasContext']['stroke']();}else{this[_0x40a38b(0x127)]['beginPath'](),this['canvasContext'][_0x40a38b(0x1ac)]=this['lineWidth'],this['canvasContext'][_0x40a38b(0x138)]=this['color'];for(let _0xe56927=0x0,_0x3fa22d=_0x1726f2[_0x40a38b(0x186)];_0xe56927<_0x3fa22d;_0xe56927++){const _0x241014=_0x1726f2[_0xe56927],_0x426bde=this['_tomap'](_0x241014,_0x241014['lng'],_0x241014['lat'],_0x241014['alt']),_0x3ba7fe=this['_tomap'](_0x241014,_0x241014['tlng'],_0x241014['tlat'],_0x241014[_0x40a38b(0x17e)]);if(!_0x426bde||!_0x3ba7fe)continue;if(_0x5e1661&&Math[_0x40a38b(0x10c)](_0x426bde[0x0]-_0x3ba7fe[0x0])>=_0x32702c)continue;this[_0x40a38b(0x127)]['moveTo'](_0x426bde[0x0],_0x426bde[0x1]),this['canvasContext'][_0x40a38b(0x1c0)](_0x3ba7fe[0x0],_0x3ba7fe[0x1]);}this[_0x40a38b(0x127)]['stroke']();}}['_tomap'](_0x347253,_0x51f2fb,_0x2dde02,_0x532483){const _0x4af99d=_0x2a4b80,_0xf3949=Cesium[_0x4af99d(0x13a)]['fromDegrees'](_0x51f2fb,_0x2dde02,_0x532483??this['fixedHeight']),_0x2de9ce=this[_0x4af99d(0x14c)]['scene'];if(_0x2de9ce[_0x4af99d(0x195)]===Cesium['SceneMode']['SCENE3D']){const _0x38bb31=new Cesium['EllipsoidalOccluder'](_0x2de9ce['globe']['ellipsoid'],_0x2de9ce['camera']['positionWC']),_0x184f90=_0x38bb31['isPointVisible'](_0xf3949);if(!_0x184f90)return _0x347253['age']=0x0,null;}const _0x281067=mars3d__namespace['PointTrans'][_0x4af99d(0x155)](this['_map']['scene'],_0xf3949);return _0x281067?[_0x281067['x'],_0x281067['y']]:null;}[_0x2a4b80(0x110)](){const _0x22fbe8=_0x2a4b80;this['windField']['clear'](),delete this[_0x22fbe8(0x19f)];}['initWorker'](){const _0x92d140=_0x2a4b80;this['worker']=new Worker(this[_0x92d140(0x152)][_0x92d140(0x133)]),this['worker']['onmessage']=_0x4cff3f=>{const _0x545bec=_0x92d140;this[_0x545bec(0x1ad)](_0x4cff3f['data']['particles']),this['_updateIng2']=![];},this[_0x92d140(0x1d6)]={'init':_0x5ebeff=>{this['worker']['postMessage']({'type':'init','options':_0x5ebeff});},'setOptions':_0x172c59=>{const _0x59e565=_0x92d140;this[_0x59e565(0x133)]['postMessage']({'type':'setOptions','options':_0x172c59});},'setDate':_0x58da2d=>{this['worker']['postMessage']({'type':'setDate','data':_0x58da2d});},'update':()=>{const _0x3200d4=_0x92d140;if(this[_0x3200d4(0x165)])return;this['_updateIng2']=!![],this['worker'][_0x3200d4(0x199)]({'type':'update'});},'clear':()=>{const _0x5a4d93=_0x92d140;this['worker']['postMessage']({'type':_0x5a4d93(0x110)});}},this['windField']['init'](this[_0x92d140(0x152)]);}}mars3d__namespace[_0x2a4b80(0x1a4)][_0x2a4b80(0x10e)](_0x2a4b80(0x142),CanvasWindLayer),mars3d__namespace['layer']['CanvasWindLayer']=CanvasWindLayer,mars3d__namespace['CanvasWindField']=CanvasWindField,mars3d__namespace['WindUtil']=WindUtil,exports[_0x2a4b80(0x177)]=CanvasWindField,exports['CanvasWindLayer']=CanvasWindLayer,exports['WindLayer']=WindLayer,exports['WindUtil']=WindUtil,Object[_0x2a4b80(0x184)](exports,'__esModule',{'value':!![]});
|
||
}));
|