mars3d-heatmap 3.5.9 → 3.5.10
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/README.md +1 -1
- package/dist/mars3d-heatmap.js +3 -3
- package/package.json +2 -2
package/README.md
CHANGED
package/dist/mars3d-heatmap.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Mars3D平台插件,结合heatmap可视化功能插件 mars3d-heatmap
|
|
3
3
|
*
|
|
4
|
-
* 版本信息:v3.5.
|
|
5
|
-
* 编译日期:2023-05
|
|
4
|
+
* 版本信息:v3.5.10
|
|
5
|
+
* 编译日期:2023-06-05 18:17:57
|
|
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 _0x1d34c6=_0x4a6a;function _0x4a6a(_0x520ddf,_0x137f59){const _0x37ce73=_0x37ce();return _0x4a6a=function(_0x4a6ab7,_0x44189a){_0x4a6ab7=_0x4a6ab7-0xf9;let _0x32fc3e=_0x37ce73[_0x4a6ab7];return _0x32fc3e;},_0x4a6a(_0x520ddf,_0x137f59);}(function(_0x3cab92,_0x3ed680){const _0x125036={_0x528b53:0x12a,_0x40e9d7:0x147,_0x338f64:0x12f},_0x58a2e9=_0x4a6a,_0x36ccf3=_0x3cab92();while(!![]){try{const _0x1864c4=parseInt(_0x58a2e9(0xf9))/0x1*(parseInt(_0x58a2e9(_0x125036._0x528b53))/0x2)+parseInt(_0x58a2e9(_0x125036._0x40e9d7))/0x3+-parseInt(_0x58a2e9(0x141))/0x4+-parseInt(_0x58a2e9(0x135))/0x5*(-parseInt(_0x58a2e9(0x151))/0x6)+parseInt(_0x58a2e9(0x143))/0x7+parseInt(_0x58a2e9(0x12b))/0x8+parseInt(_0x58a2e9(_0x125036._0x338f64))/0x9*(-parseInt(_0x58a2e9(0x121))/0xa);if(_0x1864c4===_0x3ed680)break;else _0x36ccf3['push'](_0x36ccf3['shift']());}catch(_0xb82f34){_0x36ccf3['push'](_0x36ccf3['shift']());}}}(_0x37ce,0x65e84));function _interopNamespace(_0x2d3a04){const _0x1eb5e1={_0x17f855:0x11c},_0x791131={_0x2f31f2:0xff,_0x5e05ff:0x146},_0x2287b6=_0x4a6a;if(_0x2d3a04&&_0x2d3a04['__esModule'])return _0x2d3a04;var _0x45c08e=Object['create'](null);return _0x2d3a04&&Object['keys'](_0x2d3a04)[_0x2287b6(_0x1eb5e1._0x17f855)](function(_0x3d4cc2){const _0x265bb0=_0x2287b6;if(_0x3d4cc2!==_0x265bb0(_0x791131._0x2f31f2)){var _0x2a0f68=Object['getOwnPropertyDescriptor'](_0x2d3a04,_0x3d4cc2);Object['defineProperty'](_0x45c08e,_0x3d4cc2,_0x2a0f68[_0x265bb0(_0x791131._0x5e05ff)]?_0x2a0f68:{'enumerable':!![],'get':function(){return _0x2d3a04[_0x3d4cc2];}});}}),_0x45c08e['default']=_0x2d3a04,_0x45c08e;}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[_0x1d34c6(0x114)])throw new Error('请引入\x20heatmap.js\x20库\x20');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:_0x1d34c6(0x125),0.6:_0x1d34c6(0x118),0.8:'yellow',0.9:_0x1d34c6(0x137)}},DEF_STYLE={'arcRadiusScale':1.5,'arcBlurScale':1.5,'vertexFormat':Cesium['EllipsoidSurfaceAppearance']['VERTEX_FORMAT']};class HeatLayer extends BaseLayer{constructor(_0x5c4012={}){const _0x23e37c={_0x490bc8:0x126,_0x32279:0x13f,_0x4ce58a:0x145,_0x4358af:0x127,_0x5bb5fe:0x14f},_0x56d87e=_0x1d34c6;super(_0x5c4012),this['options']['maxCanvasSize']=this[_0x56d87e(0x127)]['maxCanvasSize']??document[_0x56d87e(_0x23e37c._0x490bc8)][_0x56d87e(_0x23e37c._0x32279)],this['options'][_0x56d87e(_0x23e37c._0x4ce58a)]=Math['min'](this['options']['maxCanvasSize'],0x1388),this[_0x56d87e(_0x23e37c._0x4358af)][_0x56d87e(_0x23e37c._0x5bb5fe)]=this[_0x56d87e(0x127)][_0x56d87e(0x14f)]??document['body']['clientHeight'],this[_0x56d87e(0x127)]['minCanvasSize']=Math['max'](this['options']['minCanvasSize'],0x2bc),this[_0x56d87e(0x127)]['heatStyle']={...DEF_HEATSTYLE,...this['options'][_0x56d87e(0x109)]||{}},this['options']['style']={...DEF_STYLE,...this['options']['style']||{}};}get[_0x1d34c6(0x10e)](){return this['_layer'];}get['heatStyle'](){return this['options']['heatStyle'];}set[_0x1d34c6(0x109)](_0x4a4108){const _0x2d5085=_0x1d34c6;this['options']['heatStyle']=mars3d__namespace['Util'][_0x2d5085(0x104)](this['options']['heatStyle'],_0x4a4108),this['_heat']&&(this['_heat']['configure'](this['options'][_0x2d5085(0x109)]),this['_updatePositionsHook'](!![]));}get['style'](){const _0x20329e={_0x562ca2:0x11a},_0x217c0b=_0x1d34c6;return this['options'][_0x217c0b(_0x20329e._0x562ca2)];}set[_0x1d34c6(0x11a)](_0x2a1aea){const _0x4373d9={_0x5d77b5:0x127},_0x41e356=_0x1d34c6;this['options']['style']=mars3d__namespace[_0x41e356(0xfb)][_0x41e356(0x104)](this[_0x41e356(_0x4373d9._0x5d77b5)]['style'],_0x2a1aea);}get[_0x1d34c6(0x10c)](){return this['_positions'];}set['positions'](_0x190188){const _0xd6965f=_0x1d34c6;this[_0xd6965f(0x14d)](_0x190188);}get['coordinates'](){const _0x443462={_0x943fdb:0x13b},_0x4c683b=[];return this['points']['forEach'](_0x338454=>{const _0x469934=_0x4a6a;_0x4c683b[_0x469934(_0x443462._0x943fdb)](_0x338454['toArray']());}),_0x4c683b;}get['rectangle'](){return this['_rectangle'];}['_setOptionsHook'](_0x478bab,_0x4e4aea){_0x478bab['positions']&&(this['positions']=_0x478bab['positions']);}[_0x1d34c6(0x129)](){const _0x1fdedc={_0x4f7701:0x10e},_0x596541=_0x1d34c6;this['style']['type']==='image'?this['_layer']=new mars3d__namespace[(_0x596541(_0x1fdedc._0x4f7701))]['ImageLayer']({'crs':'EPSG:3857','private':!![]}):this[_0x596541(0x119)]=new mars3d__namespace['layer']['GraphicLayer']({'private':!![]});}['_addedHook'](){const _0x12db99={_0x35ea74:0x128,_0xbc28be:0x10c,_0xb3823d:0x150},_0xe5458=_0x1d34c6;this['_map'][_0xe5458(_0x12db99._0x35ea74)](this['_layer']),this['_container']=mars3d__namespace['DomUtil']['create']('div','mars3d-heatmap\x20mars3d-hideDiv',this['_map']['container']),this['options']['positions']&&(this[_0xe5458(_0x12db99._0xbc28be)]=this[_0xe5458(0x127)][_0xe5458(_0x12db99._0xbc28be)]),this['options'][_0xe5458(_0x12db99._0xb3823d)]&&this['flyToByAnimationEnd']();}['_removedHook'](){const _0x590392=_0x1d34c6;this['_container']&&(mars3d__namespace[_0x590392(0x122)][_0x590392(0x14b)](this[_0x590392(0x13e)]),delete this['_container']),this['clear'](),this['_map']['removeLayer'](this['_layer']);}[_0x1d34c6(0x140)](_0x57f06b,_0x26e173){const _0x337d0c={_0x49ae1c:0x14c,_0x110b3e:0xfd},_0x5f38d8=_0x1d34c6;this[_0x5f38d8(_0x337d0c._0x49ae1c)]=this['_positions']||[],this[_0x5f38d8(_0x337d0c._0x49ae1c)]['push'](_0x57f06b),this[_0x5f38d8(_0x337d0c._0x110b3e)](_0x26e173);}['setPositions'](_0x140645,_0x4ffd22){const _0x162455={_0x3ed6e8:0x14c},_0x5c51b8=_0x1d34c6;this[_0x5c51b8(_0x162455._0x3ed6e8)]=_0x140645,this['_updatePositionsHook'](_0x4ffd22);}['clear'](){const _0x102b35={_0x4c89df:0x119,_0x377e85:0x138,_0x1af9d5:0x144},_0x1d631e=_0x1d34c6;this['_graphic']&&(this[_0x1d631e(_0x102b35._0x4c89df)][_0x1d631e(_0x102b35._0x377e85)](this['_graphic'],!![]),delete this[_0x1d631e(_0x102b35._0x1af9d5)]),this[_0x1d631e(0x148)]&&(this['_layer']['removeGraphic'](this['_graphic2'],!![]),delete this['_graphic2']);}['_updatePositionsHook'](_0x39aa6f){const _0x5d6a48={_0x4e7c8a:0x124,_0x1884c0:0x139,_0x5a1cfd:0x11a,_0x5bd31d:0x108,_0x3bee83:0x102,_0x5d8e3b:0x144},_0x505e47=_0x1d34c6;if(!this[_0x505e47(0xfc)]||!this[_0x505e47(_0x5d6a48._0x4e7c8a)]||!this[_0x505e47(0x10c)]||this['positions']['length']===0x0)return this;const _0x47779e=this[_0x505e47(0x107)]();if(this['style']['type']==='image')this['_layer']['setOptions']({'url':_0x47779e['toDataURL']('image/png'),'rectangle':this[_0x505e47(0x105)],'opacity':this['style'][_0x505e47(_0x5d6a48._0x1884c0)]});else this[_0x505e47(_0x5d6a48._0x5a1cfd)]['arc']?this[_0x505e47(0x144)]&&_0x39aa6f?(this['_graphic']['uniforms']['image']=_0x47779e,this['_graphic'][_0x505e47(0x111)][_0x505e47(_0x5d6a48._0x5bd31d)]=this['_getArcHeatCanvas'](),this['_graphic2']&&(this['_graphic2']['uniforms']['image']=_0x47779e,this['_graphic2']['uniforms']['bumpMap']=this['_graphic']['uniforms'][_0x505e47(0x108)])):this[_0x505e47(_0x5d6a48._0x3bee83)](_0x47779e):this['_graphic']&&_0x39aa6f?this[_0x505e47(_0x5d6a48._0x5d8e3b)]['uniforms'][_0x505e47(0x103)]=_0x47779e:this['_createGraphic'](_0x47779e);return this;}['_createGraphic'](_0x20954e){const _0x3fec52={_0x421c06:0x120,_0x4067d0:0x119},_0x576ec0=_0x1d34c6;this[_0x576ec0(_0x3fec52._0x421c06)](),this[_0x576ec0(0x144)]=new mars3d__namespace['graphic'][(_0x576ec0(0x113))]({...this['options'],'rectangle':this['_rectangle'],'appearance':new Cesium[(_0x576ec0(0x117))]({'material':new Cesium['Material']({'fabric':{'uniforms':{'image':_0x20954e},'source':HeatMaterial},'translucent':!![]}),'flat':!![]})}),this[_0x576ec0(_0x3fec52._0x4067d0)]['addGraphic'](this[_0x576ec0(0x144)]);}['_createArcGraphic'](_0x146e30){const _0x5a8ce6={_0x20701b:0x115,_0x51e325:0x106,_0x2bb63a:0x14e,_0x27afaa:0x11a,_0x143509:0x149,_0x3148e9:0x13a,_0x461379:0x144,_0x22967b:0x119,_0x193b9:0x105,_0x3a36ad:0x148},_0x4021aa=_0x1d34c6;this['clear']();const _0x1f44fb=Cesium['RenderState']['fromCache']({'cull':{'enabled':!![]},'depthTest':{'enabled':!![]},'stencilTest':{'enabled':!![],'frontFunction':Cesium[_0x4021aa(_0x5a8ce6._0x20701b)]['ALWAYS'],'frontOperation':{'fail':Cesium[_0x4021aa(_0x5a8ce6._0x51e325)]['KEEP'],'zFail':Cesium['StencilOperation']['KEEP'],'zPass':Cesium[_0x4021aa(0x106)]['REPLACE']},'backFunction':Cesium[_0x4021aa(0x115)]['ALWAYS'],'backOperation':{'fail':Cesium['StencilOperation']['KEEP'],'zFail':Cesium['StencilOperation'][_0x4021aa(_0x5a8ce6._0x2bb63a)],'zPass':Cesium['StencilOperation']['REPLACE']},'reference':0x2,'mask':0x2},'blending':Cesium[_0x4021aa(0xfa)]['ALPHA_BLEND']}),_0x8f2e4b=Math['floor'](this['style']['diffHeight']??this['_mBoundsMax']*0.02)+0.1;this[_0x4021aa(_0x5a8ce6._0x27afaa)][_0x4021aa(_0x5a8ce6._0x143509)]&&delete this['style']['diffHeight'];const _0x38d819=(this['style'][_0x4021aa(_0x5a8ce6._0x3148e9)],0x64);let _0x7c8aa1=Math['max'](this['_rectangle']['height'],this['_rectangle']['width']);this['style']['granularity']=_0x7c8aa1/=_0x38d819;const _0x244dbf=new Cesium['Material']({'fabric':{'uniforms':{'image':_0x146e30,'repeat':new Cesium['Cartesian2'](0x1,0x1),'color':new Cesium['Color'](0x1,0x1,0x1,0x0),'bumpMap':this['_getArcHeatCanvas']()},'source':HeatMaterial},'translucent':!![]}),_0x56a3b9=this['style']['arcDirection']||0x1;this[_0x4021aa(_0x5a8ce6._0x461379)]=new mars3d__namespace[(_0x4021aa(0x14a))][(_0x4021aa(0x113))]({...this['options'],'rectangle':this['_rectangle'],'appearance':new Cesium['EllipsoidSurfaceAppearance']({'flat':!![],'aboveGround':!![],'renderState':_0x1f44fb,'material':_0x244dbf,'vertexShaderSource':getVertexShaderSource(_0x8f2e4b*_0x56a3b9)})}),this[_0x4021aa(_0x5a8ce6._0x22967b)]['addGraphic'](this['_graphic']),this['style'][_0x4021aa(0x10a)]===0x0&&(this['_graphic2']=new mars3d__namespace['graphic']['RectanglePrimitive']({...this['options'],'rectangle':this[_0x4021aa(_0x5a8ce6._0x193b9)],'appearance':new Cesium['EllipsoidSurfaceAppearance']({'flat':!![],'aboveGround':!![],'renderState':_0x1f44fb,'material':_0x244dbf,'vertexShaderSource':getVertexShaderSource(-_0x8f2e4b)})}),this['_layer']['addGraphic'](this[_0x4021aa(_0x5a8ce6._0x3a36ad)]));}[_0x1d34c6(0x132)](_0x556c36){const _0x12f541=_0x1d34c6;return _0x556c36!==null&&_0x556c36!==void 0x0&&_0x556c36[_0x12f541(0x10b)]&&this[_0x12f541(0x105)]?mars3d__namespace['PolyUtil']['formatRectangle'](this['_rectangle']):this['_rectangle'];}['_getHeatCanvas'](){const _0x1b0061={_0x1bbb77:0x12c,_0x19c01a:0x145,_0x2653b9:0x14f,_0x460f1b:0x127,_0x9f912e:0x12e,_0x3434e2:0x105,_0x188886:0x112,_0x13ea08:0x10f,_0x1e855e:0x134,_0x461809:0x13d,_0xffebd4:0x136,_0x55e84f:0x136,_0xd8a5be:0x11b},_0x284235={_0x7d8889:0x12d},_0x3a6f8f=_0x1d34c6,_0x468fe3=this['_positions'],_0x3913c9=[];let _0x4e0f88,_0x42914f,_0xaaba57,_0x3116ac;_0x468fe3['forEach'](_0x516588=>{const _0x3526db=_0x4a6a,_0x247770=mars3d__namespace['LngLatPoint'][_0x3526db(0x10d)](_0x516588);if(!_0x247770)return;_0x247770['value']=_0x516588['value']||0x1,!this['options']['rectangle']&&(_0x4e0f88===undefined?(_0x4e0f88=_0x247770['lng'],_0x42914f=_0x247770['lng'],_0xaaba57=_0x247770[_0x3526db(_0x284235._0x7d8889)],_0x3116ac=_0x247770['lat']):(_0x4e0f88=Math[_0x3526db(0xfe)](_0x4e0f88,_0x247770['lng']),_0x42914f=Math['max'](_0x42914f,_0x247770['lng']),_0xaaba57=Math['min'](_0xaaba57,_0x247770['lat']),_0x3116ac=Math['max'](_0x3116ac,_0x247770['lat']))),_0x3913c9['push'](_0x247770);});let _0xc998ec=this['options']['rectangle']||{'xmin':_0x4e0f88,'xmax':_0x42914f,'ymin':_0xaaba57,'ymax':_0x3116ac};const _0x510faf=getMercatorBounds(_0xc998ec),_0x1af62b=Math['abs'](_0x510faf['xmax']-_0x510faf['xmin']),_0x3bd1f0=Math[_0x3a6f8f(_0x1b0061._0x1bbb77)](_0x510faf[_0x3a6f8f(0x112)]-_0x510faf['ymin']),_0x372034=Math['max'](_0x1af62b,_0x3bd1f0),_0x2ced22=Math['min'](_0x1af62b,_0x3bd1f0);this['_mBoundsMax']=_0x372034;let _0x3cfb76=0x1;if(_0x372034>this['options'][_0x3a6f8f(0x145)])_0x3cfb76=_0x372034/this['options'][_0x3a6f8f(_0x1b0061._0x19c01a)],_0x2ced22/_0x3cfb76<this['options'][_0x3a6f8f(_0x1b0061._0x2653b9)]&&(_0x3cfb76=_0x2ced22/this['options']['minCanvasSize']);else _0x2ced22<this[_0x3a6f8f(_0x1b0061._0x460f1b)][_0x3a6f8f(0x14f)]&&(_0x3cfb76=_0x2ced22/this['options']['minCanvasSize'],_0x372034/_0x3cfb76>this[_0x3a6f8f(0x127)]['maxCanvasSize']&&(_0x3cfb76=_0x372034/this['options']['maxCanvasSize']));const _0x3c89c9=this[_0x3a6f8f(0x109)]['radius']*1.5,_0x83d34b=_0x1af62b/_0x3cfb76+_0x3c89c9*0x2,_0x59c0b6=_0x3bd1f0/_0x3cfb76+_0x3c89c9*0x2,_0x5520fd=_0x3c89c9*_0x3cfb76;_0x510faf[_0x3a6f8f(_0x1b0061._0x9f912e)]-=_0x5520fd,_0x510faf[_0x3a6f8f(0x136)]-=_0x5520fd,_0x510faf[_0x3a6f8f(0x100)]+=_0x5520fd,_0x510faf['ymax']+=_0x5520fd,this['_scale']=_0x3cfb76,_0xc998ec=geLatLngBounds(_0x510faf),this[_0x3a6f8f(_0x1b0061._0x3434e2)]=Cesium[_0x3a6f8f(0x110)]['fromDegrees'](_0xc998ec[_0x3a6f8f(_0x1b0061._0x9f912e)],_0xc998ec['ymin'],_0xc998ec['xmax'],_0xc998ec[_0x3a6f8f(_0x1b0061._0x188886)]);let _0x5c64c8=_0x3913c9[0x0][_0x3a6f8f(0x131)]??0x1,_0x19429b=_0x3913c9[0x0]['value']??0x0;const _0x4d8a0d=[];_0x3913c9['forEach'](_0x4f6eb9=>{const _0x5d64be=mars3d__namespace['PointTrans']['lonlat2mercator']([_0x4f6eb9['lng'],_0x4f6eb9['lat']]),_0x5577c0=_0x4f6eb9['value']||0x1,_0x48d06c=Math['round']((_0x5d64be[0x0]-_0x510faf['xmin'])/_0x3cfb76),_0x20145a=Math['round']((_0x510faf['ymax']-_0x5d64be[0x1])/_0x3cfb76);_0x5c64c8=Math['max'](_0x5c64c8,_0x5577c0),_0x19429b=Math['min'](_0x19429b,_0x5577c0),_0x4d8a0d['push']({'x':_0x48d06c,'y':_0x20145a,'value':_0x5577c0});});const _0x42fdd2={'min':this['options']['min']??_0x19429b,'max':this['options'][_0x3a6f8f(_0x1b0061._0x13ea08)]??_0x5c64c8,'data':_0x4d8a0d};this[_0x3a6f8f(_0x1b0061._0x1e855e)]=_0x42fdd2;if(!this['_last_mBounds']||_0x510faf['xmin']!==this[_0x3a6f8f(_0x1b0061._0x461809)]['xmin']||_0x510faf[_0x3a6f8f(_0x1b0061._0xffebd4)]!==this[_0x3a6f8f(0x13d)][_0x3a6f8f(_0x1b0061._0x55e84f)]||_0x510faf['xmax']!==this['_last_mBounds']['xmax']||_0x510faf['ymax']!==this['_last_mBounds']['ymax']){this['_last_mBounds']=_0x510faf,this['_container']['style']['cssText']='width:'+_0x83d34b+'px;height:'+_0x59c0b6+_0x3a6f8f(0x11e);const _0x335283={...this[_0x3a6f8f(0x109)],'container':this['_container']};!this['_heat']?this['_heat']=h337__namespace['create'](_0x335283):this['_heat']['configure'](_0x335283);}this['_heat'][_0x3a6f8f(_0x1b0061._0xd8a5be)](_0x42fdd2);const _0xb18662=mars3d__namespace['DomUtil']['copyCanvas'](this['_heat']['_renderer'][_0x3a6f8f(0x133)]);return _0xb18662;}['_getArcHeatCanvas'](){const _0x9e725a={_0x2b8a40:0x123,_0x1b94de:0x109,_0x55d331:0x11d,_0x1dab78:0x133},_0x897cd7=_0x1d34c6;this['_heat']['configure']({'radius':this['heatStyle'][_0x897cd7(_0x9e725a._0x2b8a40)]*this['style']['arcRadiusScale'],'blur':this[_0x897cd7(_0x9e725a._0x1b94de)]['blur']*this['style']['arcBlurScale'],'gradient':this[_0x897cd7(_0x9e725a._0x1b94de)]['gradientArc']||{0.25:_0x897cd7(_0x9e725a._0x55d331),0.55:'rgb(140,140,140)',0.85:'rgb(216,216,216)',0x1:'rgb(255,255,255)'}});const _0x1ba4e7=mars3d__namespace[_0x897cd7(0x122)][_0x897cd7(0x116)](this['_heat']['_renderer'][_0x897cd7(_0x9e725a._0x1dab78)]);return this['_heat']['configure'](this['options']['heatStyle']),_0x1ba4e7;}['getPointData'](_0x4b7115){const _0xa32317={_0x201ce8:0x11f,_0x5b058:0x12d},_0x438b92=_0x1d34c6,_0xfe49b2=mars3d__namespace[_0x438b92(_0xa32317._0x201ce8)]['parse'](_0x4b7115);if(!_0xfe49b2)return{};const _0xe867f4=mars3d__namespace[_0x438b92(0x130)]['lonlat2mercator']([_0xfe49b2['lng'],_0xfe49b2[_0x438b92(_0xa32317._0x5b058)]]),_0x5120b1=this['_last_mBounds'],_0x44d5f3=Math['round']((_0xe867f4[0x0]-_0x5120b1['xmin'])/this['_scale']),_0x450468=Math['round']((_0x5120b1['ymax']-_0xe867f4[0x1])/this['_scale']),_0x3e11ac=this['_heat']['getValueAt']({'x':_0x44d5f3,'y':_0x450468}),_0x6b0319=this[_0x438b92(0x142)]['_renderer']['ctx']['getImageData'](_0x44d5f3-0x1,_0x450468-0x1,0x1,0x1)['data'];return{'x':_0x44d5f3,'y':_0x450468,'value':_0x3e11ac,'color':'rgba('+_0x6b0319[0x0]+','+_0x6b0319[0x1]+','+_0x6b0319[0x2]+','+_0x6b0319[0x3]+')'};}}mars3d__namespace['layer']['HeatLayer']=HeatLayer,mars3d__namespace[_0x1d34c6(0x13c)]['register']('heat',HeatLayer);function _0x37ce(){const _0xad8d56=['337dzxCHQ','BlendingState','Util','show','_updatePositionsHook','min','default','xmax',';\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','_createArcGraphic','image','merge','_rectangle','StencilOperation','_getHeatCanvas','bumpMap','heatStyle','arcDirection','isFormat','positions','parse','layer','max','Rectangle','uniforms','ymax','RectanglePrimitive','create','StencilFunction','copyCanvas','EllipsoidSurfaceAppearance','green','_layer','style','setData','forEach','rgb(0,0,0)','px;','LngLatPoint','clear','2600630WcglNo','DomUtil','radius','_map','blue','body','options','addLayer','_mountedHook','4878SIetxr','2810320rwNhNG','abs','lat','xmin','36MQBPPg','PointTrans','value','getRectangle','canvas','_last_heatData','1922905YXBcwP','ymin','red','removeGraphic','opacity','splitNum','push','LayerUtil','_last_mBounds','_container','clientWidth','addPosition','1761536WksGot','_heat','1648192FbVQUN','_graphic','maxCanvasSize','get','314334zOyxSZ','_graphic2','diffHeight','graphic','remove','_positions','setPositions','KEEP','minCanvasSize','flyTo','6vtERwj'];_0x37ce=function(){return _0xad8d56;};return _0x37ce();}function getMercatorBounds(_0x418b8e){const _0x473e62=_0x1d34c6,_0x51ca7d=mars3d__namespace['PointTrans']['lonlat2mercator']([_0x418b8e[_0x473e62(0x12e)],_0x418b8e['ymin']]),_0xda2906=mars3d__namespace['PointTrans']['lonlat2mercator']([_0x418b8e['xmax'],_0x418b8e['ymax']]);return{'xmin':_0x51ca7d[0x0],'ymin':_0x51ca7d[0x1],'xmax':_0xda2906[0x0],'ymax':_0xda2906[0x1]};}function geLatLngBounds(_0x4bf585){const _0x3b4e0b=mars3d__namespace['PointTrans']['mercator2lonlat']([_0x4bf585['xmin'],_0x4bf585['ymin']]),_0x487fa2=mars3d__namespace['PointTrans']['mercator2lonlat']([_0x4bf585['xmax'],_0x4bf585['ymax']]);return{'xmin':_0x3b4e0b[0x0],'ymin':_0x3b4e0b[0x1],'xmax':_0x487fa2[0x0],'ymax':_0x487fa2[0x1]};}function getVertexShaderSource(_0x37d61e){const _0x10acd9=_0x1d34c6;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'+_0x37d61e+_0x10acd9(0x101);}exports['HeatLayer']=HeatLayer,Object['defineProperty'](exports,'__esModule',{'value':!![]});
|
|
14
|
+
'use strict';const _0x5997cb=_0x453f;(function(_0x499800,_0x42dcc1){const _0x49fcf3={_0x11214a:0x1ea,_0x13cdab:0x229,_0x25a5e1:0x21c,_0x35bde7:0x1f4},_0x5e2832=_0x453f,_0x547f27=_0x499800();while(!![]){try{const _0x44bf63=-parseInt(_0x5e2832(_0x49fcf3._0x11214a))/0x1+parseInt(_0x5e2832(0x22b))/0x2*(parseInt(_0x5e2832(_0x49fcf3._0x13cdab))/0x3)+-parseInt(_0x5e2832(0x21f))/0x4*(parseInt(_0x5e2832(_0x49fcf3._0x25a5e1))/0x5)+parseInt(_0x5e2832(0x204))/0x6+-parseInt(_0x5e2832(0x212))/0x7*(parseInt(_0x5e2832(_0x49fcf3._0x35bde7))/0x8)+parseInt(_0x5e2832(0x1fb))/0x9+parseInt(_0x5e2832(0x1dc))/0xa;if(_0x44bf63===_0x42dcc1)break;else _0x547f27['push'](_0x547f27['shift']());}catch(_0xe136e2){_0x547f27['push'](_0x547f27['shift']());}}}(_0xdc72,0x56f50));function _interopNamespace(_0x3c2e21){const _0x3f5188={_0x1ed444:0x22f},_0x19a13c=_0x453f;if(_0x3c2e21&&_0x3c2e21[_0x19a13c(0x1e1)])return _0x3c2e21;var _0x232fa5=Object['create'](null);return _0x3c2e21&&Object['keys'](_0x3c2e21)[_0x19a13c(_0x3f5188._0x1ed444)](function(_0x40610b){const _0x1c605b=_0x19a13c;if(_0x40610b!==_0x1c605b(0x21b)){var _0x163664=Object['getOwnPropertyDescriptor'](_0x3c2e21,_0x40610b);Object['defineProperty'](_0x232fa5,_0x40610b,_0x163664['get']?_0x163664:{'enumerable':!![],'get':function(){return _0x3c2e21[_0x40610b];}});}}),_0x232fa5['default']=_0x3c2e21,_0x232fa5;}var mars3d__namespace=_interopNamespace(mars3d),h337__namespace=_interopNamespace(h337),HeatMaterial=_0x5997cb(0x1eb);function _0xdc72(){const _0x2fd941=['value','options','lat','_getHeatCanvas','arcDirection','diffHeight','rgb(0,0,0)','_createGraphic','positions','LayerUtil','layer','div','20846dVPMiF','rgba(','_rectangle','RectanglePrimitive','Cartesian2','StencilOperation','_setOptionsHook','configure','PointTrans','default','5tLkfIc','push','heatStyle','58088yecqNr','flyTo','round','height','_heat','_layer','image','create','Rectangle','maxCanvasSize','9KWZByv','copyCanvas','3642enFAAK','length','ymin','bumpMap','forEach','px;height:','minCanvasSize','DomUtil','_updatePositionsHook','3862550jWplqf','xmin','uniforms','VERTEX_FORMAT','ImageLayer','__esModule','_graphic','_scale','min','body','_renderer','EllipsoidSurfaceAppearance','_positions','KEEP','546005VQmujk','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','max','addLayer','graphic','xmax','defineProperty','clear',';\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','Material','920FbHGSe','lng','ALWAYS','_last_mBounds','removeLayer','rectangle','_getArcHeatCanvas','6211494RbnEoR','container','EPSG:3857','getImageData','ymax','px;','_graphic2','setData','removeGraphic','1063734qvjQUU','style'];_0xdc72=function(){return _0x2fd941;};return _0xdc72();}function _0x453f(_0xe960,_0x8fef39){const _0xdc72fe=_0xdc72();return _0x453f=function(_0x453fdd,_0x4c8f5a){_0x453fdd=_0x453fdd-0x1d8;let _0x4e2ea3=_0xdc72fe[_0x453fdd];return _0x4e2ea3;},_0x453f(_0xe960,_0x8fef39);}if(!h337__namespace[_0x5997cb(0x226)])throw new Error('请引入\x20heatmap.js\x20库\x20');const Cesium=mars3d__namespace['Cesium'],BaseLayer=mars3d__namespace[_0x5997cb(0x210)]['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'][_0x5997cb(0x1df)]};class HeatLayer extends BaseLayer{constructor(_0x347ec7={}){const _0x48edc0={_0x565ae4:0x228,_0x40195d:0x207,_0x6f8c8e:0x1d9,_0x5e0487:0x21e},_0x559c0e=_0x5997cb;super(_0x347ec7),this['options'][_0x559c0e(0x228)]=this[_0x559c0e(0x207)]['maxCanvasSize']??document[_0x559c0e(0x1e5)]['clientWidth'],this['options'][_0x559c0e(_0x48edc0._0x565ae4)]=Math[_0x559c0e(0x1e4)](this[_0x559c0e(_0x48edc0._0x40195d)]['maxCanvasSize'],0x1388),this['options']['minCanvasSize']=this['options']['minCanvasSize']??document['body']['clientHeight'],this['options'][_0x559c0e(_0x48edc0._0x6f8c8e)]=Math['max'](this['options']['minCanvasSize'],0x2bc),this['options'][_0x559c0e(_0x48edc0._0x5e0487)]={...DEF_HEATSTYLE,...this['options']['heatStyle']||{}},this[_0x559c0e(_0x48edc0._0x40195d)]['style']={...DEF_STYLE,...this['options'][_0x559c0e(0x205)]||{}};}get['layer'](){return this['_layer'];}get['heatStyle'](){return this['options']['heatStyle'];}set[_0x5997cb(0x21e)](_0xddec85){const _0x4918a6={_0x5accbc:0x207,_0x2c4ce1:0x223,_0x1c58e9:0x1db},_0x3ba0f5=_0x5997cb;this[_0x3ba0f5(_0x4918a6._0x5accbc)][_0x3ba0f5(0x21e)]=mars3d__namespace['Util']['merge'](this['options'][_0x3ba0f5(0x21e)],_0xddec85),this['_heat']&&(this[_0x3ba0f5(_0x4918a6._0x2c4ce1)]['configure'](this['options']['heatStyle']),this[_0x3ba0f5(_0x4918a6._0x1c58e9)](!![]));}get[_0x5997cb(0x205)](){return this['options']['style'];}set[_0x5997cb(0x205)](_0x42adf4){this['options']['style']=mars3d__namespace['Util']['merge'](this['options']['style'],_0x42adf4);}get[_0x5997cb(0x20e)](){const _0x298630=_0x5997cb;return this[_0x298630(0x1e8)];}set['positions'](_0x2c62b0){this['setPositions'](_0x2c62b0);}get['coordinates'](){const _0x2d219b=[];return this['points']['forEach'](_0x3f9dae=>{_0x2d219b['push'](_0x3f9dae['toArray']());}),_0x2d219b;}get[_0x5997cb(0x1f9)](){const _0x3d85c5={_0x18b423:0x214},_0x458382=_0x5997cb;return this[_0x458382(_0x3d85c5._0x18b423)];}[_0x5997cb(0x218)](_0x1c9640,_0x6f6430){_0x1c9640['positions']&&(this['positions']=_0x1c9640['positions']);}['_mountedHook'](){const _0x4446d5={_0x1b19e8:0x224,_0x5d2ce3:0x1e0},_0x5a57ba=_0x5997cb;this['style']['type']==='image'?this[_0x5a57ba(_0x4446d5._0x1b19e8)]=new mars3d__namespace['layer'][(_0x5a57ba(_0x4446d5._0x5d2ce3))]({'crs':_0x5a57ba(0x1fd),'private':!![]}):this['_layer']=new mars3d__namespace['layer']['GraphicLayer']({'private':!![]});}['_addedHook'](){const _0x24935e={_0x3e9d60:0x1ed,_0x52f3db:0x224,_0x3bc2b8:0x211,_0x29bbab:0x1fc,_0x4d1bd4:0x20e},_0x2fd4bd=_0x5997cb;this['_map'][_0x2fd4bd(_0x24935e._0x3e9d60)](this[_0x2fd4bd(_0x24935e._0x52f3db)]),this['_container']=mars3d__namespace[_0x2fd4bd(0x1da)]['create'](_0x2fd4bd(_0x24935e._0x3bc2b8),'mars3d-heatmap\x20mars3d-hideDiv',this['_map'][_0x2fd4bd(_0x24935e._0x29bbab)]),this[_0x2fd4bd(0x207)][_0x2fd4bd(0x20e)]&&(this[_0x2fd4bd(_0x24935e._0x4d1bd4)]=this['options'][_0x2fd4bd(0x20e)]),this['options'][_0x2fd4bd(0x220)]&&this['flyToByAnimationEnd']();}['_removedHook'](){const _0x517720={_0x2fd9b8:0x1f1},_0x1811a6=_0x5997cb;this['_container']&&(mars3d__namespace['DomUtil']['remove'](this['_container']),delete this['_container']),this[_0x1811a6(_0x517720._0x2fd9b8)](),this['_map'][_0x1811a6(0x1f8)](this['_layer']);}['addPosition'](_0x36ffa5,_0x57e78e){const _0x3db2c4=_0x5997cb;this['_positions']=this['_positions']||[],this['_positions'][_0x3db2c4(0x21d)](_0x36ffa5),this['_updatePositionsHook'](_0x57e78e);}['setPositions'](_0x28b56a,_0x3700aa){this['_positions']=_0x28b56a,this['_updatePositionsHook'](_0x3700aa);}['clear'](){const _0x546c86={_0x4d4817:0x201},_0x12c243=_0x5997cb;this['_graphic']&&(this[_0x12c243(0x224)]['removeGraphic'](this['_graphic'],!![]),delete this['_graphic']),this[_0x12c243(_0x546c86._0x4d4817)]&&(this['_layer'][_0x12c243(0x203)](this['_graphic2'],!![]),delete this['_graphic2']);}['_updatePositionsHook'](_0xfbca6e){const _0x572122={_0x56d69f:0x20e,_0x482c7e:0x225,_0x45694b:0x22e},_0x462ec5=_0x5997cb;if(!this['show']||!this['_map']||!this[_0x462ec5(_0x572122._0x56d69f)]||this['positions'][_0x462ec5(0x22c)]===0x0)return this;const _0x4d676b=this['_getHeatCanvas']();if(this['style']['type']==='image')this['_layer']['setOptions']({'url':_0x4d676b['toDataURL']('image/png'),'rectangle':this['_rectangle'],'opacity':this['style']['opacity']});else this['style']['arc']?this['_graphic']&&_0xfbca6e?(this['_graphic']['uniforms'][_0x462ec5(_0x572122._0x482c7e)]=_0x4d676b,this['_graphic']['uniforms'][_0x462ec5(_0x572122._0x45694b)]=this['_getArcHeatCanvas'](),this['_graphic2']&&(this['_graphic2']['uniforms']['image']=_0x4d676b,this['_graphic2']['uniforms']['bumpMap']=this['_graphic']['uniforms']['bumpMap'])):this['_createArcGraphic'](_0x4d676b):this['_graphic']&&_0xfbca6e?this['_graphic'][_0x462ec5(0x1de)][_0x462ec5(0x225)]=_0x4d676b:this[_0x462ec5(0x20d)](_0x4d676b);return this;}['_createGraphic'](_0x2ca68a){const _0x29901a={_0x1e866c:0x1e2,_0xb3e280:0x215},_0x45d5b3=_0x5997cb;this['clear'](),this[_0x45d5b3(_0x29901a._0x1e866c)]=new mars3d__namespace['graphic'][(_0x45d5b3(_0x29901a._0xb3e280))]({...this['options'],'rectangle':this['_rectangle'],'appearance':new Cesium['EllipsoidSurfaceAppearance']({'material':new Cesium['Material']({'fabric':{'uniforms':{'image':_0x2ca68a},'source':HeatMaterial},'translucent':!![]}),'flat':!![]})}),this['_layer']['addGraphic'](this[_0x45d5b3(0x1e2)]);}['_createArcGraphic'](_0x1fbf66){const _0x5472b5={_0x391e2e:0x1f1,_0x2277b9:0x217,_0x24b7aa:0x1e9,_0x29740a:0x1e9,_0x14034b:0x216,_0x56d2a2:0x1e7,_0x5a689a:0x224},_0x31fde0=_0x5997cb;this[_0x31fde0(_0x5472b5._0x391e2e)]();const _0x37274a=Cesium['RenderState']['fromCache']({'cull':{'enabled':!![]},'depthTest':{'enabled':!![]},'stencilTest':{'enabled':!![],'frontFunction':Cesium['StencilFunction'][_0x31fde0(0x1f6)],'frontOperation':{'fail':Cesium[_0x31fde0(_0x5472b5._0x2277b9)][_0x31fde0(_0x5472b5._0x24b7aa)],'zFail':Cesium['StencilOperation'][_0x31fde0(_0x5472b5._0x29740a)],'zPass':Cesium['StencilOperation']['REPLACE']},'backFunction':Cesium['StencilFunction']['ALWAYS'],'backOperation':{'fail':Cesium['StencilOperation']['KEEP'],'zFail':Cesium[_0x31fde0(_0x5472b5._0x2277b9)]['KEEP'],'zPass':Cesium['StencilOperation']['REPLACE']},'reference':0x2,'mask':0x2},'blending':Cesium['BlendingState']['ALPHA_BLEND']}),_0x28ed5e=Math['floor'](this['style'][_0x31fde0(0x20b)]??this['_mBoundsMax']*0.02)+0.1;this['style']['diffHeight']&&delete this['style'][_0x31fde0(0x20b)];const _0x670f6a=(this['style']['splitNum'],0x64);let _0x2443e7=Math['max'](this['_rectangle'][_0x31fde0(0x222)],this['_rectangle']['width']);this['style']['granularity']=_0x2443e7/=_0x670f6a;const _0x3707f8=new Cesium[(_0x31fde0(0x1f3))]({'fabric':{'uniforms':{'image':_0x1fbf66,'repeat':new Cesium[(_0x31fde0(_0x5472b5._0x14034b))](0x1,0x1),'color':new Cesium['Color'](0x1,0x1,0x1,0x0),'bumpMap':this[_0x31fde0(0x1fa)]()},'source':HeatMaterial},'translucent':!![]}),_0x2ef528=this['style']['arcDirection']||0x1;this['_graphic']=new mars3d__namespace[(_0x31fde0(0x1ee))]['RectanglePrimitive']({...this['options'],'rectangle':this['_rectangle'],'appearance':new Cesium[(_0x31fde0(_0x5472b5._0x56d2a2))]({'flat':!![],'aboveGround':!![],'renderState':_0x37274a,'material':_0x3707f8,'vertexShaderSource':getVertexShaderSource(_0x28ed5e*_0x2ef528)})}),this['_layer']['addGraphic'](this['_graphic']),this[_0x31fde0(0x205)][_0x31fde0(0x20a)]===0x0&&(this['_graphic2']=new mars3d__namespace['graphic']['RectanglePrimitive']({...this['options'],'rectangle':this[_0x31fde0(0x214)],'appearance':new Cesium[(_0x31fde0(0x1e7))]({'flat':!![],'aboveGround':!![],'renderState':_0x37274a,'material':_0x3707f8,'vertexShaderSource':getVertexShaderSource(-_0x28ed5e)})}),this[_0x31fde0(_0x5472b5._0x5a689a)]['addGraphic'](this['_graphic2']));}['getRectangle'](_0x26fe32){return _0x26fe32!==null&&_0x26fe32!==void 0x0&&_0x26fe32['isFormat']&&this['_rectangle']?mars3d__namespace['PolyUtil']['formatRectangle'](this['_rectangle']):this['_rectangle'];}[_0x5997cb(0x209)](){const _0x5d8cb5={_0x2f43d9:0x1dd,_0x3c464e:0x1e4,_0x44cd7b:0x207,_0x51700d:0x1d9,_0x2408b8:0x1d9,_0x23dfd4:0x228,_0x5b0640:0x1ff,_0x2282f1:0x1e3,_0x34ec24:0x214,_0x5600ef:0x1ef,_0x228097:0x219,_0x26f975:0x202},_0x85f917={_0x52200d:0x21a,_0x54bb17:0x1dd,_0x39b8c8:0x1ff},_0x273348={_0x280036:0x206,_0xf6ba14:0x207,_0x497cc9:0x1e4,_0x261548:0x1ec},_0xc41b96=_0x5997cb,_0x29fe70=this['_positions'],_0x1045d7=[];let _0x366f0c,_0x5a941b,_0x5feb9d,_0x31f8fb;_0x29fe70['forEach'](_0x5c492f=>{const _0x545e64=_0x453f,_0x47b8ee=mars3d__namespace['LngLatPoint']['parse'](_0x5c492f);if(!_0x47b8ee)return;_0x47b8ee['value']=_0x5c492f[_0x545e64(_0x273348._0x280036)]||0x1,!this[_0x545e64(_0x273348._0xf6ba14)]['rectangle']&&(_0x366f0c===undefined?(_0x366f0c=_0x47b8ee['lng'],_0x5a941b=_0x47b8ee['lng'],_0x5feb9d=_0x47b8ee['lat'],_0x31f8fb=_0x47b8ee['lat']):(_0x366f0c=Math['min'](_0x366f0c,_0x47b8ee['lng']),_0x5a941b=Math['max'](_0x5a941b,_0x47b8ee['lng']),_0x5feb9d=Math[_0x545e64(_0x273348._0x497cc9)](_0x5feb9d,_0x47b8ee['lat']),_0x31f8fb=Math[_0x545e64(_0x273348._0x261548)](_0x31f8fb,_0x47b8ee['lat']))),_0x1045d7['push'](_0x47b8ee);});let _0x5480c5=this['options'][_0xc41b96(0x1f9)]||{'xmin':_0x366f0c,'xmax':_0x5a941b,'ymin':_0x5feb9d,'ymax':_0x31f8fb};const _0x5c6ca7=getMercatorBounds(_0x5480c5),_0x1df1da=Math['abs'](_0x5c6ca7['xmax']-_0x5c6ca7[_0xc41b96(_0x5d8cb5._0x2f43d9)]),_0xaa4fb=Math['abs'](_0x5c6ca7[_0xc41b96(0x1ff)]-_0x5c6ca7['ymin']),_0x49b7bb=Math['max'](_0x1df1da,_0xaa4fb),_0x13b3bf=Math[_0xc41b96(_0x5d8cb5._0x3c464e)](_0x1df1da,_0xaa4fb);this['_mBoundsMax']=_0x49b7bb;let _0x19962f=0x1;if(_0x49b7bb>this['options']['maxCanvasSize'])_0x19962f=_0x49b7bb/this[_0xc41b96(_0x5d8cb5._0x44cd7b)]['maxCanvasSize'],_0x13b3bf/_0x19962f<this['options']['minCanvasSize']&&(_0x19962f=_0x13b3bf/this['options']['minCanvasSize']);else _0x13b3bf<this[_0xc41b96(0x207)][_0xc41b96(_0x5d8cb5._0x51700d)]&&(_0x19962f=_0x13b3bf/this['options'][_0xc41b96(_0x5d8cb5._0x2408b8)],_0x49b7bb/_0x19962f>this['options'][_0xc41b96(_0x5d8cb5._0x23dfd4)]&&(_0x19962f=_0x49b7bb/this['options']['maxCanvasSize']));const _0x33f6c2=this['heatStyle']['radius']*1.5,_0x5b257d=_0x1df1da/_0x19962f+_0x33f6c2*0x2,_0x105c7a=_0xaa4fb/_0x19962f+_0x33f6c2*0x2,_0x1adf9c=_0x33f6c2*_0x19962f;_0x5c6ca7['xmin']-=_0x1adf9c,_0x5c6ca7['ymin']-=_0x1adf9c,_0x5c6ca7['xmax']+=_0x1adf9c,_0x5c6ca7[_0xc41b96(_0x5d8cb5._0x5b0640)]+=_0x1adf9c,this[_0xc41b96(_0x5d8cb5._0x2282f1)]=_0x19962f,_0x5480c5=geLatLngBounds(_0x5c6ca7),this[_0xc41b96(_0x5d8cb5._0x34ec24)]=Cesium[_0xc41b96(0x227)]['fromDegrees'](_0x5480c5['xmin'],_0x5480c5['ymin'],_0x5480c5[_0xc41b96(_0x5d8cb5._0x5600ef)],_0x5480c5['ymax']);let _0x959fe5=_0x1045d7[0x0]['value']??0x1,_0x506991=_0x1045d7[0x0][_0xc41b96(0x206)]??0x0;const _0x1fab3f=[];_0x1045d7['forEach'](_0x54e1d7=>{const _0x4448cc=_0xc41b96,_0x2baac9=mars3d__namespace[_0x4448cc(_0x85f917._0x52200d)]['lonlat2mercator']([_0x54e1d7['lng'],_0x54e1d7[_0x4448cc(0x208)]]),_0x12ddbd=_0x54e1d7['value']||0x1,_0x3a5e18=Math['round']((_0x2baac9[0x0]-_0x5c6ca7[_0x4448cc(_0x85f917._0x54bb17)])/_0x19962f),_0xe34bdc=Math['round']((_0x5c6ca7[_0x4448cc(_0x85f917._0x39b8c8)]-_0x2baac9[0x1])/_0x19962f);_0x959fe5=Math['max'](_0x959fe5,_0x12ddbd),_0x506991=Math['min'](_0x506991,_0x12ddbd),_0x1fab3f['push']({'x':_0x3a5e18,'y':_0xe34bdc,'value':_0x12ddbd});});const _0x5e61a2={'min':this['options'][_0xc41b96(_0x5d8cb5._0x3c464e)]??_0x506991,'max':this['options'][_0xc41b96(0x1ec)]??_0x959fe5,'data':_0x1fab3f};this['_last_heatData']=_0x5e61a2;if(!this[_0xc41b96(0x1f7)]||_0x5c6ca7['xmin']!==this['_last_mBounds']['xmin']||_0x5c6ca7['ymin']!==this['_last_mBounds'][_0xc41b96(0x22d)]||_0x5c6ca7[_0xc41b96(0x1ef)]!==this['_last_mBounds'][_0xc41b96(0x1ef)]||_0x5c6ca7[_0xc41b96(0x1ff)]!==this['_last_mBounds']['ymax']){this['_last_mBounds']=_0x5c6ca7,this['_container'][_0xc41b96(0x205)]['cssText']='width:'+_0x5b257d+_0xc41b96(0x1d8)+_0x105c7a+_0xc41b96(0x200);const _0x41fcbf={...this['heatStyle'],'container':this['_container']};!this['_heat']?this[_0xc41b96(0x223)]=h337__namespace['create'](_0x41fcbf):this['_heat'][_0xc41b96(_0x5d8cb5._0x228097)](_0x41fcbf);}this['_heat'][_0xc41b96(_0x5d8cb5._0x26f975)](_0x5e61a2);const _0x4818ce=mars3d__namespace[_0xc41b96(0x1da)]['copyCanvas'](this[_0xc41b96(0x223)]['_renderer']['canvas']);return _0x4818ce;}[_0x5997cb(0x1fa)](){const _0x497085={_0x1b9161:0x22a},_0x476dc1=_0x5997cb;this['_heat'][_0x476dc1(0x219)]({'radius':this['heatStyle']['radius']*this['style']['arcRadiusScale'],'blur':this[_0x476dc1(0x21e)]['blur']*this['style']['arcBlurScale'],'gradient':this['heatStyle']['gradientArc']||{0.25:_0x476dc1(0x20c),0.55:'rgb(140,140,140)',0.85:'rgb(216,216,216)',0x1:'rgb(255,255,255)'}});const _0x4f25dc=mars3d__namespace['DomUtil'][_0x476dc1(_0x497085._0x1b9161)](this[_0x476dc1(0x223)]['_renderer']['canvas']);return this['_heat']['configure'](this['options'][_0x476dc1(0x21e)]),_0x4f25dc;}['getPointData'](_0x310a97){const _0x5a7b9e={_0x463af7:0x221,_0x3ba806:0x1e3,_0x361ee0:0x1e6,_0x2f2826:0x1fe},_0x590f1a=_0x5997cb,_0x596240=mars3d__namespace['LngLatPoint']['parse'](_0x310a97);if(!_0x596240)return{};const _0x5aa91d=mars3d__namespace['PointTrans']['lonlat2mercator']([_0x596240[_0x590f1a(0x1f5)],_0x596240[_0x590f1a(0x208)]]),_0x20ebee=this['_last_mBounds'],_0x2e4c0b=Math[_0x590f1a(0x221)]((_0x5aa91d[0x0]-_0x20ebee['xmin'])/this[_0x590f1a(0x1e3)]),_0x3df0fa=Math[_0x590f1a(_0x5a7b9e._0x463af7)]((_0x20ebee[_0x590f1a(0x1ff)]-_0x5aa91d[0x1])/this[_0x590f1a(_0x5a7b9e._0x3ba806)]),_0x55b73d=this['_heat']['getValueAt']({'x':_0x2e4c0b,'y':_0x3df0fa}),_0x36f71e=this['_heat'][_0x590f1a(_0x5a7b9e._0x361ee0)]['ctx'][_0x590f1a(_0x5a7b9e._0x2f2826)](_0x2e4c0b-0x1,_0x3df0fa-0x1,0x1,0x1)['data'];return{'x':_0x2e4c0b,'y':_0x3df0fa,'value':_0x55b73d,'color':_0x590f1a(0x213)+_0x36f71e[0x0]+','+_0x36f71e[0x1]+','+_0x36f71e[0x2]+','+_0x36f71e[0x3]+')'};}}mars3d__namespace['layer']['HeatLayer']=HeatLayer,mars3d__namespace[_0x5997cb(0x20f)]['register']('heat',HeatLayer);function getMercatorBounds(_0x1bd2f6){const _0x5f2ff6={_0x28b19c:0x22d},_0x4b966a=_0x5997cb,_0x2ac9e1=mars3d__namespace['PointTrans']['lonlat2mercator']([_0x1bd2f6['xmin'],_0x1bd2f6[_0x4b966a(_0x5f2ff6._0x28b19c)]]),_0x281cee=mars3d__namespace['PointTrans']['lonlat2mercator']([_0x1bd2f6['xmax'],_0x1bd2f6['ymax']]);return{'xmin':_0x2ac9e1[0x0],'ymin':_0x2ac9e1[0x1],'xmax':_0x281cee[0x0],'ymax':_0x281cee[0x1]};}function geLatLngBounds(_0x35ac9d){const _0xc2cb22={_0x15d02f:0x21a},_0x25b6e7=_0x5997cb,_0xccafa6=mars3d__namespace['PointTrans']['mercator2lonlat']([_0x35ac9d['xmin'],_0x35ac9d['ymin']]),_0x93abec=mars3d__namespace[_0x25b6e7(_0xc2cb22._0x15d02f)]['mercator2lonlat']([_0x35ac9d['xmax'],_0x35ac9d['ymax']]);return{'xmin':_0xccafa6[0x0],'ymin':_0xccafa6[0x1],'xmax':_0x93abec[0x0],'ymax':_0x93abec[0x1]};}function getVertexShaderSource(_0x44e8a9){const _0x50b84c={_0x3ac1f8:0x1f2},_0x403eec=_0x5997cb;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'+_0x44e8a9+_0x403eec(_0x50b84c._0x3ac1f8);}exports['HeatLayer']=HeatLayer,Object[_0x5997cb(0x1f0)](exports,'__esModule',{'value':!![]});
|
|
15
15
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mars3d-heatmap",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.10",
|
|
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.6"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"mars3d": "~3.5.
|
|
13
|
+
"mars3d": "~3.5.10"
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
16
|
"lint": "eslint ./src/**/*.{js,ts} --fix"
|