mars3d-heatmap 3.5.15 → 3.5.16
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.5.
|
|
5
|
-
* 编译日期:2023-07-
|
|
4
|
+
* 版本信息:v3.5.16
|
|
5
|
+
* 编译日期:2023-07-17 18:16:42
|
|
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 _0x47f96c=_0x1f53;(function(_0x17c85d,_0x97dc7c){const _0xed129c={_0x25c300:0xd1,_0x2e7c24:0xe3,_0x37396:0xf6},_0x288344=_0x1f53,_0x1e06bf=_0x17c85d();while(!![]){try{const _0x291729=-parseInt(_0x288344(_0xed129c._0x25c300))/0x1*(parseInt(_0x288344(_0xed129c._0x2e7c24))/0x2)+parseInt(_0x288344(0xfc))/0x3+parseInt(_0x288344(_0xed129c._0x37396))/0x4+-parseInt(_0x288344(0xc3))/0x5*(-parseInt(_0x288344(0xe1))/0x6)+-parseInt(_0x288344(0xdc))/0x7*(parseInt(_0x288344(0xd5))/0x8)+parseInt(_0x288344(0xef))/0x9+-parseInt(_0x288344(0x105))/0xa;if(_0x291729===_0x97dc7c)break;else _0x1e06bf['push'](_0x1e06bf['shift']());}catch(_0x592cc0){_0x1e06bf['push'](_0x1e06bf['shift']());}}}(_0x278f,0x868b4));function _interopNamespace(_0x3e95b1){const _0xfddcc7={_0x1543b9:0xf9},_0x48ea7d={_0x2f109b:0xee},_0x2ecf8b=_0x1f53;if(_0x3e95b1&&_0x3e95b1['__esModule'])return _0x3e95b1;var _0x3fbc18=Object['create'](null);return _0x3e95b1&&Object[_0x2ecf8b(0xc6)](_0x3e95b1)['forEach'](function(_0x17d45b){const _0x7aba75=_0x2ecf8b;if(_0x17d45b!=='default'){var _0x2855ba=Object['getOwnPropertyDescriptor'](_0x3e95b1,_0x17d45b);Object[_0x7aba75(0xcf)](_0x3fbc18,_0x17d45b,_0x2855ba[_0x7aba75(_0x48ea7d._0x2f109b)]?_0x2855ba:{'enumerable':!![],'get':function(){return _0x3e95b1[_0x17d45b];}});}}),_0x3fbc18[_0x2ecf8b(_0xfddcc7._0x1543b9)]=_0x3e95b1,_0x3fbc18;}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['Cesium'],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(_0xd94831={}){const _0x24ebe3={_0x25ba93:0xf5,_0x9c1012:0x108,_0x1c5a25:0x107},_0x11b31f=_0x1f53;super(_0xd94831),this['options']['maxCanvasSize']=this['options']['maxCanvasSize']??document['body']['clientWidth'],this['options']['maxCanvasSize']=Math[_0x11b31f(_0x24ebe3._0x25ba93)](this['options']['maxCanvasSize'],0x1388),this['options']['minCanvasSize']=this['options'][_0x11b31f(0xfa)]??document['body']['clientHeight'],this[_0x11b31f(_0x24ebe3._0x9c1012)]['minCanvasSize']=Math[_0x11b31f(0x102)](this['options']['minCanvasSize'],0x2bc),this[_0x11b31f(0x108)]['heatStyle']={...DEF_HEATSTYLE,...this[_0x11b31f(_0x24ebe3._0x9c1012)]['heatStyle']},this['options']['style']={...DEF_STYLE,...this['options'][_0x11b31f(_0x24ebe3._0x1c5a25)]};}get[_0x47f96c(0xea)](){return this['_layer'];}get['heatStyle'](){return this['options']['heatStyle'];}set['heatStyle'](_0x980075){const _0x2717fb={_0x297fe5:0x10c,_0x3faa36:0xc9},_0x10e644=_0x47f96c;this['options'][_0x10e644(0xc9)]=mars3d__namespace[_0x10e644(0xe9)][_0x10e644(_0x2717fb._0x297fe5)](this[_0x10e644(0x108)][_0x10e644(_0x2717fb._0x3faa36)],_0x980075),this['_heat']&&(this['_heat']['configure'](this['options']['heatStyle']),this['_updatePositionsHook'](!![]));}get['style'](){const _0x34f78c={_0x5b13f2:0x107},_0x304050=_0x47f96c;return this['options'][_0x304050(_0x34f78c._0x5b13f2)];}set['style'](_0xf2e28a){this['options']['style']=mars3d__namespace['Util']['merge'](this['options']['style'],_0xf2e28a);}get['positions'](){return this['_positions'];}set['positions'](_0x490b80){this['setPositions'](_0x490b80);}get['coordinates'](){const _0x16c733={_0x5a9051:0xe0},_0x4385d5=_0x47f96c,_0x1004e8=[];return this[_0x4385d5(_0x16c733._0x5a9051)]['forEach'](_0x56836b=>{_0x1004e8['push'](_0x56836b['toArray']());}),_0x1004e8;}get[_0x47f96c(0xe6)](){const _0x29959d=_0x47f96c;return this[_0x29959d(0xd7)];}['_setOptionsHook'](_0x1306b4,_0x284bfc){const _0x4027f1={_0x498b0a:0xce},_0x5bdf35=_0x47f96c;_0x1306b4['positions']&&(this[_0x5bdf35(_0x4027f1._0x498b0a)]=_0x1306b4['positions']);}['_mountedHook'](){const _0x50e38f={_0xe5e0d7:0x106},_0x2da190=_0x47f96c;this['style'][_0x2da190(0x101)]==='image'?this['_layer']=new mars3d__namespace['layer']['ImageLayer']({'crs':'EPSG:3857','private':!![]}):this[_0x2da190(_0x50e38f._0xe5e0d7)]=new mars3d__namespace['layer']['GraphicLayer']({'private':!![]});}[_0x47f96c(0xc7)](){const _0x230d68={_0x5799e5:0x106,_0x506d52:0xe5,_0x3daf66:0xce,_0x28b253:0x109,_0x480aed:0x104},_0x545f38=_0x47f96c;this[_0x545f38(0xdf)]['addLayer'](this[_0x545f38(_0x230d68._0x5799e5)]),this['_container']=mars3d__namespace['DomUtil'][_0x545f38(0x103)]('div','mars3d-heatmap\x20mars3d-hideDiv',this[_0x545f38(0xdf)][_0x545f38(_0x230d68._0x506d52)]),this['options'][_0x545f38(_0x230d68._0x3daf66)]&&(this[_0x545f38(_0x230d68._0x3daf66)]=this[_0x545f38(0x108)]['positions']),this['options'][_0x545f38(_0x230d68._0x28b253)]&&this[_0x545f38(_0x230d68._0x480aed)]();}['_removedHook'](){const _0x27ecaa=_0x47f96c;this[_0x27ecaa(0xd4)]&&(mars3d__namespace['DomUtil']['remove'](this['_container']),delete this[_0x27ecaa(0xd4)]),this['clear'](),this['_map']['removeLayer'](this['_layer']);}['addPosition'](_0x37a920,_0x55adc0){const _0x1c8221=_0x47f96c;this[_0x1c8221(0xd0)]=this['_positions']||[],this['_positions']['push'](_0x37a920),this['_updatePositionsHook'](_0x55adc0);}['setPositions'](_0x8e1165,_0xdd3287){const _0xa173c5={_0x1e7397:0xd9},_0x1ed166=_0x47f96c;this['_positions']=_0x8e1165,this[_0x1ed166(_0xa173c5._0x1e7397)](_0xdd3287);}['clear'](){const _0x15929d={_0x21451a:0x106,_0x4af07d:0xf8,_0x26a4b5:0xbf},_0x4ce1d0=_0x47f96c;this['_graphic']&&(this[_0x4ce1d0(_0x15929d._0x21451a)]['removeGraphic'](this[_0x4ce1d0(0xf8)],!![]),delete this[_0x4ce1d0(_0x15929d._0x4af07d)]),this['_graphic2']&&(this['_layer']['removeGraphic'](this[_0x4ce1d0(_0x15929d._0x26a4b5)],!![]),delete this['_graphic2']);}[_0x47f96c(0xd9)](_0x460140){const _0x37586d={_0x68eb16:0xdf,_0x2eaef3:0xc1,_0x25c3c7:0xfe,_0x53b328:0xda,_0x39e7a3:0xfe},_0x22f860=_0x47f96c;if(!this['show']||!this[_0x22f860(_0x37586d._0x68eb16)]||!this[_0x22f860(0xce)]||this['positions']['length']===0x0)return this;const _0x5797b2=this['_getHeatCanvas']();if(this['style']['type']==='image')this[_0x22f860(0x106)]['setOptions']({'url':_0x5797b2['toDataURL']('image/png'),'rectangle':this['_rectangle'],'opacity':this['style']['opacity']});else this['style'][_0x22f860(_0x37586d._0x2eaef3)]?this['_graphic']&&_0x460140?(this['_graphic']['uniforms']['image']=_0x5797b2,this['_graphic'][_0x22f860(_0x37586d._0x25c3c7)][_0x22f860(0x100)]=this[_0x22f860(_0x37586d._0x53b328)](),this['_graphic2']&&(this['_graphic2'][_0x22f860(_0x37586d._0x25c3c7)][_0x22f860(0xc8)]=_0x5797b2,this[_0x22f860(0xbf)]['uniforms']['bumpMap']=this[_0x22f860(0xf8)][_0x22f860(_0x37586d._0x39e7a3)]['bumpMap'])):this['_createArcGraphic'](_0x5797b2):this['_graphic']&&_0x460140?this['_graphic']['uniforms']['image']=_0x5797b2:this['_createGraphic'](_0x5797b2);return this;}['_createGraphic'](_0x22ceda){const _0x55b1a2={_0x103ca6:0xf8},_0x571f07=_0x47f96c;this[_0x571f07(0xc0)](),this[_0x571f07(0xf8)]=new mars3d__namespace['graphic']['RectanglePrimitive']({...this[_0x571f07(0x108)],'rectangle':this['_rectangle'],'appearance':new Cesium['EllipsoidSurfaceAppearance']({'material':new Cesium['Material']({'fabric':{'uniforms':{'image':_0x22ceda},'source':HeatMaterial},'translucent':!![]}),'flat':!![]})}),this[_0x571f07(0x106)]['addGraphic'](this[_0x571f07(_0x55b1a2._0x103ca6)]);}[_0x47f96c(0x10b)](_0x2ead3d){const _0x10f19c={_0x272707:0xc0,_0x3d906a:0xe2,_0x1ac7de:0xe7,_0x5ca090:0xe7,_0x451542:0xe4,_0x5a82b5:0xd6,_0x56c585:0xf0,_0x21a4f1:0xfb,_0x8f94f7:0xbf,_0x9a63a9:0xd7},_0x10c6b8=_0x47f96c;this[_0x10c6b8(_0x10f19c._0x272707)]();const _0x57a45b=Cesium[_0x10c6b8(_0x10f19c._0x3d906a)]['fromCache']({'cull':{'enabled':!![]},'depthTest':{'enabled':!![]},'stencilTest':{'enabled':!![],'frontFunction':Cesium['StencilFunction'][_0x10c6b8(_0x10f19c._0x1ac7de)],'frontOperation':{'fail':Cesium[_0x10c6b8(0xe4)]['KEEP'],'zFail':Cesium['StencilOperation'][_0x10c6b8(0xc4)],'zPass':Cesium['StencilOperation']['REPLACE']},'backFunction':Cesium['StencilFunction'][_0x10c6b8(_0x10f19c._0x5ca090)],'backOperation':{'fail':Cesium[_0x10c6b8(_0x10f19c._0x451542)]['KEEP'],'zFail':Cesium['StencilOperation']['KEEP'],'zPass':Cesium[_0x10c6b8(_0x10f19c._0x451542)]['REPLACE']},'reference':0x2,'mask':0x2},'blending':Cesium['BlendingState']['ALPHA_BLEND']}),_0x220729=Math['floor'](this['style']['diffHeight']??this['_mBoundsMax']*0.02)+0.1;this['style']['diffHeight']&&delete this[_0x10c6b8(0x107)][_0x10c6b8(_0x10f19c._0x5a82b5)];const _0x451d30=(this['style']['splitNum'],0x64);let _0x4f3e28=Math['max'](this['_rectangle']['height'],this['_rectangle']['width']);this['style']['granularity']=_0x4f3e28/=_0x451d30;const _0x5deb48=new Cesium[(_0x10c6b8(_0x10f19c._0x56c585))]({'fabric':{'uniforms':{'image':_0x2ead3d,'repeat':new Cesium['Cartesian2'](0x1,0x1),'color':new Cesium['Color'](0x1,0x1,0x1,0x0),'bumpMap':this['_getArcHeatCanvas']()},'source':HeatMaterial},'translucent':!![]}),_0x51e62c=this['style']['arcDirection']||0x1;this['_graphic']=new mars3d__namespace['graphic']['RectanglePrimitive']({...this['options'],'rectangle':this['_rectangle'],'appearance':new Cesium['EllipsoidSurfaceAppearance']({'flat':!![],'aboveGround':!![],'renderState':_0x57a45b,'material':_0x5deb48,'vertexShaderSource':getVertexShaderSource(_0x220729*_0x51e62c)})}),this[_0x10c6b8(0x106)]['addGraphic'](this['_graphic']),this['style'][_0x10c6b8(_0x10f19c._0x21a4f1)]===0x0&&(this[_0x10c6b8(_0x10f19c._0x8f94f7)]=new mars3d__namespace['graphic']['RectanglePrimitive']({...this['options'],'rectangle':this[_0x10c6b8(_0x10f19c._0x9a63a9)],'appearance':new Cesium['EllipsoidSurfaceAppearance']({'flat':!![],'aboveGround':!![],'renderState':_0x57a45b,'material':_0x5deb48,'vertexShaderSource':getVertexShaderSource(-_0x220729)})}),this['_layer']['addGraphic'](this['_graphic2']));}['getRectangle'](_0x27523e){const _0x5e91e9=_0x47f96c;return _0x27523e!==null&&_0x27523e!==void 0x0&&_0x27523e[_0x5e91e9(0xd2)]&&this['_rectangle']?mars3d__namespace[_0x5e91e9(0xcb)]['formatRectangle'](this['_rectangle']):this['_rectangle'];}['_getHeatCanvas'](){const _0x5bd582={_0x13af5c:0x108,_0x133a86:0xc5,_0x132d93:0x108,_0x2fe834:0x108,_0x28173d:0xf4,_0x25854b:0x10d,_0x35635a:0x10a},_0xc7c3c7={_0x4d7d6e:0xcc,_0x5892a4:0xf2},_0xa3c03d={_0x494d6e:0xf5},_0x2248f0=_0x47f96c,_0x2f2bbe=this[_0x2248f0(0xd0)],_0x28c556=[];let _0x62d2b9,_0x41020e,_0xd4fd49,_0x462b11;_0x2f2bbe['forEach'](_0x2f6782=>{const _0x498242=_0x2248f0,_0x34b2fc=mars3d__namespace[_0x498242(0xde)]['parse'](_0x2f6782);if(!_0x34b2fc)return;_0x34b2fc['value']=_0x2f6782['value']||0x1,!this['options']['rectangle']&&(_0x62d2b9===undefined?(_0x62d2b9=_0x34b2fc['lng'],_0x41020e=_0x34b2fc[_0x498242(0xf2)],_0xd4fd49=_0x34b2fc['lat'],_0x462b11=_0x34b2fc['lat']):(_0x62d2b9=Math['min'](_0x62d2b9,_0x34b2fc['lng']),_0x41020e=Math['max'](_0x41020e,_0x34b2fc['lng']),_0xd4fd49=Math[_0x498242(_0xa3c03d._0x494d6e)](_0xd4fd49,_0x34b2fc['lat']),_0x462b11=Math[_0x498242(0x102)](_0x462b11,_0x34b2fc['lat']))),_0x28c556['push'](_0x34b2fc);});_0x62d2b9===_0x41020e&&(_0x62d2b9-=0.000001,_0x41020e+=0.000001);_0xd4fd49===_0x462b11&&(_0xd4fd49-=0.000001,_0x462b11+=0.000001);let _0x2d4b5f=this['options'][_0x2248f0(0xe6)]||{'xmin':_0x62d2b9,'xmax':_0x41020e,'ymin':_0xd4fd49,'ymax':_0x462b11};const _0x4ef9ca=getMercatorBounds(_0x2d4b5f),_0x33de9f=Math['abs'](_0x4ef9ca[_0x2248f0(0x10d)]-_0x4ef9ca['xmin']),_0x16418c=Math['abs'](_0x4ef9ca['ymax']-_0x4ef9ca['ymin']),_0x1c3e0c=Math['max'](_0x33de9f,_0x16418c),_0xa50f1b=Math['min'](_0x33de9f,_0x16418c);this['_mBoundsMax']=_0x1c3e0c;let _0x134be6=0x1;if(_0x1c3e0c>this[_0x2248f0(_0x5bd582._0x13af5c)]['maxCanvasSize'])_0x134be6=_0x1c3e0c/this['options'][_0x2248f0(_0x5bd582._0x133a86)],_0xa50f1b/_0x134be6<this['options']['minCanvasSize']&&(_0x134be6=_0xa50f1b/this[_0x2248f0(_0x5bd582._0x132d93)]['minCanvasSize']);else _0xa50f1b<this['options']['minCanvasSize']&&(_0x134be6=_0xa50f1b/this['options'][_0x2248f0(0xfa)],_0x1c3e0c/_0x134be6>this[_0x2248f0(_0x5bd582._0x2fe834)]['maxCanvasSize']&&(_0x134be6=_0x1c3e0c/this['options']['maxCanvasSize']));const _0x2fee01=this['heatStyle']['radius']*1.5,_0x594923=_0x33de9f/_0x134be6+_0x2fee01*0x2,_0x5e9361=_0x16418c/_0x134be6+_0x2fee01*0x2,_0x7e375a=_0x2fee01*_0x134be6;_0x4ef9ca['xmin']-=_0x7e375a,_0x4ef9ca[_0x2248f0(0xec)]-=_0x7e375a,_0x4ef9ca['xmax']+=_0x7e375a,_0x4ef9ca['ymax']+=_0x7e375a,this[_0x2248f0(0xd8)]=_0x134be6,_0x2d4b5f=geLatLngBounds(_0x4ef9ca),this['_rectangle']=Cesium['Rectangle']['fromDegrees'](_0x2d4b5f['xmin'],_0x2d4b5f['ymin'],_0x2d4b5f['xmax'],_0x2d4b5f['ymax']);let _0x3d4518=_0x28c556[0x0]['value']??0x1,_0x2dbfdc=_0x28c556[0x0][_0x2248f0(0xdb)]??0x0;const _0x1448ac=[];_0x28c556['forEach'](_0xfe0f0c=>{const _0x1ac7b1=_0x2248f0,_0x563cf3=mars3d__namespace[_0x1ac7b1(_0xc7c3c7._0x4d7d6e)]['lonlat2mercator']([_0xfe0f0c[_0x1ac7b1(_0xc7c3c7._0x5892a4)],_0xfe0f0c['lat']]),_0x3c449c=_0xfe0f0c['value']||0x1,_0x266eb2=Math['round']((_0x563cf3[0x0]-_0x4ef9ca['xmin'])/_0x134be6),_0x1fd507=Math['round']((_0x4ef9ca['ymax']-_0x563cf3[0x1])/_0x134be6);_0x3d4518=Math[_0x1ac7b1(0x102)](_0x3d4518,_0x3c449c),_0x2dbfdc=Math['min'](_0x2dbfdc,_0x3c449c),_0x1448ac['push']({'x':_0x266eb2,'y':_0x1fd507,'value':_0x3c449c});});const _0x4fce8a={'min':this['options'][_0x2248f0(0xf5)]??_0x2dbfdc,'max':this['options']['max']??_0x3d4518,'data':_0x1448ac};this['_last_heatData']=_0x4fce8a;if(!this[_0x2248f0(_0x5bd582._0x28173d)]||_0x4ef9ca['xmin']!==this[_0x2248f0(_0x5bd582._0x28173d)]['xmin']||_0x4ef9ca['ymin']!==this['_last_mBounds']['ymin']||_0x4ef9ca[_0x2248f0(_0x5bd582._0x25854b)]!==this['_last_mBounds'][_0x2248f0(_0x5bd582._0x25854b)]||_0x4ef9ca[_0x2248f0(0xbe)]!==this['_last_mBounds'][_0x2248f0(0xbe)]){this[_0x2248f0(_0x5bd582._0x28173d)]=_0x4ef9ca,this['_container']['style']['cssText']=_0x2248f0(0x10e)+_0x594923+'px;height:'+_0x5e9361+'px;';const _0x4600fc={...this['heatStyle'],'container':this['_container']};!this['_heat']?this['_heat']=h337__namespace['create'](_0x4600fc):this['_heat']['configure'](_0x4600fc);}this[_0x2248f0(0xe8)]['setData'](_0x4fce8a);const _0x32c975=mars3d__namespace['DomUtil']['copyCanvas'](this['_heat']['_renderer'][_0x2248f0(_0x5bd582._0x35635a)]);return _0x32c975;}['_getArcHeatCanvas'](){const _0x115fa2={_0x11ddca:0xd3,_0x32e030:0xc9,_0x31f4ac:0xf7,_0x34726e:0xf3,_0x1c0d19:0xc2,_0x4eec81:0xca,_0xcce346:0xe8},_0x3c7caa=_0x47f96c;this['_heat'][_0x3c7caa(_0x115fa2._0x11ddca)]({'radius':this[_0x3c7caa(_0x115fa2._0x32e030)][_0x3c7caa(0xeb)]*this['style']['arcRadiusScale'],'blur':this['heatStyle']['blur']*this[_0x3c7caa(0x107)][_0x3c7caa(_0x115fa2._0x31f4ac)],'gradient':this['heatStyle']['gradientArc']||{0.25:'rgb(0,0,0)',0.55:'rgb(140,140,140)',0.85:_0x3c7caa(_0x115fa2._0x34726e),0x1:_0x3c7caa(0xcd)}});const _0x2f48de=mars3d__namespace[_0x3c7caa(_0x115fa2._0x1c0d19)]['copyCanvas'](this['_heat'][_0x3c7caa(_0x115fa2._0x4eec81)]['canvas']);return this[_0x3c7caa(_0x115fa2._0xcce346)]['configure'](this['options'][_0x3c7caa(_0x115fa2._0x32e030)]),_0x2f48de;}['getPointData'](_0x5444c8){const _0x15866b=_0x47f96c,_0x1c6e53=mars3d__namespace[_0x15866b(0xde)]['parse'](_0x5444c8);if(!_0x1c6e53)return{};const _0x21e930=mars3d__namespace['PointTrans']['lonlat2mercator']([_0x1c6e53['lng'],_0x1c6e53['lat']]),_0x42d520=this['_last_mBounds'],_0x2cd0ff=Math[_0x15866b(0xdd)]((_0x21e930[0x0]-_0x42d520['xmin'])/this[_0x15866b(0xd8)]),_0x3b8ea3=Math['round']((_0x42d520['ymax']-_0x21e930[0x1])/this['_scale']),_0x2f2c97=this['_heat']['getValueAt']({'x':_0x2cd0ff,'y':_0x3b8ea3}),_0x2001d3=this['_heat']['_renderer']['ctx'][_0x15866b(0xfd)](_0x2cd0ff-0x1,_0x3b8ea3-0x1,0x1,0x1)['data'];return{'x':_0x2cd0ff,'y':_0x3b8ea3,'value':_0x2f2c97,'color':'rgba('+_0x2001d3[0x0]+','+_0x2001d3[0x1]+','+_0x2001d3[0x2]+','+_0x2001d3[0x3]+')'};}}mars3d__namespace['LayerUtil']['register'](_0x47f96c(0xf1),HeatLayer),mars3d__namespace['layer']['HeatLayer']=HeatLayer,mars3d__namespace['h337']=h337__namespace;function _0x1f53(_0xb8a9a8,_0x2fd500){const _0x278fb8=_0x278f();return _0x1f53=function(_0x1f536e,_0x32e427){_0x1f536e=_0x1f536e-0xbe;let _0x2a19c8=_0x278fb8[_0x1f536e];return _0x2a19c8;},_0x1f53(_0xb8a9a8,_0x2fd500);}function getMercatorBounds(_0x2791fc){const _0x209d81={_0xd39683:0xff},_0x51b565=_0x47f96c,_0x46dc5b=mars3d__namespace['PointTrans']['lonlat2mercator']([_0x2791fc['xmin'],_0x2791fc['ymin']]),_0x155aaf=mars3d__namespace['PointTrans'][_0x51b565(_0x209d81._0xd39683)]([_0x2791fc['xmax'],_0x2791fc['ymax']]);return{'xmin':_0x46dc5b[0x0],'ymin':_0x46dc5b[0x1],'xmax':_0x155aaf[0x0],'ymax':_0x155aaf[0x1]};}function geLatLngBounds(_0x1589e0){const _0x5b3d4f={_0x18c30e:0xed},_0x1c92c3=_0x47f96c,_0x1ce878=mars3d__namespace['PointTrans']['mercator2lonlat']([_0x1589e0['xmin'],_0x1589e0[_0x1c92c3(0xec)]]),_0x38213b=mars3d__namespace['PointTrans'][_0x1c92c3(_0x5b3d4f._0x18c30e)]([_0x1589e0['xmax'],_0x1589e0['ymax']]);return{'xmin':_0x1ce878[0x0],'ymin':_0x1ce878[0x1],'xmax':_0x38213b[0x0],'ymax':_0x38213b[0x1]};}function getVertexShaderSource(_0x3e3a62){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'+_0x3e3a62+';\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';}function _0x278f(){const _0x293acf=['1355690NmFbBl','_layer','style','options','flyTo','canvas','_createArcGraphic','merge','xmax','width:','ymax','_graphic2','clear','arc','DomUtil','20REAfnC','KEEP','maxCanvasSize','keys','_addedHook','image','heatStyle','_renderer','PolyUtil','PointTrans','rgb(255,255,255)','positions','defineProperty','_positions','12482MMSMOf','isFormat','configure','_container','504OTDJcc','diffHeight','_rectangle','_scale','_updatePositionsHook','_getArcHeatCanvas','value','104573XlQrkW','round','LngLatPoint','_map','points','806334ZJhAgQ','RenderState','92CGLpMg','StencilOperation','container','rectangle','ALWAYS','_heat','Util','layer','radius','ymin','mercator2lonlat','get','5075667RZOhGw','Material','heat','lng','rgb(216,216,216)','_last_mBounds','min','4192876cLIhTF','arcBlurScale','_graphic','default','minCanvasSize','arcDirection','156756AwFYfL','getImageData','uniforms','lonlat2mercator','bumpMap','type','max','create','flyToByAnimationEnd'];_0x278f=function(){return _0x293acf;};return _0x278f();}exports['HeatLayer']=HeatLayer,Object[_0x47f96c(0xcf)](exports,'__esModule',{'value':!![]});
|
|
14
|
+
'use strict';function _0x260c(){const _0x4f5f48=['StencilOperation','container','maxCanvasSize','merge','forEach','PointTrans','2672148oCoTDH','mercator2lonlat','addPosition','_last_mBounds','toDataURL','positions','lonlat2mercator','configure','3gUrrul','_renderer','layer','push','setPositions','3586667WoqweA','rgb(140,140,140)','width','_layer','__esModule','6010WeZTke','1161738eJlJqx','body','HeatLayer','image','EllipsoidSurfaceAppearance','lat','_updatePositionsHook','xmax','opacity','16EbEnNz','round','Util','getImageData','bumpMap','heat','arc','lng','diffHeight','flyToByAnimationEnd','removeGraphic','_positions','yellow','_container','_scale','21207210JJPlmV','_createArcGraphic','graphic','xmin','parse','toArray','uniforms','min','options','fromDegrees','addGraphic','11497068DoTYVE','heatStyle','create','blue','minCanvasSize','ymin','arcDirection','_getHeatCanvas','Cartesian2','_rectangle','style','removeLayer',';\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','_graphic','rectangle','_getArcHeatCanvas','clientWidth','GraphicLayer','ymax','setOptions','_map','1393221sZyYOG','points','KEEP','_heat','value','type','_graphic2','3044palGyd','rgba(','ALWAYS','_mBoundsMax'];_0x260c=function(){return _0x4f5f48;};return _0x260c();}const _0x4c3c37=_0x803e;(function(_0x598326,_0x14cb74){const _0x3a49bf={_0x531a3d:0x12c,_0x183956:0x145,_0x1e4e46:0x133,_0x497bed:0x150,_0x21d594:0x159,_0x5d104e:0x168},_0x4c4051=_0x803e,_0xb24ded=_0x598326();while(!![]){try{const _0x152c14=parseInt(_0x4c4051(_0x3a49bf._0x531a3d))/0x1+-parseInt(_0x4c4051(0x13d))/0x2*(parseInt(_0x4c4051(_0x3a49bf._0x183956))/0x3)+-parseInt(_0x4c4051(_0x3a49bf._0x1e4e46))/0x4*(-parseInt(_0x4c4051(0x14f))/0x5)+-parseInt(_0x4c4051(_0x3a49bf._0x497bed))/0x6+-parseInt(_0x4c4051(0x14a))/0x7*(-parseInt(_0x4c4051(_0x3a49bf._0x21d594))/0x8)+parseInt(_0x4c4051(0x117))/0x9+-parseInt(_0x4c4051(_0x3a49bf._0x5d104e))/0xa;if(_0x152c14===_0x14cb74)break;else _0xb24ded['push'](_0xb24ded['shift']());}catch(_0x7bfb09){_0xb24ded['push'](_0xb24ded['shift']());}}}(_0x260c,0xea4fb));function _interopNamespace(_0x571d14){const _0x113650={_0x54be76:0x13b},_0xa3d9aa=_0x803e;if(_0x571d14&&_0x571d14[_0xa3d9aa(0x14e)])return _0x571d14;var _0x20a3de=Object['create'](null);return _0x571d14&&Object['keys'](_0x571d14)[_0xa3d9aa(_0x113650._0x54be76)](function(_0xa662f1){if(_0xa662f1!=='default'){var _0x14e6a2=Object['getOwnPropertyDescriptor'](_0x571d14,_0xa662f1);Object['defineProperty'](_0x20a3de,_0xa662f1,_0x14e6a2['get']?_0x14e6a2:{'enumerable':!![],'get':function(){return _0x571d14[_0xa662f1];}});}}),_0x20a3de['default']=_0x571d14,_0x20a3de;}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['Cesium'],BaseLayer=mars3d__namespace['layer']['BaseLayer'],DEF_HEATSTYLE={'maxOpacity':0.8,'minOpacity':0.1,'blur':0.85,'radius':0x19,'gradient':{0.4:_0x4c3c37(0x11a),0.6:'green',0.8:_0x4c3c37(0x165),0.9:'red'}},DEF_STYLE={'arcRadiusScale':1.5,'arcBlurScale':1.5,'vertexFormat':Cesium[_0x4c3c37(0x154)]['VERTEX_FORMAT']};class HeatLayer extends BaseLayer{constructor(_0x25d952={}){const _0x10f8d6={_0xc26c22:0x114,_0x3336b6:0x139,_0x402c5d:0x114,_0xc3c833:0x113,_0x3b163f:0x121,_0x557b6d:0x114},_0x25effe=_0x4c3c37;super(_0x25d952),this[_0x25effe(_0x10f8d6._0xc26c22)][_0x25effe(_0x10f8d6._0x3336b6)]=this[_0x25effe(_0x10f8d6._0x402c5d)][_0x25effe(0x139)]??document[_0x25effe(0x151)][_0x25effe(0x127)],this[_0x25effe(_0x10f8d6._0xc26c22)][_0x25effe(_0x10f8d6._0x3336b6)]=Math[_0x25effe(_0x10f8d6._0xc3c833)](this['options'][_0x25effe(0x139)],0x1388),this['options']['minCanvasSize']=this[_0x25effe(_0x10f8d6._0xc26c22)][_0x25effe(0x11b)]??document['body']['clientHeight'],this[_0x25effe(_0x10f8d6._0x402c5d)][_0x25effe(0x11b)]=Math['max'](this['options']['minCanvasSize'],0x2bc),this['options']['heatStyle']={...DEF_HEATSTYLE,...this[_0x25effe(0x114)]['heatStyle']},this['options'][_0x25effe(_0x10f8d6._0x3b163f)]={...DEF_STYLE,...this[_0x25effe(_0x10f8d6._0x557b6d)]['style']};}get[_0x4c3c37(0x147)](){return this['_layer'];}get['heatStyle'](){return this['options']['heatStyle'];}set['heatStyle'](_0x578f6b){const _0x5453e0={_0x3c127e:0x114,_0x1ef6d5:0x15b},_0x254238=_0x4c3c37;this[_0x254238(_0x5453e0._0x3c127e)]['heatStyle']=mars3d__namespace[_0x254238(_0x5453e0._0x1ef6d5)]['merge'](this['options']['heatStyle'],_0x578f6b),this['_heat']&&(this[_0x254238(0x12f)]['configure'](this[_0x254238(_0x5453e0._0x3c127e)][_0x254238(0x118)]),this['_updatePositionsHook'](!![]));}get['style'](){const _0x5922a0=_0x4c3c37;return this['options'][_0x5922a0(0x121)];}set[_0x4c3c37(0x121)](_0x255237){const _0x2051eb=_0x4c3c37;this['options'][_0x2051eb(0x121)]=mars3d__namespace['Util'][_0x2051eb(0x13a)](this[_0x2051eb(0x114)]['style'],_0x255237);}get['positions'](){return this['_positions'];}set['positions'](_0x59d2cf){this['setPositions'](_0x59d2cf);}get['coordinates'](){const _0x26e815={_0x453e57:0x111},_0x104a93=_0x4c3c37,_0xa0cee7=[];return this[_0x104a93(0x12d)][_0x104a93(0x13b)](_0x46600c=>{const _0xe3cd15=_0x104a93;_0xa0cee7[_0xe3cd15(0x148)](_0x46600c[_0xe3cd15(_0x26e815._0x453e57)]());}),_0xa0cee7;}get[_0x4c3c37(0x125)](){return this['_rectangle'];}['_setOptionsHook'](_0x5c75bd,_0x33b0bc){const _0x5b94d6={_0x1f64f0:0x142},_0x335b10=_0x4c3c37;_0x5c75bd['positions']&&(this[_0x335b10(_0x5b94d6._0x1f64f0)]=_0x5c75bd['positions']);}['_mountedHook'](){const _0x195ddf={_0x46079c:0x153,_0x31f7f6:0x128},_0x1c3384=_0x4c3c37;this['style']['type']===_0x1c3384(_0x195ddf._0x46079c)?this['_layer']=new mars3d__namespace[(_0x1c3384(0x147))]['ImageLayer']({'crs':'EPSG:3857','private':!![]}):this[_0x1c3384(0x14d)]=new mars3d__namespace[(_0x1c3384(0x147))][(_0x1c3384(_0x195ddf._0x31f7f6))]({'private':!![]});}['_addedHook'](){const _0x1f5e5f={_0x5a33ec:0x119,_0x4ffcc7:0x142,_0xbb76c:0x114,_0x594b42:0x162},_0x312897=_0x4c3c37;this['_map']['addLayer'](this['_layer']),this['_container']=mars3d__namespace['DomUtil'][_0x312897(_0x1f5e5f._0x5a33ec)]('div','mars3d-heatmap\x20mars3d-hideDiv',this['_map'][_0x312897(0x138)]),this[_0x312897(0x114)][_0x312897(0x142)]&&(this[_0x312897(_0x1f5e5f._0x4ffcc7)]=this['options'][_0x312897(_0x1f5e5f._0x4ffcc7)]),this[_0x312897(_0x1f5e5f._0xbb76c)]['flyTo']&&this[_0x312897(_0x1f5e5f._0x594b42)]();}['_removedHook'](){const _0x5147b6={_0x20fd81:0x166,_0x3aae2a:0x12b,_0x1a4907:0x122},_0x1926b4=_0x4c3c37;this[_0x1926b4(_0x5147b6._0x20fd81)]&&(mars3d__namespace['DomUtil']['remove'](this[_0x1926b4(0x166)]),delete this[_0x1926b4(0x166)]),this['clear'](),this[_0x1926b4(_0x5147b6._0x3aae2a)][_0x1926b4(_0x5147b6._0x1a4907)](this['_layer']);}[_0x4c3c37(0x13f)](_0x1a7885,_0x28adb4){const _0x1c2380=_0x4c3c37;this[_0x1c2380(0x164)]=this['_positions']||[],this['_positions'][_0x1c2380(0x148)](_0x1a7885),this['_updatePositionsHook'](_0x28adb4);}[_0x4c3c37(0x149)](_0x4e07d6,_0x3ba0fd){const _0x477def=_0x4c3c37;this['_positions']=_0x4e07d6,this[_0x477def(0x156)](_0x3ba0fd);}['clear'](){const _0x53b3b0={_0x5cabe1:0x163,_0x14a744:0x132},_0x224169=_0x4c3c37;this['_graphic']&&(this['_layer'][_0x224169(_0x53b3b0._0x5cabe1)](this['_graphic'],!![]),delete this[_0x224169(0x124)]),this[_0x224169(_0x53b3b0._0x14a744)]&&(this['_layer']['removeGraphic'](this['_graphic2'],!![]),delete this['_graphic2']);}['_updatePositionsHook'](_0xed3b80){const _0x1ff105={_0x1de35f:0x121,_0xd8c00f:0x153,_0xc90af8:0x120,_0x25c2d8:0x158,_0x535806:0x112},_0x57e1b5=_0x4c3c37;if(!this['show']||!this[_0x57e1b5(0x12b)]||!this['positions']||this['positions']['length']===0x0)return this;const _0x179e4a=this['_getHeatCanvas']();if(this[_0x57e1b5(_0x1ff105._0x1de35f)][_0x57e1b5(0x131)]===_0x57e1b5(_0x1ff105._0xd8c00f))this['_layer'][_0x57e1b5(0x12a)]({'url':_0x179e4a[_0x57e1b5(0x141)]('image/png'),'rectangle':this[_0x57e1b5(_0x1ff105._0xc90af8)],'opacity':this[_0x57e1b5(0x121)][_0x57e1b5(_0x1ff105._0x25c2d8)]});else this['style'][_0x57e1b5(0x15f)]?this['_graphic']&&_0xed3b80?(this['_graphic']['uniforms']['image']=_0x179e4a,this['_graphic']['uniforms']['bumpMap']=this['_getArcHeatCanvas'](),this['_graphic2']&&(this['_graphic2']['uniforms']['image']=_0x179e4a,this['_graphic2'][_0x57e1b5(_0x1ff105._0x535806)][_0x57e1b5(0x15d)]=this['_graphic']['uniforms']['bumpMap'])):this['_createArcGraphic'](_0x179e4a):this['_graphic']&&_0xed3b80?this['_graphic']['uniforms']['image']=_0x179e4a:this['_createGraphic'](_0x179e4a);return this;}['_createGraphic'](_0x37cbb9){this['clear'](),this['_graphic']=new mars3d__namespace['graphic']['RectanglePrimitive']({...this['options'],'rectangle':this['_rectangle'],'appearance':new Cesium['EllipsoidSurfaceAppearance']({'material':new Cesium['Material']({'fabric':{'uniforms':{'image':_0x37cbb9},'source':HeatMaterial},'translucent':!![]}),'flat':!![]})}),this['_layer']['addGraphic'](this['_graphic']);}[_0x4c3c37(0x169)](_0x43b840){const _0x4fc602={_0x3ed7ce:0x137,_0x374854:0x12e,_0x4ee118:0x121,_0x36ebdd:0x161,_0xa11bbc:0x14c,_0x39c82a:0x11f,_0x4d8e3e:0x124,_0x28bbd0:0x16a,_0x12da41:0x154,_0x2d5379:0x116,_0x3cc8e1:0x11d,_0x399cdf:0x114,_0x128f89:0x116},_0x43112f=_0x4c3c37;this['clear']();const _0x5c2957=Cesium['RenderState']['fromCache']({'cull':{'enabled':!![]},'depthTest':{'enabled':!![]},'stencilTest':{'enabled':!![],'frontFunction':Cesium['StencilFunction'][_0x43112f(0x135)],'frontOperation':{'fail':Cesium['StencilOperation']['KEEP'],'zFail':Cesium['StencilOperation']['KEEP'],'zPass':Cesium['StencilOperation']['REPLACE']},'backFunction':Cesium['StencilFunction']['ALWAYS'],'backOperation':{'fail':Cesium['StencilOperation']['KEEP'],'zFail':Cesium[_0x43112f(_0x4fc602._0x3ed7ce)][_0x43112f(_0x4fc602._0x374854)],'zPass':Cesium['StencilOperation']['REPLACE']},'reference':0x2,'mask':0x2},'blending':Cesium['BlendingState']['ALPHA_BLEND']}),_0x4cf536=Math['floor'](this[_0x43112f(_0x4fc602._0x4ee118)]['diffHeight']??this['_mBoundsMax']*0.02)+0.1;this[_0x43112f(0x121)][_0x43112f(_0x4fc602._0x36ebdd)]&&delete this['style']['diffHeight'];const _0x10f57c=(this['style']['splitNum'],0x64);let _0x5914b1=Math['max'](this['_rectangle']['height'],this['_rectangle'][_0x43112f(_0x4fc602._0xa11bbc)]);this['style']['granularity']=_0x5914b1/=_0x10f57c;const _0x1393dd=new Cesium['Material']({'fabric':{'uniforms':{'image':_0x43b840,'repeat':new Cesium[(_0x43112f(_0x4fc602._0x39c82a))](0x1,0x1),'color':new Cesium['Color'](0x1,0x1,0x1,0x0),'bumpMap':this[_0x43112f(0x126)]()},'source':HeatMaterial},'translucent':!![]}),_0x23a748=this['style']['arcDirection']||0x1;this[_0x43112f(_0x4fc602._0x4d8e3e)]=new mars3d__namespace[(_0x43112f(_0x4fc602._0x28bbd0))]['RectanglePrimitive']({...this['options'],'rectangle':this['_rectangle'],'appearance':new Cesium[(_0x43112f(_0x4fc602._0x12da41))]({'flat':!![],'aboveGround':!![],'renderState':_0x5c2957,'material':_0x1393dd,'vertexShaderSource':getVertexShaderSource(_0x4cf536*_0x23a748)})}),this['_layer'][_0x43112f(_0x4fc602._0x2d5379)](this['_graphic']),this['style'][_0x43112f(_0x4fc602._0x3cc8e1)]===0x0&&(this['_graphic2']=new mars3d__namespace['graphic']['RectanglePrimitive']({...this[_0x43112f(_0x4fc602._0x399cdf)],'rectangle':this['_rectangle'],'appearance':new Cesium['EllipsoidSurfaceAppearance']({'flat':!![],'aboveGround':!![],'renderState':_0x5c2957,'material':_0x1393dd,'vertexShaderSource':getVertexShaderSource(-_0x4cf536)})}),this[_0x43112f(0x14d)][_0x43112f(_0x4fc602._0x128f89)](this[_0x43112f(0x132)]));}['getRectangle'](_0xcffe99){return _0xcffe99!==null&&_0xcffe99!==void 0x0&&_0xcffe99['isFormat']&&this['_rectangle']?mars3d__namespace['PolyUtil']['formatRectangle'](this['_rectangle']):this['_rectangle'];}[_0x4c3c37(0x11e)](){const _0x3d8d39={_0x1b6ef0:0x136,_0x4a091a:0x114,_0x55f893:0x114,_0x4dddf7:0x11b,_0xdeab96:0x16b,_0x2989af:0x11c,_0x3606f4:0x167,_0x37b99d:0x115,_0x45d6a0:0x130,_0x126aa8:0x130,_0x28205b:0x16b,_0x3bd0d0:0x11c,_0x3d80a8:0x140,_0x14a2ec:0x157,_0x4f9788:0x140,_0x1d6a43:0x166,_0x4b9490:0x12f},_0x2897e4={_0x44aff0:0x160,_0x48a55a:0x155},_0x585009=_0x4c3c37,_0x54c3a8=this['_positions'],_0x379193=[];let _0x5ec163,_0x26a075,_0xc47056,_0x538872;_0x54c3a8[_0x585009(0x13b)](_0x1622dd=>{const _0x5a9163=_0x585009,_0x413ef1=mars3d__namespace['LngLatPoint']['parse'](_0x1622dd);if(!_0x413ef1)return;_0x413ef1['value']=_0x1622dd['value']||0x1,!this['options']['rectangle']&&(_0x5ec163===undefined?(_0x5ec163=_0x413ef1['lng'],_0x26a075=_0x413ef1['lng'],_0xc47056=_0x413ef1['lat'],_0x538872=_0x413ef1[_0x5a9163(0x155)]):(_0x5ec163=Math[_0x5a9163(0x113)](_0x5ec163,_0x413ef1['lng']),_0x26a075=Math['max'](_0x26a075,_0x413ef1[_0x5a9163(_0x2897e4._0x44aff0)]),_0xc47056=Math['min'](_0xc47056,_0x413ef1['lat']),_0x538872=Math['max'](_0x538872,_0x413ef1[_0x5a9163(_0x2897e4._0x48a55a)]))),_0x379193['push'](_0x413ef1);});_0x5ec163===_0x26a075&&(_0x5ec163-=0.000001,_0x26a075+=0.000001);_0xc47056===_0x538872&&(_0xc47056-=0.000001,_0x538872+=0.000001);let _0x246126=this['options']['rectangle']||{'xmin':_0x5ec163,'xmax':_0x26a075,'ymin':_0xc47056,'ymax':_0x538872};const _0x1e057a=getMercatorBounds(_0x246126),_0x183812=Math['abs'](_0x1e057a['xmax']-_0x1e057a[_0x585009(0x16b)]),_0x10e01c=Math['abs'](_0x1e057a['ymax']-_0x1e057a['ymin']),_0x2d97ce=Math['max'](_0x183812,_0x10e01c),_0x50d652=Math['min'](_0x183812,_0x10e01c);this[_0x585009(_0x3d8d39._0x1b6ef0)]=_0x2d97ce;let _0x5896b0=0x1;if(_0x2d97ce>this[_0x585009(_0x3d8d39._0x4a091a)][_0x585009(0x139)])_0x5896b0=_0x2d97ce/this[_0x585009(_0x3d8d39._0x55f893)][_0x585009(0x139)],_0x50d652/_0x5896b0<this['options']['minCanvasSize']&&(_0x5896b0=_0x50d652/this[_0x585009(0x114)][_0x585009(_0x3d8d39._0x4dddf7)]);else _0x50d652<this['options']['minCanvasSize']&&(_0x5896b0=_0x50d652/this['options']['minCanvasSize'],_0x2d97ce/_0x5896b0>this['options'][_0x585009(0x139)]&&(_0x5896b0=_0x2d97ce/this[_0x585009(0x114)]['maxCanvasSize']));const _0x44584b=this['heatStyle']['radius']*1.5,_0x1fb668=_0x183812/_0x5896b0+_0x44584b*0x2,_0x467b27=_0x10e01c/_0x5896b0+_0x44584b*0x2,_0x3780e5=_0x44584b*_0x5896b0;_0x1e057a[_0x585009(_0x3d8d39._0xdeab96)]-=_0x3780e5,_0x1e057a[_0x585009(_0x3d8d39._0x2989af)]-=_0x3780e5,_0x1e057a['xmax']+=_0x3780e5,_0x1e057a[_0x585009(0x129)]+=_0x3780e5,this[_0x585009(_0x3d8d39._0x3606f4)]=_0x5896b0,_0x246126=geLatLngBounds(_0x1e057a),this['_rectangle']=Cesium['Rectangle'][_0x585009(_0x3d8d39._0x37b99d)](_0x246126['xmin'],_0x246126['ymin'],_0x246126['xmax'],_0x246126['ymax']);let _0x58e22c=_0x379193[0x0][_0x585009(_0x3d8d39._0x45d6a0)]??0x1,_0x49156b=_0x379193[0x0][_0x585009(_0x3d8d39._0x126aa8)]??0x0;const _0x2284ac=[];_0x379193['forEach'](_0x74f3c2=>{const _0x10a9f9=_0x585009,_0x5ad67c=mars3d__namespace['PointTrans']['lonlat2mercator']([_0x74f3c2['lng'],_0x74f3c2[_0x10a9f9(0x155)]]),_0x13ae9f=_0x74f3c2['value']||0x1,_0x4d6e6=Math[_0x10a9f9(0x15a)]((_0x5ad67c[0x0]-_0x1e057a['xmin'])/_0x5896b0),_0x108ccc=Math['round']((_0x1e057a['ymax']-_0x5ad67c[0x1])/_0x5896b0);_0x58e22c=Math['max'](_0x58e22c,_0x13ae9f),_0x49156b=Math['min'](_0x49156b,_0x13ae9f),_0x2284ac['push']({'x':_0x4d6e6,'y':_0x108ccc,'value':_0x13ae9f});});const _0x262c19={'min':this['options']['min']??_0x49156b,'max':this[_0x585009(0x114)]['max']??_0x58e22c,'data':_0x2284ac};this['_last_heatData']=_0x262c19;if(!this['_last_mBounds']||_0x1e057a['xmin']!==this[_0x585009(0x140)][_0x585009(_0x3d8d39._0x28205b)]||_0x1e057a[_0x585009(_0x3d8d39._0x3bd0d0)]!==this[_0x585009(0x140)]['ymin']||_0x1e057a['xmax']!==this[_0x585009(_0x3d8d39._0x3d80a8)][_0x585009(_0x3d8d39._0x14a2ec)]||_0x1e057a['ymax']!==this[_0x585009(0x140)]['ymax']){this[_0x585009(_0x3d8d39._0x4f9788)]=_0x1e057a,this[_0x585009(_0x3d8d39._0x1d6a43)]['style']['cssText']='width:'+_0x1fb668+'px;height:'+_0x467b27+'px;';const _0x3df988={...this['heatStyle'],'container':this['_container']};!this['_heat']?this['_heat']=h337__namespace['create'](_0x3df988):this['_heat']['configure'](_0x3df988);}this['_heat']['setData'](_0x262c19);const _0x14df03=mars3d__namespace['DomUtil']['copyCanvas'](this[_0x585009(_0x3d8d39._0x4b9490)][_0x585009(0x146)]['canvas']);return _0x14df03;}['_getArcHeatCanvas'](){const _0x2d86cb={_0x177ee0:0x144,_0x482a78:0x14b,_0x24de5b:0x114},_0xaa76ca=_0x4c3c37;this['_heat'][_0xaa76ca(_0x2d86cb._0x177ee0)]({'radius':this[_0xaa76ca(0x118)]['radius']*this['style']['arcRadiusScale'],'blur':this[_0xaa76ca(0x118)]['blur']*this['style']['arcBlurScale'],'gradient':this[_0xaa76ca(0x118)]['gradientArc']||{0.25:'rgb(0,0,0)',0.55:_0xaa76ca(_0x2d86cb._0x482a78),0.85:'rgb(216,216,216)',0x1:'rgb(255,255,255)'}});const _0x3606cc=mars3d__namespace['DomUtil']['copyCanvas'](this['_heat']['_renderer']['canvas']);return this[_0xaa76ca(0x12f)][_0xaa76ca(0x144)](this[_0xaa76ca(_0x2d86cb._0x24de5b)]['heatStyle']),_0x3606cc;}['getPointData'](_0x194cff){const _0x586a8e={_0x5edced:0x13c,_0x224da6:0x155,_0x380fb7:0x15c},_0x4a7b1c=_0x4c3c37,_0x25a3b2=mars3d__namespace['LngLatPoint'][_0x4a7b1c(0x16c)](_0x194cff);if(!_0x25a3b2)return{};const _0x41f7fc=mars3d__namespace[_0x4a7b1c(_0x586a8e._0x5edced)]['lonlat2mercator']([_0x25a3b2['lng'],_0x25a3b2[_0x4a7b1c(_0x586a8e._0x224da6)]]),_0x1f79d9=this['_last_mBounds'],_0x1ef769=Math['round']((_0x41f7fc[0x0]-_0x1f79d9['xmin'])/this['_scale']),_0x4929c4=Math['round']((_0x1f79d9[_0x4a7b1c(0x129)]-_0x41f7fc[0x1])/this['_scale']),_0x27f301=this['_heat']['getValueAt']({'x':_0x1ef769,'y':_0x4929c4}),_0x2a218b=this['_heat']['_renderer']['ctx'][_0x4a7b1c(_0x586a8e._0x380fb7)](_0x1ef769-0x1,_0x4929c4-0x1,0x1,0x1)['data'];return{'x':_0x1ef769,'y':_0x4929c4,'value':_0x27f301,'color':_0x4a7b1c(0x134)+_0x2a218b[0x0]+','+_0x2a218b[0x1]+','+_0x2a218b[0x2]+','+_0x2a218b[0x3]+')'};}}mars3d__namespace['LayerUtil']['register'](_0x4c3c37(0x15e),HeatLayer),mars3d__namespace[_0x4c3c37(0x147)][_0x4c3c37(0x152)]=HeatLayer,mars3d__namespace['h337']=h337__namespace;function getMercatorBounds(_0x35d7c7){const _0x57d717={_0x1dcdd8:0x143,_0x2963f9:0x16b,_0x2c9264:0x143,_0x44d8ba:0x129},_0x5d9201=_0x4c3c37,_0x379d5e=mars3d__namespace['PointTrans'][_0x5d9201(_0x57d717._0x1dcdd8)]([_0x35d7c7[_0x5d9201(_0x57d717._0x2963f9)],_0x35d7c7['ymin']]),_0x496bcc=mars3d__namespace['PointTrans'][_0x5d9201(_0x57d717._0x2c9264)]([_0x35d7c7['xmax'],_0x35d7c7[_0x5d9201(_0x57d717._0x44d8ba)]]);return{'xmin':_0x379d5e[0x0],'ymin':_0x379d5e[0x1],'xmax':_0x496bcc[0x0],'ymax':_0x496bcc[0x1]};}function _0x803e(_0x1b560e,_0x10dbfe){const _0x260c7e=_0x260c();return _0x803e=function(_0x803e49,_0x4c8e17){_0x803e49=_0x803e49-0x111;let _0x42de72=_0x260c7e[_0x803e49];return _0x42de72;},_0x803e(_0x1b560e,_0x10dbfe);}function geLatLngBounds(_0x4ad6f9){const _0x4a66f7={_0x363cbb:0x13e},_0x3bd34e=_0x4c3c37,_0x25bfe6=mars3d__namespace['PointTrans'][_0x3bd34e(_0x4a66f7._0x363cbb)]([_0x4ad6f9['xmin'],_0x4ad6f9['ymin']]),_0x19c583=mars3d__namespace['PointTrans']['mercator2lonlat']([_0x4ad6f9['xmax'],_0x4ad6f9[_0x3bd34e(0x129)]]);return{'xmin':_0x25bfe6[0x0],'ymin':_0x25bfe6[0x1],'xmax':_0x19c583[0x0],'ymax':_0x19c583[0x1]};}function getVertexShaderSource(_0x5e4eb8){const _0x14f6c1=_0x4c3c37;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'+_0x5e4eb8+_0x14f6c1(0x123);}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.5.
|
|
3
|
+
"version": "3.5.16",
|
|
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.16"
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
16
|
"lint": "eslint ./src/**/*.{js,ts} --fix"
|