mars3d-heatmap 3.6.14 → 3.6.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mars3d-heatmap.js +3 -3
- package/package.json +2 -2
package/dist/mars3d-heatmap.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Mars3D平台插件,结合heatmap可视化功能插件 mars3d-heatmap
|
|
3
3
|
*
|
|
4
|
-
* 版本信息:v3.6.
|
|
5
|
-
* 编译日期:2023-
|
|
4
|
+
* 版本信息:v3.6.15
|
|
5
|
+
* 编译日期:2023-12-05 19:27:11
|
|
6
6
|
* 版权所有:Copyright by 火星科技 http://mars3d.cn
|
|
7
7
|
* 使用单位:免费公开版 ,2023-03-17
|
|
8
8
|
*/
|
|
@@ -11,5 +11,5 @@
|
|
|
11
11
|
typeof define === 'function' && define.amd ? define(['exports', 'mars3d', '@mars3d/heatmap.js'], factory) :
|
|
12
12
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["mars3d-heatmap"] = {}, global.mars3d, global.h337));
|
|
13
13
|
})(this, (function (exports, mars3d, h337) {
|
|
14
|
-
'use strict';const _0x165c22=_0x18a4;(function(_0x8be27d,_0x1de568){const _0x16975c={_0x4bfd37:0x11d,_0x1d5ac2:0x111,_0x2c08f3:0x125,_0xf00de5:0xf2,_0x5a316b:0xff,_0x4af6be:0x11a,_0xfe5902:0x11c},_0x39c2e6=_0x18a4,_0x226b2f=_0x8be27d();while(!![]){try{const _0x4b8614=parseInt(_0x39c2e6(_0x16975c._0x4bfd37))/0x1+-parseInt(_0x39c2e6(_0x16975c._0x1d5ac2))/0x2*(parseInt(_0x39c2e6(0x126))/0x3)+-parseInt(_0x39c2e6(0x128))/0x4+-parseInt(_0x39c2e6(_0x16975c._0x2c08f3))/0x5*(-parseInt(_0x39c2e6(_0x16975c._0xf00de5))/0x6)+parseInt(_0x39c2e6(_0x16975c._0x5a316b))/0x7+parseInt(_0x39c2e6(0xf0))/0x8*(parseInt(_0x39c2e6(0x129))/0x9)+-parseInt(_0x39c2e6(_0x16975c._0x4af6be))/0xa*(parseInt(_0x39c2e6(_0x16975c._0xfe5902))/0xb);if(_0x4b8614===_0x1de568)break;else _0x226b2f['push'](_0x226b2f['shift']());}catch(_0x17f710){_0x226b2f['push'](_0x226b2f['shift']());}}}(_0x1841,0xf17fd));function _interopNamespace(_0x2439fe){const _0x5f5d5c=_0x18a4;if(_0x2439fe&&_0x2439fe['__esModule'])return _0x2439fe;var _0x2d12d3=Object['create'](null);return _0x2439fe&&Object[_0x5f5d5c(0x13e)](_0x2439fe)['forEach'](function(_0x4b10e1){const _0x379210=_0x5f5d5c;if(_0x4b10e1!=='default'){var _0x1dacf0=Object['getOwnPropertyDescriptor'](_0x2439fe,_0x4b10e1);Object['defineProperty'](_0x2d12d3,_0x4b10e1,_0x1dacf0[_0x379210(0x120)]?_0x1dacf0:{'enumerable':!![],'get':function(){return _0x2439fe[_0x4b10e1];}});}}),_0x2d12d3['default']=_0x2439fe,_0x2d12d3;}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');function _0x18a4(_0x103529,_0x4415aa){const _0x1841bb=_0x1841();return _0x18a4=function(_0x18a410,_0x133279){_0x18a410=_0x18a410-0xeb;let _0x46cada=_0x1841bb[_0x18a410];return _0x46cada;},_0x18a4(_0x103529,_0x4415aa);}const Cesium=mars3d__namespace[_0x165c22(0x140)],BaseLayer=mars3d__namespace['layer'][_0x165c22(0x108)],DEF_HEATSTYLE={'maxOpacity':0.8,'minOpacity':0.1,'blur':0.85,'radius':0x19,'gradient':{0.4:'blue',0.6:_0x165c22(0x10e),0.8:'yellow',0.9:'red'}},DEF_STYLE={'arcRadiusScale':1.5,'arcBlurScale':1.5,'vertexFormat':Cesium[_0x165c22(0x13b)][_0x165c22(0x11f)]};class HeatLayer extends BaseLayer{constructor(_0x29b668={}){const _0x5b4b07={_0x43a6e5:0x10f,_0x9d381a:0x10f,_0x3ff128:0xfe},_0x4f2e1c=_0x165c22;super(_0x29b668),this['options']['maxCanvasSize']=this['options']['maxCanvasSize']??document['body'][_0x4f2e1c(0x100)],this[_0x4f2e1c(_0x5b4b07._0x43a6e5)][_0x4f2e1c(0xef)]=Math[_0x4f2e1c(0xee)](this[_0x4f2e1c(_0x5b4b07._0x9d381a)][_0x4f2e1c(0xef)],0x1388),this[_0x4f2e1c(0x10f)]['minCanvasSize']=this['options'][_0x4f2e1c(_0x5b4b07._0x3ff128)]??document['body']['clientHeight'],this['options']['minCanvasSize']=Math['max'](this['options'][_0x4f2e1c(0xfe)],0x2bc),this[_0x4f2e1c(_0x5b4b07._0x9d381a)][_0x4f2e1c(0x132)]={...DEF_HEATSTYLE,...this['options']['heatStyle']},this['options']['style']={...DEF_STYLE,...this['options']['style']};}get['layer'](){return this['_layer'];}get['heatStyle'](){return this['options']['heatStyle'];}set[_0x165c22(0x132)](_0x277986){const _0x40d6da={_0x3fb05f:0x10f},_0x41d9c6=_0x165c22;this[_0x41d9c6(0x10f)]['heatStyle']=mars3d__namespace[_0x41d9c6(0x13f)]['merge'](this['options']['heatStyle'],_0x277986),this['_heat']&&(this['_heat']['configure'](this[_0x41d9c6(_0x40d6da._0x3fb05f)]['heatStyle']),this['_updatePositionsHook'](!![]));}get['style'](){return this['options']['style'];}set[_0x165c22(0x138)](_0xeb690d){const _0x564b5f={_0xf1685b:0x13f},_0x59b9e6=_0x165c22;this['options'][_0x59b9e6(0x138)]=mars3d__namespace[_0x59b9e6(_0x564b5f._0xf1685b)]['merge'](this['options']['style'],_0xeb690d);}get['positions'](){return this['_positions'];}set['positions'](_0x23bdcf){this['setPositions'](_0x23bdcf);}get['coordinates'](){const _0x58a5a2={_0x2754bb:0x12b},_0x41fb42=[];return this['points']['forEach'](_0x243012=>{const _0x844348=_0x18a4;_0x41fb42['push'](_0x243012[_0x844348(_0x58a5a2._0x2754bb)]());}),_0x41fb42;}get[_0x165c22(0x122)](){return this['_rectangle'];}['_setOptionsHook'](_0x3ab4fd,_0x264f9b){_0x3ab4fd['positions']&&(this['positions']=_0x3ab4fd['positions']);}[_0x165c22(0xeb)](){const _0x3f91e6={_0x53e81b:0x138},_0x2c41f6=_0x165c22;this[_0x2c41f6(_0x3f91e6._0x53e81b)]['type']==='image'?this['_layer']=new mars3d__namespace['layer']['ImageLayer']({'crs':_0x2c41f6(0x106),'private':!![]}):this['_layer']=new mars3d__namespace[(_0x2c41f6(0xf6))][(_0x2c41f6(0x12a))]({'private':!![]});}['_addedHook'](){const _0xc72435={_0x579d54:0x10b,_0xed23ec:0xf9,_0x2fc661:0x13c},_0x1c873d=_0x165c22;this['_map']['addLayer'](this['_layer']),this['_container']=mars3d__namespace['DomUtil'][_0x1c873d(0x107)]('div',_0x1c873d(_0xc72435._0x579d54),this[_0x1c873d(_0xc72435._0xed23ec)]['container']),this['options']['positions']&&(this['positions']=this[_0x1c873d(0x10f)][_0x1c873d(_0xc72435._0x2fc661)]),this['options'][_0x1c873d(0x124)]&&this['flyToByAnimationEnd']();}[_0x165c22(0x139)](){const _0x16d555={_0x22d879:0x12d},_0x27e06a=_0x165c22;this[_0x27e06a(_0x16d555._0x22d879)]&&(mars3d__namespace['DomUtil']['remove'](this['_container']),delete this['_container']),this['clear'](),this['_map']['removeLayer'](this['_layer']);}['addPosition'](_0xc96b60,_0x1c0bfb){const _0x3e47b9=_0x165c22;this['_positions']=this['_positions']||[],this['_positions'][_0x3e47b9(0x113)](_0xc96b60),this['_updatePositionsHook'](_0x1c0bfb);}['setPositions'](_0x5f21a9,_0x3c140d){const _0x3ec2ec=_0x165c22;this['_positions']=_0x5f21a9,this[_0x3ec2ec(0x102)](_0x3c140d);}['clear'](){const _0x1345ba={_0x460894:0x13d},_0x5e5e5d=_0x165c22;this['_graphic']&&(this['_layer']['removeGraphic'](this['_graphic'],!![]),delete this['_graphic']),this[_0x5e5e5d(_0x1345ba._0x460894)]&&(this['_layer']['removeGraphic'](this[_0x5e5e5d(0x13d)],!![]),delete this['_graphic2']);}['_updatePositionsHook'](_0x1cf302){const _0x3a602f={_0x169588:0xf9,_0x106086:0xf1,_0x3cb737:0x101,_0x1ea5ec:0x12f},_0x4ec698=_0x165c22;if(!this['show']||!this[_0x4ec698(_0x3a602f._0x169588)]||!this['positions']||this['positions'][_0x4ec698(_0x3a602f._0x106086)]===0x0)return this;const _0x7183b1=this['_getHeatCanvas']();if(this[_0x4ec698(0x138)][_0x4ec698(0x11e)]===_0x4ec698(0x127))this['_layer']['setOptions']({'url':_0x7183b1['toDataURL']('image/png'),'rectangle':this['_rectangle'],'opacity':this['style']['opacity']});else this['style']['arc']?this['_graphic']&&_0x1cf302?(this[_0x4ec698(_0x3a602f._0x3cb737)]['uniforms']['image']=_0x7183b1,this[_0x4ec698(0x101)]['uniforms']['bumpMap']=this['_getArcHeatCanvas'](),this['_graphic2']&&(this['_graphic2']['uniforms']['image']=_0x7183b1,this['_graphic2'][_0x4ec698(_0x3a602f._0x1ea5ec)][_0x4ec698(0x123)]=this[_0x4ec698(0x101)]['uniforms']['bumpMap'])):this['_createArcGraphic'](_0x7183b1):this['_graphic']&&_0x1cf302?this[_0x4ec698(0x101)]['uniforms']['image']=_0x7183b1:this['_createGraphic'](_0x7183b1);return this;}['_createGraphic'](_0xb8983e){const _0x27c70c={_0x5c3e52:0x11b,_0x2a65e2:0x135},_0x392b36=_0x165c22;this['clear'](),this['_graphic']=new mars3d__namespace['graphic']['RectanglePrimitive']({...this['options'],'rectangle':this[_0x392b36(0xed)],'appearance':new Cesium['EllipsoidSurfaceAppearance']({'material':new Cesium[(_0x392b36(_0x27c70c._0x5c3e52))]({'fabric':{'uniforms':{'image':_0xb8983e},'source':HeatMaterial},'translucent':!![]}),'flat':!![]})}),this[_0x392b36(_0x27c70c._0x2a65e2)]['addGraphic'](this['_graphic']);}['_createArcGraphic'](_0x14b969){const _0x19bdbb={_0x41bfc3:0x10c,_0x39c48:0x105,_0x515bc8:0x116,_0x19e676:0x138,_0x238dc6:0xed,_0x284d65:0x117,_0x48b7b9:0xf5,_0x5acf23:0x135,_0x5af661:0x112},_0x7f9028=_0x165c22;this[_0x7f9028(_0x19bdbb._0x41bfc3)]();const _0x465ab4=Cesium['RenderState'][_0x7f9028(0xfa)]({'cull':{'enabled':!![]},'depthTest':{'enabled':!![]},'stencilTest':{'enabled':!![],'frontFunction':Cesium['StencilFunction']['ALWAYS'],'frontOperation':{'fail':Cesium[_0x7f9028(0x10a)]['KEEP'],'zFail':Cesium['StencilOperation']['KEEP'],'zPass':Cesium['StencilOperation']['REPLACE']},'backFunction':Cesium['StencilFunction']['ALWAYS'],'backOperation':{'fail':Cesium['StencilOperation']['KEEP'],'zFail':Cesium['StencilOperation']['KEEP'],'zPass':Cesium['StencilOperation'][_0x7f9028(_0x19bdbb._0x39c48)]},'reference':0x2,'mask':0x2},'blending':Cesium['BlendingState'][_0x7f9028(0x109)]}),_0x172e76=Math['floor'](this[_0x7f9028(0x138)][_0x7f9028(_0x19bdbb._0x515bc8)]??this['_mBoundsMax']*0.02)+0.1;this[_0x7f9028(0x138)][_0x7f9028(_0x19bdbb._0x515bc8)]&&delete this[_0x7f9028(_0x19bdbb._0x19e676)]['diffHeight'];const _0x536f0f=(this['style']['splitNum'],0x64);let _0x48b459=Math[_0x7f9028(0x136)](this['_rectangle']['height'],this[_0x7f9028(_0x19bdbb._0x238dc6)]['width']);this[_0x7f9028(0x138)]['granularity']=_0x48b459/=_0x536f0f;const _0x23dbfd=new Cesium['Material']({'fabric':{'uniforms':{'image':_0x14b969,'repeat':new Cesium[(_0x7f9028(_0x19bdbb._0x284d65))](0x1,0x1),'color':new Cesium[(_0x7f9028(_0x19bdbb._0x48b7b9))](0x1,0x1,0x1,0x0),'bumpMap':this['_getArcHeatCanvas']()},'source':HeatMaterial},'translucent':!![]}),_0x2c7bd8=this['style']['arcDirection']||0x1;this['_graphic']=new mars3d__namespace[(_0x7f9028(0xf3))]['RectanglePrimitive']({...this['options'],'rectangle':this['_rectangle'],'appearance':new Cesium['EllipsoidSurfaceAppearance']({'flat':!![],'aboveGround':!![],'renderState':_0x465ab4,'material':_0x23dbfd,'vertexShaderSource':getVertexShaderSource(_0x172e76*_0x2c7bd8)})}),this[_0x7f9028(_0x19bdbb._0x5acf23)][_0x7f9028(0x110)](this['_graphic']),this[_0x7f9028(0x138)]['arcDirection']===0x0&&(this['_graphic2']=new mars3d__namespace[(_0x7f9028(0xf3))][(_0x7f9028(_0x19bdbb._0x5af661))]({...this['options'],'rectangle':this[_0x7f9028(_0x19bdbb._0x238dc6)],'appearance':new Cesium[(_0x7f9028(0x13b))]({'flat':!![],'aboveGround':!![],'renderState':_0x465ab4,'material':_0x23dbfd,'vertexShaderSource':getVertexShaderSource(-_0x172e76)})}),this['_layer']['addGraphic'](this[_0x7f9028(0x13d)]));}['getRectangle'](_0x2fc7b2){const _0x22d1ad=_0x165c22;return _0x2fc7b2!==null&&_0x2fc7b2!==void 0x0&&_0x2fc7b2['isFormat']&&this['_rectangle']?mars3d__namespace[_0x22d1ad(0xec)][_0x22d1ad(0x114)](this['_rectangle']):this['_rectangle'];}['_getHeatCanvas'](){const _0x5b9c6d={_0xd79602:0x12e,_0x419d2c:0x137,_0x4e9d75:0xef,_0x2633ab:0xef,_0x2d1455:0x10f,_0x1cf865:0x137,_0x494a3c:0x115,_0x293b48:0x130,_0x177ed6:0x10d,_0x1258eb:0x136,_0x103a37:0xf4,_0x4ecac8:0x103,_0x269d4c:0x107,_0x5545cd:0x104},_0x6859c3={_0x5523d7:0x121,_0x1f7496:0x10d,_0x37f636:0x12e},_0x399606={_0x56dd71:0xf7,_0x5db745:0xee,_0x3bb5d7:0x119},_0x1926da=_0x165c22,_0x3791b9=this['_positions'],_0x2522bf=[];let _0x463f7d,_0x3f820c,_0x36d1c8,_0x39a7b7;_0x3791b9['forEach'](_0x203ce3=>{const _0x348e60=_0x18a4,_0x1a1ac4=mars3d__namespace['LngLatPoint']['parse'](_0x203ce3);if(!_0x1a1ac4)return;_0x1a1ac4['value']=_0x203ce3['value']||0x1,!this[_0x348e60(0x10f)][_0x348e60(0x122)]&&(_0x463f7d===undefined?(_0x463f7d=_0x1a1ac4['lng'],_0x3f820c=_0x1a1ac4[_0x348e60(_0x399606._0x56dd71)],_0x36d1c8=_0x1a1ac4['lat'],_0x39a7b7=_0x1a1ac4['lat']):(_0x463f7d=Math[_0x348e60(_0x399606._0x5db745)](_0x463f7d,_0x1a1ac4['lng']),_0x3f820c=Math['max'](_0x3f820c,_0x1a1ac4['lng']),_0x36d1c8=Math['min'](_0x36d1c8,_0x1a1ac4[_0x348e60(_0x399606._0x3bb5d7)]),_0x39a7b7=Math[_0x348e60(0x136)](_0x39a7b7,_0x1a1ac4['lat']))),_0x2522bf['push'](_0x1a1ac4);});_0x463f7d===_0x3f820c&&(_0x463f7d-=0.000001,_0x3f820c+=0.000001);_0x36d1c8===_0x39a7b7&&(_0x36d1c8-=0.000001,_0x39a7b7+=0.000001);let _0x35e7eb=this['options']['rectangle']||{'xmin':_0x463f7d,'xmax':_0x3f820c,'ymin':_0x36d1c8,'ymax':_0x39a7b7};const _0x1088e7=getMercatorBounds(_0x35e7eb),_0x3cbe07=Math['abs'](_0x1088e7['xmax']-_0x1088e7['xmin']),_0xb3ec38=Math['abs'](_0x1088e7[_0x1926da(_0x5b9c6d._0xd79602)]-_0x1088e7[_0x1926da(_0x5b9c6d._0x419d2c)]),_0x125891=Math['max'](_0x3cbe07,_0xb3ec38),_0x1348db=Math[_0x1926da(0xee)](_0x3cbe07,_0xb3ec38);this['_mBoundsMax']=_0x125891;let _0x39b3ab=0x1;if(_0x125891>this['options'][_0x1926da(_0x5b9c6d._0x4e9d75)])_0x39b3ab=_0x125891/this[_0x1926da(0x10f)][_0x1926da(_0x5b9c6d._0x2633ab)],_0x1348db/_0x39b3ab<this['options']['minCanvasSize']&&(_0x39b3ab=_0x1348db/this['options']['minCanvasSize']);else _0x1348db<this['options'][_0x1926da(0xfe)]&&(_0x39b3ab=_0x1348db/this[_0x1926da(_0x5b9c6d._0x2d1455)]['minCanvasSize'],_0x125891/_0x39b3ab>this[_0x1926da(_0x5b9c6d._0x2d1455)]['maxCanvasSize']&&(_0x39b3ab=_0x125891/this['options'][_0x1926da(0xef)]));const _0x443014=this['heatStyle']['radius']*1.5,_0xfa1143=_0x3cbe07/_0x39b3ab+_0x443014*0x2,_0x24e295=_0xb3ec38/_0x39b3ab+_0x443014*0x2,_0x4e326d=_0x443014*_0x39b3ab;_0x1088e7['xmin']-=_0x4e326d,_0x1088e7[_0x1926da(_0x5b9c6d._0x1cf865)]-=_0x4e326d,_0x1088e7['xmax']+=_0x4e326d,_0x1088e7['ymax']+=_0x4e326d,this[_0x1926da(_0x5b9c6d._0x494a3c)]=_0x39b3ab,_0x35e7eb=geLatLngBounds(_0x1088e7),this[_0x1926da(0xed)]=Cesium[_0x1926da(_0x5b9c6d._0x293b48)][_0x1926da(0x134)](_0x35e7eb[_0x1926da(_0x5b9c6d._0x177ed6)],_0x35e7eb['ymin'],_0x35e7eb['xmax'],_0x35e7eb['ymax']);let _0x253301=_0x2522bf[0x0][_0x1926da(0xfb)]??0x1,_0x1fbba6=_0x2522bf[0x0]['value']??0x0;const _0x3d201b=[];_0x2522bf['forEach'](_0x581cf0=>{const _0x299f70=_0x1926da,_0x4b622d=mars3d__namespace[_0x299f70(_0x6859c3._0x5523d7)]['lonlat2mercator']([_0x581cf0['lng'],_0x581cf0[_0x299f70(0x119)]]),_0x5ac0ed=_0x581cf0['value']||0x1,_0x59391d=Math['round']((_0x4b622d[0x0]-_0x1088e7[_0x299f70(_0x6859c3._0x1f7496)])/_0x39b3ab),_0x5bc216=Math['round']((_0x1088e7[_0x299f70(_0x6859c3._0x37f636)]-_0x4b622d[0x1])/_0x39b3ab);_0x253301=Math[_0x299f70(0x136)](_0x253301,_0x5ac0ed),_0x1fbba6=Math['min'](_0x1fbba6,_0x5ac0ed),_0x3d201b['push']({'x':_0x59391d,'y':_0x5bc216,'value':_0x5ac0ed});});const _0x2ffc0c={'min':this['options']['min']??_0x1fbba6,'max':this['options'][_0x1926da(_0x5b9c6d._0x1258eb)]??_0x253301,'data':_0x3d201b};this['_last_heatData']=_0x2ffc0c;if(!this['_last_mBounds']||_0x1088e7['xmin']!==this['_last_mBounds']['xmin']||_0x1088e7['ymin']!==this['_last_mBounds']['ymin']||_0x1088e7['xmax']!==this[_0x1926da(_0x5b9c6d._0x103a37)]['xmax']||_0x1088e7['ymax']!==this['_last_mBounds'][_0x1926da(0x12e)]){this['_last_mBounds']=_0x1088e7,this[_0x1926da(0x12d)]['style']['cssText']='width:'+_0xfa1143+'px;height:'+_0x24e295+'px;';const _0x388285={...this[_0x1926da(0x132)],'container':this['_container']};!this[_0x1926da(_0x5b9c6d._0x4ecac8)]?this['_heat']=h337__namespace[_0x1926da(_0x5b9c6d._0x269d4c)](_0x388285):this['_heat']['configure'](_0x388285);}this['_heat']['setData'](_0x2ffc0c);const _0xc631ee=mars3d__namespace['DomUtil']['copyCanvas'](this['_heat'][_0x1926da(0x118)][_0x1926da(_0x5b9c6d._0x5545cd)]);return _0xc631ee;}[_0x165c22(0x131)](){const _0x18f72d={_0x3c154a:0x12c,_0x310138:0xfd},_0x288d73=_0x165c22;this[_0x288d73(0x103)]['configure']({'radius':this['heatStyle'][_0x288d73(_0x18f72d._0x3c154a)]*this['style']['arcRadiusScale'],'blur':this[_0x288d73(0x132)]['blur']*this['style']['arcBlurScale'],'gradient':this['heatStyle']['gradientArc']||{0.25:'rgb(0,0,0)',0.55:'rgb(140,140,140)',0.85:_0x288d73(_0x18f72d._0x310138),0x1:'rgb(255,255,255)'}});const _0x50e63d=mars3d__namespace['DomUtil']['copyCanvas'](this['_heat']['_renderer']['canvas']);return this['_heat']['configure'](this['options']['heatStyle']),_0x50e63d;}['getPointData'](_0x36eab8){const _0x10af99={_0x33023e:0x118},_0x369016=_0x165c22,_0x5aaad4=mars3d__namespace[_0x369016(0x133)]['parse'](_0x36eab8);if(!_0x5aaad4)return{};const _0x5e3b50=mars3d__namespace['PointTrans']['lonlat2mercator']([_0x5aaad4['lng'],_0x5aaad4['lat']]),_0x5a291b=this['_last_mBounds'],_0x5edec5=Math['round']((_0x5e3b50[0x0]-_0x5a291b[_0x369016(0x10d)])/this[_0x369016(0x115)]),_0x5076b7=Math['round']((_0x5a291b['ymax']-_0x5e3b50[0x1])/this['_scale']),_0x37712e=this['_heat']['getValueAt']({'x':_0x5edec5,'y':_0x5076b7}),_0x22b61a=this['_heat'][_0x369016(_0x10af99._0x33023e)]['ctx']['getImageData'](_0x5edec5-0x1,_0x5076b7-0x1,0x1,0x1)['data'];return{'x':_0x5edec5,'y':_0x5076b7,'value':_0x37712e,'color':'rgba('+_0x22b61a[0x0]+','+_0x22b61a[0x1]+','+_0x22b61a[0x2]+','+_0x22b61a[0x3]+')'};}}mars3d__namespace['LayerUtil']['register']('heat',HeatLayer),mars3d__namespace[_0x165c22(0xf6)]['HeatLayer']=HeatLayer,mars3d__namespace['h337']=h337__namespace;function getMercatorBounds(_0x5eef29){const _0x25cf70=mars3d__namespace['PointTrans']['lonlat2mercator']([_0x5eef29['xmin'],_0x5eef29['ymin']]),_0xc15b0f=mars3d__namespace['PointTrans']['lonlat2mercator']([_0x5eef29['xmax'],_0x5eef29['ymax']]);return{'xmin':_0x25cf70[0x0],'ymin':_0x25cf70[0x1],'xmax':_0xc15b0f[0x0],'ymax':_0xc15b0f[0x1]};}function _0x1841(){const _0x1acdf7=['Color','layer','lng','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','_map','fromCache','value','xmax','rgb(216,216,216)','minCanvasSize','6400331UWADax','clientWidth','_graphic','_updatePositionsHook','_heat','canvas','REPLACE','EPSG:3857','create','BaseLayer','ALPHA_BLEND','StencilOperation','mars3d-heatmap\x20mars3d-hideDiv','clear','xmin','green','options','addGraphic','18VoVhwO','RectanglePrimitive','push','formatRectangle','_scale','diffHeight','Cartesian2','_renderer','lat','14302970vGmWHb','Material','11UBCLCe','349540Easofk','type','VERTEX_FORMAT','get','PointTrans','rectangle','bumpMap','flyTo','8590ctCoLB','212082mzcTZY','image','6434768OmUvko','549ipkdin','GraphicLayer','toArray','radius','_container','ymax','uniforms','Rectangle','_getArcHeatCanvas','heatStyle','LngLatPoint','fromDegrees','_layer','max','ymin','style','_removedHook','HeatLayer','EllipsoidSurfaceAppearance','positions','_graphic2','keys','Util','Cesium','_mountedHook','PolyUtil','_rectangle','min','maxCanvasSize','193624gnULDJ','length','6720jkGyYS','graphic','_last_mBounds'];_0x1841=function(){return _0x1acdf7;};return _0x1841();}function geLatLngBounds(_0xeb7bf){const _0x38cf4a=_0x165c22,_0x9633a=mars3d__namespace['PointTrans']['mercator2lonlat']([_0xeb7bf['xmin'],_0xeb7bf['ymin']]),_0x43e90a=mars3d__namespace['PointTrans']['mercator2lonlat']([_0xeb7bf[_0x38cf4a(0xfc)],_0xeb7bf['ymax']]);return{'xmin':_0x9633a[0x0],'ymin':_0x9633a[0x1],'xmax':_0x43e90a[0x0],'ymax':_0x43e90a[0x1]};}function getVertexShaderSource(_0x2dfcb0){const _0x4d8e9f={_0x209c7d:0xf8},_0x3be015=_0x165c22;return _0x3be015(_0x4d8e9f._0x209c7d)+_0x2dfcb0+';\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[_0x165c22(0x13a)]=HeatLayer,Object['defineProperty'](exports,'__esModule',{'value':!![]});
|
|
14
|
+
'use strict';const _0x132db7=_0x590d;function _0x4867(){const _0xc81134=['_positions','h337','rgb(255,255,255)','bumpMap','ImageLayer','_graphic','abs','DomUtil','layer','parse','getRectangle','getImageData','7VrIQqW','xmin','addGraphic','2220476LxGdcD','type','clear','4632246oFKplh','flyToByAnimationEnd','style','ymax','setPositions','_heat','2204845FUEMWM','blue','4473080dwqBzj','3iqBToF','_mBoundsMax','defineProperty','xmax','VERTEX_FORMAT','Rectangle','options','minCanvasSize','Util','__esModule','graphic','LayerUtil','forEach','_rectangle','请引入\x20heatmap.js\x20库\x20','12nAZYdg','_last_heatData','_layer','points','_graphic2','min','_updatePositionsHook','diffHeight','mercator2lonlat','_map','formatRectangle','ymin','get','Color','arcBlurScale','REPLACE','image','canvas','8540EYASqe','coordinates','_container','maxCanvasSize','max','_last_mBounds','47113qalWZq','round','heatStyle','gradientArc','positions','864972lyboWF',';\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','lat','Material','value','getValueAt','StencilOperation','lonlat2mercator','177782czMBhW','clientWidth','EllipsoidSurfaceAppearance','body','create','_renderer','StencilFunction','PointTrans'];_0x4867=function(){return _0xc81134;};return _0x4867();}(function(_0x4eec13,_0x1548f3){const _0x3fa906={_0x31c6e6:0x213,_0x3e7b0f:0x21c,_0x32bf1e:0x21e,_0x5abb53:0x240},_0x347bd7=_0x590d,_0x54a0c1=_0x4eec13();while(!![]){try{const _0x25749b=-parseInt(_0x347bd7(0x21f))/0x1*(parseInt(_0x347bd7(0x1fc))/0x2)+-parseInt(_0x347bd7(0x1f4))/0x3+-parseInt(_0x347bd7(_0x3fa906._0x31c6e6))/0x4+parseInt(_0x347bd7(_0x3fa906._0x3e7b0f))/0x5*(-parseInt(_0x347bd7(0x22e))/0x6)+parseInt(_0x347bd7(0x210))/0x7*(-parseInt(_0x347bd7(_0x3fa906._0x32bf1e))/0x8)+-parseInt(_0x347bd7(0x216))/0x9+-parseInt(_0x347bd7(_0x3fa906._0x5abb53))/0xa*(-parseInt(_0x347bd7(0x1ef))/0xb);if(_0x25749b===_0x1548f3)break;else _0x54a0c1['push'](_0x54a0c1['shift']());}catch(_0x300ede){_0x54a0c1['push'](_0x54a0c1['shift']());}}}(_0x4867,0x907b7));function _interopNamespace(_0x21d168){const _0x294b6b={_0x26aade:0x221},_0x1c1285=_0x590d;if(_0x21d168&&_0x21d168[_0x1c1285(0x228)])return _0x21d168;var _0x1698ec=Object['create'](null);return _0x21d168&&Object['keys'](_0x21d168)['forEach'](function(_0x36eab4){const _0x52c5e8=_0x1c1285;if(_0x36eab4!=='default'){var _0x151734=Object['getOwnPropertyDescriptor'](_0x21d168,_0x36eab4);Object[_0x52c5e8(_0x294b6b._0x26aade)](_0x1698ec,_0x36eab4,_0x151734[_0x52c5e8(0x23a)]?_0x151734:{'enumerable':!![],'get':function(){return _0x21d168[_0x36eab4];}});}}),_0x1698ec['default']=_0x21d168,_0x1698ec;}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(_0x132db7(0x22d));const Cesium=mars3d__namespace['Cesium'],BaseLayer=mars3d__namespace['layer']['BaseLayer'],DEF_HEATSTYLE={'maxOpacity':0.8,'minOpacity':0.1,'blur':0.85,'radius':0x19,'gradient':{0.4:_0x132db7(0x21d),0.6:'green',0.8:'yellow',0.9:'red'}},DEF_STYLE={'arcRadiusScale':1.5,'arcBlurScale':1.5,'vertexFormat':Cesium['EllipsoidSurfaceAppearance'][_0x132db7(0x223)]};class HeatLayer extends BaseLayer{constructor(_0x4c98cf={}){const _0xc8a290={_0x34250d:0x1fd,_0x343f99:0x1ff,_0x1dd721:0x225,_0x583c9e:0x1f1},_0x174fd7=_0x132db7;super(_0x4c98cf),this[_0x174fd7(0x225)]['maxCanvasSize']=this[_0x174fd7(0x225)]['maxCanvasSize']??document['body'][_0x174fd7(_0xc8a290._0x34250d)],this['options'][_0x174fd7(0x1ec)]=Math['min'](this['options']['maxCanvasSize'],0x1388),this['options']['minCanvasSize']=this['options'][_0x174fd7(0x226)]??document[_0x174fd7(_0xc8a290._0x343f99)]['clientHeight'],this[_0x174fd7(0x225)]['minCanvasSize']=Math[_0x174fd7(0x1ed)](this['options']['minCanvasSize'],0x2bc),this[_0x174fd7(_0xc8a290._0x1dd721)]['heatStyle']={...DEF_HEATSTYLE,...this[_0x174fd7(_0xc8a290._0x1dd721)][_0x174fd7(_0xc8a290._0x583c9e)]},this['options']['style']={...DEF_STYLE,...this['options']['style']};}get['layer'](){return this['_layer'];}get[_0x132db7(0x1f1)](){return this['options']['heatStyle'];}set['heatStyle'](_0x369595){const _0x4ea5b3={_0x2b38bc:0x1f1},_0x16d772=_0x132db7;this[_0x16d772(0x225)][_0x16d772(_0x4ea5b3._0x2b38bc)]=mars3d__namespace['Util']['merge'](this[_0x16d772(0x225)][_0x16d772(0x1f1)],_0x369595),this['_heat']&&(this['_heat']['configure'](this['options']['heatStyle']),this['_updatePositionsHook'](!![]));}get[_0x132db7(0x218)](){return this['options']['style'];}set[_0x132db7(0x218)](_0x5b0840){const _0x24c1ee={_0x392362:0x227,_0x561580:0x218},_0x10104c=_0x132db7;this[_0x10104c(0x225)][_0x10104c(0x218)]=mars3d__namespace[_0x10104c(_0x24c1ee._0x392362)]['merge'](this['options'][_0x10104c(_0x24c1ee._0x561580)],_0x5b0840);}get[_0x132db7(0x1f3)](){return this['_positions'];}set['positions'](_0x73b842){this['setPositions'](_0x73b842);}get[_0x132db7(0x241)](){const _0x2aa191={_0x1f539b:0x231},_0x591d1a=_0x132db7,_0x4215af=[];return this[_0x591d1a(_0x2aa191._0x1f539b)]['forEach'](_0x523505=>{_0x4215af['push'](_0x523505['toArray']());}),_0x4215af;}get['rectangle'](){const _0x53f2b7={_0x42abb0:0x22c},_0x3e9614=_0x132db7;return this[_0x3e9614(_0x53f2b7._0x42abb0)];}['_setOptionsHook'](_0x43ebfb,_0x9c6282){_0x43ebfb['positions']&&(this['positions']=_0x43ebfb['positions']);}['_mountedHook'](){const _0x528703={_0x40a95a:0x214,_0x3af13d:0x23e,_0x53d4c5:0x20c},_0x12b580=_0x132db7;this['style'][_0x12b580(_0x528703._0x40a95a)]===_0x12b580(_0x528703._0x3af13d)?this[_0x12b580(0x230)]=new mars3d__namespace[(_0x12b580(_0x528703._0x53d4c5))][(_0x12b580(0x208))]({'crs':'EPSG:3857','private':!![]}):this['_layer']=new mars3d__namespace['layer']['GraphicLayer']({'private':!![]});}['_addedHook'](){const _0x5f0b14={_0x289efd:0x1eb,_0x4b43c2:0x237,_0x43835c:0x217},_0x137b46=_0x132db7;this['_map']['addLayer'](this['_layer']),this[_0x137b46(_0x5f0b14._0x289efd)]=mars3d__namespace['DomUtil'][_0x137b46(0x200)]('div','mars3d-heatmap\x20mars3d-hideDiv',this[_0x137b46(_0x5f0b14._0x4b43c2)]['container']),this['options']['positions']&&(this['positions']=this[_0x137b46(0x225)][_0x137b46(0x1f3)]),this[_0x137b46(0x225)]['flyTo']&&this[_0x137b46(_0x5f0b14._0x43835c)]();}['_removedHook'](){const _0x209079={_0x42b048:0x20b,_0x39457c:0x215},_0x407e7a=_0x132db7;this['_container']&&(mars3d__namespace[_0x407e7a(_0x209079._0x42b048)]['remove'](this['_container']),delete this['_container']),this[_0x407e7a(_0x209079._0x39457c)](),this['_map']['removeLayer'](this['_layer']);}['addPosition'](_0x175805,_0x56acfe){const _0x440ce3=_0x132db7;this['_positions']=this[_0x440ce3(0x204)]||[],this['_positions']['push'](_0x175805),this[_0x440ce3(0x234)](_0x56acfe);}[_0x132db7(0x21a)](_0x29b5b6,_0x12f731){const _0x415569=_0x132db7;this[_0x415569(0x204)]=_0x29b5b6,this['_updatePositionsHook'](_0x12f731);}['clear'](){const _0x14b0ba={_0x4ce772:0x209,_0x5a444a:0x232},_0xff9f85=_0x132db7;this['_graphic']&&(this['_layer']['removeGraphic'](this[_0xff9f85(_0x14b0ba._0x4ce772)],!![]),delete this['_graphic']),this['_graphic2']&&(this['_layer']['removeGraphic'](this[_0xff9f85(_0x14b0ba._0x5a444a)],!![]),delete this['_graphic2']);}['_updatePositionsHook'](_0x1ba07d){const _0x1155fe={_0x4e7738:0x209,_0x5962b3:0x23e,_0x4eb97e:0x232,_0x34ace5:0x23e},_0x27ed29=_0x132db7;if(!this['show']||!this['_map']||!this['positions']||this['positions']['length']===0x0)return this;const _0x1759fc=this['_getHeatCanvas']();if(this['style']['type']===_0x27ed29(0x23e))this[_0x27ed29(0x230)]['setOptions']({'url':_0x1759fc['toDataURL']('image/png'),'rectangle':this['_rectangle'],'opacity':this['style']['opacity']});else this['style']['arc']?this['_graphic']&&_0x1ba07d?(this[_0x27ed29(_0x1155fe._0x4e7738)]['uniforms'][_0x27ed29(_0x1155fe._0x5962b3)]=_0x1759fc,this['_graphic']['uniforms']['bumpMap']=this['_getArcHeatCanvas'](),this['_graphic2']&&(this['_graphic2']['uniforms']['image']=_0x1759fc,this[_0x27ed29(_0x1155fe._0x4eb97e)]['uniforms'][_0x27ed29(0x207)]=this['_graphic']['uniforms']['bumpMap'])):this['_createArcGraphic'](_0x1759fc):this['_graphic']&&_0x1ba07d?this['_graphic']['uniforms'][_0x27ed29(_0x1155fe._0x34ace5)]=_0x1759fc:this['_createGraphic'](_0x1759fc);return this;}['_createGraphic'](_0x4f44c3){const _0x2c528f={_0x46f72b:0x212},_0x3c0977=_0x132db7;this['clear'](),this['_graphic']=new mars3d__namespace['graphic']['RectanglePrimitive']({...this[_0x3c0977(0x225)],'rectangle':this['_rectangle'],'appearance':new Cesium[(_0x3c0977(0x1fe))]({'material':new Cesium['Material']({'fabric':{'uniforms':{'image':_0x4f44c3},'source':HeatMaterial},'translucent':!![]}),'flat':!![]})}),this['_layer'][_0x3c0977(_0x2c528f._0x46f72b)](this['_graphic']);}['_createArcGraphic'](_0x320169){const _0x210fb4={_0x1bb69b:0x215,_0xcc20f1:0x202,_0x50a60d:0x1fa,_0x3e171b:0x23d,_0x13115f:0x235,_0x4afef8:0x22c,_0x44f0fc:0x22c,_0x119cdd:0x229,_0x530f6d:0x209,_0x138779:0x22c},_0x220a54=_0x132db7;this[_0x220a54(_0x210fb4._0x1bb69b)]();const _0x256bf6=Cesium['RenderState']['fromCache']({'cull':{'enabled':!![]},'depthTest':{'enabled':!![]},'stencilTest':{'enabled':!![],'frontFunction':Cesium[_0x220a54(_0x210fb4._0xcc20f1)]['ALWAYS'],'frontOperation':{'fail':Cesium['StencilOperation']['KEEP'],'zFail':Cesium['StencilOperation']['KEEP'],'zPass':Cesium['StencilOperation'][_0x220a54(0x23d)]},'backFunction':Cesium[_0x220a54(_0x210fb4._0xcc20f1)]['ALWAYS'],'backOperation':{'fail':Cesium['StencilOperation']['KEEP'],'zFail':Cesium[_0x220a54(_0x210fb4._0x50a60d)]['KEEP'],'zPass':Cesium['StencilOperation'][_0x220a54(_0x210fb4._0x3e171b)]},'reference':0x2,'mask':0x2},'blending':Cesium['BlendingState']['ALPHA_BLEND']}),_0x3b5e33=Math['floor'](this['style']['diffHeight']??this[_0x220a54(0x220)]*0.02)+0.1;this['style']['diffHeight']&&delete this['style'][_0x220a54(_0x210fb4._0x13115f)];const _0x3174c0=(this[_0x220a54(0x218)]['splitNum'],0x64);let _0x187f94=Math['max'](this[_0x220a54(_0x210fb4._0x4afef8)]['height'],this[_0x220a54(_0x210fb4._0x44f0fc)]['width']);this['style']['granularity']=_0x187f94/=_0x3174c0;const _0xa4cd18=new Cesium[(_0x220a54(0x1f7))]({'fabric':{'uniforms':{'image':_0x320169,'repeat':new Cesium['Cartesian2'](0x1,0x1),'color':new Cesium[(_0x220a54(0x23b))](0x1,0x1,0x1,0x0),'bumpMap':this['_getArcHeatCanvas']()},'source':HeatMaterial},'translucent':!![]}),_0x405c27=this['style']['arcDirection']||0x1;this['_graphic']=new mars3d__namespace[(_0x220a54(_0x210fb4._0x119cdd))]['RectanglePrimitive']({...this['options'],'rectangle':this['_rectangle'],'appearance':new Cesium['EllipsoidSurfaceAppearance']({'flat':!![],'aboveGround':!![],'renderState':_0x256bf6,'material':_0xa4cd18,'vertexShaderSource':getVertexShaderSource(_0x3b5e33*_0x405c27)})}),this[_0x220a54(0x230)]['addGraphic'](this[_0x220a54(_0x210fb4._0x530f6d)]),this['style']['arcDirection']===0x0&&(this['_graphic2']=new mars3d__namespace['graphic']['RectanglePrimitive']({...this['options'],'rectangle':this[_0x220a54(_0x210fb4._0x138779)],'appearance':new Cesium['EllipsoidSurfaceAppearance']({'flat':!![],'aboveGround':!![],'renderState':_0x256bf6,'material':_0xa4cd18,'vertexShaderSource':getVertexShaderSource(-_0x3b5e33)})}),this['_layer']['addGraphic'](this['_graphic2']));}[_0x132db7(0x20e)](_0x5da58d){const _0x25e35f={_0x55685a:0x238},_0x4a83f2=_0x132db7;return _0x5da58d!==null&&_0x5da58d!==void 0x0&&_0x5da58d['isFormat']&&this['_rectangle']?mars3d__namespace['PolyUtil'][_0x4a83f2(_0x25e35f._0x55685a)](this['_rectangle']):this['_rectangle'];}['_getHeatCanvas'](){const _0x5618c4={_0x2dbc42:0x22b,_0x2d2a5f:0x20a,_0x117d4d:0x222,_0x93a8be:0x233,_0x2961ba:0x225,_0xebf77e:0x226,_0x37d520:0x1ec,_0x3af404:0x1f1,_0x3d999d:0x225,_0x17d9b1:0x22f,_0x1f32dc:0x211,_0x1e7cbf:0x222,_0x658ac9:0x1ee,_0x19b8d1:0x1eb,_0x58e6c0:0x21b,_0x2d1beb:0x201,_0x24bc3f:0x23f},_0x2c8e57={_0x43adf0:0x211},_0x1ae45c=_0x132db7,_0x2d045a=this['_positions'],_0x5e7ad9=[];let _0x145de6,_0x59bc2c,_0x43d88f,_0x42bd05;_0x2d045a[_0x1ae45c(_0x5618c4._0x2dbc42)](_0xbafd35=>{const _0x8389b2=_0x1ae45c,_0x49d4e1=mars3d__namespace['LngLatPoint']['parse'](_0xbafd35);if(!_0x49d4e1)return;_0x49d4e1['value']=_0xbafd35['value']||0x1,!this['options']['rectangle']&&(_0x145de6===undefined?(_0x145de6=_0x49d4e1['lng'],_0x59bc2c=_0x49d4e1['lng'],_0x43d88f=_0x49d4e1['lat'],_0x42bd05=_0x49d4e1['lat']):(_0x145de6=Math['min'](_0x145de6,_0x49d4e1['lng']),_0x59bc2c=Math['max'](_0x59bc2c,_0x49d4e1['lng']),_0x43d88f=Math['min'](_0x43d88f,_0x49d4e1['lat']),_0x42bd05=Math[_0x8389b2(0x1ed)](_0x42bd05,_0x49d4e1['lat']))),_0x5e7ad9['push'](_0x49d4e1);});_0x145de6===_0x59bc2c&&(_0x145de6-=0.000001,_0x59bc2c+=0.000001);_0x43d88f===_0x42bd05&&(_0x43d88f-=0.000001,_0x42bd05+=0.000001);let _0xab9b0=this['options']['rectangle']||{'xmin':_0x145de6,'xmax':_0x59bc2c,'ymin':_0x43d88f,'ymax':_0x42bd05};const _0x25290a=getMercatorBounds(_0xab9b0),_0x2086b8=Math[_0x1ae45c(_0x5618c4._0x2d2a5f)](_0x25290a[_0x1ae45c(_0x5618c4._0x117d4d)]-_0x25290a['xmin']),_0x5d5b4c=Math[_0x1ae45c(0x20a)](_0x25290a['ymax']-_0x25290a[_0x1ae45c(0x239)]),_0x342869=Math[_0x1ae45c(0x1ed)](_0x2086b8,_0x5d5b4c),_0xcfe5a4=Math[_0x1ae45c(_0x5618c4._0x93a8be)](_0x2086b8,_0x5d5b4c);this['_mBoundsMax']=_0x342869;let _0x42107f=0x1;if(_0x342869>this[_0x1ae45c(_0x5618c4._0x2961ba)]['maxCanvasSize'])_0x42107f=_0x342869/this[_0x1ae45c(_0x5618c4._0x2961ba)]['maxCanvasSize'],_0xcfe5a4/_0x42107f<this['options'][_0x1ae45c(0x226)]&&(_0x42107f=_0xcfe5a4/this['options'][_0x1ae45c(0x226)]);else _0xcfe5a4<this['options']['minCanvasSize']&&(_0x42107f=_0xcfe5a4/this[_0x1ae45c(0x225)][_0x1ae45c(_0x5618c4._0xebf77e)],_0x342869/_0x42107f>this['options']['maxCanvasSize']&&(_0x42107f=_0x342869/this['options'][_0x1ae45c(_0x5618c4._0x37d520)]));const _0x3d3372=this[_0x1ae45c(_0x5618c4._0x3af404)]['radius']*1.5,_0x17e265=_0x2086b8/_0x42107f+_0x3d3372*0x2,_0x47efd9=_0x5d5b4c/_0x42107f+_0x3d3372*0x2,_0x17ece8=_0x3d3372*_0x42107f;_0x25290a[_0x1ae45c(0x211)]-=_0x17ece8,_0x25290a['ymin']-=_0x17ece8,_0x25290a['xmax']+=_0x17ece8,_0x25290a[_0x1ae45c(0x219)]+=_0x17ece8,this['_scale']=_0x42107f,_0xab9b0=geLatLngBounds(_0x25290a),this[_0x1ae45c(0x22c)]=Cesium[_0x1ae45c(0x224)]['fromDegrees'](_0xab9b0['xmin'],_0xab9b0['ymin'],_0xab9b0['xmax'],_0xab9b0['ymax']);let _0x2e77e6=_0x5e7ad9[0x0]['value']??0x1,_0x7bb5cf=_0x5e7ad9[0x0]['value']??0x0;const _0x2a1a43=[];_0x5e7ad9['forEach'](_0x3bd611=>{const _0x51fcdb=_0x1ae45c,_0x4624ef=mars3d__namespace[_0x51fcdb(0x203)]['lonlat2mercator']([_0x3bd611['lng'],_0x3bd611['lat']]),_0x35e6e5=_0x3bd611[_0x51fcdb(0x1f8)]||0x1,_0x2ec480=Math['round']((_0x4624ef[0x0]-_0x25290a[_0x51fcdb(_0x2c8e57._0x43adf0)])/_0x42107f),_0x3e1dfb=Math['round']((_0x25290a['ymax']-_0x4624ef[0x1])/_0x42107f);_0x2e77e6=Math['max'](_0x2e77e6,_0x35e6e5),_0x7bb5cf=Math[_0x51fcdb(0x233)](_0x7bb5cf,_0x35e6e5),_0x2a1a43['push']({'x':_0x2ec480,'y':_0x3e1dfb,'value':_0x35e6e5});});const _0x35e50d={'min':this['options']['min']??_0x7bb5cf,'max':this[_0x1ae45c(_0x5618c4._0x3d999d)]['max']??_0x2e77e6,'data':_0x2a1a43};this[_0x1ae45c(_0x5618c4._0x17d9b1)]=_0x35e50d;if(!this['_last_mBounds']||_0x25290a[_0x1ae45c(_0x5618c4._0x1f32dc)]!==this['_last_mBounds']['xmin']||_0x25290a['ymin']!==this['_last_mBounds']['ymin']||_0x25290a[_0x1ae45c(0x222)]!==this['_last_mBounds'][_0x1ae45c(_0x5618c4._0x1e7cbf)]||_0x25290a['ymax']!==this['_last_mBounds']['ymax']){this[_0x1ae45c(_0x5618c4._0x658ac9)]=_0x25290a,this['_container']['style']['cssText']='width:'+_0x17e265+'px;height:'+_0x47efd9+'px;';const _0x42c7f4={...this['heatStyle'],'container':this[_0x1ae45c(_0x5618c4._0x19b8d1)]};!this[_0x1ae45c(_0x5618c4._0x58e6c0)]?this['_heat']=h337__namespace['create'](_0x42c7f4):this['_heat']['configure'](_0x42c7f4);}this['_heat']['setData'](_0x35e50d);const _0x451eb7=mars3d__namespace['DomUtil']['copyCanvas'](this[_0x1ae45c(0x21b)][_0x1ae45c(_0x5618c4._0x2d1beb)][_0x1ae45c(_0x5618c4._0x24bc3f)]);return _0x451eb7;}['_getArcHeatCanvas'](){const _0x257bfe={_0x59696c:0x23c,_0x216275:0x20b,_0x4051d4:0x201},_0x5e45c0=_0x132db7;this['_heat']['configure']({'radius':this['heatStyle']['radius']*this['style']['arcRadiusScale'],'blur':this['heatStyle']['blur']*this['style'][_0x5e45c0(_0x257bfe._0x59696c)],'gradient':this['heatStyle'][_0x5e45c0(0x1f2)]||{0.25:'rgb(0,0,0)',0.55:'rgb(140,140,140)',0.85:'rgb(216,216,216)',0x1:_0x5e45c0(0x206)}});const _0x386983=mars3d__namespace[_0x5e45c0(_0x257bfe._0x216275)]['copyCanvas'](this['_heat'][_0x5e45c0(_0x257bfe._0x4051d4)]['canvas']);return this['_heat']['configure'](this['options'][_0x5e45c0(0x1f1)]),_0x386983;}['getPointData'](_0x1951a3){const _0x25d3ad={_0x5b5abf:0x1f9,_0x499776:0x20f},_0x4ab3a8=_0x132db7,_0x5caab0=mars3d__namespace['LngLatPoint'][_0x4ab3a8(0x20d)](_0x1951a3);if(!_0x5caab0)return{};const _0x6dd69a=mars3d__namespace['PointTrans']['lonlat2mercator']([_0x5caab0['lng'],_0x5caab0[_0x4ab3a8(0x1f6)]]),_0x49c19a=this['_last_mBounds'],_0x21768b=Math['round']((_0x6dd69a[0x0]-_0x49c19a['xmin'])/this['_scale']),_0x5c6f1a=Math[_0x4ab3a8(0x1f0)]((_0x49c19a['ymax']-_0x6dd69a[0x1])/this['_scale']),_0x5cff75=this['_heat'][_0x4ab3a8(_0x25d3ad._0x5b5abf)]({'x':_0x21768b,'y':_0x5c6f1a}),_0x4cd101=this['_heat']['_renderer']['ctx'][_0x4ab3a8(_0x25d3ad._0x499776)](_0x21768b-0x1,_0x5c6f1a-0x1,0x1,0x1)['data'];return{'x':_0x21768b,'y':_0x5c6f1a,'value':_0x5cff75,'color':'rgba('+_0x4cd101[0x0]+','+_0x4cd101[0x1]+','+_0x4cd101[0x2]+','+_0x4cd101[0x3]+')'};}}mars3d__namespace[_0x132db7(0x22a)]['register']('heat',HeatLayer),mars3d__namespace['layer']['HeatLayer']=HeatLayer,mars3d__namespace[_0x132db7(0x205)]=h337__namespace;function getMercatorBounds(_0x70a75){const _0x2f3edd=_0x132db7,_0x26197e=mars3d__namespace['PointTrans']['lonlat2mercator']([_0x70a75['xmin'],_0x70a75[_0x2f3edd(0x239)]]),_0x4f7bbf=mars3d__namespace[_0x2f3edd(0x203)][_0x2f3edd(0x1fb)]([_0x70a75['xmax'],_0x70a75['ymax']]);return{'xmin':_0x26197e[0x0],'ymin':_0x26197e[0x1],'xmax':_0x4f7bbf[0x0],'ymax':_0x4f7bbf[0x1]};}function _0x590d(_0x1b4bc3,_0xe31af8){const _0x4867bf=_0x4867();return _0x590d=function(_0x590d06,_0x28d0a2){_0x590d06=_0x590d06-0x1eb;let _0x114b3e=_0x4867bf[_0x590d06];return _0x114b3e;},_0x590d(_0x1b4bc3,_0xe31af8);}function geLatLngBounds(_0x4e36c0){const _0x44a1ec={_0x5cc893:0x211,_0x181b30:0x239,_0xf1a30b:0x219},_0x184517=_0x132db7,_0x27bf79=mars3d__namespace['PointTrans']['mercator2lonlat']([_0x4e36c0[_0x184517(_0x44a1ec._0x5cc893)],_0x4e36c0[_0x184517(_0x44a1ec._0x181b30)]]),_0x34f922=mars3d__namespace['PointTrans'][_0x184517(0x236)]([_0x4e36c0['xmax'],_0x4e36c0[_0x184517(_0x44a1ec._0xf1a30b)]]);return{'xmin':_0x27bf79[0x0],'ymin':_0x27bf79[0x1],'xmax':_0x34f922[0x0],'ymax':_0x34f922[0x1]};}function getVertexShaderSource(_0xf2cf6a){const _0x2375c8={_0x20acdb:0x1f5},_0x1569b8=_0x132db7;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'+_0xf2cf6a+_0x1569b8(_0x2375c8._0x20acdb);}exports['HeatLayer']=HeatLayer,Object['defineProperty'](exports,'__esModule',{'value':!![]});
|
|
15
15
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mars3d-heatmap",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.15",
|
|
4
4
|
"description": "Mars3D平台插件,结合heatmap可视化功能插件",
|
|
5
5
|
"main": "dist/mars3d-heatmap.js",
|
|
6
6
|
"files": [
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"@mars3d/heatmap.js": "^2.0.7"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"mars3d": "~3.6.
|
|
13
|
+
"mars3d": "~3.6.15"
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
16
|
"lint": "eslint ./src/**/*.{js,ts} --fix"
|