mars3d-heatmap 3.6.15 → 3.6.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.6.
|
|
5
|
-
* 编译日期:2023-12-
|
|
4
|
+
* 版本信息:v3.6.17
|
|
5
|
+
* 编译日期:2023-12-18 20:13:45
|
|
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 _0x132db7=_0x590d;function _0x4867(){const _0xc81134=['_positions','h337','rgb(255,255,255)','bumpMap','ImageLayer','_graphic','abs','DomUtil','layer','parse','getRectangle','getImageData','7VrIQqW','xmin','addGraphic','2220476LxGdcD','type','clear','4632246oFKplh','flyToByAnimationEnd','style','ymax','setPositions','_heat','2204845FUEMWM','blue','4473080dwqBzj','3iqBToF','_mBoundsMax','defineProperty','xmax','VERTEX_FORMAT','Rectangle','options','minCanvasSize','Util','__esModule','graphic','LayerUtil','forEach','_rectangle','请引入\x20heatmap.js\x20库\x20','12nAZYdg','_last_heatData','_layer','points','_graphic2','min','_updatePositionsHook','diffHeight','mercator2lonlat','_map','formatRectangle','ymin','get','Color','arcBlurScale','REPLACE','image','canvas','8540EYASqe','coordinates','_container','maxCanvasSize','max','_last_mBounds','47113qalWZq','round','heatStyle','gradientArc','positions','864972lyboWF',';\x0a\x20\x20\x20\x20p\x20+=vec4(disPos,0.0);\x0a\x20\x20\x20\x20gl_Position\x20=\x20czm_modelViewProjectionRelativeToEye\x20*\x20p;\x0a\x20\x20}\x0a','lat','Material','value','getValueAt','StencilOperation','lonlat2mercator','177782czMBhW','clientWidth','EllipsoidSurfaceAppearance','body','create','_renderer','StencilFunction','PointTrans'];_0x4867=function(){return _0xc81134;};return _0x4867();}(function(_0x4eec13,_0x1548f3){const _0x3fa906={_0x31c6e6:0x213,_0x3e7b0f:0x21c,_0x32bf1e:0x21e,_0x5abb53:0x240},_0x347bd7=_0x590d,_0x54a0c1=_0x4eec13();while(!![]){try{const _0x25749b=-parseInt(_0x347bd7(0x21f))/0x1*(parseInt(_0x347bd7(0x1fc))/0x2)+-parseInt(_0x347bd7(0x1f4))/0x3+-parseInt(_0x347bd7(_0x3fa906._0x31c6e6))/0x4+parseInt(_0x347bd7(_0x3fa906._0x3e7b0f))/0x5*(-parseInt(_0x347bd7(0x22e))/0x6)+parseInt(_0x347bd7(0x210))/0x7*(-parseInt(_0x347bd7(_0x3fa906._0x32bf1e))/0x8)+-parseInt(_0x347bd7(0x216))/0x9+-parseInt(_0x347bd7(_0x3fa906._0x5abb53))/0xa*(-parseInt(_0x347bd7(0x1ef))/0xb);if(_0x25749b===_0x1548f3)break;else _0x54a0c1['push'](_0x54a0c1['shift']());}catch(_0x300ede){_0x54a0c1['push'](_0x54a0c1['shift']());}}}(_0x4867,0x907b7));function _interopNamespace(_0x21d168){const _0x294b6b={_0x26aade:0x221},_0x1c1285=_0x590d;if(_0x21d168&&_0x21d168[_0x1c1285(0x228)])return _0x21d168;var _0x1698ec=Object['create'](null);return _0x21d168&&Object['keys'](_0x21d168)['forEach'](function(_0x36eab4){const _0x52c5e8=_0x1c1285;if(_0x36eab4!=='default'){var _0x151734=Object['getOwnPropertyDescriptor'](_0x21d168,_0x36eab4);Object[_0x52c5e8(_0x294b6b._0x26aade)](_0x1698ec,_0x36eab4,_0x151734[_0x52c5e8(0x23a)]?_0x151734:{'enumerable':!![],'get':function(){return _0x21d168[_0x36eab4];}});}}),_0x1698ec['default']=_0x21d168,_0x1698ec;}var mars3d__namespace=_interopNamespace(mars3d),h337__namespace=_interopNamespace(h337),HeatMaterial='uniform\x20sampler2D\x20image;\x0a\x0aczm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x20{\x0a\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20vec4\x20colorImage\x20=\x20texture(image,\x20st);\x0a\x20\x20if(colorImage.rgb\x20==\x20vec3(1.0)\x20||\x20colorImage.rgb\x20==\x20vec3(0.0))\x20{\x0a\x20\x20\x20\x20discard;\x0a\x20\x20}\x0a\x20\x20material.diffuse\x20=\x20colorImage.rgb;\x0a\x20\x20material.alpha\x20=\x20colorImage.a;\x0a\x20\x20return\x20material;\x0a}\x0a';if(!h337__namespace['create'])throw new Error(_0x132db7(0x22d));const Cesium=mars3d__namespace['Cesium'],BaseLayer=mars3d__namespace['layer']['BaseLayer'],DEF_HEATSTYLE={'maxOpacity':0.8,'minOpacity':0.1,'blur':0.85,'radius':0x19,'gradient':{0.4:_0x132db7(0x21d),0.6:'green',0.8:'yellow',0.9:'red'}},DEF_STYLE={'arcRadiusScale':1.5,'arcBlurScale':1.5,'vertexFormat':Cesium['EllipsoidSurfaceAppearance'][_0x132db7(0x223)]};class HeatLayer extends BaseLayer{constructor(_0x4c98cf={}){const _0xc8a290={_0x34250d:0x1fd,_0x343f99:0x1ff,_0x1dd721:0x225,_0x583c9e:0x1f1},_0x174fd7=_0x132db7;super(_0x4c98cf),this[_0x174fd7(0x225)]['maxCanvasSize']=this[_0x174fd7(0x225)]['maxCanvasSize']??document['body'][_0x174fd7(_0xc8a290._0x34250d)],this['options'][_0x174fd7(0x1ec)]=Math['min'](this['options']['maxCanvasSize'],0x1388),this['options']['minCanvasSize']=this['options'][_0x174fd7(0x226)]??document[_0x174fd7(_0xc8a290._0x343f99)]['clientHeight'],this[_0x174fd7(0x225)]['minCanvasSize']=Math[_0x174fd7(0x1ed)](this['options']['minCanvasSize'],0x2bc),this[_0x174fd7(_0xc8a290._0x1dd721)]['heatStyle']={...DEF_HEATSTYLE,...this[_0x174fd7(_0xc8a290._0x1dd721)][_0x174fd7(_0xc8a290._0x583c9e)]},this['options']['style']={...DEF_STYLE,...this['options']['style']};}get['layer'](){return this['_layer'];}get[_0x132db7(0x1f1)](){return this['options']['heatStyle'];}set['heatStyle'](_0x369595){const _0x4ea5b3={_0x2b38bc:0x1f1},_0x16d772=_0x132db7;this[_0x16d772(0x225)][_0x16d772(_0x4ea5b3._0x2b38bc)]=mars3d__namespace['Util']['merge'](this[_0x16d772(0x225)][_0x16d772(0x1f1)],_0x369595),this['_heat']&&(this['_heat']['configure'](this['options']['heatStyle']),this['_updatePositionsHook'](!![]));}get[_0x132db7(0x218)](){return this['options']['style'];}set[_0x132db7(0x218)](_0x5b0840){const _0x24c1ee={_0x392362:0x227,_0x561580:0x218},_0x10104c=_0x132db7;this[_0x10104c(0x225)][_0x10104c(0x218)]=mars3d__namespace[_0x10104c(_0x24c1ee._0x392362)]['merge'](this['options'][_0x10104c(_0x24c1ee._0x561580)],_0x5b0840);}get[_0x132db7(0x1f3)](){return this['_positions'];}set['positions'](_0x73b842){this['setPositions'](_0x73b842);}get[_0x132db7(0x241)](){const _0x2aa191={_0x1f539b:0x231},_0x591d1a=_0x132db7,_0x4215af=[];return this[_0x591d1a(_0x2aa191._0x1f539b)]['forEach'](_0x523505=>{_0x4215af['push'](_0x523505['toArray']());}),_0x4215af;}get['rectangle'](){const _0x53f2b7={_0x42abb0:0x22c},_0x3e9614=_0x132db7;return this[_0x3e9614(_0x53f2b7._0x42abb0)];}['_setOptionsHook'](_0x43ebfb,_0x9c6282){_0x43ebfb['positions']&&(this['positions']=_0x43ebfb['positions']);}['_mountedHook'](){const _0x528703={_0x40a95a:0x214,_0x3af13d:0x23e,_0x53d4c5:0x20c},_0x12b580=_0x132db7;this['style'][_0x12b580(_0x528703._0x40a95a)]===_0x12b580(_0x528703._0x3af13d)?this[_0x12b580(0x230)]=new mars3d__namespace[(_0x12b580(_0x528703._0x53d4c5))][(_0x12b580(0x208))]({'crs':'EPSG:3857','private':!![]}):this['_layer']=new mars3d__namespace['layer']['GraphicLayer']({'private':!![]});}['_addedHook'](){const _0x5f0b14={_0x289efd:0x1eb,_0x4b43c2:0x237,_0x43835c:0x217},_0x137b46=_0x132db7;this['_map']['addLayer'](this['_layer']),this[_0x137b46(_0x5f0b14._0x289efd)]=mars3d__namespace['DomUtil'][_0x137b46(0x200)]('div','mars3d-heatmap\x20mars3d-hideDiv',this[_0x137b46(_0x5f0b14._0x4b43c2)]['container']),this['options']['positions']&&(this['positions']=this[_0x137b46(0x225)][_0x137b46(0x1f3)]),this[_0x137b46(0x225)]['flyTo']&&this[_0x137b46(_0x5f0b14._0x43835c)]();}['_removedHook'](){const _0x209079={_0x42b048:0x20b,_0x39457c:0x215},_0x407e7a=_0x132db7;this['_container']&&(mars3d__namespace[_0x407e7a(_0x209079._0x42b048)]['remove'](this['_container']),delete this['_container']),this[_0x407e7a(_0x209079._0x39457c)](),this['_map']['removeLayer'](this['_layer']);}['addPosition'](_0x175805,_0x56acfe){const _0x440ce3=_0x132db7;this['_positions']=this[_0x440ce3(0x204)]||[],this['_positions']['push'](_0x175805),this[_0x440ce3(0x234)](_0x56acfe);}[_0x132db7(0x21a)](_0x29b5b6,_0x12f731){const _0x415569=_0x132db7;this[_0x415569(0x204)]=_0x29b5b6,this['_updatePositionsHook'](_0x12f731);}['clear'](){const _0x14b0ba={_0x4ce772:0x209,_0x5a444a:0x232},_0xff9f85=_0x132db7;this['_graphic']&&(this['_layer']['removeGraphic'](this[_0xff9f85(_0x14b0ba._0x4ce772)],!![]),delete this['_graphic']),this['_graphic2']&&(this['_layer']['removeGraphic'](this[_0xff9f85(_0x14b0ba._0x5a444a)],!![]),delete this['_graphic2']);}['_updatePositionsHook'](_0x1ba07d){const _0x1155fe={_0x4e7738:0x209,_0x5962b3:0x23e,_0x4eb97e:0x232,_0x34ace5:0x23e},_0x27ed29=_0x132db7;if(!this['show']||!this['_map']||!this['positions']||this['positions']['length']===0x0)return this;const _0x1759fc=this['_getHeatCanvas']();if(this['style']['type']===_0x27ed29(0x23e))this[_0x27ed29(0x230)]['setOptions']({'url':_0x1759fc['toDataURL']('image/png'),'rectangle':this['_rectangle'],'opacity':this['style']['opacity']});else this['style']['arc']?this['_graphic']&&_0x1ba07d?(this[_0x27ed29(_0x1155fe._0x4e7738)]['uniforms'][_0x27ed29(_0x1155fe._0x5962b3)]=_0x1759fc,this['_graphic']['uniforms']['bumpMap']=this['_getArcHeatCanvas'](),this['_graphic2']&&(this['_graphic2']['uniforms']['image']=_0x1759fc,this[_0x27ed29(_0x1155fe._0x4eb97e)]['uniforms'][_0x27ed29(0x207)]=this['_graphic']['uniforms']['bumpMap'])):this['_createArcGraphic'](_0x1759fc):this['_graphic']&&_0x1ba07d?this['_graphic']['uniforms'][_0x27ed29(_0x1155fe._0x34ace5)]=_0x1759fc:this['_createGraphic'](_0x1759fc);return this;}['_createGraphic'](_0x4f44c3){const _0x2c528f={_0x46f72b:0x212},_0x3c0977=_0x132db7;this['clear'](),this['_graphic']=new mars3d__namespace['graphic']['RectanglePrimitive']({...this[_0x3c0977(0x225)],'rectangle':this['_rectangle'],'appearance':new Cesium[(_0x3c0977(0x1fe))]({'material':new Cesium['Material']({'fabric':{'uniforms':{'image':_0x4f44c3},'source':HeatMaterial},'translucent':!![]}),'flat':!![]})}),this['_layer'][_0x3c0977(_0x2c528f._0x46f72b)](this['_graphic']);}['_createArcGraphic'](_0x320169){const _0x210fb4={_0x1bb69b:0x215,_0xcc20f1:0x202,_0x50a60d:0x1fa,_0x3e171b:0x23d,_0x13115f:0x235,_0x4afef8:0x22c,_0x44f0fc:0x22c,_0x119cdd:0x229,_0x530f6d:0x209,_0x138779:0x22c},_0x220a54=_0x132db7;this[_0x220a54(_0x210fb4._0x1bb69b)]();const _0x256bf6=Cesium['RenderState']['fromCache']({'cull':{'enabled':!![]},'depthTest':{'enabled':!![]},'stencilTest':{'enabled':!![],'frontFunction':Cesium[_0x220a54(_0x210fb4._0xcc20f1)]['ALWAYS'],'frontOperation':{'fail':Cesium['StencilOperation']['KEEP'],'zFail':Cesium['StencilOperation']['KEEP'],'zPass':Cesium['StencilOperation'][_0x220a54(0x23d)]},'backFunction':Cesium[_0x220a54(_0x210fb4._0xcc20f1)]['ALWAYS'],'backOperation':{'fail':Cesium['StencilOperation']['KEEP'],'zFail':Cesium[_0x220a54(_0x210fb4._0x50a60d)]['KEEP'],'zPass':Cesium['StencilOperation'][_0x220a54(_0x210fb4._0x3e171b)]},'reference':0x2,'mask':0x2},'blending':Cesium['BlendingState']['ALPHA_BLEND']}),_0x3b5e33=Math['floor'](this['style']['diffHeight']??this[_0x220a54(0x220)]*0.02)+0.1;this['style']['diffHeight']&&delete this['style'][_0x220a54(_0x210fb4._0x13115f)];const _0x3174c0=(this[_0x220a54(0x218)]['splitNum'],0x64);let _0x187f94=Math['max'](this[_0x220a54(_0x210fb4._0x4afef8)]['height'],this[_0x220a54(_0x210fb4._0x44f0fc)]['width']);this['style']['granularity']=_0x187f94/=_0x3174c0;const _0xa4cd18=new Cesium[(_0x220a54(0x1f7))]({'fabric':{'uniforms':{'image':_0x320169,'repeat':new Cesium['Cartesian2'](0x1,0x1),'color':new Cesium[(_0x220a54(0x23b))](0x1,0x1,0x1,0x0),'bumpMap':this['_getArcHeatCanvas']()},'source':HeatMaterial},'translucent':!![]}),_0x405c27=this['style']['arcDirection']||0x1;this['_graphic']=new mars3d__namespace[(_0x220a54(_0x210fb4._0x119cdd))]['RectanglePrimitive']({...this['options'],'rectangle':this['_rectangle'],'appearance':new Cesium['EllipsoidSurfaceAppearance']({'flat':!![],'aboveGround':!![],'renderState':_0x256bf6,'material':_0xa4cd18,'vertexShaderSource':getVertexShaderSource(_0x3b5e33*_0x405c27)})}),this[_0x220a54(0x230)]['addGraphic'](this[_0x220a54(_0x210fb4._0x530f6d)]),this['style']['arcDirection']===0x0&&(this['_graphic2']=new mars3d__namespace['graphic']['RectanglePrimitive']({...this['options'],'rectangle':this[_0x220a54(_0x210fb4._0x138779)],'appearance':new Cesium['EllipsoidSurfaceAppearance']({'flat':!![],'aboveGround':!![],'renderState':_0x256bf6,'material':_0xa4cd18,'vertexShaderSource':getVertexShaderSource(-_0x3b5e33)})}),this['_layer']['addGraphic'](this['_graphic2']));}[_0x132db7(0x20e)](_0x5da58d){const _0x25e35f={_0x55685a:0x238},_0x4a83f2=_0x132db7;return _0x5da58d!==null&&_0x5da58d!==void 0x0&&_0x5da58d['isFormat']&&this['_rectangle']?mars3d__namespace['PolyUtil'][_0x4a83f2(_0x25e35f._0x55685a)](this['_rectangle']):this['_rectangle'];}['_getHeatCanvas'](){const _0x5618c4={_0x2dbc42:0x22b,_0x2d2a5f:0x20a,_0x117d4d:0x222,_0x93a8be:0x233,_0x2961ba:0x225,_0xebf77e:0x226,_0x37d520:0x1ec,_0x3af404:0x1f1,_0x3d999d:0x225,_0x17d9b1:0x22f,_0x1f32dc:0x211,_0x1e7cbf:0x222,_0x658ac9:0x1ee,_0x19b8d1:0x1eb,_0x58e6c0:0x21b,_0x2d1beb:0x201,_0x24bc3f:0x23f},_0x2c8e57={_0x43adf0:0x211},_0x1ae45c=_0x132db7,_0x2d045a=this['_positions'],_0x5e7ad9=[];let _0x145de6,_0x59bc2c,_0x43d88f,_0x42bd05;_0x2d045a[_0x1ae45c(_0x5618c4._0x2dbc42)](_0xbafd35=>{const _0x8389b2=_0x1ae45c,_0x49d4e1=mars3d__namespace['LngLatPoint']['parse'](_0xbafd35);if(!_0x49d4e1)return;_0x49d4e1['value']=_0xbafd35['value']||0x1,!this['options']['rectangle']&&(_0x145de6===undefined?(_0x145de6=_0x49d4e1['lng'],_0x59bc2c=_0x49d4e1['lng'],_0x43d88f=_0x49d4e1['lat'],_0x42bd05=_0x49d4e1['lat']):(_0x145de6=Math['min'](_0x145de6,_0x49d4e1['lng']),_0x59bc2c=Math['max'](_0x59bc2c,_0x49d4e1['lng']),_0x43d88f=Math['min'](_0x43d88f,_0x49d4e1['lat']),_0x42bd05=Math[_0x8389b2(0x1ed)](_0x42bd05,_0x49d4e1['lat']))),_0x5e7ad9['push'](_0x49d4e1);});_0x145de6===_0x59bc2c&&(_0x145de6-=0.000001,_0x59bc2c+=0.000001);_0x43d88f===_0x42bd05&&(_0x43d88f-=0.000001,_0x42bd05+=0.000001);let _0xab9b0=this['options']['rectangle']||{'xmin':_0x145de6,'xmax':_0x59bc2c,'ymin':_0x43d88f,'ymax':_0x42bd05};const _0x25290a=getMercatorBounds(_0xab9b0),_0x2086b8=Math[_0x1ae45c(_0x5618c4._0x2d2a5f)](_0x25290a[_0x1ae45c(_0x5618c4._0x117d4d)]-_0x25290a['xmin']),_0x5d5b4c=Math[_0x1ae45c(0x20a)](_0x25290a['ymax']-_0x25290a[_0x1ae45c(0x239)]),_0x342869=Math[_0x1ae45c(0x1ed)](_0x2086b8,_0x5d5b4c),_0xcfe5a4=Math[_0x1ae45c(_0x5618c4._0x93a8be)](_0x2086b8,_0x5d5b4c);this['_mBoundsMax']=_0x342869;let _0x42107f=0x1;if(_0x342869>this[_0x1ae45c(_0x5618c4._0x2961ba)]['maxCanvasSize'])_0x42107f=_0x342869/this[_0x1ae45c(_0x5618c4._0x2961ba)]['maxCanvasSize'],_0xcfe5a4/_0x42107f<this['options'][_0x1ae45c(0x226)]&&(_0x42107f=_0xcfe5a4/this['options'][_0x1ae45c(0x226)]);else _0xcfe5a4<this['options']['minCanvasSize']&&(_0x42107f=_0xcfe5a4/this[_0x1ae45c(0x225)][_0x1ae45c(_0x5618c4._0xebf77e)],_0x342869/_0x42107f>this['options']['maxCanvasSize']&&(_0x42107f=_0x342869/this['options'][_0x1ae45c(_0x5618c4._0x37d520)]));const _0x3d3372=this[_0x1ae45c(_0x5618c4._0x3af404)]['radius']*1.5,_0x17e265=_0x2086b8/_0x42107f+_0x3d3372*0x2,_0x47efd9=_0x5d5b4c/_0x42107f+_0x3d3372*0x2,_0x17ece8=_0x3d3372*_0x42107f;_0x25290a[_0x1ae45c(0x211)]-=_0x17ece8,_0x25290a['ymin']-=_0x17ece8,_0x25290a['xmax']+=_0x17ece8,_0x25290a[_0x1ae45c(0x219)]+=_0x17ece8,this['_scale']=_0x42107f,_0xab9b0=geLatLngBounds(_0x25290a),this[_0x1ae45c(0x22c)]=Cesium[_0x1ae45c(0x224)]['fromDegrees'](_0xab9b0['xmin'],_0xab9b0['ymin'],_0xab9b0['xmax'],_0xab9b0['ymax']);let _0x2e77e6=_0x5e7ad9[0x0]['value']??0x1,_0x7bb5cf=_0x5e7ad9[0x0]['value']??0x0;const _0x2a1a43=[];_0x5e7ad9['forEach'](_0x3bd611=>{const _0x51fcdb=_0x1ae45c,_0x4624ef=mars3d__namespace[_0x51fcdb(0x203)]['lonlat2mercator']([_0x3bd611['lng'],_0x3bd611['lat']]),_0x35e6e5=_0x3bd611[_0x51fcdb(0x1f8)]||0x1,_0x2ec480=Math['round']((_0x4624ef[0x0]-_0x25290a[_0x51fcdb(_0x2c8e57._0x43adf0)])/_0x42107f),_0x3e1dfb=Math['round']((_0x25290a['ymax']-_0x4624ef[0x1])/_0x42107f);_0x2e77e6=Math['max'](_0x2e77e6,_0x35e6e5),_0x7bb5cf=Math[_0x51fcdb(0x233)](_0x7bb5cf,_0x35e6e5),_0x2a1a43['push']({'x':_0x2ec480,'y':_0x3e1dfb,'value':_0x35e6e5});});const _0x35e50d={'min':this['options']['min']??_0x7bb5cf,'max':this[_0x1ae45c(_0x5618c4._0x3d999d)]['max']??_0x2e77e6,'data':_0x2a1a43};this[_0x1ae45c(_0x5618c4._0x17d9b1)]=_0x35e50d;if(!this['_last_mBounds']||_0x25290a[_0x1ae45c(_0x5618c4._0x1f32dc)]!==this['_last_mBounds']['xmin']||_0x25290a['ymin']!==this['_last_mBounds']['ymin']||_0x25290a[_0x1ae45c(0x222)]!==this['_last_mBounds'][_0x1ae45c(_0x5618c4._0x1e7cbf)]||_0x25290a['ymax']!==this['_last_mBounds']['ymax']){this[_0x1ae45c(_0x5618c4._0x658ac9)]=_0x25290a,this['_container']['style']['cssText']='width:'+_0x17e265+'px;height:'+_0x47efd9+'px;';const _0x42c7f4={...this['heatStyle'],'container':this[_0x1ae45c(_0x5618c4._0x19b8d1)]};!this[_0x1ae45c(_0x5618c4._0x58e6c0)]?this['_heat']=h337__namespace['create'](_0x42c7f4):this['_heat']['configure'](_0x42c7f4);}this['_heat']['setData'](_0x35e50d);const _0x451eb7=mars3d__namespace['DomUtil']['copyCanvas'](this[_0x1ae45c(0x21b)][_0x1ae45c(_0x5618c4._0x2d1beb)][_0x1ae45c(_0x5618c4._0x24bc3f)]);return _0x451eb7;}['_getArcHeatCanvas'](){const _0x257bfe={_0x59696c:0x23c,_0x216275:0x20b,_0x4051d4:0x201},_0x5e45c0=_0x132db7;this['_heat']['configure']({'radius':this['heatStyle']['radius']*this['style']['arcRadiusScale'],'blur':this['heatStyle']['blur']*this['style'][_0x5e45c0(_0x257bfe._0x59696c)],'gradient':this['heatStyle'][_0x5e45c0(0x1f2)]||{0.25:'rgb(0,0,0)',0.55:'rgb(140,140,140)',0.85:'rgb(216,216,216)',0x1:_0x5e45c0(0x206)}});const _0x386983=mars3d__namespace[_0x5e45c0(_0x257bfe._0x216275)]['copyCanvas'](this['_heat'][_0x5e45c0(_0x257bfe._0x4051d4)]['canvas']);return this['_heat']['configure'](this['options'][_0x5e45c0(0x1f1)]),_0x386983;}['getPointData'](_0x1951a3){const _0x25d3ad={_0x5b5abf:0x1f9,_0x499776:0x20f},_0x4ab3a8=_0x132db7,_0x5caab0=mars3d__namespace['LngLatPoint'][_0x4ab3a8(0x20d)](_0x1951a3);if(!_0x5caab0)return{};const _0x6dd69a=mars3d__namespace['PointTrans']['lonlat2mercator']([_0x5caab0['lng'],_0x5caab0[_0x4ab3a8(0x1f6)]]),_0x49c19a=this['_last_mBounds'],_0x21768b=Math['round']((_0x6dd69a[0x0]-_0x49c19a['xmin'])/this['_scale']),_0x5c6f1a=Math[_0x4ab3a8(0x1f0)]((_0x49c19a['ymax']-_0x6dd69a[0x1])/this['_scale']),_0x5cff75=this['_heat'][_0x4ab3a8(_0x25d3ad._0x5b5abf)]({'x':_0x21768b,'y':_0x5c6f1a}),_0x4cd101=this['_heat']['_renderer']['ctx'][_0x4ab3a8(_0x25d3ad._0x499776)](_0x21768b-0x1,_0x5c6f1a-0x1,0x1,0x1)['data'];return{'x':_0x21768b,'y':_0x5c6f1a,'value':_0x5cff75,'color':'rgba('+_0x4cd101[0x0]+','+_0x4cd101[0x1]+','+_0x4cd101[0x2]+','+_0x4cd101[0x3]+')'};}}mars3d__namespace[_0x132db7(0x22a)]['register']('heat',HeatLayer),mars3d__namespace['layer']['HeatLayer']=HeatLayer,mars3d__namespace[_0x132db7(0x205)]=h337__namespace;function getMercatorBounds(_0x70a75){const _0x2f3edd=_0x132db7,_0x26197e=mars3d__namespace['PointTrans']['lonlat2mercator']([_0x70a75['xmin'],_0x70a75[_0x2f3edd(0x239)]]),_0x4f7bbf=mars3d__namespace[_0x2f3edd(0x203)][_0x2f3edd(0x1fb)]([_0x70a75['xmax'],_0x70a75['ymax']]);return{'xmin':_0x26197e[0x0],'ymin':_0x26197e[0x1],'xmax':_0x4f7bbf[0x0],'ymax':_0x4f7bbf[0x1]};}function _0x590d(_0x1b4bc3,_0xe31af8){const _0x4867bf=_0x4867();return _0x590d=function(_0x590d06,_0x28d0a2){_0x590d06=_0x590d06-0x1eb;let _0x114b3e=_0x4867bf[_0x590d06];return _0x114b3e;},_0x590d(_0x1b4bc3,_0xe31af8);}function geLatLngBounds(_0x4e36c0){const _0x44a1ec={_0x5cc893:0x211,_0x181b30:0x239,_0xf1a30b:0x219},_0x184517=_0x132db7,_0x27bf79=mars3d__namespace['PointTrans']['mercator2lonlat']([_0x4e36c0[_0x184517(_0x44a1ec._0x5cc893)],_0x4e36c0[_0x184517(_0x44a1ec._0x181b30)]]),_0x34f922=mars3d__namespace['PointTrans'][_0x184517(0x236)]([_0x4e36c0['xmax'],_0x4e36c0[_0x184517(_0x44a1ec._0xf1a30b)]]);return{'xmin':_0x27bf79[0x0],'ymin':_0x27bf79[0x1],'xmax':_0x34f922[0x0],'ymax':_0x34f922[0x1]};}function getVertexShaderSource(_0xf2cf6a){const _0x2375c8={_0x20acdb:0x1f5},_0x1569b8=_0x132db7;return'in\x20vec3\x20position3DHigh;\x0a\x20\x20in\x20vec3\x20position3DLow;\x0a\x20\x20in\x20vec2\x20st;\x0a\x20\x20in\x20float\x20batchId;\x0a\x20\x20uniform\x20sampler2D\x20bumpMap_3;\x0a\x20\x20out\x20vec3\x20v_positionMC;\x0a\x20\x20out\x20vec3\x20v_positionEC;\x0a\x20\x20out\x20vec2\x20v_st;\x0a\x0a\x20\x20void\x20main()\x0a\x20\x20{\x0a\x20\x20\x20\x20vec4\x20p\x20=\x20czm_computePosition();\x0a\x20\x20\x20\x20v_positionMC\x20=\x20position3DHigh\x20+\x20position3DLow;\x0a\x20\x20\x20\x20v_positionEC\x20=\x20(czm_modelViewRelativeToEye\x20*\x20p).xyz;\x0a\x20\x20\x20\x20v_st\x20=\x20st;\x0a\x20\x20\x20\x20vec4\x20color\x20=\x20texture(bumpMap_3,\x20v_st);\x0a\x20\x20\x20\x20float\x20centerBump\x20=\x20distance(vec3(0.0),color.rgb);\x0a\x20\x20\x20\x20vec3\x20upDir\x20=\x20normalize(v_positionMC.xyz);\x0a\x20\x20\x20\x20vec3\x20disPos\x20=\x20upDir\x20*\x20centerBump\x20*\x20'+_0xf2cf6a+_0x1569b8(_0x2375c8._0x20acdb);}exports['HeatLayer']=HeatLayer,Object['defineProperty'](exports,'__esModule',{'value':!![]});
|
|
14
|
+
'use strict';function _0x1839(){const _0x2de345=['6cLIvqQ','addGraphic','image','_last_heatData','default','_createGraphic','body','1782568RXpIoz','PointTrans','_graphic','Cesium','lat','_heat','rectangle','mercator2lonlat','EllipsoidSurfaceAppearance','fromDegrees','minCanvasSize','flyTo','cssText','_container','xmax','create','LngLatPoint','forEach','_getArcHeatCanvas','push','bumpMap','arc','546225RXTWAh','EPSG:3857','_updatePositionsHook','325575qxnBne','3389309DZtJxm','uniforms','toArray','_scale','_layer','round','register','_graphic2','clientHeight','GraphicLayer','layer','35852PZuQhM','ymax','9OKJUlb','DomUtil','BaseLayer','parse','10691325PqNbRf','heat','abs','xmin','KEEP','options','heatStyle','addLayer','PolyUtil','isFormat','_rectangle','setOptions','235848viOePB','lonlat2mercator','setData','removeGraphic','style','addPosition','max','StencilOperation','positions','ymin','arcRadiusScale','yellow','min','merge','StencilFunction','ImageLayer','setPositions','_removedHook','_renderer','_last_mBounds','px;height:','_positions'];_0x1839=function(){return _0x2de345;};return _0x1839();}const _0x3fe13f=_0x463d;(function(_0x49f4fd,_0x24a5db){const _0x296b89={_0x17e9b1:0xc0,_0x18b9e:0xcf,_0x1a3e82:0xaa,_0x3c6dc9:0xc4},_0x7fa634=_0x463d,_0x35d0db=_0x49f4fd();while(!![]){try{const _0x5d6f74=parseInt(_0x7fa634(_0x296b89._0x17e9b1))/0x1+parseInt(_0x7fa634(_0x296b89._0x18b9e))/0x2*(parseInt(_0x7fa634(0xd1))/0x3)+parseInt(_0x7fa634(_0x296b89._0x1a3e82))/0x4+-parseInt(_0x7fa634(0xc3))/0x5+-parseInt(_0x7fa634(0xa3))/0x6*(-parseInt(_0x7fa634(_0x296b89._0x3c6dc9))/0x7)+parseInt(_0x7fa634(0xe1))/0x8+-parseInt(_0x7fa634(0xd5))/0x9;if(_0x5d6f74===_0x24a5db)break;else _0x35d0db['push'](_0x35d0db['shift']());}catch(_0x314ab7){_0x35d0db['push'](_0x35d0db['shift']());}}}(_0x1839,0x4ac61));function _interopNamespace(_0x3e5030){const _0x13ad0d=_0x463d;if(_0x3e5030&&_0x3e5030['__esModule'])return _0x3e5030;var _0x3591aa=Object[_0x13ad0d(0xb9)](null);return _0x3e5030&&Object['keys'](_0x3e5030)['forEach'](function(_0x39caa1){if(_0x39caa1!=='default'){var _0x491954=Object['getOwnPropertyDescriptor'](_0x3e5030,_0x39caa1);Object['defineProperty'](_0x3591aa,_0x39caa1,_0x491954['get']?_0x491954:{'enumerable':!![],'get':function(){return _0x3e5030[_0x39caa1];}});}}),_0x3591aa[_0x13ad0d(0xa7)]=_0x3e5030,_0x3591aa;}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[_0x3fe13f(0xb9)])throw new Error('请引入\x20heatmap.js\x20库\x20');function _0x463d(_0x5ca123,_0x16b0ba){const _0x183927=_0x1839();return _0x463d=function(_0x463dfe,_0x14b96e){_0x463dfe=_0x463dfe-0x8e;let _0x376727=_0x183927[_0x463dfe];return _0x376727;},_0x463d(_0x5ca123,_0x16b0ba);}const Cesium=mars3d__namespace[_0x3fe13f(0xad)],BaseLayer=mars3d__namespace['layer'][_0x3fe13f(0xd3)],DEF_HEATSTYLE={'maxOpacity':0.8,'minOpacity':0.1,'blur':0.85,'radius':0x19,'gradient':{0.4:'blue',0.6:'green',0.8:_0x3fe13f(0x98),0.9:'red'}},DEF_STYLE={'arcRadiusScale':1.5,'arcBlurScale':1.5,'vertexFormat':Cesium['EllipsoidSurfaceAppearance']['VERTEX_FORMAT']};class HeatLayer extends BaseLayer{constructor(_0x52b8c6={}){const _0x5209ba={_0x248e23:0xda,_0x27cab9:0x99,_0x18740a:0xb4},_0x3e9a12=_0x3fe13f;super(_0x52b8c6),this['options']['maxCanvasSize']=this[_0x3e9a12(_0x5209ba._0x248e23)]['maxCanvasSize']??document['body']['clientWidth'],this['options']['maxCanvasSize']=Math[_0x3e9a12(_0x5209ba._0x27cab9)](this[_0x3e9a12(0xda)]['maxCanvasSize'],0x1388),this['options'][_0x3e9a12(_0x5209ba._0x18740a)]=this['options']['minCanvasSize']??document[_0x3e9a12(0xa9)][_0x3e9a12(0xcc)],this[_0x3e9a12(0xda)]['minCanvasSize']=Math[_0x3e9a12(0x93)](this['options']['minCanvasSize'],0x2bc),this[_0x3e9a12(0xda)]['heatStyle']={...DEF_HEATSTYLE,...this[_0x3e9a12(_0x5209ba._0x248e23)]['heatStyle']},this['options']['style']={...DEF_STYLE,...this['options']['style']};}get['layer'](){return this['_layer'];}get['heatStyle'](){const _0x434681={_0x2281ff:0xda},_0x8b516c=_0x3fe13f;return this[_0x8b516c(_0x434681._0x2281ff)]['heatStyle'];}set['heatStyle'](_0x4de1f1){const _0x2ca07c={_0xbda8b1:0x9a,_0x245dc0:0xaf},_0x49e506=_0x3fe13f;this[_0x49e506(0xda)]['heatStyle']=mars3d__namespace['Util'][_0x49e506(_0x2ca07c._0xbda8b1)](this['options']['heatStyle'],_0x4de1f1),this['_heat']&&(this[_0x49e506(_0x2ca07c._0x245dc0)]['configure'](this['options']['heatStyle']),this['_updatePositionsHook'](!![]));}get['style'](){const _0x3016ca={_0x4c65b8:0xda},_0x310909=_0x3fe13f;return this[_0x310909(_0x3016ca._0x4c65b8)]['style'];}set[_0x3fe13f(0x91)](_0x490274){const _0x8dc0d9={_0x26d33f:0x91},_0x47f5bb=_0x3fe13f;this['options']['style']=mars3d__namespace['Util'][_0x47f5bb(0x9a)](this[_0x47f5bb(0xda)][_0x47f5bb(_0x8dc0d9._0x26d33f)],_0x490274);}get[_0x3fe13f(0x95)](){const _0x22802b={_0x3202da:0xa2},_0x2dc456=_0x3fe13f;return this[_0x2dc456(_0x22802b._0x3202da)];}set[_0x3fe13f(0x95)](_0x72d773){const _0x1fec57={_0x244b83:0x9d},_0x4abdda=_0x3fe13f;this[_0x4abdda(_0x1fec57._0x244b83)](_0x72d773);}get['coordinates'](){const _0x2901eb=[];return this['points']['forEach'](_0x4035d4=>{const _0x193253=_0x463d;_0x2901eb['push'](_0x4035d4[_0x193253(0xc6)]());}),_0x2901eb;}get['rectangle'](){return this['_rectangle'];}['_setOptionsHook'](_0x469f2b,_0x16c2c0){const _0xa9db42=_0x3fe13f;_0x469f2b[_0xa9db42(0x95)]&&(this[_0xa9db42(0x95)]=_0x469f2b['positions']);}['_mountedHook'](){const _0x16036b={_0x2d9127:0xa5,_0x5885dd:0xce,_0x4e483b:0x9c},_0x45c08a=_0x3fe13f;this['style']['type']===_0x45c08a(_0x16036b._0x2d9127)?this['_layer']=new mars3d__namespace[(_0x45c08a(_0x16036b._0x5885dd))][(_0x45c08a(_0x16036b._0x4e483b))]({'crs':_0x45c08a(0xc1),'private':!![]}):this['_layer']=new mars3d__namespace['layer'][(_0x45c08a(0xcd))]({'private':!![]});}['_addedHook'](){const _0x59f42c={_0x574e37:0xda},_0x37c2e8=_0x3fe13f;this['_map'][_0x37c2e8(0xdc)](this['_layer']),this['_container']=mars3d__namespace['DomUtil']['create']('div','mars3d-heatmap\x20mars3d-hideDiv',this['_map']['container']),this[_0x37c2e8(_0x59f42c._0x574e37)]['positions']&&(this['positions']=this['options']['positions']),this['options'][_0x37c2e8(0xb5)]&&this['flyToByAnimationEnd']();}[_0x3fe13f(0x9e)](){const _0x2e8c83={_0x1fd17a:0xb7,_0x8081cd:0xc8},_0x50d0fd=_0x3fe13f;this[_0x50d0fd(0xb7)]&&(mars3d__namespace['DomUtil']['remove'](this['_container']),delete this[_0x50d0fd(_0x2e8c83._0x1fd17a)]),this['clear'](),this['_map']['removeLayer'](this[_0x50d0fd(_0x2e8c83._0x8081cd)]);}[_0x3fe13f(0x92)](_0x3afd0b,_0x4d2013){const _0x2cc3e={_0x5709a9:0xa2},_0xa77423=_0x3fe13f;this[_0xa77423(_0x2cc3e._0x5709a9)]=this['_positions']||[],this['_positions'][_0xa77423(0xbd)](_0x3afd0b),this['_updatePositionsHook'](_0x4d2013);}[_0x3fe13f(0x9d)](_0x22b03a,_0x16f47a){this['_positions']=_0x22b03a,this['_updatePositionsHook'](_0x16f47a);}['clear'](){const _0x5c4b10=_0x3fe13f;this[_0x5c4b10(0xac)]&&(this['_layer'][_0x5c4b10(0x90)](this['_graphic'],!![]),delete this[_0x5c4b10(0xac)]),this['_graphic2']&&(this['_layer']['removeGraphic'](this['_graphic2'],!![]),delete this['_graphic2']);}[_0x3fe13f(0xc2)](_0x186d1c){const _0x31428c={_0x123f0c:0xe0,_0xd2e93c:0xbc},_0x4cacbe=_0x3fe13f;if(!this['show']||!this['_map']||!this['positions']||this['positions']['length']===0x0)return this;const _0x21e9ef=this['_getHeatCanvas']();if(this['style']['type']==='image')this[_0x4cacbe(0xc8)][_0x4cacbe(_0x31428c._0x123f0c)]({'url':_0x21e9ef['toDataURL']('image/png'),'rectangle':this['_rectangle'],'opacity':this['style']['opacity']});else this['style'][_0x4cacbe(0xbf)]?this['_graphic']&&_0x186d1c?(this['_graphic'][_0x4cacbe(0xc5)]['image']=_0x21e9ef,this['_graphic']['uniforms']['bumpMap']=this[_0x4cacbe(_0x31428c._0xd2e93c)](),this[_0x4cacbe(0xcb)]&&(this['_graphic2']['uniforms']['image']=_0x21e9ef,this[_0x4cacbe(0xcb)][_0x4cacbe(0xc5)]['bumpMap']=this[_0x4cacbe(0xac)]['uniforms'][_0x4cacbe(0xbe)])):this['_createArcGraphic'](_0x21e9ef):this['_graphic']&&_0x186d1c?this['_graphic']['uniforms'][_0x4cacbe(0xa5)]=_0x21e9ef:this['_createGraphic'](_0x21e9ef);return this;}[_0x3fe13f(0xa8)](_0x2b3545){const _0x42ad66={_0x4fec6a:0xb2},_0x553f3c=_0x3fe13f;this['clear'](),this['_graphic']=new mars3d__namespace['graphic']['RectanglePrimitive']({...this['options'],'rectangle':this['_rectangle'],'appearance':new Cesium[(_0x553f3c(_0x42ad66._0x4fec6a))]({'material':new Cesium['Material']({'fabric':{'uniforms':{'image':_0x2b3545},'source':HeatMaterial},'translucent':!![]}),'flat':!![]})}),this['_layer'][_0x553f3c(0xa4)](this['_graphic']);}['_createArcGraphic'](_0x55c0eb){const _0x46031c={_0x5c2480:0x9b,_0x4c021e:0x94,_0x396842:0x91,_0xfa425a:0xac,_0x10c1d1:0xdf},_0x4d4ab0=_0x3fe13f;this['clear']();const _0x46373d=Cesium['RenderState']['fromCache']({'cull':{'enabled':!![]},'depthTest':{'enabled':!![]},'stencilTest':{'enabled':!![],'frontFunction':Cesium[_0x4d4ab0(_0x46031c._0x5c2480)]['ALWAYS'],'frontOperation':{'fail':Cesium['StencilOperation']['KEEP'],'zFail':Cesium['StencilOperation']['KEEP'],'zPass':Cesium[_0x4d4ab0(_0x46031c._0x4c021e)]['REPLACE']},'backFunction':Cesium['StencilFunction']['ALWAYS'],'backOperation':{'fail':Cesium['StencilOperation']['KEEP'],'zFail':Cesium['StencilOperation'][_0x4d4ab0(0xd9)],'zPass':Cesium['StencilOperation']['REPLACE']},'reference':0x2,'mask':0x2},'blending':Cesium['BlendingState']['ALPHA_BLEND']}),_0x78660a=Math['floor'](this['style']['diffHeight']??this['_mBoundsMax']*0.02)+0.1;this['style']['diffHeight']&&delete this[_0x4d4ab0(0x91)]['diffHeight'];const _0x344153=(this[_0x4d4ab0(_0x46031c._0x396842)]['splitNum'],0x64);let _0x17b28b=Math['max'](this['_rectangle']['height'],this['_rectangle']['width']);this[_0x4d4ab0(_0x46031c._0x396842)]['granularity']=_0x17b28b/=_0x344153;const _0x31ab3f=new Cesium['Material']({'fabric':{'uniforms':{'image':_0x55c0eb,'repeat':new Cesium['Cartesian2'](0x1,0x1),'color':new Cesium['Color'](0x1,0x1,0x1,0x0),'bumpMap':this['_getArcHeatCanvas']()},'source':HeatMaterial},'translucent':!![]}),_0x519bd5=this['style']['arcDirection']||0x1;this[_0x4d4ab0(_0x46031c._0xfa425a)]=new mars3d__namespace['graphic']['RectanglePrimitive']({...this['options'],'rectangle':this['_rectangle'],'appearance':new Cesium['EllipsoidSurfaceAppearance']({'flat':!![],'aboveGround':!![],'renderState':_0x46373d,'material':_0x31ab3f,'vertexShaderSource':getVertexShaderSource(_0x78660a*_0x519bd5)})}),this['_layer']['addGraphic'](this['_graphic']),this['style']['arcDirection']===0x0&&(this['_graphic2']=new mars3d__namespace['graphic']['RectanglePrimitive']({...this['options'],'rectangle':this[_0x4d4ab0(_0x46031c._0x10c1d1)],'appearance':new Cesium['EllipsoidSurfaceAppearance']({'flat':!![],'aboveGround':!![],'renderState':_0x46373d,'material':_0x31ab3f,'vertexShaderSource':getVertexShaderSource(-_0x78660a)})}),this['_layer']['addGraphic'](this['_graphic2']));}['getRectangle'](_0x1fde56){const _0x4dbcac={_0x587e4a:0xdd},_0x37216c=_0x3fe13f;return _0x1fde56!==null&&_0x1fde56!==void 0x0&&_0x1fde56[_0x37216c(0xde)]&&this['_rectangle']?mars3d__namespace[_0x37216c(_0x4dbcac._0x587e4a)]['formatRectangle'](this['_rectangle']):this[_0x37216c(0xdf)];}['_getHeatCanvas'](){const _0x41c3ef={_0x12c192:0xa2,_0x109cc2:0xd7,_0x21c17:0x96,_0x43767b:0xd0,_0x47b10a:0xc7,_0x3621f3:0xbb,_0x530f28:0xda,_0x297ce8:0x93,_0x475a34:0xa6,_0x5961b4:0xa0,_0x534c30:0xd8,_0x387d27:0xd0,_0x4b0e66:0xa0,_0x2178bc:0x91,_0x853149:0xa1,_0x4d202b:0x8f},_0x527a1d={_0x2395c7:0x8e,_0x135399:0xd0,_0x132ad0:0x93},_0x1b7bac={_0x143d21:0xba,_0x48cb3b:0xb0},_0xd39d91=_0x3fe13f,_0x3d69b1=this[_0xd39d91(_0x41c3ef._0x12c192)],_0x4eff89=[];let _0x48ec3d,_0x3fe325,_0x4a3986,_0xed37a7;_0x3d69b1['forEach'](_0x5e957e=>{const _0x5d06e2=_0xd39d91,_0x4ec082=mars3d__namespace[_0x5d06e2(_0x1b7bac._0x143d21)]['parse'](_0x5e957e);if(!_0x4ec082)return;_0x4ec082['value']=_0x5e957e['value']||0x1,!this['options'][_0x5d06e2(_0x1b7bac._0x48cb3b)]&&(_0x48ec3d===undefined?(_0x48ec3d=_0x4ec082['lng'],_0x3fe325=_0x4ec082['lng'],_0x4a3986=_0x4ec082['lat'],_0xed37a7=_0x4ec082['lat']):(_0x48ec3d=Math['min'](_0x48ec3d,_0x4ec082['lng']),_0x3fe325=Math[_0x5d06e2(0x93)](_0x3fe325,_0x4ec082['lng']),_0x4a3986=Math['min'](_0x4a3986,_0x4ec082['lat']),_0xed37a7=Math['max'](_0xed37a7,_0x4ec082['lat']))),_0x4eff89['push'](_0x4ec082);});_0x48ec3d===_0x3fe325&&(_0x48ec3d-=0.000001,_0x3fe325+=0.000001);_0x4a3986===_0xed37a7&&(_0x4a3986-=0.000001,_0xed37a7+=0.000001);let _0x4040b5=this['options'][_0xd39d91(0xb0)]||{'xmin':_0x48ec3d,'xmax':_0x3fe325,'ymin':_0x4a3986,'ymax':_0xed37a7};const _0x17836f=getMercatorBounds(_0x4040b5),_0x28947e=Math[_0xd39d91(0xd7)](_0x17836f['xmax']-_0x17836f[_0xd39d91(0xd8)]),_0x4c2c40=Math[_0xd39d91(_0x41c3ef._0x109cc2)](_0x17836f['ymax']-_0x17836f[_0xd39d91(_0x41c3ef._0x21c17)]),_0x4c1f6d=Math['max'](_0x28947e,_0x4c2c40),_0x18e949=Math['min'](_0x28947e,_0x4c2c40);this['_mBoundsMax']=_0x4c1f6d;let _0x4fc339=0x1;if(_0x4c1f6d>this['options']['maxCanvasSize'])_0x4fc339=_0x4c1f6d/this['options']['maxCanvasSize'],_0x18e949/_0x4fc339<this[_0xd39d91(0xda)]['minCanvasSize']&&(_0x4fc339=_0x18e949/this[_0xd39d91(0xda)]['minCanvasSize']);else _0x18e949<this['options']['minCanvasSize']&&(_0x4fc339=_0x18e949/this['options']['minCanvasSize'],_0x4c1f6d/_0x4fc339>this[_0xd39d91(0xda)]['maxCanvasSize']&&(_0x4fc339=_0x4c1f6d/this['options']['maxCanvasSize']));const _0x304db0=this[_0xd39d91(0xdb)]['radius']*1.5,_0x3760d1=_0x28947e/_0x4fc339+_0x304db0*0x2,_0x362793=_0x4c2c40/_0x4fc339+_0x304db0*0x2,_0x531e32=_0x304db0*_0x4fc339;_0x17836f[_0xd39d91(0xd8)]-=_0x531e32,_0x17836f['ymin']-=_0x531e32,_0x17836f['xmax']+=_0x531e32,_0x17836f[_0xd39d91(_0x41c3ef._0x43767b)]+=_0x531e32,this[_0xd39d91(_0x41c3ef._0x47b10a)]=_0x4fc339,_0x4040b5=geLatLngBounds(_0x17836f),this['_rectangle']=Cesium['Rectangle'][_0xd39d91(0xb3)](_0x4040b5['xmin'],_0x4040b5['ymin'],_0x4040b5['xmax'],_0x4040b5[_0xd39d91(0xd0)]);let _0x161628=_0x4eff89[0x0]['value']??0x1,_0x1d1bfc=_0x4eff89[0x0]['value']??0x0;const _0x589033=[];_0x4eff89[_0xd39d91(_0x41c3ef._0x3621f3)](_0x15e7b0=>{const _0x455200=_0xd39d91,_0x1dbbcf=mars3d__namespace[_0x455200(0xab)][_0x455200(_0x527a1d._0x2395c7)]([_0x15e7b0['lng'],_0x15e7b0['lat']]),_0x4f0eb9=_0x15e7b0['value']||0x1,_0x252b1d=Math['round']((_0x1dbbcf[0x0]-_0x17836f[_0x455200(0xd8)])/_0x4fc339),_0x2b353b=Math['round']((_0x17836f[_0x455200(_0x527a1d._0x135399)]-_0x1dbbcf[0x1])/_0x4fc339);_0x161628=Math[_0x455200(_0x527a1d._0x132ad0)](_0x161628,_0x4f0eb9),_0x1d1bfc=Math['min'](_0x1d1bfc,_0x4f0eb9),_0x589033[_0x455200(0xbd)]({'x':_0x252b1d,'y':_0x2b353b,'value':_0x4f0eb9});});const _0x2d489b={'min':this[_0xd39d91(_0x41c3ef._0x530f28)][_0xd39d91(0x99)]??_0x1d1bfc,'max':this['options'][_0xd39d91(_0x41c3ef._0x297ce8)]??_0x161628,'data':_0x589033};this[_0xd39d91(_0x41c3ef._0x475a34)]=_0x2d489b;if(!this[_0xd39d91(_0x41c3ef._0x5961b4)]||_0x17836f['xmin']!==this[_0xd39d91(0xa0)][_0xd39d91(_0x41c3ef._0x534c30)]||_0x17836f['ymin']!==this['_last_mBounds']['ymin']||_0x17836f['xmax']!==this['_last_mBounds'][_0xd39d91(0xb8)]||_0x17836f[_0xd39d91(_0x41c3ef._0x387d27)]!==this['_last_mBounds']['ymax']){this[_0xd39d91(_0x41c3ef._0x4b0e66)]=_0x17836f,this[_0xd39d91(0xb7)][_0xd39d91(_0x41c3ef._0x2178bc)][_0xd39d91(0xb6)]='width:'+_0x3760d1+_0xd39d91(_0x41c3ef._0x853149)+_0x362793+'px;';const _0x36b090={...this['heatStyle'],'container':this['_container']};!this['_heat']?this['_heat']=h337__namespace[_0xd39d91(0xb9)](_0x36b090):this['_heat']['configure'](_0x36b090);}this['_heat'][_0xd39d91(_0x41c3ef._0x4d202b)](_0x2d489b);const _0x26fc98=mars3d__namespace['DomUtil']['copyCanvas'](this['_heat']['_renderer']['canvas']);return _0x26fc98;}[_0x3fe13f(0xbc)](){const _0x51c2da={_0x14515d:0x97,_0x2be72c:0xaf},_0x5e26e1=_0x3fe13f;this['_heat']['configure']({'radius':this['heatStyle']['radius']*this['style'][_0x5e26e1(_0x51c2da._0x14515d)],'blur':this['heatStyle']['blur']*this['style']['arcBlurScale'],'gradient':this['heatStyle']['gradientArc']||{0.25:'rgb(0,0,0)',0.55:'rgb(140,140,140)',0.85:'rgb(216,216,216)',0x1:'rgb(255,255,255)'}});const _0x4f3718=mars3d__namespace[_0x5e26e1(0xd2)]['copyCanvas'](this[_0x5e26e1(0xaf)]['_renderer']['canvas']);return this[_0x5e26e1(_0x51c2da._0x2be72c)]['configure'](this[_0x5e26e1(0xda)]['heatStyle']),_0x4f3718;}['getPointData'](_0xb8569){const _0x287f28={_0x3d2eaa:0xd4,_0x3798ce:0xab},_0x5434d1=_0x3fe13f,_0x171c99=mars3d__namespace['LngLatPoint'][_0x5434d1(_0x287f28._0x3d2eaa)](_0xb8569);if(!_0x171c99)return{};const _0x40c5c2=mars3d__namespace[_0x5434d1(_0x287f28._0x3798ce)]['lonlat2mercator']([_0x171c99['lng'],_0x171c99[_0x5434d1(0xae)]]),_0x45ddc5=this[_0x5434d1(0xa0)],_0x48a376=Math[_0x5434d1(0xc9)]((_0x40c5c2[0x0]-_0x45ddc5['xmin'])/this['_scale']),_0x2f01df=Math['round']((_0x45ddc5[_0x5434d1(0xd0)]-_0x40c5c2[0x1])/this[_0x5434d1(0xc7)]),_0x478d67=this['_heat']['getValueAt']({'x':_0x48a376,'y':_0x2f01df}),_0x2a2017=this['_heat'][_0x5434d1(0x9f)]['ctx']['getImageData'](_0x48a376-0x1,_0x2f01df-0x1,0x1,0x1)['data'];return{'x':_0x48a376,'y':_0x2f01df,'value':_0x478d67,'color':'rgba('+_0x2a2017[0x0]+','+_0x2a2017[0x1]+','+_0x2a2017[0x2]+','+_0x2a2017[0x3]+')'};}}mars3d__namespace['LayerUtil'][_0x3fe13f(0xca)](_0x3fe13f(0xd6),HeatLayer),mars3d__namespace[_0x3fe13f(0xce)]['HeatLayer']=HeatLayer,mars3d__namespace['h337']=h337__namespace;function getMercatorBounds(_0x392af7){const _0x2f3489=_0x3fe13f,_0x71b5bc=mars3d__namespace['PointTrans']['lonlat2mercator']([_0x392af7['xmin'],_0x392af7[_0x2f3489(0x96)]]),_0xba6146=mars3d__namespace['PointTrans'][_0x2f3489(0x8e)]([_0x392af7['xmax'],_0x392af7['ymax']]);return{'xmin':_0x71b5bc[0x0],'ymin':_0x71b5bc[0x1],'xmax':_0xba6146[0x0],'ymax':_0xba6146[0x1]};}function geLatLngBounds(_0x408487){const _0xd9aee2=_0x3fe13f,_0x416e1c=mars3d__namespace[_0xd9aee2(0xab)][_0xd9aee2(0xb1)]([_0x408487['xmin'],_0x408487['ymin']]),_0x3c050f=mars3d__namespace['PointTrans']['mercator2lonlat']([_0x408487['xmax'],_0x408487['ymax']]);return{'xmin':_0x416e1c[0x0],'ymin':_0x416e1c[0x1],'xmax':_0x3c050f[0x0],'ymax':_0x3c050f[0x1]};}function getVertexShaderSource(_0x16412a){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'+_0x16412a+';\x0a\x20\x20\x20\x20p\x20+=vec4(disPos,0.0);\x0a\x20\x20\x20\x20gl_Position\x20=\x20czm_modelViewProjectionRelativeToEye\x20*\x20p;\x0a\x20\x20}\x0a';}exports['HeatLayer']=HeatLayer,Object['defineProperty'](exports,'__esModule',{'value':!![]});
|
|
15
15
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mars3d-heatmap",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.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.7"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"mars3d": "~3.6.
|
|
13
|
+
"mars3d": "~3.6.17"
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
16
|
"lint": "eslint ./src/**/*.{js,ts} --fix"
|