/**
 * Mars3D平台插件,支持气象 风向图 功能插件  mars3d-wind
 *
 * 版本信息：v3.10.1
 * 编译日期：2025-08-04 14:15
 * 版权所有：Copyright by 火星科技  http://mars3d.cn
 * 使用单位：山东慧创信息科技有限公司 ，2025-08-04
 */
(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';function _0x38e7(){const _0x4e5a38=['height','previousParticlesPosition','alt','setDate','attributeLocations','array','LINEAR','_updateIng','particleSystem','_speedRate','windTextures','3tyxfBL','moveTo','warn','lineLength','mouse_move','STATIC_DRAW','lineTo','fromDegrees','lat','tlat','_addedHook','toDegrees','mouse_down','_onMouseDownEvent','IDENTITY','postProcessingPosition','geometry','outputTexture','vertexShaderSource','EllipsoidalOccluder','off','_randomParticle','framebuffer','particles','_bilinearInterpolation','latitude','talt','speed','createParticlesTextures','processWindData','pointer-events','updateViewerParameters','ymin','refreshTimer','DEPTH_COMPONENT','destroy','vdata','none','east','1533akAsKZ','windData','_removedHook','prototype','strokeStyle','age','values','changed','pow','UNSIGNED_BYTE','floor','register','flipY','_canrefresh','_createCanvas','particlesTextureSize\x20must\x20be\x20greater\x20than\x200','_pointerEvents','beginPath','Cesium','framebuffers','isDynamic','worker','drawingBufferHeight','west','camera','scene','Cartesian3','SceneMode','isDestroy','_calcUV','WindUtil','canvasContext','Invalid\x20particlesTextureSize.\x20Using\x20default\x20value\x20of\x20256.','setOptions','viewerParameters','fixedHeight','onColorTableChange','setData','colors','clearCommand','_showHook','clear','add','removeEventListener','preExecute','particlesTextures','1892710RFdONz','init','log','lighter','ellipsoid','frameTime','abs','reCreateWindTextures','computing','now','frameRateMonitor','layer','_updateIng2','ColorRamp','push','sqrt','getDataAtLonLat','unbindEvent','red','clientHeight','fragmentShaderSource','bind','morphComplete','SCENE3D','_colorRamp','xmax','nextParticlesPosition','max','autoClear','_map','pointerEvents','visibility','reverse','_mountedHook','particlesTextureSize','lastFramesPerSecond','sin','BaseLayer','slice','_onMouseMoveEvent','2518492YixiMH','uniformMap','colorTable','_onMapWhellEvent','color','globe','tlng','absolute','clientWidth','rows','PointTrans','udata','_maxAge','style','context','data','canvasWind','getCalculateSpeedShader','commandToExecute','864282YECaXy','vertexArray','Compute','min','frameRateAdjustment','speedRate','ymax','getUVByXY','xmin','FLOAT','815hyZUJI','options','873203gWQojV','container','canvas','cos','remove','redraw','grid','getDefaultRenderState','windField','particlesNumber','show','width','mode','primitives','frameRate','forEach','lonRange','maxAge','lng','bounds','applyViewerParameters','umax','CanvasWindLayer','rendering','fromGeometry','segments','segmentsDepth','length','_onMouseUpEvent','4248onxiZq','fromCssColorString','toRadians','getSegmentDrawVertexShader','cols','textures','mouseMove','createColorTableTexture','north','EventType','44538wWGsCY','OPAQUE','lineWidth','324621HtRWEp','canvasWidth','resize','rgb(206,255,255)','primitiveType','createRawRenderState','Cartesian2'];_0x38e7=function(){return _0x4e5a38;};return _0x38e7();}const _0x314b11=_0x5546;(function(_0x5d091b,_0x1cc8ad){const _0x4a437b=_0x5546,_0x3a1a0a=_0x5d091b();while(!![]){try{const _0x8256f9=parseInt(_0x4a437b(0x1a3))/0x1+parseInt(_0x4a437b(0x197))/0x2+parseInt(_0x4a437b(0x1df))/0x3*(parseInt(_0x4a437b(0x25c))/0x4)+-parseInt(_0x4a437b(0x1a1))/0x5*(parseInt(_0x4a437b(0x1ca))/0x6)+-parseInt(_0x4a437b(0x206))/0x7*(-parseInt(_0x4a437b(0x1c0))/0x8)+-parseInt(_0x4a437b(0x1cd))/0x9+-parseInt(_0x4a437b(0x234))/0xa;if(_0x8256f9===_0x1cc8ad)break;else _0x3a1a0a['push'](_0x3a1a0a['shift']());}catch(_0x205eae){_0x3a1a0a['push'](_0x3a1a0a['shift']());}}}(_0x38e7,0x9661f));function _interopNamespace(_0x1db35f){if(_0x1db35f&&_0x1db35f['__esModule'])return _0x1db35f;var _0x4452ad=Object['create'](null);return _0x1db35f&&Object['keys'](_0x1db35f)['forEach'](function(_0x1f0a61){if(_0x1f0a61!=='default'){var _0x5d0a23=Object['getOwnPropertyDescriptor'](_0x1db35f,_0x1f0a61);Object['defineProperty'](_0x4452ad,_0x1f0a61,_0x5d0a23['get']?_0x5d0a23:{'enumerable':!![],'get':function(){return _0x1db35f[_0x1f0a61];}});}}),_0x4452ad['default']=_0x1db35f,_0x4452ad;}var mars3d__namespace=_interopNamespace(mars3d);const Cesium$2=mars3d__namespace[_0x314b11(0x218)];function getU(_0x753bae,_0xf7c646){const _0x3eae6a=_0x314b11,_0x57f538=_0x753bae*Math[_0x3eae6a(0x1a6)](Cesium$2['Math'][_0x3eae6a(0x1c2)](_0xf7c646));return _0x57f538;}function getV(_0x2a6ec4,_0x495e9a){const _0x11951f=_0x314b11,_0x107b61=_0x2a6ec4*Math[_0x11951f(0x258)](Cesium$2['Math'][_0x11951f(0x1c2)](_0x495e9a));return _0x107b61;}function getSpeed(_0x4aa807,_0x1dd833){const _0x3983d6=_0x314b11,_0x40e804=Math[_0x3983d6(0x243)](Math[_0x3983d6(0x20e)](_0x4aa807,0x2)+Math['pow'](_0x1dd833,0x2));return _0x40e804;}function getDirection(_0x11ccb,_0x360fc0){let _0xb7b241=Cesium$2['Math']['toDegrees'](Math['atan2'](_0x360fc0,_0x11ccb));return _0xb7b241+=_0xb7b241<0x0?0x168:0x0,_0xb7b241;}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='#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';function _0x5546(_0x51f86a,_0x4b5970){const _0x38e708=_0x38e7();return _0x5546=function(_0x554601,_0x2bddf3){_0x554601=_0x554601-0x187;let _0x1afbf5=_0x38e708[_0x554601];return _0x1afbf5;},_0x5546(_0x51f86a,_0x4b5970);}const {ShaderSource:ShaderSource$1}=mars3d__namespace['Cesium'];class ShaderManager{static[_0x314b11(0x195)](){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,defined,destroyObject}=mars3d__namespace['Cesium'];class CustomPrimitive{constructor(_0x4a3beb){const _0x63cc88=_0x314b11;this['commandType']=_0x4a3beb['commandType'],this['geometry']=_0x4a3beb[_0x63cc88(0x1ef)],this['attributeLocations']=_0x4a3beb[_0x63cc88(0x1d8)],this[_0x63cc88(0x1d1)]=_0x4a3beb[_0x63cc88(0x1d1)],this[_0x63cc88(0x25d)]=_0x4a3beb['uniformMap']||{},this[_0x63cc88(0x1f1)]=_0x4a3beb['vertexShaderSource'],this['fragmentShaderSource']=_0x4a3beb[_0x63cc88(0x248)],this['rawRenderState']=_0x4a3beb['rawRenderState'],this['framebuffer']=_0x4a3beb['framebuffer'],this[_0x63cc88(0x1f0)]=_0x4a3beb['outputTexture'],this['autoClear']=_0x4a3beb['autoClear']??![],this['preExecute']=_0x4a3beb['preExecute'],this['show']=!![],this['commandToExecute']=undefined,this['clearCommand']=undefined,this['isDynamic']=_0x4a3beb[_0x63cc88(0x21a)]??(()=>!![]),this[_0x63cc88(0x250)]&&(this['clearCommand']=new ClearCommand$1({'color':new Color$2(0x0,0x0,0x0,0x0),'depth':0x1,'framebuffer':this['framebuffer'],'pass':Pass$1['OPAQUE']}));}['createCommand'](_0x3b4c93){const _0x1795f0=_0x314b11;if(this['commandType']==='Draw'){const _0x5a7a59=VertexArray$1['fromGeometry']({'context':_0x3b4c93,'geometry':this[_0x1795f0(0x1ef)],'attributeLocations':this['attributeLocations'],'bufferUsage':BufferUsage$1[_0x1795f0(0x1e4)]}),_0x93ce77=ShaderProgram['fromCache']({'context':_0x3b4c93,'vertexShaderSource':this[_0x1795f0(0x1f1)],'fragmentShaderSource':this['fragmentShaderSource'],'attributeLocations':this[_0x1795f0(0x1d8)]}),_0x4ea138=RenderState['fromCache'](this['rawRenderState']);return new DrawCommand({'owner':this,'vertexArray':_0x5a7a59,'primitiveType':this['primitiveType'],'modelMatrix':Matrix4[_0x1795f0(0x1ed)],'renderState':_0x4ea138,'shaderProgram':_0x93ce77,'framebuffer':this[_0x1795f0(0x1f5)],'uniformMap':this['uniformMap'],'pass':Pass$1['OPAQUE']});}else{if(this['commandType']==='Compute')return new ComputeCommand({'owner':this,'fragmentShaderSource':this['fragmentShaderSource'],'uniformMap':this['uniformMap'],'outputTexture':this['outputTexture'],'persists':!![]});else throw new Error('Unknown\x20command\x20type');}}['setGeometry'](_0xbce705,_0x5d655a){const _0x407b1c=_0x314b11;this['geometry']=_0x5d655a,defined(this['commandToExecute'])&&(this['commandToExecute']['vertexArray']=VertexArray$1['fromGeometry']({'context':_0xbce705,'geometry':this['geometry'],'attributeLocations':this[_0x407b1c(0x1d8)],'bufferUsage':BufferUsage$1['STATIC_DRAW']}));}['update'](_0x1f4f6d){const _0x53b74d=_0x314b11;if(!this['isDynamic']())return;if(!this['show']||!defined(_0x1f4f6d))return;!defined(this[_0x53b74d(0x196)])&&(this['commandToExecute']=this['createCommand'](_0x1f4f6d['context']));defined(this[_0x53b74d(0x232)])&&this['preExecute']();if(!_0x1f4f6d['commandList']){console[_0x53b74d(0x1e1)]('frameState.commandList\x20is\x20undefined');return;}defined(this[_0x53b74d(0x22d)])&&_0x1f4f6d['commandList']['push'](this['clearCommand']),defined(this['commandToExecute'])&&_0x1f4f6d['commandList']['push'](this[_0x53b74d(0x196)]);}['isDestroyed'](){return![];}[_0x314b11(0x202)](){const _0x21704e=_0x314b11;if(defined(this['commandToExecute'])){var _0x39ea89;(_0x39ea89=this[_0x21704e(0x196)]['shaderProgram'])===null||_0x39ea89===void 0x0||_0x39ea89['destroy'](),this['commandToExecute']['shaderProgram']=undefined;}return destroyObject(this);}}function deepMerge(_0x5c8e88,_0xfdb7d6){const _0x1a6175=_0x314b11;if(!_0x5c8e88)return _0xfdb7d6;if(!_0xfdb7d6)return _0x5c8e88;const _0x1d787b={..._0xfdb7d6};for(const _0x4a7721 in _0x5c8e88){if(Object[_0x1a6175(0x209)]['hasOwnProperty']['call'](_0x5c8e88,_0x4a7721)){const _0x515a0f=_0x5c8e88[_0x4a7721],_0x2ffaf2=_0xfdb7d6[_0x4a7721];if(Array['isArray'](_0x515a0f)){_0x1d787b[_0x4a7721]=_0x515a0f[_0x1a6175(0x25a)]();continue;}if(_0x515a0f&&typeof _0x515a0f==='object'){_0x1d787b[_0x4a7721]=deepMerge(_0x515a0f,_0x2ffaf2||{});continue;}_0x515a0f!==undefined&&(_0x1d787b[_0x4a7721]=_0x515a0f);}}return _0x1d787b;}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(_0x4af617,_0xcb80ca,_0x448316,_0x392fca,_0x182655){const _0x488b44=_0x314b11;this['context']=_0x4af617,this['options']=_0x448316,this['viewerParameters']=_0x392fca,this['windData']=_0xcb80ca,this['frameRate']=0x3c,this['frameRateAdjustment']=0x1,this['frameRateMonitor']=new FrameRateMonitor({'scene':_0x182655,'samplingWindow':0x1,'quietPeriod':0x0}),this['initFrameRate'](),this['createWindTextures'](),this[_0x488b44(0x1fb)](),this['createComputingPrimitives']();}['initFrameRate'](){const _0x4c29e7=_0x314b11,_0x525379=()=>{const _0x10b193=_0x5546;this['frameRateMonitor'][_0x10b193(0x257)]>0x14&&(this['frameRate']=this['frameRateMonitor']['lastFramesPerSecond'],this[_0x10b193(0x19b)]=0x3c/Math['max'](this[_0x10b193(0x1b1)],0x1));};_0x525379();const _0xc36211=setInterval(_0x525379,0x3e8),_0xd704d3=this[_0x4c29e7(0x202)][_0x4c29e7(0x249)](this);this['destroy']=()=>{clearInterval(_0xc36211),_0xd704d3();};}['createWindTextures'](){const _0x5be9fb=_0x314b11,_0x5f45a5={'context':this['context'],'width':this[_0x5be9fb(0x207)]['width'],'height':this['windData'][_0x5be9fb(0x1d4)],'pixelFormat':PixelFormat$1['RED'],'pixelDatatype':PixelDatatype$1[_0x5be9fb(0x1a0)],'flipY':this['options']['flipY']??![],'sampler':new Sampler$1({'minificationFilter':TextureMinificationFilter$1['LINEAR'],'magnificationFilter':TextureMagnificationFilter$1['LINEAR']})};this[_0x5be9fb(0x1de)]={'U':new Texture$1({..._0x5f45a5,'source':{'arrayBufferView':new Float32Array(this['windData']['u']['array'])}}),'V':new Texture$1({..._0x5f45a5,'source':{'arrayBufferView':new Float32Array(this['windData']['v']['array'])}})};}['createParticlesTextures'](){const _0x35a7e0=_0x314b11,_0xdcf299={'context':this['context'],'width':this['options']['particlesTextureSize'],'height':this[_0x35a7e0(0x1a2)]['particlesTextureSize'],'pixelFormat':PixelFormat$1['RGBA'],'pixelDatatype':PixelDatatype$1['FLOAT'],'flipY':![],'source':{'arrayBufferView':new Float32Array(this[_0x35a7e0(0x1a2)]['particlesTextureSize']*this[_0x35a7e0(0x1a2)]['particlesTextureSize']*0x4)['fill'](0x0)},'sampler':new Sampler$1({'minificationFilter':TextureMinificationFilter$1['NEAREST'],'magnificationFilter':TextureMagnificationFilter$1['NEAREST']})};this['particlesTextures']={'previousParticlesPosition':new Texture$1(_0xdcf299),'currentParticlesPosition':new Texture$1(_0xdcf299),'nextParticlesPosition':new Texture$1(_0xdcf299),'postProcessingPosition':new Texture$1(_0xdcf299),'particlesSpeed':new Texture$1(_0xdcf299)};}['destroyParticlesTextures'](){const _0x45b4d6=_0x314b11;Object['values'](this[_0x45b4d6(0x233)])['forEach'](_0x5ef74f=>_0x5ef74f[_0x45b4d6(0x202)]());}['createComputingPrimitives'](){const _0x1f214e=_0x314b11;this[_0x1f214e(0x1b0)]={'calculateSpeed':new CustomPrimitive({'commandType':'Compute','uniformMap':{'U':()=>this[_0x1f214e(0x1de)]['U'],'V':()=>this['windTextures']['V'],'uRange':()=>new Cartesian2$1(this['windData']['u']['min'],this['windData']['u']['max']),'vRange':()=>new Cartesian2$1(this['windData']['v']['min'],this[_0x1f214e(0x207)]['v']['max']),'speedRange':()=>new Cartesian2$1(this['windData']['speed'][_0x1f214e(0x19a)],this[_0x1f214e(0x207)][_0x1f214e(0x1fa)][_0x1f214e(0x24f)]),'currentParticlesPosition':()=>this[_0x1f214e(0x233)]['currentParticlesPosition'],'speedScaleFactor':()=>{const _0x5bc431=_0x1f214e;return(this['viewerParameters']['pixelSize']+0x32)*this[_0x5bc431(0x1a2)]['speedFactor'];},'frameRateAdjustment':()=>this[_0x1f214e(0x19b)],'dimension':()=>new Cartesian2$1(this['windData']['width'],this['windData']['height']),'minimum':()=>new Cartesian2$1(this['windData']['bounds'][_0x1f214e(0x21d)],this['windData']['bounds']['south']),'maximum':()=>new Cartesian2$1(this['windData']['bounds']['east'],this['windData']['bounds'][_0x1f214e(0x1c8)])},'fragmentShaderSource':ShaderManager['getCalculateSpeedShader'](),'outputTexture':this['particlesTextures']['particlesSpeed'],'preExecute':()=>{const _0x1613e9=_0x1f214e,_0x2f013c=this[_0x1613e9(0x233)]['previousParticlesPosition'];this['particlesTextures']['previousParticlesPosition']=this[_0x1613e9(0x233)]['currentParticlesPosition'],this['particlesTextures']['currentParticlesPosition']=this['particlesTextures'][_0x1613e9(0x1ee)],this[_0x1613e9(0x233)]['postProcessingPosition']=_0x2f013c,this['primitives']['calculateSpeed']['commandToExecute']&&(this['primitives']['calculateSpeed']['commandToExecute']['outputTexture']=this['particlesTextures']['particlesSpeed']);},'isDynamic':()=>this[_0x1f214e(0x1a2)]['dynamic']}),'updatePosition':new CustomPrimitive({'commandType':_0x1f214e(0x199),'uniformMap':{'currentParticlesPosition':()=>this['particlesTextures']['currentParticlesPosition'],'particlesSpeed':()=>this['particlesTextures']['particlesSpeed']},'fragmentShaderSource':ShaderManager['getUpdatePositionShader'](),'outputTexture':this['particlesTextures']['nextParticlesPosition'],'preExecute':()=>{const _0x22db6a=_0x1f214e;this['primitives']['updatePosition'][_0x22db6a(0x196)]&&(this['primitives']['updatePosition']['commandToExecute']['outputTexture']=this[_0x22db6a(0x233)][_0x22db6a(0x24e)]);},'isDynamic':()=>this['options']['dynamic']}),'postProcessingPosition':new CustomPrimitive({'commandType':_0x1f214e(0x199),'uniformMap':{'nextParticlesPosition':()=>this[_0x1f214e(0x233)]['nextParticlesPosition'],'particlesSpeed':()=>this['particlesTextures']['particlesSpeed'],'lonRange':()=>this['viewerParameters'][_0x1f214e(0x1b3)],'latRange':()=>this['viewerParameters']['latRange'],'dataLonRange':()=>new Cartesian2$1(this['windData'][_0x1f214e(0x1b6)]['west'],this[_0x1f214e(0x207)]['bounds'][_0x1f214e(0x205)]),'dataLatRange':()=>new Cartesian2$1(this[_0x1f214e(0x207)]['bounds']['south'],this[_0x1f214e(0x207)]['bounds']['north']),'randomCoefficient':function(){return Math['random']();},'dropRate':()=>this[_0x1f214e(0x1a2)]['dropRate'],'dropRateBump':()=>this['options']['dropRateBump'],'useViewerBounds':()=>this['options']['useViewerBounds']},'fragmentShaderSource':ShaderManager['getPostProcessingPositionShader'](),'outputTexture':this[_0x1f214e(0x233)]['postProcessingPosition'],'preExecute':()=>{const _0x40d872=_0x1f214e;this['primitives']['postProcessingPosition']['commandToExecute']&&(this['primitives']['postProcessingPosition']['commandToExecute'][_0x40d872(0x1f0)]=this[_0x40d872(0x233)]['postProcessingPosition']);},'isDynamic':()=>this['options']['dynamic']})};}['reCreateWindTextures'](){this['windTextures']['U']['destroy'](),this['windTextures']['V']['destroy'](),this['createWindTextures']();}['updateWindData'](_0x9e9df5){this['windData']=_0x9e9df5,this['reCreateWindTextures']();}['updateOptions'](_0x5472d7){const _0x2154a5=_0x314b11,_0x17f03e=_0x5472d7['flipY']!==undefined&&_0x5472d7['flipY']!==this['options'][_0x2154a5(0x212)];this['options']=deepMerge(_0x5472d7,this['options']),_0x17f03e&&this[_0x2154a5(0x23b)]();}['processWindData'](_0x41735f){const _0x25088f=_0x314b11,{array:_0x424190}=_0x41735f;let {min:_0x301cc7,max:_0x3be5fc}=_0x41735f;const _0x54fc3e=new Float32Array(_0x424190['length']);_0x301cc7===undefined&&(console[_0x25088f(0x1e1)]('min\x20is\x20undefined,\x20calculate\x20min'),_0x301cc7=Math['min'](..._0x424190));_0x3be5fc===undefined&&(console['warn']('max\x20is\x20undefined,\x20calculate\x20max'),_0x3be5fc=Math[_0x25088f(0x24f)](..._0x424190));const _0x32652f=Math[_0x25088f(0x24f)](Math[_0x25088f(0x23a)](_0x301cc7),Math['abs'](_0x3be5fc));for(let _0x388dbb=0x0;_0x388dbb<_0x424190['length'];_0x388dbb++){const _0x1096e5=_0x424190[_0x388dbb]/_0x32652f;_0x54fc3e[_0x388dbb]=_0x1096e5;}return _0x54fc3e;}[_0x314b11(0x202)](){const _0x2ad3da=_0x314b11;Object['values'](this['windTextures'])[_0x2ad3da(0x1b2)](_0x4d8708=>_0x4d8708['destroy']()),Object[_0x2ad3da(0x20c)](this['particlesTextures'])[_0x2ad3da(0x1b2)](_0x162838=>_0x162838[_0x2ad3da(0x202)]()),Object['values'](this[_0x2ad3da(0x1b0)])['forEach'](_0x20d09d=>_0x20d09d[_0x2ad3da(0x202)]()),this[_0x2ad3da(0x23e)][_0x2ad3da(0x202)]();}}const {Appearance,BufferUsage,Cartesian2,Color:Color$1,ComponentDatatype,Framebuffer,Geometry,GeometryAttribute,GeometryAttributes,PixelDatatype,PixelFormat,PrimitiveType,Sampler,SceneMode,Texture,TextureMagnificationFilter,TextureMinificationFilter,TextureWrap,VertexArray}=mars3d__namespace['Cesium'];class WindParticlesRendering{constructor(_0x4a521d,_0x30b549,_0x2b42c0,_0x3173e8){const _0xe13411=_0x314b11;this[_0xe13411(0x192)]=_0x4a521d,this['options']=_0x30b549,this['viewerParameters']=_0x2b42c0,this['computing']=_0x3173e8,(typeof this[_0xe13411(0x1a2)]['particlesTextureSize']!=='number'||this['options']['particlesTextureSize']<=0x0)&&(console['error'](_0xe13411(0x226)),this['options'][_0xe13411(0x256)]=0x100),this[_0xe13411(0x25e)]=this['createColorTableTexture'](),this['textures']=this['createRenderingTextures'](),this[_0xe13411(0x219)]=this['createRenderingFramebuffers'](),this['primitives']=this['createPrimitives']();}['createRenderingTextures'](){const _0x5bb6da=_0x314b11,_0x266ddb={'context':this['context'],'width':this['context']['drawingBufferWidth'],'height':this['context']['drawingBufferHeight'],'pixelFormat':PixelFormat['RGBA'],'pixelDatatype':PixelDatatype[_0x5bb6da(0x20f)]},_0x5f0bdf={'context':this[_0x5bb6da(0x192)],'width':this[_0x5bb6da(0x192)]['drawingBufferWidth'],'height':this[_0x5bb6da(0x192)]['drawingBufferHeight'],'pixelFormat':PixelFormat[_0x5bb6da(0x201)],'pixelDatatype':PixelDatatype['UNSIGNED_INT']};return{'segmentsColor':new Texture(_0x266ddb),'segmentsDepth':new Texture(_0x5f0bdf)};}['createRenderingFramebuffers'](){const _0x353874=_0x314b11;return{'segments':new Framebuffer({'context':this['context'],'colorTextures':[this[_0x353874(0x1c5)]['segmentsColor']],'depthTexture':this['textures'][_0x353874(0x1bd)]})};}['destoryRenderingFramebuffers'](){Object['values'](this['framebuffers'])['forEach'](_0x485d14=>{_0x485d14['destroy']();});}[_0x314b11(0x1c7)](){const _0x2b2e2e=_0x314b11,_0x5ac803=new Float32Array(this['options']['colors']['flatMap'](_0x374253=>{const _0x599a90=_0x5546,_0x1c9359=Color$1[_0x599a90(0x1c1)](_0x374253);return[_0x1c9359[_0x599a90(0x246)],_0x1c9359['green'],_0x1c9359['blue'],_0x1c9359['alpha']];}));return new Texture({'context':this['context'],'width':this['options']['colors']['length'],'height':0x1,'pixelFormat':PixelFormat['RGBA'],'pixelDatatype':PixelDatatype['FLOAT'],'sampler':new Sampler({'minificationFilter':TextureMinificationFilter[_0x2b2e2e(0x1da)],'magnificationFilter':TextureMagnificationFilter[_0x2b2e2e(0x1da)],'wrapS':TextureWrap['CLAMP_TO_EDGE'],'wrapT':TextureWrap['CLAMP_TO_EDGE']}),'source':{'width':this['options']['colors']['length'],'height':0x1,'arrayBufferView':_0x5ac803}});}['createSegmentsGeometry'](){const _0x3930d4=0x4,_0x2d57eb=this['options']['particlesTextureSize'];let _0x29f206=[];for(let _0x45951d=0x0;_0x45951d<_0x2d57eb;_0x45951d++){for(let _0x40baa7=0x0;_0x40baa7<_0x2d57eb;_0x40baa7++){for(let _0x3c2d94=0x0;_0x3c2d94<_0x3930d4;_0x3c2d94++){_0x29f206['push'](_0x45951d/_0x2d57eb),_0x29f206['push'](_0x40baa7/_0x2d57eb);}}}_0x29f206=new Float32Array(_0x29f206);const _0xb54f40=this['options']['particlesTextureSize']**0x2;let _0x3d3f70=[];for(let _0x3c4c3d=0x0;_0x3c4c3d<_0xb54f40;_0x3c4c3d++){_0x3d3f70['push'](-0x1,-0x1,0x0,-0x1,0x1,0x0,0x1,-0x1,0x0,0x1,0x1,0x0);}_0x3d3f70=new Float32Array(_0x3d3f70);let _0x362041=[];for(let _0x283dce=0x0,_0x1c3244=0x0;_0x283dce<_0xb54f40;_0x283dce++){_0x362041['push'](_0x1c3244+0x0,_0x1c3244+0x1,_0x1c3244+0x2,_0x1c3244+0x2,_0x1c3244+0x1,_0x1c3244+0x3),_0x1c3244+=_0x3930d4;}_0x362041=new Uint32Array(_0x362041);const _0x11c785=new Geometry({'attributes':new GeometryAttributes({'st':new GeometryAttribute({'componentDatatype':ComponentDatatype['FLOAT'],'componentsPerAttribute':0x2,'values':_0x29f206}),'normal':new GeometryAttribute({'componentDatatype':ComponentDatatype['FLOAT'],'componentsPerAttribute':0x3,'values':_0x3d3f70})}),'indices':_0x362041});return _0x11c785;}[_0x314b11(0x1d2)](_0x35f9a9){const _0x1c6ae9=_0x314b11;return Appearance[_0x1c6ae9(0x1aa)](!![],![],{'viewport':undefined,'depthTest':undefined,'depthMask':undefined,'blending':undefined,..._0x35f9a9});}['createPrimitives'](){const _0x40e7f1=_0x314b11,_0x254bc0=new CustomPrimitive({'commandType':'Draw','attributeLocations':{'st':0x0,'normal':0x1},'geometry':this['createSegmentsGeometry'](),'primitiveType':PrimitiveType['TRIANGLES'],'uniformMap':{'previousParticlesPosition':()=>this['computing']['particlesTextures'][_0x40e7f1(0x1d5)],'currentParticlesPosition':()=>this['computing']['particlesTextures']['currentParticlesPosition'],'postProcessingPosition':()=>this[_0x40e7f1(0x23c)]['particlesTextures']['postProcessingPosition'],'particlesSpeed':()=>this['computing']['particlesTextures']['particlesSpeed'],'frameRateAdjustment':()=>this['computing'][_0x40e7f1(0x19b)],'colorTable':()=>this['colorTable'],'domain':()=>{const _0x3b7c0f=_0x40e7f1;var _0x2faebc,_0x48cfb6;const _0x3dfa17=new Cartesian2(((_0x2faebc=this[_0x3b7c0f(0x1a2)]['domain'])===null||_0x2faebc===void 0x0?void 0x0:_0x2faebc[_0x3b7c0f(0x19a)])??this['computing']['windData']['speed']['min'],((_0x48cfb6=this['options']['domain'])===null||_0x48cfb6===void 0x0?void 0x0:_0x48cfb6[_0x3b7c0f(0x24f)])??this['computing']['windData']['speed']['max']);return _0x3dfa17;},'displayRange':()=>{const _0x40a787=_0x40e7f1;var _0x2aa220,_0x18e164;const _0x469116=new Cartesian2(((_0x2aa220=this['options']['displayRange'])===null||_0x2aa220===void 0x0?void 0x0:_0x2aa220['min'])??this['computing']['windData'][_0x40a787(0x1fa)]['min'],((_0x18e164=this['options']['displayRange'])===null||_0x18e164===void 0x0?void 0x0:_0x18e164[_0x40a787(0x24f)])??this['computing']['windData'][_0x40a787(0x1fa)]['max']);return _0x469116;},'particleHeight':()=>this['options'][_0x40e7f1(0x229)]||0x0,'aspect':()=>this['context']['drawingBufferWidth']/this['context'][_0x40e7f1(0x21c)],'pixelSize':()=>this['viewerParameters']['pixelSize'],'lineWidth':()=>{const _0x222f0b=_0x40e7f1,_0x47297b=this['options']['lineWidth']||{'min':0x1,'max':0x2};return new Cartesian2(_0x47297b['min'],_0x47297b[_0x222f0b(0x24f)]);},'lineLength':()=>{const _0x61a25c=_0x40e7f1,_0x45fd3a=this['options'][_0x61a25c(0x1e2)]||{'min':0x14,'max':0x64};return new Cartesian2(_0x45fd3a['min'],_0x45fd3a[_0x61a25c(0x24f)]);},'is3D':()=>this['viewerParameters']['sceneMode']===SceneMode['SCENE3D'],'segmentsDepthTexture':()=>this['textures'][_0x40e7f1(0x1bd)]},'vertexShaderSource':ShaderManager[_0x40e7f1(0x1c3)](),'fragmentShaderSource':ShaderManager['getSegmentDrawFragmentShader'](),'rawRenderState':this['createRawRenderState']({'viewport':undefined,'depthTest':{'enabled':!![]},'depthMask':!![],'blending':{'enabled':!![],'blendEquation':WebGLRenderingContext['FUNC_ADD'],'blendFuncSource':WebGLRenderingContext['SRC_ALPHA'],'blendFuncDestination':WebGLRenderingContext['ONE_MINUS_SRC_ALPHA']}})});return{'segments':_0x254bc0};}['onParticlesTextureSizeChange'](){const _0x170710=_0x314b11,_0x4c70eb=this['createSegmentsGeometry']();this['primitives'][_0x170710(0x1bc)][_0x170710(0x1ef)]=_0x4c70eb;const _0x29a733=VertexArray[_0x170710(0x1bb)]({'context':this['context'],'geometry':_0x4c70eb,'attributeLocations':this['primitives']['segments']['attributeLocations'],'bufferUsage':BufferUsage['STATIC_DRAW']});this[_0x170710(0x1b0)]['segments']['commandToExecute']&&(this[_0x170710(0x1b0)]['segments']['commandToExecute'][_0x170710(0x198)]=_0x29a733);}[_0x314b11(0x22a)](){this['colorTable']['destroy'](),this['colorTable']=this['createColorTableTexture']();}['updateOptions'](_0x523f4f){const _0x28755e=_0x314b11,_0x42c758=_0x523f4f[_0x28755e(0x22c)]&&JSON['stringify'](_0x523f4f['colors'])!==JSON['stringify'](this['options']['colors']);this['options']=deepMerge(_0x523f4f,this['options']),_0x42c758&&this[_0x28755e(0x22a)]();}['destroy'](){const _0x33addd=_0x314b11;Object[_0x33addd(0x20c)](this['framebuffers'])['forEach'](_0x4520d7=>{_0x4520d7['destroy']();}),Object['values'](this['primitives'])['forEach'](_0x1980b2=>{_0x1980b2['destroy']();}),this[_0x33addd(0x25e)][_0x33addd(0x202)]();}}const {ClearCommand,Color,Pass}=mars3d__namespace['Cesium'];class WindParticleSystem{constructor(_0x475aa1,_0x52e9d8,_0x373d8c,_0x40a1ca,_0x52f856){const _0x567be9=_0x314b11;this['context']=_0x475aa1,this['options']=_0x373d8c,this[_0x567be9(0x228)]=_0x40a1ca,this[_0x567be9(0x23c)]=new WindParticlesComputing(_0x475aa1,_0x52e9d8,_0x373d8c,_0x40a1ca,_0x52f856),this['rendering']=new WindParticlesRendering(_0x475aa1,_0x373d8c,_0x40a1ca,this[_0x567be9(0x23c)]),this['clearFramebuffers']();}['getPrimitives'](){const _0x31912d=_0x314b11,_0x4ce659=[this[_0x31912d(0x23c)]['primitives']['calculateSpeed'],this['computing']['primitives']['updatePosition'],this['computing']['primitives']['postProcessingPosition'],this['rendering']['primitives']['segments']];return _0x4ce659;}['clearFramebuffers'](){const _0x4806a4=_0x314b11,_0x1bf407=new ClearCommand({'color':new Color(0x0,0x0,0x0,0x0),'depth':0x1,'framebuffer':undefined,'pass':Pass[_0x4806a4(0x1cb)]});Object['keys'](this['rendering']['framebuffers'])['forEach'](_0x4dae0e=>{const _0x3edaf7=_0x4806a4;_0x1bf407['framebuffer']=this[_0x3edaf7(0x1ba)]['framebuffers'][_0x4dae0e],_0x1bf407['execute'](this['context']);});}['changeOptions'](_0x6daaac){const _0x435179=_0x314b11;let _0x237042=![];_0x6daaac[_0x435179(0x256)]&&this['options']['particlesTextureSize']!==_0x6daaac[_0x435179(0x256)]&&(_0x237042=!![]);const _0x3f2932=deepMerge(_0x6daaac,this['options']);if(_0x3f2932[_0x435179(0x256)]<0x1)throw new Error(_0x435179(0x215));this['options']=_0x3f2932,this['rendering']['updateOptions'](_0x6daaac),this['computing']['updateOptions'](_0x6daaac),_0x237042&&(this[_0x435179(0x23c)]['destroyParticlesTextures'](),this['computing'][_0x435179(0x1fb)](),this[_0x435179(0x1ba)]['onParticlesTextureSizeChange']());}[_0x314b11(0x1b7)](_0x5ca841){this['viewerParameters']=_0x5ca841,this['computing']['viewerParameters']=_0x5ca841,this['rendering']['viewerParameters']=_0x5ca841;}[_0x314b11(0x202)](){const _0xc959a8=_0x314b11;this[_0xc959a8(0x23c)][_0xc959a8(0x202)](),this[_0xc959a8(0x1ba)][_0xc959a8(0x202)]();}}const Cesium$1=mars3d__namespace[_0x314b11(0x218)],BaseLayer$1=mars3d__namespace['layer'][_0x314b11(0x259)],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':[_0x314b11(0x1d0)],'flipY':![],'dynamic':!![]};class WindLayer extends BaseLayer$1{constructor(_0x533ea0={}){_0x533ea0={...DEF_OPTIONS,..._0x533ea0},super(_0x533ea0),this['_setOptionsHook'](_0x533ea0,_0x533ea0);}get['layer'](){return this['primitives'];}get['data'](){return this['options']['data'];}set['data'](_0x3c6b5e){this['options']['data']=_0x3c6b5e,this['setData'](_0x3c6b5e);}get[_0x314b11(0x22c)](){return this['options']['colors'];}set[_0x314b11(0x22c)](_0x2ca261){this['options']['colors']=_0x2ca261,this['_setOptionsHook'](this['options'],{'colors':_0x2ca261});}[_0x314b11(0x22e)](_0x23a551){_0x23a551?this['_addedHook']():this['_removedHook']();}['_mountedHook'](){}[_0x314b11(0x1e9)](){const _0x40863a=_0x314b11;this['scene']=this['_map'][_0x40863a(0x21f)],this['camera']=this['_map']['camera'];this['options']['data']&&this['setData'](this['options']['data']);if(!this['windData']||!this[_0x40863a(0x1ad)])return;this[_0x40863a(0x228)]={'lonRange':new Cesium$1['Cartesian2'](-0xb4,0xb4),'latRange':new Cesium$1[(_0x40863a(0x1d3))](-0x5a,0x5a),'pixelSize':0x3e8,'sceneMode':this[_0x40863a(0x21f)]['mode']},this['updateViewerParameters'](),this['particleSystem']=new WindParticleSystem(this[_0x40863a(0x21f)]['context'],this[_0x40863a(0x207)],this['options'],this['viewerParameters'],this[_0x40863a(0x21f)]),this['primitives']=this['particleSystem']['getPrimitives'](),this['primitives']['forEach'](_0x1f0e54=>{const _0xafbb3=_0x40863a;this[_0xafbb3(0x21f)]['primitives'][_0xafbb3(0x230)](_0x1f0e54);}),this['camera']['percentageChanged']=0.01,this[_0x40863a(0x21e)][_0x40863a(0x20d)]['addEventListener'](this[_0x40863a(0x1fe)]['bind'](this)),this['scene'][_0x40863a(0x24a)]['addEventListener'](this['updateViewerParameters']['bind'](this)),window['addEventListener']('resize',this[_0x40863a(0x1fe)]['bind'](this));}[_0x314b11(0x208)](){const _0x2f6f26=_0x314b11;this['camera'][_0x2f6f26(0x20d)][_0x2f6f26(0x231)](this[_0x2f6f26(0x1fe)][_0x2f6f26(0x249)](this)),this['scene']['morphComplete']['removeEventListener'](this['updateViewerParameters']['bind'](this)),window['removeEventListener']('resize',this[_0x2f6f26(0x1fe)]['bind'](this)),this[_0x2f6f26(0x1b0)]&&(this['primitives'][_0x2f6f26(0x1b2)](_0x329527=>{const _0x3e4b18=_0x2f6f26;this[_0x3e4b18(0x21f)][_0x3e4b18(0x1b0)][_0x3e4b18(0x1a7)](_0x329527);}),delete this['primitives']),this['particleSystem']&&(this['particleSystem']['destroy'](),delete this['particleSystem']);}[_0x314b11(0x22b)](_0x5d362a,_0x44bd57){const _0xe684d9=_0x314b11;this['windData']=this[_0xe684d9(0x1fc)](_0x5d362a);if(_0x44bd57){this['_removedHook'](),this[_0xe684d9(0x1e9)]();return;}this[_0xe684d9(0x1dc)]?(this['particleSystem']['computing']['updateWindData'](this['windData']),this['scene']['requestRender']()):this['_addedHook']();}['_setOptionsHook'](_0x380427,_0xbdccb){const _0x215205=_0x314b11;this['particleSystem']&&(this['particleSystem']['changeOptions'](_0xbdccb),this[_0x215205(0x21f)]['requestRender']());}['processWindData'](_0x21b54d){const _0x4e48d7=_0x314b11;var _0x4a76df,_0x1b9a53;const _0x424d54={..._0x21b54d};!_0x424d54[_0x4e48d7(0x1d4)]&&_0x424d54['rows']&&(_0x424d54['height']=_0x424d54[_0x4e48d7(0x18d)]);!_0x424d54['width']&&_0x424d54['cols']&&(_0x424d54[_0x4e48d7(0x1ae)]=_0x424d54['cols']);!_0x424d54['bounds']&&(_0x424d54[_0x4e48d7(0x1b6)]={'west':_0x424d54['xmin'],'south':_0x424d54[_0x4e48d7(0x1ff)],'east':_0x424d54[_0x4e48d7(0x24d)],'north':_0x424d54['ymax']});!_0x424d54['u']&&(_0x424d54['u']={'array':_0x21b54d['udata'],'min':_0x21b54d['umin'],'max':_0x21b54d[_0x4e48d7(0x1b8)]});!_0x424d54['v']&&(_0x424d54['v']={'array':_0x21b54d[_0x4e48d7(0x203)],'min':_0x21b54d['vmin'],'max':_0x21b54d['vmax']});if(((_0x4a76df=_0x424d54['speed'])===null||_0x4a76df===void 0x0?void 0x0:_0x4a76df['min'])===undefined||((_0x1b9a53=_0x424d54['speed'])===null||_0x1b9a53===void 0x0?void 0x0:_0x1b9a53[_0x4e48d7(0x24f)])===undefined||_0x424d54['speed'][_0x4e48d7(0x1d9)]===undefined){const _0x272650={'array':new Float32Array(_0x424d54['u']['array']['length']),'min':Number['MAX_VALUE'],'max':Number['MIN_VALUE']};for(let _0x2e1128=0x0;_0x2e1128<_0x424d54['u']['array']['length'];_0x2e1128++){_0x272650['array'][_0x2e1128]=Math[_0x4e48d7(0x243)](_0x424d54['u']['array'][_0x2e1128]*_0x424d54['u']['array'][_0x2e1128]+_0x424d54['v']['array'][_0x2e1128]*_0x424d54['v']['array'][_0x2e1128]),_0x272650['array'][_0x2e1128]!==0x0&&(_0x272650['min']=Math[_0x4e48d7(0x19a)](_0x272650['min'],_0x272650['array'][_0x2e1128]),_0x272650[_0x4e48d7(0x24f)]=Math['max'](_0x272650[_0x4e48d7(0x24f)],_0x272650[_0x4e48d7(0x1d9)][_0x2e1128]));}_0x424d54[_0x4e48d7(0x1fa)]=_0x272650;}return _0x424d54;}['updateViewerParameters'](){const _0x4404b4=_0x314b11;var _0x52a719;const _0x2ff34c=this['scene'];if(!_0x2ff34c)return;const _0x402e8d=_0x2ff34c['canvas'],_0x2f3085=[{'x':0x0,'y':0x0},{'x':0x0,'y':_0x402e8d['clientHeight']},{'x':_0x402e8d['clientWidth'],'y':0x0},{'x':_0x402e8d['clientWidth'],'y':_0x402e8d[_0x4404b4(0x247)]}];let _0x15d4a7=0xb4,_0x40a749=-0xb4,_0x2ac8ab=0x5a,_0x4ff89f=-0x5a,_0x57457a=![];for(const _0x57dfe4 of _0x2f3085){const _0x159b33=_0x2ff34c['camera']['pickEllipsoid'](new Cesium$1['Cartesian2'](_0x57dfe4['x'],_0x57dfe4['y']),_0x2ff34c[_0x4404b4(0x189)][_0x4404b4(0x238)]);if(!_0x159b33){_0x57457a=!![];break;}const _0xcdecec=_0x2ff34c[_0x4404b4(0x189)][_0x4404b4(0x238)]['cartesianToCartographic'](_0x159b33),_0x19827e=Cesium$1['Math'][_0x4404b4(0x1ea)](_0xcdecec['longitude']),_0x41fd91=Cesium$1['Math'][_0x4404b4(0x1ea)](_0xcdecec[_0x4404b4(0x1f8)]);_0x15d4a7=Math['min'](_0x15d4a7,_0x19827e),_0x40a749=Math[_0x4404b4(0x24f)](_0x40a749,_0x19827e),_0x2ac8ab=Math['min'](_0x2ac8ab,_0x41fd91),_0x4ff89f=Math['max'](_0x4ff89f,_0x41fd91);}if(!_0x57457a){const _0x5b9fbf=new Cesium$1[(_0x4404b4(0x1d3))](Math['max'](this['windData']['bounds'][_0x4404b4(0x21d)],_0x15d4a7),Math[_0x4404b4(0x19a)](this['windData']['bounds']['east'],_0x40a749)),_0x110eb9=new Cesium$1['Cartesian2'](Math['max'](this['windData']['bounds']['south'],_0x2ac8ab),Math['min'](this['windData']['bounds'][_0x4404b4(0x1c8)],_0x4ff89f)),_0x137b8c=(_0x5b9fbf['y']-_0x5b9fbf['x'])*0.05,_0x585b02=(_0x110eb9['y']-_0x110eb9['x'])*0.05;_0x5b9fbf['x']=Math['max'](this['windData']['bounds']['west'],_0x5b9fbf['x']-_0x137b8c),_0x5b9fbf['y']=Math[_0x4404b4(0x19a)](this['windData']['bounds']['east'],_0x5b9fbf['y']+_0x137b8c),_0x110eb9['x']=Math[_0x4404b4(0x24f)](this['windData']['bounds']['south'],_0x110eb9['x']-_0x585b02),_0x110eb9['y']=Math[_0x4404b4(0x19a)](this['windData'][_0x4404b4(0x1b6)]['north'],_0x110eb9['y']+_0x585b02),this['viewerParameters']['lonRange']=_0x5b9fbf,this['viewerParameters']['latRange']=_0x110eb9;const _0x10a43c=this[_0x4404b4(0x207)][_0x4404b4(0x1b6)]['east']-this['windData']['bounds']['west'],_0x2a4e15=this[_0x4404b4(0x207)]['bounds']['north']-this['windData']['bounds']['south'],_0xcf42d4=(_0x5b9fbf['y']-_0x5b9fbf['x'])/_0x10a43c,_0x2ca16b=(_0x110eb9['y']-_0x110eb9['x'])/_0x2a4e15,_0x377c75=Math['min'](_0xcf42d4,_0x2ca16b),_0xd55e06=0x3e8*_0x377c75;_0xd55e06>0x0&&(this[_0x4404b4(0x228)]['pixelSize']=Math['max'](0x0,Math[_0x4404b4(0x19a)](0x3e8,_0xd55e06)));}this['viewerParameters']['sceneMode']=this['scene'][_0x4404b4(0x1af)],(_0x52a719=this['particleSystem'])===null||_0x52a719===void 0x0||_0x52a719[_0x4404b4(0x1b7)](this['viewerParameters']);}[_0x314b11(0x244)](_0x2cee8e,_0x1a947c){const _0x46bd01=_0x314b11,{bounds:_0x402192,width:_0x42e74d,height:_0x570955,u:_0x30c313,v:_0x49e515,speed:_0x3d42ce}=this['windData'],{flipY:_0x2cfc50}=this['options'];if(_0x2cee8e<_0x402192['west']||_0x2cee8e>_0x402192['east']||_0x1a947c<_0x402192['south']||_0x1a947c>_0x402192['north'])return null;const _0x2361d0=(_0x2cee8e-_0x402192['west'])/(_0x402192['east']-_0x402192['west'])*(_0x42e74d-0x1);let _0x28a953=(_0x1a947c-_0x402192['south'])/(_0x402192['north']-_0x402192['south'])*(_0x570955-0x1);_0x2cfc50&&(_0x28a953=_0x570955-0x1-_0x28a953);const _0x263a8b=Math[_0x46bd01(0x210)](_0x2361d0),_0x27edff=Math['floor'](_0x28a953),_0x3a0078=Math['floor'](_0x2361d0),_0x2ca16c=Math['min'](_0x3a0078+0x1,_0x42e74d-0x1),_0x25a2d3=Math['floor'](_0x28a953),_0x6cd64e=Math['min'](_0x25a2d3+0x1,_0x570955-0x1),_0x16c6da=_0x2361d0-_0x3a0078,_0x10f139=_0x28a953-_0x25a2d3,_0x2893a8=_0x27edff*_0x42e74d+_0x263a8b,_0x557694=_0x25a2d3*_0x42e74d+_0x3a0078,_0x33dbb6=_0x25a2d3*_0x42e74d+_0x2ca16c,_0x55f849=_0x6cd64e*_0x42e74d+_0x3a0078,_0x21f936=_0x6cd64e*_0x42e74d+_0x2ca16c,_0x2cc9f7=_0x30c313['array'][_0x557694],_0x14664c=_0x30c313['array'][_0x33dbb6],_0x2a5e31=_0x30c313['array'][_0x55f849],_0xddbb4d=_0x30c313[_0x46bd01(0x1d9)][_0x21f936],_0x180414=(0x1-_0x16c6da)*(0x1-_0x10f139)*_0x2cc9f7+_0x16c6da*(0x1-_0x10f139)*_0x14664c+(0x1-_0x16c6da)*_0x10f139*_0x2a5e31+_0x16c6da*_0x10f139*_0xddbb4d,_0x57ecef=_0x49e515[_0x46bd01(0x1d9)][_0x557694],_0x319eb7=_0x49e515['array'][_0x33dbb6],_0x40f250=_0x49e515['array'][_0x55f849],_0x42b170=_0x49e515['array'][_0x21f936],_0x4dca6b=(0x1-_0x16c6da)*(0x1-_0x10f139)*_0x57ecef+_0x16c6da*(0x1-_0x10f139)*_0x319eb7+(0x1-_0x16c6da)*_0x10f139*_0x40f250+_0x16c6da*_0x10f139*_0x42b170,_0x5191fc=Math['sqrt'](_0x180414*_0x180414+_0x4dca6b*_0x4dca6b);return{'original':{'u':_0x30c313['array'][_0x2893a8],'v':_0x49e515[_0x46bd01(0x1d9)][_0x2893a8],'speed':_0x3d42ce[_0x46bd01(0x1d9)][_0x2893a8]},'interpolated':{'u':_0x180414,'v':_0x4dca6b,'speed':_0x5191fc}};}}mars3d__namespace['LayerUtil'][_0x314b11(0x211)]('wind',WindLayer),mars3d__namespace['layer']['WindLayer']=WindLayer;class CanvasParticle{constructor(){const _0x1765ab=_0x314b11;this['lng']=null,this['lat']=null,this['tlng']=null,this['tlat']=null,this['age']=null,this[_0x1765ab(0x1fa)]=null;}[_0x314b11(0x202)](){for(const _0x470e11 in this){delete this[_0x470e11];}}}class CanvasWindField{constructor(_0x2c1853){const _0x453f66=_0x314b11;this[_0x453f66(0x227)](_0x2c1853);}get[_0x314b11(0x19c)](){return this['_speedRate'];}set['speedRate'](_0x1bdb70){const _0x2d7906=_0x314b11;this['_speedRate']=(0x64-(_0x1bdb70>0x63?0x63:_0x1bdb70))*0x64,this['_calc_speedRate']=[(this[_0x2d7906(0x24d)]-this[_0x2d7906(0x19f)])/this[_0x2d7906(0x1dd)],(this['ymax']-this['ymin'])/this[_0x2d7906(0x1dd)]];}get['maxAge'](){const _0x468f05=_0x314b11;return this[_0x468f05(0x190)];}set['maxAge'](_0x2b8156){this['_maxAge']=_0x2b8156;}[_0x314b11(0x227)](_0x209faa){const _0x38af46=_0x314b11;this['options']=_0x209faa,this['maxAge']=_0x209faa[_0x38af46(0x1b4)]||0x78,this['speedRate']=_0x209faa['speedRate']||0x32,this['particles']=[];const _0x32a194=_0x209faa[_0x38af46(0x1ac)]||0x1000;for(let _0x1ee398=0x0;_0x1ee398<_0x32a194;_0x1ee398++){const _0x48ca6f=this[_0x38af46(0x1f4)](new CanvasParticle());this[_0x38af46(0x1f6)]['push'](_0x48ca6f);}}[_0x314b11(0x1d7)](_0x4aefd1){const _0x106534=_0x314b11;this[_0x106534(0x18d)]=_0x4aefd1['rows'],this[_0x106534(0x1c4)]=_0x4aefd1['cols'],this['xmin']=_0x4aefd1[_0x106534(0x19f)],this['xmax']=_0x4aefd1[_0x106534(0x24d)],this['ymin']=_0x4aefd1['ymin'],this[_0x106534(0x19d)]=_0x4aefd1['ymax'],this['grid']=[];const _0x44121e=_0x4aefd1[_0x106534(0x18f)],_0x3228cf=_0x4aefd1['vdata'];let _0x76c6ad=![];_0x44121e[_0x106534(0x1be)]===this['rows']&&_0x44121e[0x0]['length']===this['cols']&&(_0x76c6ad=!![]);let _0x590516=0x0,_0xd5b8aa=null,_0x1b9a07=null;for(let _0x1eedef=0x0;_0x1eedef<this[_0x106534(0x18d)];_0x1eedef++){_0xd5b8aa=[];for(let _0x48d7f6=0x0;_0x48d7f6<this['cols'];_0x48d7f6++,_0x590516++){_0x76c6ad?_0x1b9a07=this[_0x106534(0x223)](_0x44121e[_0x1eedef][_0x48d7f6],_0x3228cf[_0x1eedef][_0x48d7f6]):_0x1b9a07=this[_0x106534(0x223)](_0x44121e[_0x590516],_0x3228cf[_0x590516]),_0xd5b8aa[_0x106534(0x242)](_0x1b9a07);}this[_0x106534(0x1a9)]['push'](_0xd5b8aa);}!this[_0x106534(0x1a2)]['flipY']&&this[_0x106534(0x1a9)][_0x106534(0x254)]();}['clear'](){const _0x12b2e5=_0x314b11;delete this[_0x12b2e5(0x18d)],delete this['cols'],delete this['xmin'],delete this[_0x12b2e5(0x24d)],delete this['ymin'],delete this['ymax'],delete this[_0x12b2e5(0x1a9)],delete this['particles'];}['toGridXY'](_0xd235b,_0x38c33d){const _0x3ba29c=(_0xd235b-this['xmin'])/(this['xmax']-this['xmin'])*(this['cols']-0x1),_0x5455b5=(this['ymax']-_0x38c33d)/(this['ymax']-this['ymin'])*(this['rows']-0x1);return[_0x3ba29c,_0x5455b5];}['getUVByXY'](_0xd186a2,_0x10aef4){const _0x540b5a=_0x314b11;if(_0xd186a2<0x0||_0xd186a2>=this[_0x540b5a(0x1c4)]||_0x10aef4>=this['rows'])return[0x0,0x0,0x0];const _0x317447=Math[_0x540b5a(0x210)](_0xd186a2),_0x12bbf8=Math['floor'](_0x10aef4);if(_0x317447===_0xd186a2&&_0x12bbf8===_0x10aef4)return this[_0x540b5a(0x1a9)][_0x10aef4][_0xd186a2];const _0x170da8=_0x317447+0x1,_0x18e238=_0x12bbf8+0x1,_0x26f761=this[_0x540b5a(0x19e)](_0x317447,_0x12bbf8),_0xb3ba55=this['getUVByXY'](_0x170da8,_0x12bbf8),_0x1c9bb3=this[_0x540b5a(0x19e)](_0x317447,_0x18e238),_0x330e7c=this[_0x540b5a(0x19e)](_0x170da8,_0x18e238);let _0x30c788=null;try{_0x30c788=this['_bilinearInterpolation'](_0xd186a2-_0x317447,_0x10aef4-_0x12bbf8,_0x26f761,_0xb3ba55,_0x1c9bb3,_0x330e7c);}catch(_0x6ee723){console[_0x540b5a(0x236)](_0xd186a2,_0x10aef4);}return _0x30c788;}[_0x314b11(0x1f7)](_0x592886,_0x4ef381,_0x55c5e6,_0x3e31d0,_0x53a330,_0x2c2f63){const _0x22efd6=_0x314b11,_0x44d2d8=0x1-_0x592886,_0x55aa4a=0x1-_0x4ef381,_0x868503=_0x44d2d8*_0x55aa4a,_0x38ba45=_0x592886*_0x55aa4a,_0x228de7=_0x44d2d8*_0x4ef381,_0x47c4b3=_0x592886*_0x4ef381,_0x4317a1=_0x55c5e6[0x0]*_0x868503+_0x3e31d0[0x0]*_0x38ba45+_0x53a330[0x0]*_0x228de7+_0x2c2f63[0x0]*_0x47c4b3,_0xbcbdf7=_0x55c5e6[0x1]*_0x868503+_0x3e31d0[0x1]*_0x38ba45+_0x53a330[0x1]*_0x228de7+_0x2c2f63[0x1]*_0x47c4b3;return this[_0x22efd6(0x223)](_0x4317a1,_0xbcbdf7);}['_calcUV'](_0x4faedb,_0x367843){return[+_0x4faedb,+_0x367843,Math['sqrt'](_0x4faedb*_0x4faedb+_0x367843*_0x367843)];}['getUVByPoint'](_0x3a0cbc,_0x54aac4){if(!this['isInExtent'](_0x3a0cbc,_0x54aac4))return null;const _0x2a0c8b=this['toGridXY'](_0x3a0cbc,_0x54aac4),_0x2a57d0=this['getUVByXY'](_0x2a0c8b[0x0],_0x2a0c8b[0x1]);return _0x2a57d0;}['isInExtent'](_0x91dafd,_0x2ffecb){const _0x4070ba=_0x314b11;return _0x91dafd>=this['xmin']&&_0x91dafd<=this[_0x4070ba(0x24d)]&&_0x2ffecb>=this[_0x4070ba(0x1ff)]&&_0x2ffecb<=this['ymax']?!![]:![];}['getRandomLatLng'](){const _0x1868b3=_0x314b11,_0x29f032=fRandomByfloat(this[_0x1868b3(0x19f)],this[_0x1868b3(0x24d)]),_0x15fb00=fRandomByfloat(this[_0x1868b3(0x1ff)],this['ymax']);return{'lat':_0x15fb00,'lng':_0x29f032};}['getParticles'](){const _0x16c488=_0x314b11;let _0x50eb63,_0x4284c3,_0xfff358;for(let _0xb9f2a4=0x0,_0x4cd5ef=this['particles'][_0x16c488(0x1be)];_0xb9f2a4<_0x4cd5ef;_0xb9f2a4++){let _0x1bbf9d=this['particles'][_0xb9f2a4];_0x1bbf9d[_0x16c488(0x20b)]<=0x0&&(_0x1bbf9d=this['_randomParticle'](_0x1bbf9d));if(_0x1bbf9d['age']>0x0){const _0xbe234b=_0x1bbf9d['tlng'],_0x1d9036=_0x1bbf9d[_0x16c488(0x1e8)];_0xfff358=this['getUVByPoint'](_0xbe234b,_0x1d9036),_0xfff358?(_0x50eb63=_0xbe234b+this['_calc_speedRate'][0x0]*_0xfff358[0x0],_0x4284c3=_0x1d9036+this['_calc_speedRate'][0x1]*_0xfff358[0x1],_0x1bbf9d['lng']=_0xbe234b,_0x1bbf9d['lat']=_0x1d9036,_0x1bbf9d[_0x16c488(0x18a)]=_0x50eb63,_0x1bbf9d['tlat']=_0x4284c3,_0x1bbf9d['speed']=_0xfff358[0x2],_0x1bbf9d['age']--):_0x1bbf9d['age']=0x0;}}return this['particles'];}['_randomParticle'](_0x39e911){const _0x112e8b=_0x314b11;let _0x37b6de,_0x49839b;for(let _0x95062d=0x0;_0x95062d<0x1e;_0x95062d++){_0x37b6de=this['getRandomLatLng'](),_0x49839b=this['getUVByPoint'](_0x37b6de[_0x112e8b(0x1b5)],_0x37b6de['lat']);if(_0x49839b&&_0x49839b[0x2]>0x0)break;}if(!_0x49839b)return _0x39e911;const _0xa552bd=_0x37b6de['lng']+this['_calc_speedRate'][0x0]*_0x49839b[0x0],_0x2c3ae0=_0x37b6de['lat']+this['_calc_speedRate'][0x1]*_0x49839b[0x1];return _0x39e911[_0x112e8b(0x1b5)]=_0x37b6de['lng'],_0x39e911['lat']=_0x37b6de[_0x112e8b(0x1e7)],_0x39e911[_0x112e8b(0x18a)]=_0xa552bd,_0x39e911['tlat']=_0x2c3ae0,_0x39e911['age']=Math['round'](0xa+Math['random']()*this['maxAge']),_0x39e911['speed']=_0x49839b[0x2],_0x39e911;}['destroy'](){for(const _0x2a1f92 in this){delete this[_0x2a1f92];}}}function fRandomByfloat(_0x11a0fb,_0x194054){return _0x11a0fb+Math['random']()*(_0x194054-_0x11a0fb);}const Cesium=mars3d__namespace[_0x314b11(0x218)],BaseLayer=mars3d__namespace[_0x314b11(0x23f)][_0x314b11(0x259)];class CanvasWindLayer extends BaseLayer{constructor(_0x296fd2={}){const _0x2360fe=_0x314b11;super(_0x296fd2),this['_setOptionsHook'](_0x296fd2),this['canvas']=null,_0x296fd2[_0x2360fe(0x22c)]&&_0x296fd2['steps']&&(this[_0x2360fe(0x24c)]=new mars3d__namespace[(_0x2360fe(0x241))](_0x296fd2));}['_setOptionsHook'](_0xe685b4,_0x2c9b03){const _0x55f9aa=_0x314b11;this[_0x55f9aa(0x239)]=0x3e8/(_0xe685b4['frameRate']||0xa),this['_pointerEvents']=this['options'][_0x55f9aa(0x252)]??![],this[_0x55f9aa(0x188)]=_0xe685b4[_0x55f9aa(0x188)]||'#ffffff',this[_0x55f9aa(0x1cc)]=_0xe685b4['lineWidth']||0x1,this[_0x55f9aa(0x229)]=_0xe685b4['fixedHeight']??0x0,this[_0x55f9aa(0x212)]=_0xe685b4['flipY']??![],this['windField']&&this['windField']['setOptions'](_0xe685b4);}get['layer'](){const _0x4ef987=_0x314b11;return this[_0x4ef987(0x1a5)];}get[_0x314b11(0x1ce)](){const _0x25dec5=_0x314b11;return this[_0x25dec5(0x251)]['scene']['canvas'][_0x25dec5(0x18c)];}get['canvasHeight'](){const _0x21a276=_0x314b11;return this['_map'][_0x21a276(0x21f)]['canvas']['clientHeight'];}get['pointerEvents'](){const _0xe13e20=_0x314b11;return this[_0xe13e20(0x216)];}set[_0x314b11(0x252)](_0x1ecfaa){const _0x4ac5c7=_0x314b11;this['_pointerEvents']=_0x1ecfaa;if(!this['canvas'])return;_0x1ecfaa?this[_0x4ac5c7(0x1a5)]['style']['pointer-events']='all':this[_0x4ac5c7(0x1a5)][_0x4ac5c7(0x191)][_0x4ac5c7(0x1fd)]='none';}get['particlesNumber'](){return this['options']['particlesNumber'];}set[_0x314b11(0x1ac)](_0x2ddb36){const _0x24bc84=_0x314b11;this['options']['particlesNumber']=_0x2ddb36,clearTimeout(this[_0x24bc84(0x213)]),this['_canrefresh']=setTimeout(()=>{const _0x3e1ee5=_0x24bc84;this[_0x3e1ee5(0x1a8)]();},0x1f4);}get[_0x314b11(0x19c)](){return this['options']['speedRate'];}set[_0x314b11(0x19c)](_0x5e64c2){const _0x37483c=_0x314b11;this['options'][_0x37483c(0x19c)]=_0x5e64c2,this['windField']&&(this[_0x37483c(0x1ab)]['speedRate']=_0x5e64c2);}get['maxAge'](){const _0x25dc8f=_0x314b11;return this['options'][_0x25dc8f(0x1b4)];}set['maxAge'](_0x1fbde3){const _0x4c38fe=_0x314b11;this['options']['maxAge']=_0x1fbde3,this[_0x4c38fe(0x1ab)]&&(this[_0x4c38fe(0x1ab)]['maxAge']=_0x1fbde3);}get['data'](){return this['windData'];}set['data'](_0x46fa50){this['setData'](_0x46fa50);}get['rectangle'](){const _0x26cca8=_0x314b11;let _0x2fc2fa=this['windData'][_0x26cca8(0x19f)],_0x43ccd9=this['windData']['xmax'],_0x2d76b2=this['windData']['ymin'],_0x58eab2=this['windData']['ymax'];return _0x43ccd9>=0x167&&_0x2fc2fa===0x0&&(_0x2fc2fa=-0xb4,_0x43ccd9=0xb4),_0x2fc2fa=Math['max'](_0x2fc2fa,-0xb4),_0x43ccd9=Math['min'](_0x43ccd9,0xb4),_0x2d76b2=Math[_0x26cca8(0x24f)](_0x2d76b2,-0x5a),_0x58eab2=Math[_0x26cca8(0x19a)](_0x58eab2,0x5a),Cesium['Rectangle']['fromDegrees'](_0x2fc2fa,_0x2d76b2,_0x43ccd9,_0x58eab2);}['_showHook'](_0x3609ff){const _0x336cd3=_0x314b11;_0x3609ff?this[_0x336cd3(0x1e9)]():(this['windData']&&(this[_0x336cd3(0x1a2)]['data']=this['windData']),this['_removedHook']());}[_0x314b11(0x255)](){this['options']['worker']?this['initWorker']():this['windField']=new CanvasWindField(this['options']);}[_0x314b11(0x1e9)](){const _0x494dc8=_0x314b11;this['canvas']=this['_createCanvas'](),this['canvasContext']=this['canvas']['getContext']('2d',{'willReadFrequently':!![]}),this['bindEvent'](),this[_0x494dc8(0x1a2)]['data']&&this['setData'](this['options']['data']);}['_removedHook'](){const _0x5812eb=_0x314b11;this['clear'](),this['unbindEvent'](),this['canvas']&&(this[_0x5812eb(0x251)]['container']['removeChild'](this['canvas']),delete this['canvas']);}[_0x314b11(0x214)](){const _0x18ce18=_0x314b11,_0x4472c2=mars3d__namespace['DomUtil']['create']('canvas','mars3d-canvasWind',this[_0x18ce18(0x251)][_0x18ce18(0x1a4)]);return _0x4472c2[_0x18ce18(0x191)]['position']=_0x18ce18(0x18b),_0x4472c2['style']['top']='0px',_0x4472c2['style']['left']='0px',_0x4472c2[_0x18ce18(0x191)]['width']=this['_map']['scene']['canvas']['clientWidth']+'px',_0x4472c2['style']['height']=this['_map']['scene'][_0x18ce18(0x1a5)]['clientHeight']+'px',_0x4472c2['style']['pointerEvents']=this['_pointerEvents']?'auto':_0x18ce18(0x204),_0x4472c2['style']['zIndex']=this[_0x18ce18(0x1a2)]['zIndex']??0x9,_0x4472c2['width']=this['_map']['scene']['canvas']['clientWidth'],_0x4472c2[_0x18ce18(0x1d4)]=this[_0x18ce18(0x251)]['scene']['canvas'][_0x18ce18(0x247)],_0x4472c2;}['resize'](){const _0x36f012=_0x314b11;this['canvas']&&(this[_0x36f012(0x1a5)]['style']['width']=this[_0x36f012(0x251)]['scene']['canvas']['clientWidth']+'px',this[_0x36f012(0x1a5)]['style']['height']=this['_map']['scene'][_0x36f012(0x1a5)][_0x36f012(0x247)]+'px',this['canvas']['width']=this[_0x36f012(0x251)][_0x36f012(0x21f)]['canvas'][_0x36f012(0x18c)],this['canvas']['height']=this['_map']['scene']['canvas']['clientHeight']);}['bindEvent'](){const _0x54a5d3=_0x314b11,_0x334bd5=this;let _0x233237=Date[_0x54a5d3(0x23d)]();(function _0x58e4dc(){const _0x480be1=_0x54a5d3;if(_0x334bd5[_0x480be1(0x222)])return;_0x334bd5['_animateFrame']=window['requestAnimationFrame'](_0x58e4dc);if(_0x334bd5[_0x480be1(0x1ad)]&&_0x334bd5['windField']){const _0x5a3c16=Date['now'](),_0x59e2c4=_0x5a3c16-_0x233237;_0x59e2c4>_0x334bd5['frameTime']&&(_0x233237=_0x5a3c16-_0x59e2c4%_0x334bd5[_0x480be1(0x239)],_0x334bd5['update']());}}(),window['addEventListener']('resize',this[_0x54a5d3(0x1cf)][_0x54a5d3(0x249)](this),![]),this['mouse_down']=![],this[_0x54a5d3(0x1e3)]=![],this['options']['mouseHidden']&&(this['_map']['on'](mars3d__namespace['EventType']['wheel'],this[_0x54a5d3(0x187)],this),this['_map']['on'](mars3d__namespace['EventType']['mouseDown'],this['_onMouseDownEvent'],this),this['_map']['on'](mars3d__namespace['EventType']['mouseUp'],this[_0x54a5d3(0x1bf)],this)));}[_0x314b11(0x245)](){const _0x1ae861=_0x314b11;window['cancelAnimationFrame'](this['_animateFrame']),delete this['_animateFrame'],window['removeEventListener']('resize',this['resize']),this['options']['mouseHidden']&&(this[_0x1ae861(0x251)][_0x1ae861(0x1f3)](mars3d__namespace['EventType']['wheel'],this['_onMapWhellEvent'],this),this[_0x1ae861(0x251)]['off'](mars3d__namespace['EventType']['mouseDown'],this['_onMouseDownEvent'],this),this['_map']['off'](mars3d__namespace['EventType']['mouseUp'],this['_onMouseUpEvent'],this),this['_map'][_0x1ae861(0x1f3)](mars3d__namespace['EventType']['mouseMove'],this[_0x1ae861(0x25b)],this));}['_onMapWhellEvent'](_0x2d17bc){const _0x53e059=_0x314b11;clearTimeout(this['refreshTimer']);if(!this['show']||!this[_0x53e059(0x1a5)])return;this[_0x53e059(0x1a5)]['style']['visibility']='hidden',this[_0x53e059(0x200)]=setTimeout(()=>{if(!this['show'])return;this['redraw'](),this['canvas']['style']['visibility']='visible';},0xc8);}[_0x314b11(0x1ec)](_0x4308ef){const _0xd79d30=_0x314b11;this['mouse_down']=!![],this[_0xd79d30(0x251)]['off'](mars3d__namespace[_0xd79d30(0x1c9)][_0xd79d30(0x1c6)],this['_onMouseMoveEvent'],this),this['_map']['on'](mars3d__namespace['EventType'][_0xd79d30(0x1c6)],this['_onMouseMoveEvent'],this);}['_onMouseMoveEvent'](_0x446684){const _0x31479d=_0x314b11;if(!this['show']||!this['canvas'])return;this['mouse_down']&&(this['canvas']['style'][_0x31479d(0x253)]='hidden',this['mouse_move']=!![]);}['_onMouseUpEvent'](_0x34e2d1){const _0x3aa97d=_0x314b11;if(!this['show']||!this['canvas'])return;this['_map']['off'](mars3d__namespace[_0x3aa97d(0x1c9)]['mouseMove'],this[_0x3aa97d(0x25b)],this),this[_0x3aa97d(0x1eb)]&&this[_0x3aa97d(0x1e3)]&&this['redraw'](),this['canvas']['style']['visibility']='visible',this['mouse_down']=![],this[_0x3aa97d(0x1e3)]=![];}['setData'](_0xc58a53){const _0x1e00b8=_0x314b11;this[_0x1e00b8(0x22f)](),this['windData']=_0xc58a53,this['windField']['setDate'](_0xc58a53),this['redraw']();}['redraw'](){if(!this['show'])return;this['windField']['setOptions'](this['options']),this['update']();}['update'](){const _0x4fd5c2=_0x314b11;if(this[_0x4fd5c2(0x1db)])return;this['_updateIng']=!![];if(this['worker'])this['windField']['update']();else{const _0x3ea016=this[_0x4fd5c2(0x1ab)]['getParticles']();this['_drawLines'](_0x3ea016);}this['_updateIng']=![];}['_drawLines'](_0x175c36){const _0x494a1e=_0x314b11;this['_canvasParticles']=_0x175c36,this[_0x494a1e(0x225)]['globalCompositeOperation']='destination-in',this['canvasContext']['fillRect'](0x0,0x0,this['canvasWidth'],this['canvasHeight']),this[_0x494a1e(0x225)]['globalCompositeOperation']=_0x494a1e(0x237),this['canvasContext']['globalAlpha']=0.9;const _0x10e94d=this['_map'][_0x494a1e(0x21f)]['mode']!==Cesium[_0x494a1e(0x221)][_0x494a1e(0x24b)],_0x149f2d=this[_0x494a1e(0x1ce)]*0.25;if(this['_colorRamp'])for(let _0x2678cb=0x0,_0x2324a4=_0x175c36[_0x494a1e(0x1be)];_0x2678cb<_0x2324a4;_0x2678cb++){const _0x3d0fc7=_0x175c36[_0x2678cb],_0x20fdb0=this['_tomap'](_0x3d0fc7,_0x3d0fc7['lng'],_0x3d0fc7['lat'],_0x3d0fc7[_0x494a1e(0x1d6)]),_0x5ba8a8=this['_tomap'](_0x3d0fc7,_0x3d0fc7['tlng'],_0x3d0fc7['tlat'],_0x3d0fc7['talt']);if(!_0x20fdb0||!_0x5ba8a8)continue;if(_0x10e94d&&Math['abs'](_0x20fdb0[0x0]-_0x5ba8a8[0x0])>=_0x149f2d)continue;this['canvasContext']['beginPath'](),this['canvasContext']['lineWidth']=this[_0x494a1e(0x1cc)],this[_0x494a1e(0x225)][_0x494a1e(0x20a)]=this[_0x494a1e(0x24c)]['getColor'](_0x3d0fc7['speed']),this[_0x494a1e(0x225)][_0x494a1e(0x1e0)](_0x20fdb0[0x0],_0x20fdb0[0x1]),this[_0x494a1e(0x225)]['lineTo'](_0x5ba8a8[0x0],_0x5ba8a8[0x1]),this['canvasContext']['stroke']();}else{this[_0x494a1e(0x225)][_0x494a1e(0x217)](),this[_0x494a1e(0x225)]['lineWidth']=this['lineWidth'],this['canvasContext']['strokeStyle']=this['color'];for(let _0x2a7b5b=0x0,_0x170857=_0x175c36['length'];_0x2a7b5b<_0x170857;_0x2a7b5b++){const _0x14022c=_0x175c36[_0x2a7b5b],_0xb0565b=this['_tomap'](_0x14022c,_0x14022c['lng'],_0x14022c['lat'],_0x14022c[_0x494a1e(0x1d6)]),_0x2ca9aa=this['_tomap'](_0x14022c,_0x14022c['tlng'],_0x14022c[_0x494a1e(0x1e8)],_0x14022c[_0x494a1e(0x1f9)]);if(!_0xb0565b||!_0x2ca9aa)continue;if(_0x10e94d&&Math['abs'](_0xb0565b[0x0]-_0x2ca9aa[0x0])>=_0x149f2d)continue;this['canvasContext'][_0x494a1e(0x1e0)](_0xb0565b[0x0],_0xb0565b[0x1]),this[_0x494a1e(0x225)][_0x494a1e(0x1e5)](_0x2ca9aa[0x0],_0x2ca9aa[0x1]);}this['canvasContext']['stroke']();}}['_tomap'](_0x1e5810,_0x59ae08,_0x4beefd,_0x1fdfb5){const _0x548f27=_0x314b11,_0x429fe7=Cesium[_0x548f27(0x220)][_0x548f27(0x1e6)](_0x59ae08,_0x4beefd,_0x1fdfb5??this['fixedHeight']),_0xc2868c=this['_map'][_0x548f27(0x21f)];if(_0xc2868c['mode']===Cesium[_0x548f27(0x221)]['SCENE3D']){const _0x2f02c8=new Cesium[(_0x548f27(0x1f2))](_0xc2868c[_0x548f27(0x189)][_0x548f27(0x238)],_0xc2868c['camera']['positionWC']),_0x56a91f=_0x2f02c8['isPointVisible'](_0x429fe7);if(!_0x56a91f)return _0x1e5810[_0x548f27(0x20b)]=0x0,null;}const _0x5dbf4d=mars3d__namespace[_0x548f27(0x18e)]['toWindowCoordinates'](this['_map'][_0x548f27(0x21f)],_0x429fe7);return _0x5dbf4d?[_0x5dbf4d['x'],_0x5dbf4d['y']]:null;}[_0x314b11(0x22f)](){const _0x1dc2c8=_0x314b11;this['windField'][_0x1dc2c8(0x22f)](),delete this['windData'];}['initWorker'](){const _0xcf8f5a=_0x314b11;this['worker']=new Worker(this['options']['worker']),this['worker']['onmessage']=_0x21e091=>{const _0x4edc4f=_0x5546;this['_drawLines'](_0x21e091[_0x4edc4f(0x193)]['particles']),this[_0x4edc4f(0x240)]=![];},this['windField']={'init':_0x46053c=>{const _0x4139b5=_0x5546;this['worker']['postMessage']({'type':_0x4139b5(0x235),'options':_0x46053c});},'setOptions':_0xf37414=>{const _0x4d3e50=_0x5546;this[_0x4d3e50(0x21b)]['postMessage']({'type':_0x4d3e50(0x227),'options':_0xf37414});},'setDate':_0x390afe=>{const _0x32ed58=_0x5546;this['worker']['postMessage']({'type':_0x32ed58(0x1d7),'data':_0x390afe});},'update':()=>{if(this['_updateIng2'])return;this['_updateIng2']=!![],this['worker']['postMessage']({'type':'update'});},'clear':()=>{this['worker']['postMessage']({'type':'clear'});}},this[_0xcf8f5a(0x1ab)]['init'](this['options']);}}mars3d__namespace['LayerUtil']['register'](_0x314b11(0x194),CanvasWindLayer),mars3d__namespace['layer'][_0x314b11(0x1b9)]=CanvasWindLayer,mars3d__namespace['CanvasWindField']=CanvasWindField,mars3d__namespace['Log']['logInfo']('mars3d-wind插件\x20注册成功'),mars3d__namespace[_0x314b11(0x224)]=WindUtil,exports['CanvasWindField']=CanvasWindField,exports[_0x314b11(0x1b9)]=CanvasWindLayer,exports['WindLayer']=WindLayer,exports['WindUtil']=WindUtil,Object['defineProperty'](exports,'__esModule',{'value':!![]});
}));
