DiKongGanZhiPingTai/packages/mars3d/plugins/echarts/mars3d-echarts.js

16 lines
13 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/**
* Mars3D平台插件,结合echarts可视化功能插件 mars3d-echarts
*
* 版本信息v3.10.12
* 编译日期2026-01-11 17:27
* 版权所有Copyright by 火星科技 http://mars3d.cn
* 使用单位:山东慧创信息科技有限公司 2025-08-04
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, (window.mars3d || require('mars3d')), (window.echarts || require('echarts'))) :
typeof define === 'function' && define.amd ? define(['exports', 'mars3d', 'echarts'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["mars3d-echarts"] = {}, global.mars3d, global.echarts));
})(this, (function (exports, mars3d, echarts) {
'use strict';const _0x2b091f=_0xd8fa;(function(_0x57ef53,_0x17776a){const _0x1a5a41={_0x148c06:0x1f3,_0x169272:0x205,_0x305e90:0x1e0,_0x34b336:0x1e5,_0x357fbd:0x1df},_0x397148=_0xd8fa,_0x254e4a=_0x57ef53();while(!![]){try{const _0x402fac=-parseInt(_0x397148(_0x1a5a41._0x148c06))/0x1*(-parseInt(_0x397148(0x20e))/0x2)+-parseInt(_0x397148(_0x1a5a41._0x169272))/0x3*(-parseInt(_0x397148(0x1d4))/0x4)+-parseInt(_0x397148(_0x1a5a41._0x305e90))/0x5*(-parseInt(_0x397148(0x202))/0x6)+-parseInt(_0x397148(0x206))/0x7+parseInt(_0x397148(0x1db))/0x8+-parseInt(_0x397148(_0x1a5a41._0x34b336))/0x9*(parseInt(_0x397148(_0x1a5a41._0x357fbd))/0xa)+-parseInt(_0x397148(0x1fd))/0xb;if(_0x402fac===_0x17776a)break;else _0x254e4a['push'](_0x254e4a['shift']());}catch(_0x1d5838){_0x254e4a['push'](_0x254e4a['shift']());}}}(_0x47a8,0x29237));function _interopNamespace(_0x37399e){const _0x3925ac=_0xd8fa;if(_0x37399e&&_0x37399e[_0x3925ac(0x1e4)])return _0x37399e;var _0x2a36b2=Object['create'](null);return _0x37399e&&Object['keys'](_0x37399e)['forEach'](function(_0xc38616){const _0x2b1564=_0x3925ac;if(_0xc38616!=='default'){var _0xd4f726=Object[_0x2b1564(0x200)](_0x37399e,_0xc38616);Object['defineProperty'](_0x2a36b2,_0xc38616,_0xd4f726['get']?_0xd4f726:{'enumerable':!![],'get':function(){return _0x37399e[_0xc38616];}});}}),_0x2a36b2['default']=_0x37399e,_0x2a36b2;}var mars3d__namespace=_interopNamespace(mars3d),echarts__namespace=_interopNamespace(echarts);function _0x47a8(){const _0x326f63=['eventParent','isArray','max','getWidth','41CovbRO','_echartsContainer','lng','EllipsoidalOccluder','\x20\x20\x20\x20编译日期','mars3d-echarts插件注册成功\x20\x20\x20\x20\x20版本','dispose','_echartsInstance','_pointerEvents','registerAction','3095796ZqqJti','zIndex','setOption','getOwnPropertyDescriptor','setMapOffset','60FELusa','ecInstance','mars3d-echarts','1167NGASVj','759059hjpHLl','data','forEach','Rectangle','getHeight','mars3dMapRoam','canvas','get','8106eqWMpQ','min','style','PointTrans','defineProperty','addEventListener','layer','getZr','create','width','Cesium','832NnHXBg','fromDegrees','echartsDepthTest','dimensions','getViewRect','mode','getRectangle','2629488hvzKix','painter','echartsFixedHeight','value','70DpVeCh','39375uMyAPG','scene','mars3dMap','onByQuery','__esModule','123615fyWjSL','echarts','pointerEvents','clientHeight','clientWidth','clear','Log','all','_map','options'];_0x47a8=function(){return _0x326f63;};return _0x47a8();}const version='3.10.12',buildTime='2026-01-11\x2017:26',Cesium$1=mars3d__namespace[_0x2b091f(0x1d3)];class CompositeCoordinateSystem{constructor(_0x41b7ef,_0x1d1791){const _0x144cae=_0x2b091f;this['_mars3d_scene']=_0x41b7ef,this['dimensions']=[_0x144cae(0x1f5),'lat'],this['_mapOffset']=[0x0,0x0],this['_api']=_0x1d1791;}[_0x2b091f(0x201)](_0x1a8f80){this['_mapOffset']=_0x1a8f80;}['getBMap'](){return this['_mars3d_scene'];}['dataToPoint'](_0x1b1435){const _0x4b08d1={_0x778ab:0x20a,_0x436b43:0x211,_0x1866bd:0x1d6,_0x4e8724:0x1f6},_0x1cc13c=_0x2b091f,_0x1ad3fd=this['_mars3d_scene'],_0x6b5808=[NaN,NaN];let _0x1007a9=_0x1ad3fd['echartsFixedHeight'];_0x1ad3fd['echartsAutoHeight']&&(_0x1007a9=_0x1ad3fd[_0x1cc13c(_0x4b08d1._0x778ab)](Cesium$1['Cartographic']['fromDegrees'](_0x1b1435[0x0],_0x1b1435[0x1])));const _0x354740=Cesium$1['Cartesian3']['fromDegrees'](_0x1b1435[0x0],_0x1b1435[0x1],_0x1007a9);if(!_0x354740)return _0x6b5808;const _0x48d34c=mars3d__namespace[_0x1cc13c(_0x4b08d1._0x436b43)]['toWindowCoordinates'](_0x1ad3fd,_0x354740);if(!_0x48d34c)return _0x6b5808;if(_0x1ad3fd[_0x1cc13c(_0x4b08d1._0x1866bd)]&&_0x1ad3fd[_0x1cc13c(0x1d9)]===Cesium$1['SceneMode']['SCENE3D']){const _0xd7c331=new Cesium$1[(_0x1cc13c(_0x4b08d1._0x4e8724))](_0x1ad3fd['globe']['ellipsoid'],_0x1ad3fd['camera']['positionWC']),_0x429102=_0xd7c331['isPointVisible'](_0x354740);if(!_0x429102)return _0x6b5808;}return[_0x48d34c['x']-this['_mapOffset'][0x0],_0x48d34c['y']-this['_mapOffset'][0x1]];}[_0x2b091f(0x1d8)](){const _0x206f74={_0x3e819e:0x1f2},_0x1bd2c3=_0x2b091f,_0x23b1d0=this['_api'];return new echarts__namespace['graphic']['BoundingRect'](0x0,0x0,_0x23b1d0[_0x1bd2c3(_0x206f74._0x3e819e)](),_0x23b1d0[_0x1bd2c3(0x20a)]());}['getRoamTransform'](){const _0x27de8b=_0x2b091f;return echarts__namespace['matrix'][_0x27de8b(0x216)]();}}CompositeCoordinateSystem[_0x2b091f(0x1d7)]=['lng','lat'],CompositeCoordinateSystem['create']=function(_0x2aac0f,_0x4eb8b0){const _0x323c18={_0x980ef3:0x215,_0x3bd060:0x1dc},_0x33832e=_0x2b091f;let _0x1c7414;const _0x2b1466=_0x2aac0f['scheduler'][_0x33832e(0x203)]['_mars3d_scene'];_0x2aac0f['eachComponent'](_0x33832e(0x1e2),function(_0x57ff46){const _0xa614b2=_0x33832e,_0x4b967d=_0x4eb8b0[_0xa614b2(_0x323c18._0x980ef3)]()[_0xa614b2(_0x323c18._0x3bd060)];if(!_0x4b967d)return;!_0x1c7414&&(_0x1c7414=new CompositeCoordinateSystem(_0x2b1466,_0x4eb8b0)),_0x57ff46['coordinateSystem']=_0x1c7414,_0x1c7414['setMapOffset'](_0x57ff46['__mapOffset']||[0x0,0x0]);}),_0x2aac0f['eachSeries'](function(_0x4e4920){const _0x361920=_0x33832e;_0x4e4920[_0x361920(0x20d)]('coordinateSystem')===_0x361920(0x1e2)&&(!_0x1c7414&&(_0x1c7414=new CompositeCoordinateSystem(_0x2b1466,_0x4eb8b0)),_0x4e4920['coordinateSystem']=_0x1c7414);});};if(echarts__namespace!==null&&echarts__namespace!==void 0x0&&echarts__namespace['init'])echarts__namespace['registerCoordinateSystem']('mars3dMap',CompositeCoordinateSystem),echarts__namespace[_0x2b091f(0x1fc)]({'type':_0x2b091f(0x20b),'event':'mars3dMapRoam','update':'updateLayout'},function(_0x3b79ea,_0x398545){}),echarts__namespace['extendComponentModel']({'type':'mars3dMap','getBMap':function(){return this['_mars3d_scene'];},'defaultOption':{'roam':![]}}),echarts__namespace['extendComponentView']({'type':'mars3dMap','init':function(_0x593c6d,_0xb4dfb1){const _0x23228d={_0x4f5b19:0x1e1},_0xe2b0e3=_0x2b091f;this['api']=_0xb4dfb1,this[_0xe2b0e3(_0x23228d._0x4f5b19)]=_0x593c6d['scheduler']['ecInstance']['_mars3d_scene'],this['scene']['postRender'][_0xe2b0e3(0x213)](this['moveHandler'],this);},'moveHandler':function(_0x35ec7f,_0x4bb2e6){const _0x1dbd38={_0x3b48ac:0x20b},_0x324bef=_0x2b091f;this['api']['dispatchAction']({'type':_0x324bef(_0x1dbd38._0x3b48ac)});},'render':function(_0xec9569,_0x5e6209,_0x41e214){},'dispose':function(_0x40419d){this['scene']['postRender']['removeEventListener'](this['moveHandler'],this);}});else throw new Error('请引入\x20echarts\x20库\x20');const Cesium=mars3d__namespace['Cesium'],BaseLayer=mars3d__namespace['layer']['BaseLayer'];class EchartsLayer extends BaseLayer{constructor(_0x4ff654={}){super(_0x4ff654),this['_pointerEvents']=this['options']['pointerEvents'];}get[_0x2b091f(0x214)](){const _0x1e6b3d=_0x2b091f;return this[_0x1e6b3d(0x1fa)];}get[_0x2b091f(0x1e7)](){return this['_pointerEvents'];}set[_0x2b091f(0x1e7)](_0x49d78c){const _0x12b612={_0xfab2d7:0x1fb,_0x3343eb:0x1ec},_0x226dfa=_0x2b091f;this[_0x226dfa(_0x12b612._0xfab2d7)]=_0x49d78c,this['_echartsContainer']&&(_0x49d78c?this['_echartsContainer']['style']['pointerEvents']=_0x226dfa(_0x12b612._0x3343eb):this['_echartsContainer']['style']['pointerEvents']='none');}['_setOptionsHook'](_0x3b0951,_0x110ca0){this['setEchartsOption'](_0x3b0951);}['_showHook'](_0x24bc56){_0x24bc56?this['_echartsContainer']['style']['visibility']='visible':this['_echartsContainer']['style']['visibility']='hidden';}['_mountedHook'](){const _0x5091b7={_0x5e6fc9:0x1d6,_0x1864fc:0x1ed,_0x3cab96:0x1dd,_0x4d3d0c:0x1ee},_0x2213c7=_0x2b091f;this['_map']['scene'][_0x2213c7(_0x5091b7._0x5e6fc9)]=this['options']['depthTest']??!![],this[_0x2213c7(_0x5091b7._0x1864fc)]['scene']['echartsAutoHeight']=this['options']['clampToGround']??![],this['_map']['scene'][_0x2213c7(_0x5091b7._0x3cab96)]=this[_0x2213c7(_0x5091b7._0x4d3d0c)]['fixedHeight']??0x0;}['_addedHook'](){const _0x4143ea={_0x4fa411:0x1f4,_0x100f77:0x1ee},_0x1e8438=_0x2b091f;this[_0x1e8438(_0x4143ea._0x4fa411)]=this['_createChartOverlay'](),this['_echartsInstance']=echarts__namespace['init'](this[_0x1e8438(0x1f4)]),this['_echartsInstance']['_mars3d_scene']=this['_map']['scene'],this['setEchartsOption'](this[_0x1e8438(_0x4143ea._0x100f77)]);}['_removedHook'](){const _0xbcc245={_0x3ebd31:0x1fa,_0x204475:0x1f9},_0x3407d8=_0x2b091f;this['_echartsInstance']&&(this[_0x3407d8(_0xbcc245._0x3ebd31)][_0x3407d8(0x1ea)](),this['_echartsInstance'][_0x3407d8(_0xbcc245._0x204475)](),delete this['_echartsInstance']),this[_0x3407d8(0x1f4)]&&(this['_map']['container']['removeChild'](this['_echartsContainer']),delete this['_echartsContainer']);}['_createChartOverlay'](){const _0xd5ae5d={_0x34e7eb:0x216,_0x43957b:0x210,_0x5f5523:0x20c,_0x376adc:0x1fe},_0x161ddb=_0x2b091f,_0x1ec655=mars3d__namespace['DomUtil'][_0x161ddb(_0xd5ae5d._0x34e7eb)]('div',_0x161ddb(0x204),this['_map']['container']);return _0x1ec655['id']=this['id'],_0x1ec655['style']['position']='absolute',_0x1ec655['style']['top']='0px',_0x1ec655['style']['left']='0px',_0x1ec655[_0x161ddb(_0xd5ae5d._0x43957b)]['width']=this['_map']['scene'][_0x161ddb(_0xd5ae5d._0x5f5523)]['clientWidth']+'px',_0x1ec655['style']['height']=this[_0x161ddb(0x1ed)]['scene']['canvas'][_0x161ddb(0x1e8)]+'px',_0x1ec655['style']['pointerEvents']=this['_pointerEvents']?'all':'none',_0x1ec655['style'][_0x161ddb(_0xd5ae5d._0x376adc)]=this['options']['zIndex']??0x9,_0x1ec655;}['resize'](){const _0x15fba2={_0x1d096b:0x1d2,_0x591308:0x1e1,_0x822261:0x1e9},_0x5b98c4=_0x2b091f;if(!this['_echartsInstance'])return;this['_echartsContainer']['style'][_0x5b98c4(_0x15fba2._0x1d096b)]=this['_map'][_0x5b98c4(_0x15fba2._0x591308)][_0x5b98c4(0x20c)][_0x5b98c4(_0x15fba2._0x822261)]+'px',this['_echartsContainer']['style']['height']=this['_map']['scene']['canvas']['clientHeight']+'px',this['_echartsInstance']['resize']();}['setEchartsOption'](_0x23f4ae,_0x5a88be,_0xc5be4a){const _0x4ac7b6={_0x2d9eaf:0x1ef,_0x20548c:0x1fa,_0x12418d:0x1ff},_0x951019=_0x2b091f;this['_echartsInstance']&&(_0x23f4ae={'mars3dMap':{},...mars3d__namespace['Util']['getAttrVal'](_0x23f4ae,{'onlySimpleType':!![]})},delete _0x23f4ae[_0x951019(_0x4ac7b6._0x2d9eaf)],this[_0x951019(_0x4ac7b6._0x20548c)][_0x951019(_0x4ac7b6._0x12418d)](_0x23f4ae,_0x5a88be,_0xc5be4a));}[_0x2b091f(0x1da)](_0x52de67){const _0x478f09={_0xd426f5:0x1d5},_0x4fb4ef={_0x47c2db:0x1de},_0x2f7278={_0x300ba9:0x1f0,_0x4b0ab1:0x20f},_0x28c8f5=_0x2b091f;let _0x58783f,_0x3b0612,_0x53550f,_0x52fd81;function _0x456248(_0x29c843){const _0x1774cb=_0xd8fa;if(!Array[_0x1774cb(_0x2f7278._0x300ba9)](_0x29c843))return;const _0x570b0c=_0x29c843[0x0]||0x0,_0x1fa99b=_0x29c843[0x1]||0x0;_0x570b0c!==0x0&&_0x1fa99b!==0x0&&(_0x58783f===undefined?(_0x58783f=_0x570b0c,_0x3b0612=_0x570b0c,_0x53550f=_0x1fa99b,_0x52fd81=_0x1fa99b):(_0x58783f=Math[_0x1774cb(_0x2f7278._0x4b0ab1)](_0x58783f,_0x570b0c),_0x3b0612=Math['max'](_0x3b0612,_0x570b0c),_0x53550f=Math['min'](_0x53550f,_0x1fa99b),_0x52fd81=Math[_0x1774cb(0x1f1)](_0x52fd81,_0x1fa99b)));}const _0x5ced81=this['options']['series'];_0x5ced81&&_0x5ced81['forEach'](_0x3b64fa=>{const _0x27f457=_0xd8fa;_0x3b64fa['data']&&_0x3b64fa[_0x27f457(0x207)][_0x27f457(0x208)](_0x63cd15=>{const _0x1db114=_0x27f457;if(_0x63cd15['value'])_0x456248(_0x63cd15[_0x1db114(_0x4fb4ef._0x47c2db)]);else _0x63cd15['coords']&&_0x63cd15['coords']['forEach'](_0x2e0b06=>{_0x456248(_0x2e0b06);});});});if(_0x58783f===0x0&&_0x53550f===0x0&&_0x3b0612===0x0&&_0x52fd81===0x0)return null;return _0x52de67!==null&&_0x52de67!==void 0x0&&_0x52de67['isFormat']?{'xmin':_0x58783f,'xmax':_0x3b0612,'ymin':_0x53550f,'ymax':_0x52fd81}:Cesium[_0x28c8f5(0x209)][_0x28c8f5(_0x478f09._0xd426f5)](_0x58783f,_0x53550f,_0x3b0612,_0x52fd81);}['on'](_0x6d3ab3,_0x31a97e,_0x12ff04){const _0x2e5052={_0x57afd0:0x1fa},_0x5d69c2=_0x2b091f;return this[_0x5d69c2(_0x2e5052._0x57afd0)]['on'](_0x6d3ab3,_0x31a97e,_0x12ff04||this),this;}[_0x2b091f(0x1e3)](_0x45ad5b,_0xd75ac8,_0xdb849e,_0x382e8d){return this['_echartsInstance']['on'](_0x45ad5b,_0xd75ac8,_0xdb849e,_0x382e8d||this),this;}['off'](_0x11430e,_0x5f0bf9,_0x327a83){return this['_echartsInstance']['off'](_0x11430e,_0x5f0bf9,_0x327a83||this),this;}}function _0xd8fa(_0x4a9260,_0x25fba3){const _0x47a804=_0x47a8();return _0xd8fa=function(_0xd8fa7f,_0x2deb97){_0xd8fa7f=_0xd8fa7f-0x1d2;let _0x3fd40b=_0x47a804[_0xd8fa7f];return _0x3fd40b;},_0xd8fa(_0x4a9260,_0x25fba3);}mars3d__namespace['LayerUtil']['register'](_0x2b091f(0x1e6),EchartsLayer),mars3d__namespace[_0x2b091f(0x214)]['EchartsLayer']=EchartsLayer,mars3d__namespace['echarts']=echarts__namespace,mars3d__namespace[_0x2b091f(0x1eb)]['logInfo'](_0x2b091f(0x1f8)+version+_0x2b091f(0x1f7)+buildTime),exports['EchartsLayer']=EchartsLayer,Object['keys'](echarts)['forEach'](function(_0xd3b670){if(_0xd3b670!=='default'&&!exports['hasOwnProperty'](_0xd3b670))Object['defineProperty'](exports,_0xd3b670,{'enumerable':!![],'get':function(){return echarts[_0xd3b670];}});}),Object[_0x2b091f(0x212)](exports,'__esModule',{'value':!![]});
}));