mars3d-heatmap 3.5.15 → 3.5.17
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.17
|
|
5
|
+
* 编译日期:2023-07-24 22:20:56
|
|
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';const _0x50910b=_0x4778;(function(_0x15d52a,_0x40d501){const _0x18b248={_0xa62559:0xe0,_0x5e5144:0x10a,_0x44c810:0x109,_0x129328:0xf9,_0x34e11e:0xd8,_0x4e7214:0xc8,_0x309742:0xe6},_0x2452d9=_0x4778,_0x1b1d15=_0x15d52a();while(!![]){try{const _0x1b2abe=-parseInt(_0x2452d9(_0x18b248._0xa62559))/0x1*(parseInt(_0x2452d9(_0x18b248._0x5e5144))/0x2)+-parseInt(_0x2452d9(0xf7))/0x3+-parseInt(_0x2452d9(0xfb))/0x4+-parseInt(_0x2452d9(_0x18b248._0x44c810))/0x5+-parseInt(_0x2452d9(_0x18b248._0x129328))/0x6*(-parseInt(_0x2452d9(_0x18b248._0x34e11e))/0x7)+-parseInt(_0x2452d9(_0x18b248._0x4e7214))/0x8*(parseInt(_0x2452d9(0x114))/0x9)+parseInt(_0x2452d9(_0x18b248._0x309742))/0xa;if(_0x1b2abe===_0x40d501)break;else _0x1b1d15['push'](_0x1b1d15['shift']());}catch(_0x1ddb1f){_0x1b1d15['push'](_0x1b1d15['shift']());}}}(_0x256c,0x409f4));function _interopNamespace(_0x52a420){const _0x4f0f4c={_0x4fc450:0x100},_0x4569e8=_0x4778;if(_0x52a420&&_0x52a420[_0x4569e8(_0x4f0f4c._0x4fc450)])return _0x52a420;var _0x17e1ff=Object['create'](null);return _0x52a420&&Object['keys'](_0x52a420)['forEach'](function(_0x3cfc3c){if(_0x3cfc3c!=='default'){var _0x2f5d8f=Object['getOwnPropertyDescriptor'](_0x52a420,_0x3cfc3c);Object['defineProperty'](_0x17e1ff,_0x3cfc3c,_0x2f5d8f['get']?_0x2f5d8f:{'enumerable':!![],'get':function(){return _0x52a420[_0x3cfc3c];}});}}),_0x17e1ff['default']=_0x52a420,_0x17e1ff;}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[_0x50910b(0xde)][_0x50910b(0xdf)],DEF_HEATSTYLE={'maxOpacity':0.8,'minOpacity':0.1,'blur':0.85,'radius':0x19,'gradient':{0.4:'blue',0.6:_0x50910b(0xf6),0.8:'yellow',0.9:'red'}},DEF_STYLE={'arcRadiusScale':1.5,'arcBlurScale':1.5,'vertexFormat':Cesium['EllipsoidSurfaceAppearance']['VERTEX_FORMAT']};class HeatLayer extends BaseLayer{constructor(_0x1a1667={}){const _0x8d5a96={_0x48e1b0:0xfd,_0x4d6e2a:0x101,_0x1d5f8c:0xee},_0x3a5a6d=_0x50910b;super(_0x1a1667),this['options'][_0x3a5a6d(_0x8d5a96._0x48e1b0)]=this['options']['maxCanvasSize']??document['body']['clientWidth'],this[_0x3a5a6d(_0x8d5a96._0x4d6e2a)][_0x3a5a6d(_0x8d5a96._0x48e1b0)]=Math['min'](this['options']['maxCanvasSize'],0x1388),this[_0x3a5a6d(0x101)][_0x3a5a6d(0xd3)]=this['options'][_0x3a5a6d(0xd3)]??document['body']['clientHeight'],this['options']['minCanvasSize']=Math['max'](this['options']['minCanvasSize'],0x2bc),this['options']['heatStyle']={...DEF_HEATSTYLE,...this['options'][_0x3a5a6d(0xc6)]},this['options'][_0x3a5a6d(0xee)]={...DEF_STYLE,...this[_0x3a5a6d(0x101)][_0x3a5a6d(_0x8d5a96._0x1d5f8c)]};}get[_0x50910b(0xde)](){return this['_layer'];}get[_0x50910b(0xc6)](){return this['options']['heatStyle'];}set[_0x50910b(0xc6)](_0x470b51){const _0x5a6068={_0x2a9542:0xc6,_0x2e2dfa:0xc5},_0x259f6d=_0x50910b;this['options']['heatStyle']=mars3d__namespace['Util'][_0x259f6d(0x10d)](this['options'][_0x259f6d(_0x5a6068._0x2a9542)],_0x470b51),this['_heat']&&(this['_heat']['configure'](this['options']['heatStyle']),this[_0x259f6d(_0x5a6068._0x2e2dfa)](!![]));}get['style'](){return this['options']['style'];}set['style'](_0x363960){const _0x23064b=_0x50910b;this[_0x23064b(0x101)][_0x23064b(0xee)]=mars3d__namespace[_0x23064b(0xe1)]['merge'](this['options'][_0x23064b(0xee)],_0x363960);}get['positions'](){return this['_positions'];}set[_0x50910b(0xdd)](_0x2c5afb){this['setPositions'](_0x2c5afb);}get['coordinates'](){const _0x3a9918=[];return this['points']['forEach'](_0x28a8fd=>{const _0x424e4a=_0x4778;_0x3a9918['push'](_0x28a8fd[_0x424e4a(0xcc)]());}),_0x3a9918;}get[_0x50910b(0xf1)](){return this['_rectangle'];}[_0x50910b(0xe3)](_0x50a88a,_0x1454ae){_0x50a88a['positions']&&(this['positions']=_0x50a88a['positions']);}['_mountedHook'](){const _0xe36449={_0x551dd0:0xed,_0x5121e8:0xda},_0x4af106=_0x50910b;this['style'][_0x4af106(_0xe36449._0x551dd0)]==='image'?this['_layer']=new mars3d__namespace['layer']['ImageLayer']({'crs':'EPSG:3857','private':!![]}):this[_0x4af106(_0xe36449._0x5121e8)]=new mars3d__namespace[(_0x4af106(0xde))]['GraphicLayer']({'private':!![]});}['_addedHook'](){const _0x3802f6={_0x4440b8:0xd7},_0xaca649=_0x50910b;this['_map']['addLayer'](this['_layer']),this['_container']=mars3d__namespace['DomUtil']['create'](_0xaca649(_0x3802f6._0x4440b8),_0xaca649(0x107),this['_map']['container']),this['options']['positions']&&(this['positions']=this['options']['positions']),this[_0xaca649(0x101)]['flyTo']&&this['flyToByAnimationEnd']();}['_removedHook'](){const _0x5e4af9={_0x3f5753:0xe9,_0x2d16ce:0xd0,_0x1d98f4:0xda},_0x2ce471=_0x50910b;this['_container']&&(mars3d__namespace[_0x2ce471(_0x5e4af9._0x3f5753)]['remove'](this['_container']),delete this['_container']),this['clear'](),this[_0x2ce471(_0x5e4af9._0x2d16ce)]['removeLayer'](this[_0x2ce471(_0x5e4af9._0x1d98f4)]);}['addPosition'](_0x5b9f5d,_0x450a8c){const _0x10ed32={_0x1396f9:0xc5},_0xd548d9=_0x50910b;this[_0xd548d9(0xe8)]=this['_positions']||[],this[_0xd548d9(0xe8)]['push'](_0x5b9f5d),this[_0xd548d9(_0x10ed32._0x1396f9)](_0x450a8c);}[_0x50910b(0xc7)](_0x37e974,_0x70eba0){this['_positions']=_0x37e974,this['_updatePositionsHook'](_0x70eba0);}[_0x50910b(0xe4)](){const _0x17344c={_0x1d958f:0x10b,_0x4c29f5:0xf2},_0x485583=_0x50910b;this['_graphic']&&(this['_layer'][_0x485583(_0x17344c._0x1d958f)](this[_0x485583(_0x17344c._0x4c29f5)],!![]),delete this[_0x485583(0xf2)]),this['_graphic2']&&(this['_layer']['removeGraphic'](this['_graphic2'],!![]),delete this['_graphic2']);}['_updatePositionsHook'](_0x23d64a){const _0x1c2d71={_0x2f5893:0xdd,_0x3ea9c1:0xed,_0xfa5373:0x10f,_0x1cec10:0xcb,_0x5176cf:0xc9,_0x56baa8:0xfe,_0x2f162b:0xd6},_0x57bde4=_0x50910b;if(!this['show']||!this['_map']||!this['positions']||this[_0x57bde4(_0x1c2d71._0x2f5893)]['length']===0x0)return this;const _0x48385d=this['_getHeatCanvas']();if(this[_0x57bde4(0xee)][_0x57bde4(_0x1c2d71._0x3ea9c1)]==='image')this['_layer'][_0x57bde4(_0x1c2d71._0xfa5373)]({'url':_0x48385d[_0x57bde4(0x108)](_0x57bde4(_0x1c2d71._0x1cec10)),'rectangle':this[_0x57bde4(_0x1c2d71._0x5176cf)],'opacity':this['style']['opacity']});else this[_0x57bde4(0xee)]['arc']?this['_graphic']&&_0x23d64a?(this['_graphic']['uniforms'][_0x57bde4(0x103)]=_0x48385d,this['_graphic']['uniforms'][_0x57bde4(_0x1c2d71._0x56baa8)]=this['_getArcHeatCanvas'](),this['_graphic2']&&(this['_graphic2'][_0x57bde4(0xcf)]['image']=_0x48385d,this['_graphic2']['uniforms']['bumpMap']=this['_graphic'][_0x57bde4(0xcf)]['bumpMap'])):this[_0x57bde4(_0x1c2d71._0x2f162b)](_0x48385d):this['_graphic']&&_0x23d64a?this['_graphic'][_0x57bde4(0xcf)][_0x57bde4(0x103)]=_0x48385d:this['_createGraphic'](_0x48385d);return this;}['_createGraphic'](_0x36934c){const _0x49300a=_0x50910b;this[_0x49300a(0xe4)](),this['_graphic']=new mars3d__namespace['graphic']['RectanglePrimitive']({...this['options'],'rectangle':this['_rectangle'],'appearance':new Cesium['EllipsoidSurfaceAppearance']({'material':new Cesium['Material']({'fabric':{'uniforms':{'image':_0x36934c},'source':HeatMaterial},'translucent':!![]}),'flat':!![]})}),this[_0x49300a(0xda)]['addGraphic'](this['_graphic']);}['_createArcGraphic'](_0x20c997){const _0x416eab={_0xce51cb:0xf5,_0x472915:0x111,_0x549328:0xdb,_0x290bea:0xfa,_0x36bf63:0x106,_0x16870a:0xee,_0x2d95c7:0xf3,_0xf2c0cf:0xc3,_0x119b70:0x110,_0x4cd2e2:0xee,_0x5cd792:0xd1},_0x1f8ec3=_0x50910b;this['clear']();const _0x36b560=Cesium['RenderState']['fromCache']({'cull':{'enabled':!![]},'depthTest':{'enabled':!![]},'stencilTest':{'enabled':!![],'frontFunction':Cesium['StencilFunction']['ALWAYS'],'frontOperation':{'fail':Cesium[_0x1f8ec3(0x112)]['KEEP'],'zFail':Cesium[_0x1f8ec3(0x112)][_0x1f8ec3(_0x416eab._0xce51cb)],'zPass':Cesium['StencilOperation']['REPLACE']},'backFunction':Cesium[_0x1f8ec3(_0x416eab._0x472915)]['ALWAYS'],'backOperation':{'fail':Cesium['StencilOperation']['KEEP'],'zFail':Cesium['StencilOperation']['KEEP'],'zPass':Cesium[_0x1f8ec3(0x112)][_0x1f8ec3(_0x416eab._0x549328)]},'reference':0x2,'mask':0x2},'blending':Cesium['BlendingState']['ALPHA_BLEND']}),_0x54377a=Math[_0x1f8ec3(_0x416eab._0x290bea)](this['style'][_0x1f8ec3(_0x416eab._0x36bf63)]??this['_mBoundsMax']*0.02)+0.1;this[_0x1f8ec3(_0x416eab._0x16870a)]['diffHeight']&&delete this['style'][_0x1f8ec3(0x106)];const _0xc8ecf9=(this['style']['splitNum'],0x64);let _0x25833e=Math[_0x1f8ec3(_0x416eab._0x2d95c7)](this['_rectangle'][_0x1f8ec3(0xd4)],this['_rectangle']['width']);this['style'][_0x1f8ec3(0xc4)]=_0x25833e/=_0xc8ecf9;const _0x3d3b70=new Cesium['Material']({'fabric':{'uniforms':{'image':_0x20c997,'repeat':new Cesium['Cartesian2'](0x1,0x1),'color':new Cesium['Color'](0x1,0x1,0x1,0x0),'bumpMap':this['_getArcHeatCanvas']()},'source':HeatMaterial},'translucent':!![]}),_0xf47844=this['style'][_0x1f8ec3(_0x416eab._0xf2c0cf)]||0x1;this['_graphic']=new mars3d__namespace['graphic']['RectanglePrimitive']({...this['options'],'rectangle':this['_rectangle'],'appearance':new Cesium['EllipsoidSurfaceAppearance']({'flat':!![],'aboveGround':!![],'renderState':_0x36b560,'material':_0x3d3b70,'vertexShaderSource':getVertexShaderSource(_0x54377a*_0xf47844)})}),this['_layer'][_0x1f8ec3(_0x416eab._0x119b70)](this['_graphic']),this[_0x1f8ec3(_0x416eab._0x4cd2e2)]['arcDirection']===0x0&&(this['_graphic2']=new mars3d__namespace['graphic']['RectanglePrimitive']({...this[_0x1f8ec3(0x101)],'rectangle':this[_0x1f8ec3(0xc9)],'appearance':new Cesium[(_0x1f8ec3(_0x416eab._0x5cd792))]({'flat':!![],'aboveGround':!![],'renderState':_0x36b560,'material':_0x3d3b70,'vertexShaderSource':getVertexShaderSource(-_0x54377a)})}),this[_0x1f8ec3(0xda)][_0x1f8ec3(0x110)](this['_graphic2']));}[_0x50910b(0x104)](_0x4099e8){const _0x4e828a={_0x323c3a:0xc9},_0x241a37=_0x50910b;return _0x4099e8!==null&&_0x4099e8!==void 0x0&&_0x4099e8[_0x241a37(0xfc)]&&this[_0x241a37(_0x4e828a._0x323c3a)]?mars3d__namespace['PolyUtil'][_0x241a37(0xe7)](this['_rectangle']):this['_rectangle'];}['_getHeatCanvas'](){const _0x350ef1={_0xf2bae6:0xef,_0x4eacca:0xf3,_0x3b6038:0x10c,_0x1f854e:0x101,_0xf7c90:0xfd,_0xfe3f86:0x101,_0x3eac43:0xd2,_0x16a48a:0xeb,_0x33cc2b:0xce,_0x1b57b6:0xe5},_0x7d9f31={_0x503178:0x113},_0xdf683d=_0x50910b,_0x2b6609=this['_positions'],_0x57954e=[];let _0x3d6239,_0x379057,_0x3efc4f,_0x8ec62b;_0x2b6609['forEach'](_0x590165=>{const _0x3517e0=_0x4778,_0x2e70bb=mars3d__namespace['LngLatPoint'][_0x3517e0(0xcd)](_0x590165);if(!_0x2e70bb)return;_0x2e70bb['value']=_0x590165['value']||0x1,!this['options'][_0x3517e0(0xf1)]&&(_0x3d6239===undefined?(_0x3d6239=_0x2e70bb[_0x3517e0(0x113)],_0x379057=_0x2e70bb['lng'],_0x3efc4f=_0x2e70bb['lat'],_0x8ec62b=_0x2e70bb['lat']):(_0x3d6239=Math[_0x3517e0(0x10c)](_0x3d6239,_0x2e70bb['lng']),_0x379057=Math['max'](_0x379057,_0x2e70bb['lng']),_0x3efc4f=Math[_0x3517e0(0x10c)](_0x3efc4f,_0x2e70bb[_0x3517e0(0xf0)]),_0x8ec62b=Math['max'](_0x8ec62b,_0x2e70bb[_0x3517e0(0xf0)]))),_0x57954e['push'](_0x2e70bb);});_0x3d6239===_0x379057&&(_0x3d6239-=0.000001,_0x379057+=0.000001);_0x3efc4f===_0x8ec62b&&(_0x3efc4f-=0.000001,_0x8ec62b+=0.000001);let _0x1110e8=this['options']['rectangle']||{'xmin':_0x3d6239,'xmax':_0x379057,'ymin':_0x3efc4f,'ymax':_0x8ec62b};const _0x431052=getMercatorBounds(_0x1110e8),_0x90307f=Math[_0xdf683d(_0x350ef1._0xf2bae6)](_0x431052['xmax']-_0x431052['xmin']),_0x201777=Math['abs'](_0x431052['ymax']-_0x431052[_0xdf683d(0xd2)]),_0x32c908=Math[_0xdf683d(_0x350ef1._0x4eacca)](_0x90307f,_0x201777),_0x57d36c=Math[_0xdf683d(_0x350ef1._0x3b6038)](_0x90307f,_0x201777);this['_mBoundsMax']=_0x32c908;let _0x1a9450=0x1;if(_0x32c908>this['options']['maxCanvasSize'])_0x1a9450=_0x32c908/this[_0xdf683d(0x101)]['maxCanvasSize'],_0x57d36c/_0x1a9450<this['options']['minCanvasSize']&&(_0x1a9450=_0x57d36c/this['options']['minCanvasSize']);else _0x57d36c<this['options'][_0xdf683d(0xd3)]&&(_0x1a9450=_0x57d36c/this[_0xdf683d(_0x350ef1._0x1f854e)]['minCanvasSize'],_0x32c908/_0x1a9450>this['options'][_0xdf683d(_0x350ef1._0xf7c90)]&&(_0x1a9450=_0x32c908/this[_0xdf683d(_0x350ef1._0xfe3f86)][_0xdf683d(0xfd)]));const _0x2f2e73=this['heatStyle']['radius']*1.5,_0x5ba75d=_0x90307f/_0x1a9450+_0x2f2e73*0x2,_0x3341d8=_0x201777/_0x1a9450+_0x2f2e73*0x2,_0x516c62=_0x2f2e73*_0x1a9450;_0x431052[_0xdf683d(0x102)]-=_0x516c62,_0x431052['ymin']-=_0x516c62,_0x431052['xmax']+=_0x516c62,_0x431052['ymax']+=_0x516c62,this['_scale']=_0x1a9450,_0x1110e8=geLatLngBounds(_0x431052),this[_0xdf683d(0xc9)]=Cesium[_0xdf683d(0xd9)]['fromDegrees'](_0x1110e8[_0xdf683d(0x102)],_0x1110e8[_0xdf683d(_0x350ef1._0x3eac43)],_0x1110e8[_0xdf683d(_0x350ef1._0x16a48a)],_0x1110e8['ymax']);let _0xdce168=_0x57954e[0x0][_0xdf683d(0xf4)]??0x1,_0x4926ac=_0x57954e[0x0]['value']??0x0;const _0x4f7e22=[];_0x57954e['forEach'](_0x22a466=>{const _0x24dff7=_0xdf683d,_0x5a76b7=mars3d__namespace['PointTrans']['lonlat2mercator']([_0x22a466[_0x24dff7(_0x7d9f31._0x503178)],_0x22a466['lat']]),_0x511b66=_0x22a466['value']||0x1,_0x2a0ebb=Math[_0x24dff7(0x105)]((_0x5a76b7[0x0]-_0x431052['xmin'])/_0x1a9450),_0x443d6e=Math['round']((_0x431052['ymax']-_0x5a76b7[0x1])/_0x1a9450);_0xdce168=Math['max'](_0xdce168,_0x511b66),_0x4926ac=Math['min'](_0x4926ac,_0x511b66),_0x4f7e22['push']({'x':_0x2a0ebb,'y':_0x443d6e,'value':_0x511b66});});const _0x9c0591={'min':this['options']['min']??_0x4926ac,'max':this['options']['max']??_0xdce168,'data':_0x4f7e22};this['_last_heatData']=_0x9c0591;if(!this['_last_mBounds']||_0x431052['xmin']!==this['_last_mBounds']['xmin']||_0x431052['ymin']!==this['_last_mBounds']['ymin']||_0x431052['xmax']!==this['_last_mBounds'][_0xdf683d(0xeb)]||_0x431052['ymax']!==this['_last_mBounds']['ymax']){this['_last_mBounds']=_0x431052,this['_container']['style']['cssText']='width:'+_0x5ba75d+_0xdf683d(_0x350ef1._0x33cc2b)+_0x3341d8+'px;';const _0x433e06={...this['heatStyle'],'container':this['_container']};!this['_heat']?this['_heat']=h337__namespace['create'](_0x433e06):this['_heat'][_0xdf683d(_0x350ef1._0x1b57b6)](_0x433e06);}this['_heat']['setData'](_0x9c0591);const _0x1f6628=mars3d__namespace['DomUtil']['copyCanvas'](this['_heat']['_renderer']['canvas']);return _0x1f6628;}['_getArcHeatCanvas'](){const _0x5a0ecc={_0xa60bfe:0xe5,_0x343834:0xe2},_0xfb8f50=_0x50910b;this['_heat'][_0xfb8f50(_0x5a0ecc._0xa60bfe)]({'radius':this['heatStyle']['radius']*this[_0xfb8f50(0xee)]['arcRadiusScale'],'blur':this[_0xfb8f50(0xc6)][_0xfb8f50(0xff)]*this[_0xfb8f50(0xee)]['arcBlurScale'],'gradient':this['heatStyle'][_0xfb8f50(0x10e)]||{0.25:'rgb(0,0,0)',0.55:_0xfb8f50(_0x5a0ecc._0x343834),0.85:'rgb(216,216,216)',0x1:'rgb(255,255,255)'}});const _0x59af8e=mars3d__namespace['DomUtil']['copyCanvas'](this[_0xfb8f50(0xdc)]['_renderer']['canvas']);return this['_heat']['configure'](this[_0xfb8f50(0x101)]['heatStyle']),_0x59af8e;}['getPointData'](_0x49137c){const _0x3441e3={_0x28238c:0x113,_0x402dac:0x105},_0x317ec0=_0x50910b,_0xd53a53=mars3d__namespace['LngLatPoint']['parse'](_0x49137c);if(!_0xd53a53)return{};const _0x381eb7=mars3d__namespace['PointTrans']['lonlat2mercator']([_0xd53a53[_0x317ec0(_0x3441e3._0x28238c)],_0xd53a53['lat']]),_0x3eb0bd=this['_last_mBounds'],_0x175023=Math[_0x317ec0(_0x3441e3._0x402dac)]((_0x381eb7[0x0]-_0x3eb0bd['xmin'])/this['_scale']),_0x1d58d2=Math['round']((_0x3eb0bd['ymax']-_0x381eb7[0x1])/this['_scale']),_0x6a927f=this['_heat']['getValueAt']({'x':_0x175023,'y':_0x1d58d2}),_0xf87f8c=this['_heat']['_renderer']['ctx']['getImageData'](_0x175023-0x1,_0x1d58d2-0x1,0x1,0x1)['data'];return{'x':_0x175023,'y':_0x1d58d2,'value':_0x6a927f,'color':'rgba('+_0xf87f8c[0x0]+','+_0xf87f8c[0x1]+','+_0xf87f8c[0x2]+','+_0xf87f8c[0x3]+')'};}}mars3d__namespace[_0x50910b(0xea)][_0x50910b(0xd5)]('heat',HeatLayer),mars3d__namespace[_0x50910b(0xde)][_0x50910b(0xf8)]=HeatLayer,mars3d__namespace['h337']=h337__namespace;function _0x256c(){const _0x59797a=['type','style','abs','lat','rectangle','_graphic','max','value','KEEP','green','1516851nKPSoF','HeatLayer','6mjMZlI','floor','629068LYfKZz','isFormat','maxCanvasSize','bumpMap','blur','__esModule','options','xmin','image','getRectangle','round','diffHeight','mars3d-heatmap\x20mars3d-hideDiv','toDataURL','979345xajecP','56HHiYuS','removeGraphic','min','merge','gradientArc','setOptions','addGraphic','StencilFunction','StencilOperation','lng','365886rzTdwl','arcDirection','granularity','_updatePositionsHook','heatStyle','setPositions','16YKRoKX','_rectangle','mercator2lonlat','image/png','toArray','parse','px;height:','uniforms','_map','EllipsoidSurfaceAppearance','ymin','minCanvasSize','height','register','_createArcGraphic','div','3385823jXkRgd','Rectangle','_layer','REPLACE','_heat','positions','layer','BaseLayer','12104wZicun','Util','rgb(140,140,140)','_setOptionsHook','clear','configure','10599760goRUCj','formatRectangle','_positions','DomUtil','LayerUtil','xmax','defineProperty'];_0x256c=function(){return _0x59797a;};return _0x256c();}function getMercatorBounds(_0x40e07d){const _0x4801c7={_0x9e26ac:0x102},_0x1fd7d1=_0x50910b,_0x4172e4=mars3d__namespace['PointTrans']['lonlat2mercator']([_0x40e07d[_0x1fd7d1(_0x4801c7._0x9e26ac)],_0x40e07d['ymin']]),_0x2c8af8=mars3d__namespace['PointTrans']['lonlat2mercator']([_0x40e07d['xmax'],_0x40e07d['ymax']]);return{'xmin':_0x4172e4[0x0],'ymin':_0x4172e4[0x1],'xmax':_0x2c8af8[0x0],'ymax':_0x2c8af8[0x1]};}function geLatLngBounds(_0x2cff6e){const _0x19649c=_0x50910b,_0x13ced0=mars3d__namespace['PointTrans']['mercator2lonlat']([_0x2cff6e[_0x19649c(0x102)],_0x2cff6e['ymin']]),_0x1aba46=mars3d__namespace['PointTrans'][_0x19649c(0xca)]([_0x2cff6e['xmax'],_0x2cff6e['ymax']]);return{'xmin':_0x13ced0[0x0],'ymin':_0x13ced0[0x1],'xmax':_0x1aba46[0x0],'ymax':_0x1aba46[0x1]};}function _0x4778(_0x2f838f,_0x48061a){const _0x256c60=_0x256c();return _0x4778=function(_0x4778f8,_0x283065){_0x4778f8=_0x4778f8-0xc3;let _0x49a462=_0x256c60[_0x4778f8];return _0x49a462;},_0x4778(_0x2f838f,_0x48061a);}function getVertexShaderSource(_0x52f714){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'+_0x52f714+';\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[_0x50910b(0xf8)]=HeatLayer,Object[_0x50910b(0xec)](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.17",
|
|
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.17"
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
16
|
"lint": "eslint ./src/**/*.{js,ts} --fix"
|