mars3d-heatmap
Advanced tools
Comparing version 3.6.0 to 3.6.1
/** | ||
* Mars3D平台插件,结合heatmap可视化功能插件 mars3d-heatmap | ||
* | ||
* 版本信息:v3.6.0 | ||
* 编译日期:2023-08-04 12:18:40 | ||
* 版本信息:v3.6.1 | ||
* 编译日期:2023-08-14 21:28:22 | ||
* 版权所有:Copyright by 火星科技 http://mars3d.cn | ||
@@ -14,3 +14,3 @@ * 使用单位:免费公开版 ,2023-03-17 | ||
})(this, (function (exports, mars3d, h337) { | ||
'use strict';const _0x169532=_0x4443;(function(_0x236169,_0x3aff11){const _0x1a3e8d={_0x505495:0xeb,_0x33a292:0x120,_0x36ba90:0x101,_0xb4976c:0x134,_0x53faf1:0xee,_0x10ba32:0x117,_0x52a1f1:0xfb},_0x1d6dbc=_0x4443,_0x51ee72=_0x236169();while(!![]){try{const _0x4883ac=-parseInt(_0x1d6dbc(_0x1a3e8d._0x505495))/0x1*(parseInt(_0x1d6dbc(0xf2))/0x2)+-parseInt(_0x1d6dbc(_0x1a3e8d._0x33a292))/0x3*(-parseInt(_0x1d6dbc(_0x1a3e8d._0x36ba90))/0x4)+parseInt(_0x1d6dbc(_0x1a3e8d._0xb4976c))/0x5*(-parseInt(_0x1d6dbc(0x12c))/0x6)+parseInt(_0x1d6dbc(0x123))/0x7*(parseInt(_0x1d6dbc(_0x1a3e8d._0x53faf1))/0x8)+-parseInt(_0x1d6dbc(_0x1a3e8d._0x10ba32))/0x9+parseInt(_0x1d6dbc(_0x1a3e8d._0x52a1f1))/0xa+-parseInt(_0x1d6dbc(0xf5))/0xb;if(_0x4883ac===_0x3aff11)break;else _0x51ee72['push'](_0x51ee72['shift']());}catch(_0x27c675){_0x51ee72['push'](_0x51ee72['shift']());}}}(_0x4cd4,0xd2df1));function _0x4cd4(){const _0x199796=['4593UiemnQ','max','style','800XvGeGF','_layer','options','minCanvasSize','170CAOkGq','rgb(0,0,0)','xmin','789910LGJPHu','diffHeight','_graphic','addGraphic','LayerUtil','min','8242730Qtckqy','positions','canvas','_heat','_graphic2','body','870380PNSzoT','BlendingState','rgb(216,216,216)','getRectangle','forEach','RenderState','clear','_createGraphic','lng','mercator2lonlat','PointTrans','ymin','LngLatPoint','lonlat2mercator','StencilOperation','heatStyle','_mountedHook','floor','RectanglePrimitive','PolyUtil','_scale','fromDegrees','3501630tyAIPR','Cesium','rgb(255,255,255)','_renderer','cssText','maxCanvasSize','__esModule','image','_getHeatCanvas','6RMCZgS','formatRectangle','remove','84091xfnbca','graphic','show','StencilFunction','_setOptionsHook','create','bumpMap','isFormat','ALWAYS','2214GyAVYK','_mBoundsMax','toDataURL','copyCanvas','configure','default','getValueAt','type','10105msJGJq','_positions','_rectangle','uniforms','round','heat','EllipsoidSurfaceAppearance','value','lat','px;','ymax','KEEP','length','push'];_0x4cd4=function(){return _0x199796;};return _0x4cd4();}function _interopNamespace(_0x3da217){const _0x3c95c6={_0x4886c4:0x131},_0x20134c={_0x450270:0x131},_0x29792b=_0x4443;if(_0x3da217&&_0x3da217['__esModule'])return _0x3da217;var _0x17d9b2=Object['create'](null);return _0x3da217&&Object['keys'](_0x3da217)['forEach'](function(_0x2bcae6){const _0x11e06d=_0x4443;if(_0x2bcae6!==_0x11e06d(_0x20134c._0x450270)){var _0x154662=Object['getOwnPropertyDescriptor'](_0x3da217,_0x2bcae6);Object['defineProperty'](_0x17d9b2,_0x2bcae6,_0x154662['get']?_0x154662:{'enumerable':!![],'get':function(){return _0x3da217[_0x2bcae6];}});}}),_0x17d9b2[_0x29792b(_0x3c95c6._0x4886c4)]=_0x3da217,_0x17d9b2;}var mars3d__namespace=_interopNamespace(mars3d),h337__namespace=_interopNamespace(h337),HeatMaterial='uniform\x20sampler2D\x20image;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20vec4\x20colorImage\x20=\x20texture(image,\x20st);\x0a\x20\x20if(colorImage.rgb\x20==\x20vec3(1.0)\x20||\x20colorImage.rgb\x20==\x20vec3(0.0))\x20{\x0a\x20\x20\x20\x20discard;\x0a\x20\x20}\x0a\x20\x20material.diffuse\x20=\x20colorImage.rgb;\x0a\x20\x20material.alpha\x20=\x20colorImage.a;\x0a\x20\x20return\x20material;\x0a}\x0a';if(!h337__namespace['create'])throw new Error('请引入\x20heatmap.js\x20库\x20');const Cesium=mars3d__namespace[_0x169532(0x118)],BaseLayer=mars3d__namespace['layer']['BaseLayer'],DEF_HEATSTYLE={'maxOpacity':0.8,'minOpacity':0.1,'blur':0.85,'radius':0x19,'gradient':{0.4:'blue',0.6:'green',0.8:'yellow',0.9:'red'}},DEF_STYLE={'arcRadiusScale':1.5,'arcBlurScale':1.5,'vertexFormat':Cesium['EllipsoidSurfaceAppearance']['VERTEX_FORMAT']};class HeatLayer extends BaseLayer{constructor(_0x2923ea={}){const _0x5a3aef={_0x32cdb1:0xf0,_0x262789:0x110,_0x4f9a42:0xf0},_0x392d8e=_0x169532;super(_0x2923ea),this[_0x392d8e(0xf0)]['maxCanvasSize']=this[_0x392d8e(_0x5a3aef._0x32cdb1)]['maxCanvasSize']??document[_0x392d8e(0x100)]['clientWidth'],this['options']['maxCanvasSize']=Math['min'](this['options']['maxCanvasSize'],0x1388),this[_0x392d8e(0xf0)]['minCanvasSize']=this['options'][_0x392d8e(0xf1)]??document['body']['clientHeight'],this['options']['minCanvasSize']=Math['max'](this['options']['minCanvasSize'],0x2bc),this['options'][_0x392d8e(_0x5a3aef._0x262789)]={...DEF_HEATSTYLE,...this[_0x392d8e(_0x5a3aef._0x4f9a42)]['heatStyle']},this['options']['style']={...DEF_STYLE,...this[_0x392d8e(0xf0)]['style']};}get['layer'](){return this['_layer'];}get['heatStyle'](){return this['options']['heatStyle'];}set['heatStyle'](_0x3bc5f5){const _0x1419fc={_0x5e71b9:0x110},_0x1d01dd=_0x169532;this[_0x1d01dd(0xf0)]['heatStyle']=mars3d__namespace['Util']['merge'](this['options']['heatStyle'],_0x3bc5f5),this['_heat']&&(this['_heat']['configure'](this['options'][_0x1d01dd(_0x1419fc._0x5e71b9)]),this['_updatePositionsHook'](!![]));}get['style'](){const _0x3dd41b=_0x169532;return this[_0x3dd41b(0xf0)]['style'];}set['style'](_0x5de1c2){this['options']['style']=mars3d__namespace['Util']['merge'](this['options']['style'],_0x5de1c2);}get['positions'](){return this['_positions'];}set[_0x169532(0xfc)](_0x37bfa3){this['setPositions'](_0x37bfa3);}get['coordinates'](){const _0x326ce5=_0x169532,_0x34865b=[];return this['points'][_0x326ce5(0x105)](_0x26408e=>{const _0x51a149=_0x326ce5;_0x34865b[_0x51a149(0xea)](_0x26408e['toArray']());}),_0x34865b;}get['rectangle'](){const _0x2ec73e=_0x169532;return this[_0x2ec73e(0x136)];}[_0x169532(0x127)](_0x983feb,_0x5ddcc2){const _0x208b95=_0x169532;_0x983feb['positions']&&(this['positions']=_0x983feb[_0x208b95(0xfc)]);}[_0x169532(0x111)](){const _0x2a43df=_0x169532;this['style']['type']===_0x2a43df(0x11e)?this['_layer']=new mars3d__namespace['layer']['ImageLayer']({'crs':'EPSG:3857','private':!![]}):this['_layer']=new mars3d__namespace['layer']['GraphicLayer']({'private':!![]});}['_addedHook'](){const _0xb36ea5={_0x457bd0:0xfc,_0x52b234:0xf0},_0x29d06e=_0x169532;this['_map']['addLayer'](this['_layer']),this['_container']=mars3d__namespace['DomUtil'][_0x29d06e(0x128)]('div','mars3d-heatmap\x20mars3d-hideDiv',this['_map']['container']),this[_0x29d06e(0xf0)][_0x29d06e(_0xb36ea5._0x457bd0)]&&(this['positions']=this[_0x29d06e(_0xb36ea5._0x52b234)]['positions']),this[_0x29d06e(_0xb36ea5._0x52b234)]['flyTo']&&this['flyToByAnimationEnd']();}['_removedHook'](){const _0x4ddb5d=_0x169532;this['_container']&&(mars3d__namespace['DomUtil'][_0x4ddb5d(0x122)](this['_container']),delete this['_container']),this[_0x4ddb5d(0x107)](),this['_map']['removeLayer'](this['_layer']);}['addPosition'](_0x462a4b,_0x9a0191){const _0x2be8b9={_0x4227cc:0x135},_0x7273a9=_0x169532;this[_0x7273a9(_0x2be8b9._0x4227cc)]=this['_positions']||[],this['_positions']['push'](_0x462a4b),this['_updatePositionsHook'](_0x9a0191);}['setPositions'](_0x32cd49,_0x3fee65){this['_positions']=_0x32cd49,this['_updatePositionsHook'](_0x3fee65);}['clear'](){const _0x41b338={_0x40610f:0xf7},_0xf3c998=_0x169532;this[_0xf3c998(0xf7)]&&(this['_layer']['removeGraphic'](this[_0xf3c998(_0x41b338._0x40610f)],!![]),delete this['_graphic']),this['_graphic2']&&(this['_layer']['removeGraphic'](this['_graphic2'],!![]),delete this['_graphic2']);}['_updatePositionsHook'](_0x278693){const _0x458633={_0x1ce24c:0xfc,_0x42f73e:0xe9,_0x380078:0x133,_0x1c3821:0x11e,_0x37a834:0x12e,_0xdbbf45:0x129,_0x3a08ec:0xf7},_0x42c4ab=_0x169532;if(!this[_0x42c4ab(0x125)]||!this['_map']||!this['positions']||this[_0x42c4ab(_0x458633._0x1ce24c)][_0x42c4ab(_0x458633._0x42f73e)]===0x0)return this;const _0x3b0242=this[_0x42c4ab(0x11f)]();if(this[_0x42c4ab(0xed)][_0x42c4ab(_0x458633._0x380078)]===_0x42c4ab(_0x458633._0x1c3821))this['_layer']['setOptions']({'url':_0x3b0242[_0x42c4ab(_0x458633._0x37a834)]('image/png'),'rectangle':this['_rectangle'],'opacity':this['style']['opacity']});else this['style']['arc']?this['_graphic']&&_0x278693?(this['_graphic']['uniforms']['image']=_0x3b0242,this[_0x42c4ab(0xf7)]['uniforms']['bumpMap']=this['_getArcHeatCanvas'](),this['_graphic2']&&(this['_graphic2']['uniforms']['image']=_0x3b0242,this['_graphic2']['uniforms'][_0x42c4ab(_0x458633._0xdbbf45)]=this['_graphic'][_0x42c4ab(0x137)]['bumpMap'])):this['_createArcGraphic'](_0x3b0242):this[_0x42c4ab(_0x458633._0x3a08ec)]&&_0x278693?this[_0x42c4ab(0xf7)]['uniforms']['image']=_0x3b0242:this[_0x42c4ab(0x108)](_0x3b0242);return this;}['_createGraphic'](_0x4fc9b4){const _0x339f7c={_0x3ab513:0xf7},_0x2ca7e9=_0x169532;this['clear'](),this[_0x2ca7e9(_0x339f7c._0x3ab513)]=new mars3d__namespace['graphic']['RectanglePrimitive']({...this['options'],'rectangle':this['_rectangle'],'appearance':new Cesium['EllipsoidSurfaceAppearance']({'material':new Cesium['Material']({'fabric':{'uniforms':{'image':_0x4fc9b4},'source':HeatMaterial},'translucent':!![]}),'flat':!![]})}),this[_0x2ca7e9(0xef)][_0x2ca7e9(0xf8)](this[_0x2ca7e9(0xf7)]);}['_createArcGraphic'](_0x3073c1){const _0x1cf604={_0x25cf1f:0x107,_0x2202a6:0x126,_0x649f04:0x12b,_0x3c139f:0xe8,_0xa6c605:0x102,_0x5efea8:0x112,_0x31aa98:0x136,_0x49befb:0xf0,_0x54c2b1:0x113,_0x52ce65:0xe3,_0x275fe7:0xff},_0x2ac55a=_0x169532;this[_0x2ac55a(_0x1cf604._0x25cf1f)]();const _0x51e87a=Cesium[_0x2ac55a(0x106)]['fromCache']({'cull':{'enabled':!![]},'depthTest':{'enabled':!![]},'stencilTest':{'enabled':!![],'frontFunction':Cesium[_0x2ac55a(_0x1cf604._0x2202a6)][_0x2ac55a(_0x1cf604._0x649f04)],'frontOperation':{'fail':Cesium['StencilOperation']['KEEP'],'zFail':Cesium['StencilOperation'][_0x2ac55a(_0x1cf604._0x3c139f)],'zPass':Cesium[_0x2ac55a(0x10f)]['REPLACE']},'backFunction':Cesium['StencilFunction']['ALWAYS'],'backOperation':{'fail':Cesium[_0x2ac55a(0x10f)][_0x2ac55a(0xe8)],'zFail':Cesium['StencilOperation']['KEEP'],'zPass':Cesium[_0x2ac55a(0x10f)]['REPLACE']},'reference':0x2,'mask':0x2},'blending':Cesium[_0x2ac55a(_0x1cf604._0xa6c605)]['ALPHA_BLEND']}),_0x2ced6f=Math[_0x2ac55a(_0x1cf604._0x5efea8)](this[_0x2ac55a(0xed)][_0x2ac55a(0xf6)]??this['_mBoundsMax']*0.02)+0.1;this['style']['diffHeight']&&delete this['style']['diffHeight'];const _0x2eb602=(this['style']['splitNum'],0x64);let _0x3432d3=Math['max'](this[_0x2ac55a(0x136)]['height'],this[_0x2ac55a(_0x1cf604._0x31aa98)]['width']);this['style']['granularity']=_0x3432d3/=_0x2eb602;const _0x1fc5e1=new Cesium['Material']({'fabric':{'uniforms':{'image':_0x3073c1,'repeat':new Cesium['Cartesian2'](0x1,0x1),'color':new Cesium['Color'](0x1,0x1,0x1,0x0),'bumpMap':this['_getArcHeatCanvas']()},'source':HeatMaterial},'translucent':!![]}),_0x7f3dda=this['style']['arcDirection']||0x1;this['_graphic']=new mars3d__namespace[(_0x2ac55a(0x124))]['RectanglePrimitive']({...this[_0x2ac55a(_0x1cf604._0x49befb)],'rectangle':this['_rectangle'],'appearance':new Cesium[(_0x2ac55a(0xe3))]({'flat':!![],'aboveGround':!![],'renderState':_0x51e87a,'material':_0x1fc5e1,'vertexShaderSource':getVertexShaderSource(_0x2ced6f*_0x7f3dda)})}),this[_0x2ac55a(0xef)]['addGraphic'](this['_graphic']),this['style']['arcDirection']===0x0&&(this['_graphic2']=new mars3d__namespace['graphic'][(_0x2ac55a(_0x1cf604._0x54c2b1))]({...this['options'],'rectangle':this[_0x2ac55a(0x136)],'appearance':new Cesium[(_0x2ac55a(_0x1cf604._0x52ce65))]({'flat':!![],'aboveGround':!![],'renderState':_0x51e87a,'material':_0x1fc5e1,'vertexShaderSource':getVertexShaderSource(-_0x2ced6f)})}),this['_layer']['addGraphic'](this[_0x2ac55a(_0x1cf604._0x275fe7)]));}[_0x169532(0x104)](_0x20d26c){const _0x42ad05={_0x3edb74:0x12a,_0x259b8c:0x114},_0x5037a5=_0x169532;return _0x20d26c!==null&&_0x20d26c!==void 0x0&&_0x20d26c[_0x5037a5(_0x42ad05._0x3edb74)]&&this['_rectangle']?mars3d__namespace[_0x5037a5(_0x42ad05._0x259b8c)][_0x5037a5(0x121)](this['_rectangle']):this['_rectangle'];}['_getHeatCanvas'](){const _0x1b4774={_0x2fd7c2:0x135,_0x3709e3:0xf0,_0x33fb80:0xf4,_0x5e68ca:0xec,_0x248f1b:0x11c,_0x227c33:0xf4,_0x4311df:0xe7,_0x458e22:0x115,_0x1d1d29:0x136,_0x1a3a37:0x116,_0x197ee6:0xec,_0x47d522:0xf4,_0x4b5096:0x10c,_0x5997e2:0x11b,_0x3917c6:0xe6,_0x1716a4:0xfe,_0x167297:0x11a},_0x2eab5c={_0x2d7ec0:0x10e},_0x4637c1={_0x4a178d:0xe4,_0x1204e5:0xfa},_0x1eca3c=_0x169532,_0x4cc9f=this[_0x1eca3c(_0x1b4774._0x2fd7c2)],_0x24cbd9=[];let _0x1c9f25,_0x1b7068,_0x44ca0c,_0x1a4719;_0x4cc9f['forEach'](_0x39fba1=>{const _0x42af11=_0x1eca3c,_0xd32572=mars3d__namespace[_0x42af11(0x10d)]['parse'](_0x39fba1);if(!_0xd32572)return;_0xd32572[_0x42af11(_0x4637c1._0x4a178d)]=_0x39fba1['value']||0x1,!this[_0x42af11(0xf0)]['rectangle']&&(_0x1c9f25===undefined?(_0x1c9f25=_0xd32572['lng'],_0x1b7068=_0xd32572['lng'],_0x44ca0c=_0xd32572['lat'],_0x1a4719=_0xd32572[_0x42af11(0xe5)]):(_0x1c9f25=Math[_0x42af11(0xfa)](_0x1c9f25,_0xd32572['lng']),_0x1b7068=Math['max'](_0x1b7068,_0xd32572['lng']),_0x44ca0c=Math[_0x42af11(_0x4637c1._0x1204e5)](_0x44ca0c,_0xd32572['lat']),_0x1a4719=Math['max'](_0x1a4719,_0xd32572['lat']))),_0x24cbd9['push'](_0xd32572);});_0x1c9f25===_0x1b7068&&(_0x1c9f25-=0.000001,_0x1b7068+=0.000001);_0x44ca0c===_0x1a4719&&(_0x44ca0c-=0.000001,_0x1a4719+=0.000001);let _0x569f47=this[_0x1eca3c(_0x1b4774._0x3709e3)]['rectangle']||{'xmin':_0x1c9f25,'xmax':_0x1b7068,'ymin':_0x44ca0c,'ymax':_0x1a4719};const _0x1aead6=getMercatorBounds(_0x569f47),_0x3c35c3=Math['abs'](_0x1aead6['xmax']-_0x1aead6[_0x1eca3c(_0x1b4774._0x33fb80)]),_0xbbd460=Math['abs'](_0x1aead6['ymax']-_0x1aead6['ymin']),_0xa61afe=Math[_0x1eca3c(_0x1b4774._0x5e68ca)](_0x3c35c3,_0xbbd460),_0x4b235c=Math['min'](_0x3c35c3,_0xbbd460);this[_0x1eca3c(0x12d)]=_0xa61afe;let _0x388b49=0x1;if(_0xa61afe>this['options']['maxCanvasSize'])_0x388b49=_0xa61afe/this['options']['maxCanvasSize'],_0x4b235c/_0x388b49<this[_0x1eca3c(0xf0)]['minCanvasSize']&&(_0x388b49=_0x4b235c/this['options']['minCanvasSize']);else _0x4b235c<this['options']['minCanvasSize']&&(_0x388b49=_0x4b235c/this[_0x1eca3c(0xf0)][_0x1eca3c(0xf1)],_0xa61afe/_0x388b49>this['options']['maxCanvasSize']&&(_0x388b49=_0xa61afe/this['options'][_0x1eca3c(_0x1b4774._0x248f1b)]));const _0xcc09e6=this['heatStyle']['radius']*1.5,_0x2b05a8=_0x3c35c3/_0x388b49+_0xcc09e6*0x2,_0x3e76a2=_0xbbd460/_0x388b49+_0xcc09e6*0x2,_0x4e92dd=_0xcc09e6*_0x388b49;_0x1aead6[_0x1eca3c(_0x1b4774._0x227c33)]-=_0x4e92dd,_0x1aead6['ymin']-=_0x4e92dd,_0x1aead6['xmax']+=_0x4e92dd,_0x1aead6[_0x1eca3c(_0x1b4774._0x4311df)]+=_0x4e92dd,this[_0x1eca3c(_0x1b4774._0x458e22)]=_0x388b49,_0x569f47=geLatLngBounds(_0x1aead6),this[_0x1eca3c(_0x1b4774._0x1d1d29)]=Cesium['Rectangle'][_0x1eca3c(_0x1b4774._0x1a3a37)](_0x569f47['xmin'],_0x569f47['ymin'],_0x569f47['xmax'],_0x569f47[_0x1eca3c(0xe7)]);let _0x5d653b=_0x24cbd9[0x0]['value']??0x1,_0xb580d3=_0x24cbd9[0x0]['value']??0x0;const _0x48f10b=[];_0x24cbd9['forEach'](_0x256b64=>{const _0xc4ffd6=_0x1eca3c,_0x2c7f49=mars3d__namespace[_0xc4ffd6(0x10b)][_0xc4ffd6(_0x2eab5c._0x2d7ec0)]([_0x256b64['lng'],_0x256b64[_0xc4ffd6(0xe5)]]),_0x2841f6=_0x256b64['value']||0x1,_0x4002b3=Math['round']((_0x2c7f49[0x0]-_0x1aead6['xmin'])/_0x388b49),_0x204cc7=Math[_0xc4ffd6(0x138)]((_0x1aead6['ymax']-_0x2c7f49[0x1])/_0x388b49);_0x5d653b=Math['max'](_0x5d653b,_0x2841f6),_0xb580d3=Math[_0xc4ffd6(0xfa)](_0xb580d3,_0x2841f6),_0x48f10b['push']({'x':_0x4002b3,'y':_0x204cc7,'value':_0x2841f6});});const _0x18c149={'min':this[_0x1eca3c(0xf0)][_0x1eca3c(0xfa)]??_0xb580d3,'max':this['options'][_0x1eca3c(_0x1b4774._0x197ee6)]??_0x5d653b,'data':_0x48f10b};this['_last_heatData']=_0x18c149;if(!this['_last_mBounds']||_0x1aead6['xmin']!==this['_last_mBounds'][_0x1eca3c(_0x1b4774._0x47d522)]||_0x1aead6[_0x1eca3c(_0x1b4774._0x4b5096)]!==this['_last_mBounds']['ymin']||_0x1aead6['xmax']!==this['_last_mBounds']['xmax']||_0x1aead6['ymax']!==this['_last_mBounds']['ymax']){this['_last_mBounds']=_0x1aead6,this['_container']['style'][_0x1eca3c(_0x1b4774._0x5997e2)]='width:'+_0x2b05a8+'px;height:'+_0x3e76a2+_0x1eca3c(_0x1b4774._0x3917c6);const _0x3f16d1={...this['heatStyle'],'container':this['_container']};!this['_heat']?this['_heat']=h337__namespace['create'](_0x3f16d1):this[_0x1eca3c(_0x1b4774._0x1716a4)]['configure'](_0x3f16d1);}this['_heat']['setData'](_0x18c149);const _0x59b40f=mars3d__namespace['DomUtil'][_0x1eca3c(0x12f)](this['_heat'][_0x1eca3c(_0x1b4774._0x167297)]['canvas']);return _0x59b40f;}['_getArcHeatCanvas'](){const _0x4cc81e={_0x587a25:0xfe,_0x4f438d:0xfd,_0x36ddbb:0x130,_0x457915:0xf0},_0x50bc5c=_0x169532;this['_heat']['configure']({'radius':this['heatStyle']['radius']*this['style']['arcRadiusScale'],'blur':this['heatStyle']['blur']*this[_0x50bc5c(0xed)]['arcBlurScale'],'gradient':this[_0x50bc5c(0x110)]['gradientArc']||{0.25:_0x50bc5c(0xf3),0.55:'rgb(140,140,140)',0.85:_0x50bc5c(0x103),0x1:_0x50bc5c(0x119)}});const _0xae8f05=mars3d__namespace['DomUtil']['copyCanvas'](this[_0x50bc5c(_0x4cc81e._0x587a25)][_0x50bc5c(0x11a)][_0x50bc5c(_0x4cc81e._0x4f438d)]);return this[_0x50bc5c(0xfe)][_0x50bc5c(_0x4cc81e._0x36ddbb)](this[_0x50bc5c(_0x4cc81e._0x457915)]['heatStyle']),_0xae8f05;}['getPointData'](_0x42c36b){const _0x210336={_0x29cbb4:0xe5,_0x324dac:0xe7,_0x1bcbaa:0xfe},_0x173d1f=_0x169532,_0x875303=mars3d__namespace['LngLatPoint']['parse'](_0x42c36b);if(!_0x875303)return{};const _0x43e291=mars3d__namespace['PointTrans'][_0x173d1f(0x10e)]([_0x875303[_0x173d1f(0x109)],_0x875303[_0x173d1f(_0x210336._0x29cbb4)]]),_0x338b52=this['_last_mBounds'],_0x70c885=Math['round']((_0x43e291[0x0]-_0x338b52['xmin'])/this['_scale']),_0x10b0d9=Math['round']((_0x338b52[_0x173d1f(_0x210336._0x324dac)]-_0x43e291[0x1])/this['_scale']),_0x345e6a=this[_0x173d1f(_0x210336._0x1bcbaa)][_0x173d1f(0x132)]({'x':_0x70c885,'y':_0x10b0d9}),_0x1ee12f=this['_heat']['_renderer']['ctx']['getImageData'](_0x70c885-0x1,_0x10b0d9-0x1,0x1,0x1)['data'];return{'x':_0x70c885,'y':_0x10b0d9,'value':_0x345e6a,'color':'rgba('+_0x1ee12f[0x0]+','+_0x1ee12f[0x1]+','+_0x1ee12f[0x2]+','+_0x1ee12f[0x3]+')'};}}mars3d__namespace[_0x169532(0xf9)]['register'](_0x169532(0xe2),HeatLayer),mars3d__namespace['layer']['HeatLayer']=HeatLayer,mars3d__namespace['h337']=h337__namespace;function getMercatorBounds(_0x4531c0){const _0x2047cd={_0x27ebed:0x10e,_0x39f150:0x10c,_0xc9d8b8:0x10e},_0x3682ae=_0x169532,_0x3fd241=mars3d__namespace['PointTrans'][_0x3682ae(_0x2047cd._0x27ebed)]([_0x4531c0['xmin'],_0x4531c0[_0x3682ae(_0x2047cd._0x39f150)]]),_0x125316=mars3d__namespace['PointTrans'][_0x3682ae(_0x2047cd._0xc9d8b8)]([_0x4531c0['xmax'],_0x4531c0['ymax']]);return{'xmin':_0x3fd241[0x0],'ymin':_0x3fd241[0x1],'xmax':_0x125316[0x0],'ymax':_0x125316[0x1]};}function _0x4443(_0x164358,_0x306ade){const _0x4cd4d0=_0x4cd4();return _0x4443=function(_0x4443cb,_0x1a0e36){_0x4443cb=_0x4443cb-0xe2;let _0x4fda11=_0x4cd4d0[_0x4443cb];return _0x4fda11;},_0x4443(_0x164358,_0x306ade);}function geLatLngBounds(_0x29660b){const _0x327f67={_0x543faf:0x10b},_0x139da0=_0x169532,_0x511ce7=mars3d__namespace['PointTrans'][_0x139da0(0x10a)]([_0x29660b[_0x139da0(0xf4)],_0x29660b['ymin']]),_0x31af62=mars3d__namespace[_0x139da0(_0x327f67._0x543faf)][_0x139da0(0x10a)]([_0x29660b['xmax'],_0x29660b[_0x139da0(0xe7)]]);return{'xmin':_0x511ce7[0x0],'ymin':_0x511ce7[0x1],'xmax':_0x31af62[0x0],'ymax':_0x31af62[0x1]};}function getVertexShaderSource(_0x5a67e1){return'in\x20vec3\x20position3DHigh;\x0a\x20\x20in\x20vec3\x20position3DLow;\x0a\x20\x20in\x20vec2\x20st;\x0a\x20\x20in\x20float\x20batchId;\x0a\x20\x20uniform\x20sampler2D\x20bumpMap_3;\x0a\x20\x20out\x20vec3\x20v_positionMC;\x0a\x20\x20out\x20vec3\x20v_positionEC;\x0a\x20\x20out\x20vec2\x20v_st;\x0a\x0a\x20\x20void\x20main()\x0a\x20\x20{\x0a\x20\x20\x20\x20vec4\x20p\x20=\x20czm_computePosition();\x0a\x20\x20\x20\x20v_positionMC\x20=\x20position3DHigh\x20+\x20position3DLow;\x0a\x20\x20\x20\x20v_positionEC\x20=\x20(czm_modelViewRelativeToEye\x20*\x20p).xyz;\x0a\x20\x20\x20\x20v_st\x20=\x20st;\x0a\x20\x20\x20\x20vec4\x20color\x20=\x20texture(bumpMap_3,\x20v_st);\x0a\x20\x20\x20\x20float\x20centerBump\x20=\x20distance(vec3(0.0),color.rgb);\x0a\x20\x20\x20\x20vec3\x20upDir\x20=\x20normalize(v_positionMC.xyz);\x0a\x20\x20\x20\x20vec3\x20disPos\x20=\x20upDir\x20*\x20centerBump\x20*\x20'+_0x5a67e1+';\x0a\x20\x20\x20\x20p\x20+=vec4(disPos,0.0);\x0a\x20\x20\x20\x20gl_Position\x20=\x20czm_modelViewProjectionRelativeToEye\x20*\x20p;\x0a\x20\x20}\x0a';}exports['HeatLayer']=HeatLayer,Object['defineProperty'](exports,_0x169532(0x11d),{'value':!![]}); | ||
'use strict';function _0x445c(_0x36fe09,_0x3864b8){const _0x25a3d=_0x25a3();return _0x445c=function(_0x445c0a,_0x3afe3f){_0x445c0a=_0x445c0a-0x148;let _0x3d69c5=_0x25a3d[_0x445c0a];return _0x3d69c5;},_0x445c(_0x36fe09,_0x3864b8);}const _0x2e1288=_0x445c;(function(_0x14ed43,_0x120fd7){const _0xcb6fb9={_0x50d8fd:0x172,_0x501662:0x149,_0x56c82d:0x18e,_0x587596:0x15d,_0x53e162:0x186},_0x206edd=_0x445c,_0x261fc1=_0x14ed43();while(!![]){try{const _0x459008=parseInt(_0x206edd(0x16b))/0x1+parseInt(_0x206edd(_0xcb6fb9._0x50d8fd))/0x2+parseInt(_0x206edd(0x17f))/0x3+-parseInt(_0x206edd(_0xcb6fb9._0x501662))/0x4*(-parseInt(_0x206edd(0x180))/0x5)+parseInt(_0x206edd(_0xcb6fb9._0x56c82d))/0x6*(parseInt(_0x206edd(0x18d))/0x7)+-parseInt(_0x206edd(_0xcb6fb9._0x587596))/0x8*(-parseInt(_0x206edd(_0xcb6fb9._0x53e162))/0x9)+-parseInt(_0x206edd(0x15f))/0xa*(parseInt(_0x206edd(0x17c))/0xb);if(_0x459008===_0x120fd7)break;else _0x261fc1['push'](_0x261fc1['shift']());}catch(_0x588bc9){_0x261fc1['push'](_0x261fc1['shift']());}}}(_0x25a3,0xdfd89));function _0x25a3(){const _0x52b839=['clear','data','clientWidth','HeatLayer','style','_scale','configure','rectangle','ALWAYS','uniforms','StencilFunction','heat','Material','defineProperty','lng','_renderer','_updatePositionsHook','LngLatPoint','8sPTrhZ','image','36720810AowYrB','options','push','_rectangle','_graphic','PolyUtil','radius','ymax','heatStyle','create','DomUtil','_createGraphic','567592aSNlnp','addLayer','xmax','_map','maxCanvasSize','arc','value','16776RMqaDO','abs','layer','_mBoundsMax','removeGraphic','_layer','default','round','StencilOperation','width:','11aXgDrW','PointTrans','graphic','4006650lfkWXa','14185RsCCoQ','lonlat2mercator','_heat','bumpMap','_last_mBounds','canvas','4559067lrsEda','setPositions','removeLayer','positions','lat','_graphic2','remove','224504gkPnUA','240MsFQQP','formatRectangle','max','EllipsoidSurfaceAppearance','EPSG:3857','VERTEX_FORMAT','BaseLayer','_setOptionsHook','_container','xmin','type','copyCanvas','min','addGraphic','Util','forEach','_positions','parse','minCanvasSize','1252HxdKHZ','length'];_0x25a3=function(){return _0x52b839;};return _0x25a3();}function _interopNamespace(_0x26ed54){const _0x44b767={_0x419dc4:0x178},_0x3890da=_0x445c;if(_0x26ed54&&_0x26ed54['__esModule'])return _0x26ed54;var _0x14dd9c=Object['create'](null);return _0x26ed54&&Object['keys'](_0x26ed54)['forEach'](function(_0x3744c3){if(_0x3744c3!=='default'){var _0x124026=Object['getOwnPropertyDescriptor'](_0x26ed54,_0x3744c3);Object['defineProperty'](_0x14dd9c,_0x3744c3,_0x124026['get']?_0x124026:{'enumerable':!![],'get':function(){return _0x26ed54[_0x3744c3];}});}}),_0x14dd9c[_0x3890da(_0x44b767._0x419dc4)]=_0x26ed54,_0x14dd9c;}var mars3d__namespace=_interopNamespace(mars3d),h337__namespace=_interopNamespace(h337),HeatMaterial='uniform\x20sampler2D\x20image;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20vec4\x20colorImage\x20=\x20texture(image,\x20st);\x0a\x20\x20if(colorImage.rgb\x20==\x20vec3(1.0)\x20||\x20colorImage.rgb\x20==\x20vec3(0.0))\x20{\x0a\x20\x20\x20\x20discard;\x0a\x20\x20}\x0a\x20\x20material.diffuse\x20=\x20colorImage.rgb;\x0a\x20\x20material.alpha\x20=\x20colorImage.a;\x0a\x20\x20return\x20material;\x0a}\x0a';if(!h337__namespace[_0x2e1288(0x168)])throw new Error('请引入\x20heatmap.js\x20库\x20');const Cesium=mars3d__namespace['Cesium'],BaseLayer=mars3d__namespace[_0x2e1288(0x174)][_0x2e1288(0x194)],DEF_HEATSTYLE={'maxOpacity':0.8,'minOpacity':0.1,'blur':0.85,'radius':0x19,'gradient':{0.4:'blue',0.6:'green',0.8:'yellow',0.9:'red'}},DEF_STYLE={'arcRadiusScale':1.5,'arcBlurScale':1.5,'vertexFormat':Cesium['EllipsoidSurfaceAppearance'][_0x2e1288(0x193)]};class HeatLayer extends BaseLayer{constructor(_0x38cd11={}){const _0xb684b5={_0x1b9e51:0x14d,_0x146ba3:0x160},_0x77baf4=_0x2e1288;super(_0x38cd11),this[_0x77baf4(0x160)]['maxCanvasSize']=this['options']['maxCanvasSize']??document['body'][_0x77baf4(_0xb684b5._0x1b9e51)],this['options']['maxCanvasSize']=Math['min'](this['options']['maxCanvasSize'],0x1388),this[_0x77baf4(0x160)]['minCanvasSize']=this['options']['minCanvasSize']??document['body']['clientHeight'],this['options'][_0x77baf4(0x148)]=Math['max'](this['options']['minCanvasSize'],0x2bc),this['options']['heatStyle']={...DEF_HEATSTYLE,...this['options']['heatStyle']},this[_0x77baf4(_0xb684b5._0x146ba3)]['style']={...DEF_STYLE,...this['options']['style']};}get['layer'](){return this['_layer'];}get['heatStyle'](){const _0x383362=_0x2e1288;return this[_0x383362(0x160)]['heatStyle'];}set[_0x2e1288(0x167)](_0x3044be){const _0x206df3={_0x53ccaf:0x19c,_0x3ab5e8:0x160,_0x323c96:0x160},_0x352ef7=_0x2e1288;this['options']['heatStyle']=mars3d__namespace[_0x352ef7(_0x206df3._0x53ccaf)]['merge'](this[_0x352ef7(_0x206df3._0x3ab5e8)]['heatStyle'],_0x3044be),this['_heat']&&(this['_heat']['configure'](this[_0x352ef7(_0x206df3._0x323c96)]['heatStyle']),this[_0x352ef7(0x15b)](!![]));}get[_0x2e1288(0x14f)](){return this['options']['style'];}set[_0x2e1288(0x14f)](_0x1a7878){this['options']['style']=mars3d__namespace['Util']['merge'](this['options']['style'],_0x1a7878);}get['positions'](){const _0x524c2b=_0x2e1288;return this[_0x524c2b(0x19e)];}set['positions'](_0x5617bf){this['setPositions'](_0x5617bf);}get['coordinates'](){const _0x60dd29=[];return this['points']['forEach'](_0x2943dc=>{const _0x12cb89=_0x445c;_0x60dd29[_0x12cb89(0x161)](_0x2943dc['toArray']());}),_0x60dd29;}get['rectangle'](){return this['_rectangle'];}[_0x2e1288(0x195)](_0x44ffee,_0x420b97){_0x44ffee['positions']&&(this['positions']=_0x44ffee['positions']);}['_mountedHook'](){const _0x1bb4c5={_0x2c5fb6:0x177},_0xf5fe9d=_0x2e1288;this['style']['type']==='image'?this['_layer']=new mars3d__namespace['layer']['ImageLayer']({'crs':_0xf5fe9d(0x192),'private':!![]}):this[_0xf5fe9d(_0x1bb4c5._0x2c5fb6)]=new mars3d__namespace['layer']['GraphicLayer']({'private':!![]});}['_addedHook'](){const _0x9229dc={_0xa7d698:0x16c,_0x259443:0x196,_0x3965ee:0x189,_0x2bc61b:0x189},_0x50893a=_0x2e1288;this['_map'][_0x50893a(_0x9229dc._0xa7d698)](this['_layer']),this[_0x50893a(_0x9229dc._0x259443)]=mars3d__namespace['DomUtil'][_0x50893a(0x168)]('div','mars3d-heatmap\x20mars3d-hideDiv',this['_map']['container']),this['options'][_0x50893a(_0x9229dc._0x3965ee)]&&(this['positions']=this[_0x50893a(0x160)][_0x50893a(_0x9229dc._0x2bc61b)]),this['options']['flyTo']&&this['flyToByAnimationEnd']();}['_removedHook'](){const _0x1aaa70={_0x4ba6c9:0x169,_0x15dbb4:0x188},_0x1a0a81=_0x2e1288;this['_container']&&(mars3d__namespace[_0x1a0a81(_0x1aaa70._0x4ba6c9)][_0x1a0a81(0x18c)](this[_0x1a0a81(0x196)]),delete this['_container']),this['clear'](),this['_map'][_0x1a0a81(_0x1aaa70._0x15dbb4)](this['_layer']);}['addPosition'](_0x32fc2c,_0x487803){const _0x201c12=_0x2e1288;this['_positions']=this['_positions']||[],this['_positions'][_0x201c12(0x161)](_0x32fc2c),this['_updatePositionsHook'](_0x487803);}[_0x2e1288(0x187)](_0x57aac9,_0x16c675){this['_positions']=_0x57aac9,this['_updatePositionsHook'](_0x16c675);}['clear'](){const _0x4ee590={_0x2135e4:0x176,_0x228ecf:0x18b},_0x4a78d4=_0x2e1288;this['_graphic']&&(this['_layer']['removeGraphic'](this['_graphic'],!![]),delete this[_0x4a78d4(0x163)]),this['_graphic2']&&(this['_layer'][_0x4a78d4(_0x4ee590._0x2135e4)](this['_graphic2'],!![]),delete this[_0x4a78d4(_0x4ee590._0x228ecf)]);}['_updatePositionsHook'](_0x39eb4c){const _0x107c6c={_0x2bf541:0x14a,_0x5edc4e:0x15e,_0x2e275c:0x170,_0x509243:0x183},_0x4fe56d=_0x2e1288;if(!this['show']||!this[_0x4fe56d(0x16e)]||!this['positions']||this[_0x4fe56d(0x189)][_0x4fe56d(_0x107c6c._0x2bf541)]===0x0)return this;const _0xd7fc25=this['_getHeatCanvas']();if(this[_0x4fe56d(0x14f)][_0x4fe56d(0x198)]===_0x4fe56d(_0x107c6c._0x5edc4e))this['_layer']['setOptions']({'url':_0xd7fc25['toDataURL']('image/png'),'rectangle':this['_rectangle'],'opacity':this['style']['opacity']});else this['style'][_0x4fe56d(_0x107c6c._0x2e275c)]?this['_graphic']&&_0x39eb4c?(this['_graphic']['uniforms']['image']=_0xd7fc25,this[_0x4fe56d(0x163)]['uniforms'][_0x4fe56d(_0x107c6c._0x509243)]=this['_getArcHeatCanvas'](),this['_graphic2']&&(this['_graphic2']['uniforms']['image']=_0xd7fc25,this[_0x4fe56d(0x18b)]['uniforms']['bumpMap']=this['_graphic'][_0x4fe56d(0x154)]['bumpMap'])):this['_createArcGraphic'](_0xd7fc25):this['_graphic']&&_0x39eb4c?this['_graphic']['uniforms']['image']=_0xd7fc25:this['_createGraphic'](_0xd7fc25);return this;}[_0x2e1288(0x16a)](_0x1830d3){const _0x296e51={_0x9cbb47:0x14b,_0xb6f998:0x160,_0x137546:0x157,_0x2d4205:0x177},_0xb093f6=_0x2e1288;this[_0xb093f6(_0x296e51._0x9cbb47)](),this['_graphic']=new mars3d__namespace[(_0xb093f6(0x17e))]['RectanglePrimitive']({...this[_0xb093f6(_0x296e51._0xb6f998)],'rectangle':this['_rectangle'],'appearance':new Cesium['EllipsoidSurfaceAppearance']({'material':new Cesium[(_0xb093f6(_0x296e51._0x137546))]({'fabric':{'uniforms':{'image':_0x1830d3},'source':HeatMaterial},'translucent':!![]}),'flat':!![]})}),this[_0xb093f6(_0x296e51._0x2d4205)]['addGraphic'](this['_graphic']);}['_createArcGraphic'](_0x4113a3){const _0x2e1400={_0x9b856c:0x17a,_0x4c8ab7:0x153,_0x53146d:0x191,_0x2b88a7:0x163,_0x198489:0x14f,_0x4d976e:0x162,_0x6c4ab7:0x19b,_0x339b3f:0x18b},_0x24dff2=_0x2e1288;this['clear']();const _0x5bd6a1=Cesium['RenderState']['fromCache']({'cull':{'enabled':!![]},'depthTest':{'enabled':!![]},'stencilTest':{'enabled':!![],'frontFunction':Cesium['StencilFunction']['ALWAYS'],'frontOperation':{'fail':Cesium['StencilOperation']['KEEP'],'zFail':Cesium[_0x24dff2(_0x2e1400._0x9b856c)]['KEEP'],'zPass':Cesium['StencilOperation']['REPLACE']},'backFunction':Cesium[_0x24dff2(0x155)][_0x24dff2(_0x2e1400._0x4c8ab7)],'backOperation':{'fail':Cesium['StencilOperation']['KEEP'],'zFail':Cesium['StencilOperation']['KEEP'],'zPass':Cesium['StencilOperation']['REPLACE']},'reference':0x2,'mask':0x2},'blending':Cesium['BlendingState']['ALPHA_BLEND']}),_0x401717=Math['floor'](this['style']['diffHeight']??this['_mBoundsMax']*0.02)+0.1;this['style']['diffHeight']&&delete this['style']['diffHeight'];const _0x25c1b3=(this['style']['splitNum'],0x64);let _0x5238c3=Math[_0x24dff2(0x190)](this[_0x24dff2(0x162)]['height'],this['_rectangle']['width']);this['style']['granularity']=_0x5238c3/=_0x25c1b3;const _0x2442c2=new Cesium['Material']({'fabric':{'uniforms':{'image':_0x4113a3,'repeat':new Cesium['Cartesian2'](0x1,0x1),'color':new Cesium['Color'](0x1,0x1,0x1,0x0),'bumpMap':this['_getArcHeatCanvas']()},'source':HeatMaterial},'translucent':!![]}),_0x5af849=this[_0x24dff2(0x14f)]['arcDirection']||0x1;this['_graphic']=new mars3d__namespace['graphic']['RectanglePrimitive']({...this['options'],'rectangle':this['_rectangle'],'appearance':new Cesium[(_0x24dff2(_0x2e1400._0x53146d))]({'flat':!![],'aboveGround':!![],'renderState':_0x5bd6a1,'material':_0x2442c2,'vertexShaderSource':getVertexShaderSource(_0x401717*_0x5af849)})}),this['_layer'][_0x24dff2(0x19b)](this[_0x24dff2(_0x2e1400._0x2b88a7)]),this[_0x24dff2(_0x2e1400._0x198489)]['arcDirection']===0x0&&(this[_0x24dff2(0x18b)]=new mars3d__namespace['graphic']['RectanglePrimitive']({...this[_0x24dff2(0x160)],'rectangle':this[_0x24dff2(_0x2e1400._0x4d976e)],'appearance':new Cesium['EllipsoidSurfaceAppearance']({'flat':!![],'aboveGround':!![],'renderState':_0x5bd6a1,'material':_0x2442c2,'vertexShaderSource':getVertexShaderSource(-_0x401717)})}),this['_layer'][_0x24dff2(_0x2e1400._0x6c4ab7)](this[_0x24dff2(_0x2e1400._0x339b3f)]));}['getRectangle'](_0x2f3b55){const _0x1a6b60={_0x253408:0x18f,_0x468fe3:0x162},_0x3cd616=_0x2e1288;return _0x2f3b55!==null&&_0x2f3b55!==void 0x0&&_0x2f3b55['isFormat']&&this['_rectangle']?mars3d__namespace[_0x3cd616(0x164)][_0x3cd616(_0x1a6b60._0x253408)](this[_0x3cd616(0x162)]):this[_0x3cd616(_0x1a6b60._0x468fe3)];}['_getHeatCanvas'](){const _0x37a42f={_0x45d3e2:0x19d,_0x519a2f:0x160,_0x53cb09:0x160,_0x22dd27:0x167,_0x3d8a2a:0x16d,_0x13ec33:0x162,_0xf4d391:0x166,_0x4cde89:0x171,_0x3352ba:0x184,_0x27213a:0x16d,_0x38952f:0x166,_0x1d06b8:0x17b,_0x58285b:0x151,_0x5922aa:0x15a},_0x12087c={_0x1af22a:0x160,_0x116ec5:0x159,_0x171944:0x190,_0x3a77a6:0x161},_0x12d247=_0x2e1288,_0x5977a3=this['_positions'],_0x4960d8=[];let _0x9edf22,_0x43aa8c,_0x53d5b7,_0x4e6b03;_0x5977a3[_0x12d247(_0x37a42f._0x45d3e2)](_0x25f8a7=>{const _0x59d355=_0x12d247,_0x573d96=mars3d__namespace[_0x59d355(0x15c)]['parse'](_0x25f8a7);if(!_0x573d96)return;_0x573d96['value']=_0x25f8a7[_0x59d355(0x171)]||0x1,!this[_0x59d355(_0x12087c._0x1af22a)][_0x59d355(0x152)]&&(_0x9edf22===undefined?(_0x9edf22=_0x573d96['lng'],_0x43aa8c=_0x573d96['lng'],_0x53d5b7=_0x573d96[_0x59d355(0x18a)],_0x4e6b03=_0x573d96[_0x59d355(0x18a)]):(_0x9edf22=Math[_0x59d355(0x19a)](_0x9edf22,_0x573d96['lng']),_0x43aa8c=Math[_0x59d355(0x190)](_0x43aa8c,_0x573d96[_0x59d355(_0x12087c._0x116ec5)]),_0x53d5b7=Math['min'](_0x53d5b7,_0x573d96['lat']),_0x4e6b03=Math[_0x59d355(_0x12087c._0x171944)](_0x4e6b03,_0x573d96['lat']))),_0x4960d8[_0x59d355(_0x12087c._0x3a77a6)](_0x573d96);});_0x9edf22===_0x43aa8c&&(_0x9edf22-=0.000001,_0x43aa8c+=0.000001);_0x53d5b7===_0x4e6b03&&(_0x53d5b7-=0.000001,_0x4e6b03+=0.000001);let _0x4ab269=this[_0x12d247(_0x37a42f._0x519a2f)]['rectangle']||{'xmin':_0x9edf22,'xmax':_0x43aa8c,'ymin':_0x53d5b7,'ymax':_0x4e6b03};const _0x4aeb9f=getMercatorBounds(_0x4ab269),_0x497c8a=Math[_0x12d247(0x173)](_0x4aeb9f[_0x12d247(0x16d)]-_0x4aeb9f['xmin']),_0x864ca3=Math[_0x12d247(0x173)](_0x4aeb9f['ymax']-_0x4aeb9f['ymin']),_0x51c9f6=Math['max'](_0x497c8a,_0x864ca3),_0x5dba4f=Math['min'](_0x497c8a,_0x864ca3);this[_0x12d247(0x175)]=_0x51c9f6;let _0x5e84d6=0x1;if(_0x51c9f6>this['options']['maxCanvasSize'])_0x5e84d6=_0x51c9f6/this['options']['maxCanvasSize'],_0x5dba4f/_0x5e84d6<this[_0x12d247(0x160)]['minCanvasSize']&&(_0x5e84d6=_0x5dba4f/this[_0x12d247(_0x37a42f._0x53cb09)][_0x12d247(0x148)]);else _0x5dba4f<this['options'][_0x12d247(0x148)]&&(_0x5e84d6=_0x5dba4f/this['options'][_0x12d247(0x148)],_0x51c9f6/_0x5e84d6>this['options'][_0x12d247(0x16f)]&&(_0x5e84d6=_0x51c9f6/this['options']['maxCanvasSize']));const _0x4afdba=this[_0x12d247(_0x37a42f._0x22dd27)][_0x12d247(0x165)]*1.5,_0x4ae32d=_0x497c8a/_0x5e84d6+_0x4afdba*0x2,_0x271626=_0x864ca3/_0x5e84d6+_0x4afdba*0x2,_0x2d3dfb=_0x4afdba*_0x5e84d6;_0x4aeb9f['xmin']-=_0x2d3dfb,_0x4aeb9f['ymin']-=_0x2d3dfb,_0x4aeb9f[_0x12d247(_0x37a42f._0x3d8a2a)]+=_0x2d3dfb,_0x4aeb9f[_0x12d247(0x166)]+=_0x2d3dfb,this['_scale']=_0x5e84d6,_0x4ab269=geLatLngBounds(_0x4aeb9f),this[_0x12d247(_0x37a42f._0x13ec33)]=Cesium['Rectangle']['fromDegrees'](_0x4ab269['xmin'],_0x4ab269['ymin'],_0x4ab269['xmax'],_0x4ab269[_0x12d247(_0x37a42f._0xf4d391)]);let _0x1c0787=_0x4960d8[0x0][_0x12d247(_0x37a42f._0x4cde89)]??0x1,_0x1fce16=_0x4960d8[0x0]['value']??0x0;const _0x5cdd88=[];_0x4960d8['forEach'](_0x35cffb=>{const _0x132c39=_0x12d247,_0x3142ba=mars3d__namespace['PointTrans']['lonlat2mercator']([_0x35cffb['lng'],_0x35cffb['lat']]),_0x3026d9=_0x35cffb['value']||0x1,_0x3c81fe=Math[_0x132c39(0x179)]((_0x3142ba[0x0]-_0x4aeb9f['xmin'])/_0x5e84d6),_0x4d74d2=Math[_0x132c39(0x179)]((_0x4aeb9f['ymax']-_0x3142ba[0x1])/_0x5e84d6);_0x1c0787=Math['max'](_0x1c0787,_0x3026d9),_0x1fce16=Math['min'](_0x1fce16,_0x3026d9),_0x5cdd88['push']({'x':_0x3c81fe,'y':_0x4d74d2,'value':_0x3026d9});});const _0x435baf={'min':this['options']['min']??_0x1fce16,'max':this['options']['max']??_0x1c0787,'data':_0x5cdd88};this['_last_heatData']=_0x435baf;if(!this[_0x12d247(_0x37a42f._0x3352ba)]||_0x4aeb9f['xmin']!==this['_last_mBounds']['xmin']||_0x4aeb9f['ymin']!==this['_last_mBounds']['ymin']||_0x4aeb9f[_0x12d247(_0x37a42f._0x27213a)]!==this[_0x12d247(0x184)]['xmax']||_0x4aeb9f['ymax']!==this['_last_mBounds'][_0x12d247(_0x37a42f._0x38952f)]){this['_last_mBounds']=_0x4aeb9f,this['_container']['style']['cssText']=_0x12d247(_0x37a42f._0x1d06b8)+_0x4ae32d+'px;height:'+_0x271626+'px;';const _0x1430cc={...this['heatStyle'],'container':this['_container']};!this['_heat']?this['_heat']=h337__namespace['create'](_0x1430cc):this['_heat'][_0x12d247(_0x37a42f._0x58285b)](_0x1430cc);}this['_heat']['setData'](_0x435baf);const _0x165771=mars3d__namespace[_0x12d247(0x169)]['copyCanvas'](this['_heat'][_0x12d247(_0x37a42f._0x5922aa)][_0x12d247(0x185)]);return _0x165771;}['_getArcHeatCanvas'](){const _0x48aecb={_0x54e7ba:0x169,_0x48677a:0x199},_0x4ae2d9=_0x2e1288;this[_0x4ae2d9(0x182)]['configure']({'radius':this['heatStyle']['radius']*this[_0x4ae2d9(0x14f)]['arcRadiusScale'],'blur':this['heatStyle']['blur']*this['style']['arcBlurScale'],'gradient':this['heatStyle']['gradientArc']||{0.25:'rgb(0,0,0)',0.55:'rgb(140,140,140)',0.85:'rgb(216,216,216)',0x1:'rgb(255,255,255)'}});const _0x1ffda5=mars3d__namespace[_0x4ae2d9(_0x48aecb._0x54e7ba)][_0x4ae2d9(_0x48aecb._0x48677a)](this['_heat']['_renderer'][_0x4ae2d9(0x185)]);return this[_0x4ae2d9(0x182)]['configure'](this['options']['heatStyle']),_0x1ffda5;}['getPointData'](_0x322f3c){const _0x4fa5c6={_0x416a02:0x19f,_0x35ca13:0x181,_0x1e77f2:0x159,_0x22b34e:0x182,_0x1a212c:0x14c},_0x2b5fbd=_0x2e1288,_0x1bff6c=mars3d__namespace['LngLatPoint'][_0x2b5fbd(_0x4fa5c6._0x416a02)](_0x322f3c);if(!_0x1bff6c)return{};const _0x3041b1=mars3d__namespace['PointTrans'][_0x2b5fbd(_0x4fa5c6._0x35ca13)]([_0x1bff6c[_0x2b5fbd(_0x4fa5c6._0x1e77f2)],_0x1bff6c['lat']]),_0x28292f=this[_0x2b5fbd(0x184)],_0x266ccd=Math['round']((_0x3041b1[0x0]-_0x28292f['xmin'])/this['_scale']),_0x211bfe=Math['round']((_0x28292f['ymax']-_0x3041b1[0x1])/this[_0x2b5fbd(0x150)]),_0x5451c8=this['_heat']['getValueAt']({'x':_0x266ccd,'y':_0x211bfe}),_0x3eb8a2=this[_0x2b5fbd(_0x4fa5c6._0x22b34e)]['_renderer']['ctx']['getImageData'](_0x266ccd-0x1,_0x211bfe-0x1,0x1,0x1)[_0x2b5fbd(_0x4fa5c6._0x1a212c)];return{'x':_0x266ccd,'y':_0x211bfe,'value':_0x5451c8,'color':'rgba('+_0x3eb8a2[0x0]+','+_0x3eb8a2[0x1]+','+_0x3eb8a2[0x2]+','+_0x3eb8a2[0x3]+')'};}}mars3d__namespace['LayerUtil']['register'](_0x2e1288(0x156),HeatLayer),mars3d__namespace[_0x2e1288(0x174)][_0x2e1288(0x14e)]=HeatLayer,mars3d__namespace['h337']=h337__namespace;function getMercatorBounds(_0x5a2bfc){const _0x447f28={_0xd5091b:0x181},_0x1409d8=_0x2e1288,_0x466e26=mars3d__namespace['PointTrans'][_0x1409d8(_0x447f28._0xd5091b)]([_0x5a2bfc['xmin'],_0x5a2bfc['ymin']]),_0x539db3=mars3d__namespace[_0x1409d8(0x17d)][_0x1409d8(0x181)]([_0x5a2bfc['xmax'],_0x5a2bfc[_0x1409d8(0x166)]]);return{'xmin':_0x466e26[0x0],'ymin':_0x466e26[0x1],'xmax':_0x539db3[0x0],'ymax':_0x539db3[0x1]};}function geLatLngBounds(_0x3225bc){const _0x21fe88={_0x39fbc3:0x16d,_0x2de8d8:0x166},_0x5e655d=_0x2e1288,_0x4b5a46=mars3d__namespace['PointTrans']['mercator2lonlat']([_0x3225bc[_0x5e655d(0x197)],_0x3225bc['ymin']]),_0x39cdb4=mars3d__namespace['PointTrans']['mercator2lonlat']([_0x3225bc[_0x5e655d(_0x21fe88._0x39fbc3)],_0x3225bc[_0x5e655d(_0x21fe88._0x2de8d8)]]);return{'xmin':_0x4b5a46[0x0],'ymin':_0x4b5a46[0x1],'xmax':_0x39cdb4[0x0],'ymax':_0x39cdb4[0x1]};}function getVertexShaderSource(_0x611633){return'in\x20vec3\x20position3DHigh;\x0a\x20\x20in\x20vec3\x20position3DLow;\x0a\x20\x20in\x20vec2\x20st;\x0a\x20\x20in\x20float\x20batchId;\x0a\x20\x20uniform\x20sampler2D\x20bumpMap_3;\x0a\x20\x20out\x20vec3\x20v_positionMC;\x0a\x20\x20out\x20vec3\x20v_positionEC;\x0a\x20\x20out\x20vec2\x20v_st;\x0a\x0a\x20\x20void\x20main()\x0a\x20\x20{\x0a\x20\x20\x20\x20vec4\x20p\x20=\x20czm_computePosition();\x0a\x20\x20\x20\x20v_positionMC\x20=\x20position3DHigh\x20+\x20position3DLow;\x0a\x20\x20\x20\x20v_positionEC\x20=\x20(czm_modelViewRelativeToEye\x20*\x20p).xyz;\x0a\x20\x20\x20\x20v_st\x20=\x20st;\x0a\x20\x20\x20\x20vec4\x20color\x20=\x20texture(bumpMap_3,\x20v_st);\x0a\x20\x20\x20\x20float\x20centerBump\x20=\x20distance(vec3(0.0),color.rgb);\x0a\x20\x20\x20\x20vec3\x20upDir\x20=\x20normalize(v_positionMC.xyz);\x0a\x20\x20\x20\x20vec3\x20disPos\x20=\x20upDir\x20*\x20centerBump\x20*\x20'+_0x611633+';\x0a\x20\x20\x20\x20p\x20+=vec4(disPos,0.0);\x0a\x20\x20\x20\x20gl_Position\x20=\x20czm_modelViewProjectionRelativeToEye\x20*\x20p;\x0a\x20\x20}\x0a';}exports['HeatLayer']=HeatLayer,Object[_0x2e1288(0x158)](exports,'__esModule',{'value':!![]}); | ||
})); |
{ | ||
"name": "mars3d-heatmap", | ||
"version": "3.6.0", | ||
"version": "3.6.1", | ||
"description": "Mars3D平台插件,结合heatmap可视化功能插件", | ||
@@ -13,3 +13,3 @@ "main": "dist/mars3d-heatmap.js", | ||
"devDependencies": { | ||
"mars3d": "~3.6.0" | ||
"mars3d": "~3.6.1" | ||
}, | ||
@@ -16,0 +16,0 @@ "scripts": { |
24600