园林绿化
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

611 lines
26 KiB

  1. /**
  2. * Mars3D平台插件,结合mapv可视化功能插件 mars3d-mapv
  3. *
  4. * 版本信息:v3.7.23
  5. * 编译日期:2024-07-22 00:04:50
  6. * 版权所有:Copyright by 火星科技 http://mars3d.cn
  7. * 使用单位:免费公开版 ,2024-01-15
  8. */
  9. (function (global, factory) {
  10. if (typeof exports === 'object' && typeof module !== 'undefined') {
  11. factory(exports, window.mapv || require('mapv'), window.mars3d || require('mars3d'));
  12. } else if (typeof define === 'function' && define.amd) {
  13. define(['exports', 'mapv', 'mars3d'], factory);
  14. } else {
  15. global = typeof globalThis !== 'undefined' ? globalThis : global || self;
  16. factory(global["mars3d-mapv"] = {}, global.mapv, global.mars3d);
  17. }
  18. })(this, function (exports, mapv, mars3d) {
  19. 'use strict';
  20. function _interopNamespace(_0x573ae7) {
  21. if (_0x573ae7 && _0x573ae7.__esModule) {
  22. return _0x573ae7;
  23. }
  24. var _0x5455e0 = Object.create(null);
  25. if (_0x573ae7) {
  26. Object.keys(_0x573ae7).forEach(function (_0x153706) {
  27. if (_0x153706 !== 'default') {
  28. var _0x19ee1b = Object.getOwnPropertyDescriptor(_0x573ae7, _0x153706);
  29. Object.defineProperty(_0x5455e0, _0x153706, _0x19ee1b.get ? _0x19ee1b : {
  30. 'enumerable': true,
  31. 'get': function () {
  32. return _0x573ae7[_0x153706];
  33. }
  34. });
  35. }
  36. });
  37. }
  38. _0x5455e0['default'] = _0x573ae7;
  39. return _0x5455e0;
  40. }
  41. var mapv__namespace = _interopNamespace(mapv);
  42. var mars3d__namespace = _interopNamespace(mars3d);
  43. const Cesium$1 = mars3d__namespace.Cesium;
  44. const baiduMapLayer = mapv__namespace ? mapv__namespace.baiduMapLayer : null;
  45. const BaseLayer$1 = baiduMapLayer ? baiduMapLayer.__proto__ : Function;
  46. class MapVRenderer extends BaseLayer$1 {
  47. constructor(_0x18d85c, _0x42db71, _0x576641, _0x34a4eb) {
  48. super(_0x18d85c, _0x42db71, _0x576641);
  49. if (!BaseLayer$1) {
  50. return;
  51. }
  52. this.map = _0x18d85c;
  53. this.scene = _0x18d85c.scene;
  54. this.dataSet = _0x42db71;
  55. _0x576641 = _0x576641 || {};
  56. this.init(_0x576641);
  57. this.argCheck(_0x576641);
  58. this.initDevicePixelRatio();
  59. this.canvasLayer = _0x34a4eb;
  60. this.stopAniamation = false;
  61. this.animation = _0x576641.animation;
  62. }
  63. ['initDevicePixelRatio']() {
  64. this.devicePixelRatio = window.devicePixelRatio || 0x1;
  65. }
  66. ['addAnimatorEvent']() {}
  67. ['animatorMovestartEvent']() {
  68. const _0x314d7a = this.options.animation;
  69. if (this.isEnabledTime() && this.animator) {
  70. this.steps.step = _0x314d7a.stepsRange.start;
  71. }
  72. }
  73. ["animatorMoveendEvent"]() {
  74. if (this.isEnabledTime()) {
  75. this.animator;
  76. }
  77. }
  78. ['getContext']() {
  79. return this.canvasLayer.canvas.getContext(this.context);
  80. }
  81. ['init'](_0x51f4aa) {
  82. this.options = _0x51f4aa;
  83. this.initDataRange(_0x51f4aa);
  84. this.context = this.options.context || '2d';
  85. if (Cesium$1.defined(this.options.zIndex) && this.canvasLayer && this.canvasLayer.setZIndex) {
  86. this.canvasLayer.setZIndex(this.options.zIndex);
  87. }
  88. this.initAnimator();
  89. }
  90. ["_canvasUpdate"](_0x20338a) {
  91. if (!this.canvasLayer || this.stopAniamation) {
  92. return;
  93. }
  94. const _0x416071 = this.scene;
  95. const _0x2399bf = this.options.animation;
  96. const _0x39a81a = this.getContext();
  97. if (this.isEnabledTime()) {
  98. if (undefined === _0x20338a) {
  99. return void this.clear(_0x39a81a);
  100. }
  101. if (this.context === '2d') {
  102. _0x39a81a.save();
  103. _0x39a81a.globalCompositeOperation = 'destination-out';
  104. _0x39a81a.fillStyle = "rgba(0, 0, 0, .1)";
  105. _0x39a81a.fillRect(0x0, 0x0, _0x39a81a.canvas.width, _0x39a81a.canvas.height);
  106. _0x39a81a.restore();
  107. }
  108. } else {
  109. this.clear(_0x39a81a);
  110. }
  111. if (this.context === '2d') {
  112. for (const _0x378c53 in this.options) {
  113. _0x39a81a[_0x378c53] = this.options[_0x378c53];
  114. }
  115. } else {
  116. _0x39a81a.clear(_0x39a81a.COLOR_BUFFER_BIT);
  117. }
  118. const _0x381465 = {
  119. 'transferCoordinate': function (_0x2707ae) {
  120. let _0x439b1f = _0x416071.mapvFixedHeight;
  121. if (_0x416071.mapvAutoHeight) {
  122. _0x439b1f = _0x416071.getHeight(Cesium$1.Cartographic.fromDegrees(_0x2707ae[0x0], _0x2707ae[0x1]));
  123. }
  124. const _0x36ea67 = Cesium$1.Cartesian3.fromDegrees(_0x2707ae[0x0], _0x2707ae[0x1], _0x439b1f);
  125. if (!_0x36ea67) {
  126. return null;
  127. }
  128. const _0x5ce1af = _0x416071.cartesianToCanvasCoordinates(_0x36ea67);
  129. if (!_0x5ce1af) {
  130. return null;
  131. }
  132. if (_0x416071.mapvDepthTest && _0x416071.mode === Cesium$1.SceneMode.SCENE3D) {
  133. const _0x5cf40c = new Cesium$1.EllipsoidalOccluder(_0x416071.globe.ellipsoid, _0x416071.camera.positionWC);
  134. const _0xccc6c5 = _0x5cf40c.isPointVisible(_0x36ea67);
  135. if (!_0xccc6c5) {
  136. return null;
  137. }
  138. }
  139. return [_0x5ce1af.x, _0x5ce1af.y];
  140. }
  141. };
  142. if (undefined !== _0x20338a) {
  143. _0x381465.filter = function (_0x501bbe) {
  144. const _0x3c6991 = _0x2399bf.trails || 0xa;
  145. return !!(_0x20338a && _0x501bbe.time > _0x20338a - _0x3c6991 && _0x501bbe.time < _0x20338a);
  146. };
  147. }
  148. let _0x1b9b76;
  149. if (this.options.draw === "cluster" && (!this.options.maxClusterZoom || this.options.maxClusterZoom >= this.getZoom())) {
  150. this.map.getExtent();
  151. const _0x440029 = this.getZoom();
  152. const _0x1cb057 = this.supercluster.getClusters([-0xb4, -0x5a, 0xb4, 0x5a], _0x440029);
  153. this.pointCountMax = this.supercluster.trees[_0x440029].max;
  154. this.pointCountMin = this.supercluster.trees[_0x440029].min;
  155. let _0x5bc48e = {};
  156. let _0x349eb2 = null;
  157. let _0xe32a87 = null;
  158. if (this.pointCountMax === this.pointCountMin) {
  159. _0x349eb2 = this.options.fillStyle;
  160. _0xe32a87 = this.options.minSize || 0x8;
  161. } else {
  162. const _0x1a5a3f = {
  163. min: this.pointCountMin,
  164. max: this.pointCountMax,
  165. minSize: this.options.minSize || 0x8,
  166. maxSize: this.options.maxSize || 0x1e,
  167. gradient: this.options.gradient
  168. };
  169. _0x5bc48e = new mapv__namespace.utilDataRangeIntensity(_0x1a5a3f);
  170. }
  171. for (let _0x4be964 = 0x0; _0x4be964 < _0x1cb057.length; _0x4be964++) {
  172. const _0x52b538 = _0x1cb057[_0x4be964];
  173. if (_0x52b538.properties && _0x52b538.properties.cluster_id) {
  174. _0x1cb057[_0x4be964].size = _0xe32a87 || _0x5bc48e.getSize(_0x52b538.properties.point_count);
  175. _0x1cb057[_0x4be964].fillStyle = _0x349eb2 || _0x5bc48e.getColor(_0x52b538.properties.point_count);
  176. } else {
  177. _0x1cb057[_0x4be964].size = this.options.size;
  178. }
  179. }
  180. this.clusterDataSet.set(_0x1cb057);
  181. _0x1b9b76 = this.clusterDataSet.get(_0x381465);
  182. } else {
  183. _0x1b9b76 = this.dataSet.get(_0x381465);
  184. }
  185. this.processData(_0x1b9b76);
  186. if (this.options.unit === 'm' && this.options.size) {
  187. this.options._size = this.options.size;
  188. }
  189. const _0x3ef808 = _0x416071.cartesianToCanvasCoordinates(Cesium$1.Cartesian3.fromDegrees(0x0, 0x0));
  190. if (!_0x3ef808) {
  191. return;
  192. }
  193. this.drawContext(_0x39a81a, new mapv__namespace.DataSet(_0x1b9b76), this.options, _0x3ef808);
  194. if (this.options.updateCallback) {
  195. this.options.updateCallback(_0x20338a);
  196. }
  197. }
  198. ['updateData'](_0x260212, _0x5b851c) {
  199. let _0x189e00 = _0x260212;
  200. if (_0x189e00 && _0x189e00.get) {
  201. _0x189e00 = _0x189e00.get();
  202. }
  203. if (undefined !== _0x189e00) {
  204. this.dataSet.set(_0x189e00);
  205. }
  206. const _0x465b76 = {
  207. 'options': _0x5b851c
  208. };
  209. super.update(_0x465b76);
  210. }
  211. ['addData'](_0x28f22, _0x564ee7) {
  212. let _0x41f1d8 = _0x28f22;
  213. const _0x27f2bd = {
  214. 'options': _0x564ee7
  215. };
  216. if (_0x28f22 && _0x28f22.get) {
  217. _0x41f1d8 = _0x28f22.get();
  218. }
  219. this.dataSet.add(_0x41f1d8);
  220. this.update(_0x27f2bd);
  221. }
  222. ['getData']() {
  223. return this.dataSet;
  224. }
  225. ['removeData'](_0x464f7d) {
  226. if (this.dataSet) {
  227. const _0x12718a = this.dataSet.get({
  228. 'filter': function (_0xe00322) {
  229. return _0x464f7d == null || typeof _0x464f7d !== "function" || !_0x464f7d(_0xe00322);
  230. }
  231. });
  232. this.dataSet.set(_0x12718a);
  233. const _0x1157d6 = {
  234. options: null
  235. };
  236. this.update(_0x1157d6);
  237. }
  238. }
  239. ['clearData']() {
  240. if (this.dataSet) {
  241. this.dataSet.clear();
  242. }
  243. const _0x1dd969 = {
  244. options: null
  245. };
  246. this.update(_0x1dd969);
  247. }
  248. ['draw']() {
  249. this.canvasLayer.draw();
  250. }
  251. ["clear"](_0x4b8669) {
  252. if (_0x4b8669 && _0x4b8669.clearRect) {
  253. _0x4b8669.clearRect(0x0, 0x0, _0x4b8669.canvas.width, _0x4b8669.canvas.height);
  254. }
  255. }
  256. ['getZoom']() {
  257. return this.map.level;
  258. }
  259. ['destroy']() {
  260. this.clear(this.getContext());
  261. this.clearData();
  262. if (this.animator) {
  263. this.animator.stop();
  264. }
  265. this.animator = null;
  266. this.canvasLayer = null;
  267. }
  268. }
  269. if (mapv__namespace !== null && mapv__namespace !== undefined && mapv__namespace.DataSet) {
  270. mapv__namespace.DataSet.prototype.transferCoordinate = function (_0x4f82a4, _0xdf712b, _0x5dc743, _0x400bac) {
  271. _0x400bac = _0x400bac || "_coordinates";
  272. _0x5dc743 = _0x5dc743 || 'coordinates';
  273. for (let _0x54053f = 0x0; _0x54053f < _0x4f82a4.length; _0x54053f++) {
  274. const _0x3a6e1b = _0x4f82a4[_0x54053f].geometry;
  275. const _0x476e96 = _0x3a6e1b[_0x5dc743];
  276. switch (_0x3a6e1b.type) {
  277. case "Point":
  278. {
  279. const _0x137d16 = _0xdf712b(_0x476e96);
  280. if (_0x137d16) {
  281. _0x3a6e1b[_0x400bac] = _0x137d16;
  282. } else {
  283. _0x3a6e1b[_0x400bac] = [-0x3e7, -0x3e7];
  284. }
  285. }
  286. break;
  287. case "LineString":
  288. {
  289. const _0x1cc238 = [];
  290. for (let _0x3e1833 = 0x0; _0x3e1833 < _0x476e96.length; _0x3e1833++) {
  291. const _0x512dbe = _0xdf712b(_0x476e96[_0x3e1833]);
  292. if (_0x512dbe) {
  293. _0x1cc238.push(_0x512dbe);
  294. }
  295. }
  296. _0x3a6e1b[_0x400bac] = _0x1cc238;
  297. }
  298. break;
  299. case 'MultiLineString':
  300. case "Polygon":
  301. {
  302. const _0x247cdf = _0x178cd7(_0x476e96);
  303. _0x3a6e1b[_0x400bac] = _0x247cdf;
  304. }
  305. break;
  306. case 'MultiPolygon':
  307. {
  308. const _0x23f598 = [];
  309. for (let _0x20a32b = 0x0; _0x20a32b < _0x476e96.length; _0x20a32b++) {
  310. const _0x5bbaf6 = _0x178cd7(_0x476e96[_0x20a32b]);
  311. if (_0x5bbaf6.length > 0x0) {
  312. _0x23f598.push(_0x5bbaf6);
  313. }
  314. }
  315. _0x3a6e1b[_0x400bac] = _0x23f598;
  316. }
  317. break;
  318. }
  319. }
  320. function _0x178cd7(_0x4713d8) {
  321. const _0x5027d2 = [];
  322. for (let _0x45afa1 = 0x0; _0x45afa1 < _0x4713d8.length; _0x45afa1++) {
  323. const _0x54a18b = _0x4713d8[_0x45afa1];
  324. const _0x5f842c = [];
  325. for (let _0x281016 = 0x0; _0x281016 < _0x54a18b.length; _0x281016++) {
  326. const _0x4f4c1b = _0xdf712b(_0x54a18b[_0x281016]);
  327. if (_0x4f4c1b) {
  328. _0x5f842c.push(_0x4f4c1b);
  329. }
  330. }
  331. if (_0x5f842c.length > 0x0) {
  332. _0x5027d2.push(_0x5f842c);
  333. }
  334. }
  335. return _0x5027d2;
  336. }
  337. return _0x4f82a4;
  338. };
  339. } else {
  340. throw new Error("请引入 mapv 库 ");
  341. }
  342. const Cesium = mars3d__namespace.Cesium;
  343. const BaseLayer = mars3d__namespace.layer.BaseLayer;
  344. class MapVLayer extends BaseLayer {
  345. constructor(_0x56419, _0x16a668) {
  346. super(_0x56419);
  347. this._pointerEvents = this.options.pointerEvents;
  348. this.dataSet = _0x16a668 || new mapv__namespace.DataSet(_0x56419.data);
  349. this.canvas = null;
  350. }
  351. get ['pointerEvents']() {
  352. return this._pointerEvents;
  353. }
  354. set ["pointerEvents"](_0x58af16) {
  355. this._pointerEvents = _0x58af16;
  356. if (this.canvas) {
  357. if (_0x58af16) {
  358. this.canvas.style.pointerEvents = 'all';
  359. } else {
  360. this.canvas.style.pointerEvents = "none";
  361. }
  362. }
  363. }
  364. ['_showHook'](_0x10638f) {
  365. if (_0x10638f) {
  366. this.canvas.style.display = 'block';
  367. } else {
  368. this.canvas.style.display = "none";
  369. }
  370. }
  371. ['_mountedHook']() {
  372. this._map.scene.mapvDepthTest = this.options.depthTest ?? true;
  373. this._map.scene.mapvAutoHeight = this.options.clampToGround ?? false;
  374. this._map.scene.mapvFixedHeight = this.options.fixedHeight ?? 0x0;
  375. }
  376. ['_addedHook']() {
  377. if (this.dataSet && (!this.dataSet._data || this.dataSet._data.length === 0x0)) {
  378. this.dataSet._data = [].concat(this.dataSet._dataCache);
  379. }
  380. this._mapVRenderer = new MapVRenderer(this._map, this.dataSet, this.options, this);
  381. this.initDevicePixelRatio();
  382. this.canvas = this._createCanvas();
  383. this.render = this.render.bind(this);
  384. this.bindEvent();
  385. this._reset();
  386. }
  387. ['_removedHook']() {
  388. this.unbindEvent();
  389. if (this._mapVRenderer) {
  390. this._mapVRenderer.destroy();
  391. this._mapVRenderer = null;
  392. }
  393. this.canvas.parentElement.removeChild(this.canvas);
  394. }
  395. ['initDevicePixelRatio']() {
  396. this.devicePixelRatio = window.devicePixelRatio || 0x1;
  397. }
  398. ['bindEvent']() {
  399. var _0x3ce2ad;
  400. var _0x498282;
  401. this._map.on(mars3d__namespace.EventType.mouseDown, this._onMoveStartEvent, this);
  402. this._map.on(mars3d__namespace.EventType.cameraMoveStart, this._onMoveStartEvent, this);
  403. this._map.on(mars3d__namespace.EventType.cameraMoveEnd, this._onMoveEndEvent, this);
  404. if ((_0x3ce2ad = this.options) !== null && _0x3ce2ad !== undefined && (_0x3ce2ad = _0x3ce2ad.methods) !== null && _0x3ce2ad !== undefined && _0x3ce2ad.click) {
  405. this._map.on(mars3d__namespace.EventType.click, this._onMapClick, this);
  406. }
  407. if ((_0x498282 = this.options) !== null && _0x498282 !== undefined && (_0x498282 = _0x498282.methods) !== null && _0x498282 !== undefined && _0x498282.mousemove) {
  408. this._map.on(mars3d__namespace.EventType.mouseMove, this._onMapMouseMove, this);
  409. }
  410. }
  411. ['unbindEvent']() {
  412. var _0x44d725;
  413. var _0xec0e4a;
  414. this._map.off(mars3d__namespace.EventType.mouseDown, this._onMoveStartEvent, this);
  415. this._map.off(mars3d__namespace.EventType.cameraMoveStart, this._onMoveStartEvent, this);
  416. this._map.off(mars3d__namespace.EventType.cameraMoveEnd, this._onMoveEndEvent, this);
  417. this._map.off(mars3d__namespace.EventType.postRender, this._reset, this);
  418. if ((_0x44d725 = this.options) !== null && _0x44d725 !== undefined && (_0x44d725 = _0x44d725.methods) !== null && _0x44d725 !== undefined && _0x44d725.click) {
  419. this._map.off(mars3d__namespace.EventType.click, this._onMapClick, this);
  420. }
  421. if ((_0xec0e4a = this.options) !== null && _0xec0e4a !== undefined && (_0xec0e4a = _0xec0e4a.methods) !== null && _0xec0e4a !== undefined && _0xec0e4a.mousemove) {
  422. this._map.off(mars3d__namespace.EventType.mouseMove, this._onMapMouseMove, this);
  423. }
  424. }
  425. ["_onMoveStartEvent"]() {
  426. if (this._mapVRenderer) {
  427. this._mapVRenderer.animatorMovestartEvent();
  428. this._map.off(mars3d__namespace.EventType.postRender, this._reset, this);
  429. this._map.on(mars3d__namespace.EventType.postRender, this._reset, this);
  430. }
  431. }
  432. ["_onMoveEndEvent"]() {
  433. if (this._mapVRenderer) {
  434. this._map.off(mars3d__namespace.EventType.postRender, this._reset, this);
  435. this._mapVRenderer.animatorMoveendEvent();
  436. this._reset();
  437. }
  438. }
  439. ['_setOptionsHook'](_0x4678bc, _0x3e2c62) {
  440. this._removedHook();
  441. this._addedHook();
  442. }
  443. ['addData'](_0x2384db) {
  444. if (this._mapVRenderer) {
  445. this._mapVRenderer.addData(_0x2384db, this.options);
  446. }
  447. }
  448. ["updateData"](_0x4baab4) {
  449. if (this._mapVRenderer) {
  450. this._mapVRenderer.updateData(_0x4baab4, this.options);
  451. }
  452. }
  453. ["getData"]() {
  454. if (this._mapVRenderer) {
  455. this.dataSet = this._mapVRenderer.getData();
  456. }
  457. return this.dataSet;
  458. }
  459. ['removeData'](_0x14bf91) {
  460. if (this._mapVRenderer) {
  461. this._mapVRenderer.removeData(_0x14bf91);
  462. }
  463. }
  464. ['removeAllData']() {
  465. if (this._mapVRenderer) {
  466. this._mapVRenderer.clearData();
  467. }
  468. }
  469. ['_createCanvas']() {
  470. const _0xabae54 = mars3d__namespace.DomUtil.create('canvas', 'mars3d-mapv', this._map.container);
  471. _0xabae54.id = this.id;
  472. _0xabae54.style.position = 'absolute';
  473. _0xabae54.style.top = '0px';
  474. _0xabae54.style.left = "0px";
  475. _0xabae54.width = parseInt(this._map.canvas.width);
  476. _0xabae54.height = parseInt(this._map.canvas.height);
  477. _0xabae54.style.width = this._map.canvas.style.width;
  478. _0xabae54.style.height = this._map.canvas.style.height;
  479. _0xabae54.style.pointerEvents = this._pointerEvents ? "auto" : 'none';
  480. _0xabae54.style.zIndex = this.options.zIndex ?? 0x9;
  481. if (this.options.context === '2d') {
  482. const _0x3a854b = this.devicePixelRatio;
  483. _0xabae54.getContext(this.options.context).scale(_0x3a854b, _0x3a854b);
  484. }
  485. return _0xabae54;
  486. }
  487. ["_reset"]() {
  488. this.resize();
  489. this.render();
  490. }
  491. ["draw"]() {
  492. this._reset();
  493. }
  494. ['remove']() {
  495. if (this._mapVRenderer) {
  496. this._mapVRenderer.destroy();
  497. this._mapVRenderer = null;
  498. }
  499. this.canvas.parentElement.removeChild(this.canvas);
  500. }
  501. ['render']() {
  502. this._mapVRenderer._canvasUpdate();
  503. }
  504. ["resize"]() {
  505. if (this.canvas) {
  506. const _0x48d6 = this.canvas;
  507. _0x48d6.style.position = 'absolute';
  508. _0x48d6.style.top = "0px";
  509. _0x48d6.style.left = '0px';
  510. _0x48d6.width = parseInt(this._map.canvas.width);
  511. _0x48d6.height = parseInt(this._map.canvas.height);
  512. _0x48d6.style.width = this._map.canvas.style.width;
  513. _0x48d6.style.height = this._map.canvas.style.height;
  514. }
  515. }
  516. ["getRectangle"](_0x2b1698) {
  517. if (!this.dataSet || !this.dataSet._data) {
  518. return;
  519. }
  520. const _0x114d2e = {
  521. type: 'FeatureCollection',
  522. features: this.dataSet._data
  523. };
  524. const _0x4569b7 = mars3d__namespace.Util.getExtentByGeoJSON(_0x114d2e);
  525. if (!_0x4569b7) {
  526. return;
  527. }
  528. return _0x2b1698 !== null && _0x2b1698 !== undefined && _0x2b1698.isFormat ? _0x4569b7 : Cesium.Rectangle.fromDegrees(_0x4569b7.xmin, _0x4569b7.ymin, _0x4569b7.xmax, _0x4569b7.ymax);
  529. }
  530. ['_onMapClick'](_0x44e19c) {
  531. this._cache_event = _0x44e19c;
  532. // alert(1);
  533. if (this._mapVRenderer) {
  534. this._mapVRenderer.clickEvent(_0x44e19c.windowPosition, _0x44e19c);
  535. }
  536. }
  537. ['_onMapMouseMove'](_0x59a0cf) {
  538. this._cache_event = _0x59a0cf;
  539. if (this._mapVRenderer) {
  540. this._mapVRenderer.mousemoveEvent(_0x59a0cf.windowPosition, _0x59a0cf);
  541. }
  542. }
  543. ['on'](_0x3a2096, _0x494636, _0x2f773d) {
  544. this.options.methods = this.options.methods || {};
  545. if (_0x3a2096 === mars3d__namespace.EventType.click) {
  546. this.options.methods.click = _0x2d7a56 => {
  547. if (_0x2d7a56) {
  548. const _0xf52206 = {
  549. ...this._cache_event
  550. };
  551. _0xf52206.layer = this;
  552. _0xf52206.data = _0x2d7a56;
  553. _0x494636.bind(_0x2f773d)(_0xf52206);
  554. }
  555. };
  556. this._map.on(mars3d__namespace.EventType.click, this._onMapClick, this);
  557. } else if (_0x3a2096 === mars3d__namespace.EventType.mouseMove) {
  558. this.options.methods.mousemove = _0x46d7eb => {
  559. if (_0x46d7eb) {
  560. const _0x51132e = {
  561. ...this._cache_event
  562. };
  563. _0x51132e.layer = this;
  564. _0x51132e.data = _0x46d7eb;
  565. _0x494636.bind(_0x2f773d)(_0x51132e);
  566. }
  567. };
  568. this._map.on(mars3d__namespace.EventType.mouseMove, this._onMapMouseMove, this);
  569. }
  570. return this;
  571. }
  572. ['off'](_0x210b79, _0x6aa22a) {
  573. if (_0x210b79 === "click") {
  574. var _0x5b11c7;
  575. this._map.off(_0x210b79, this._onMapClick, this);
  576. if ((_0x5b11c7 = this.options.methods) !== null && _0x5b11c7 !== undefined && _0x5b11c7.mousemove) {
  577. delete this.options.methods.click;
  578. }
  579. } else {
  580. if (_0x210b79 === 'mouseMove') {
  581. var _0x4bcab2;
  582. this._map.off(_0x210b79, this._onMapMouseMove, this);
  583. if ((_0x4bcab2 = this.options.methods) !== null && _0x4bcab2 !== undefined && _0x4bcab2.mousemove) {
  584. delete this.options.methods.mousemove;
  585. }
  586. }
  587. }
  588. return this;
  589. }
  590. }
  591. mars3d__namespace.LayerUtil.register("mapv", MapVLayer);
  592. mars3d__namespace.layer.MapVLayer = MapVLayer;
  593. mars3d__namespace.mapv = mapv__namespace;
  594. exports.MapVLayer = MapVLayer;
  595. Object.keys(mapv).forEach(function (_0x122543) {
  596. if (_0x122543 !== "default" && !exports.hasOwnProperty(_0x122543)) {
  597. Object.defineProperty(exports, _0x122543, {
  598. 'enumerable': true,
  599. 'get': function () {
  600. return mapv[_0x122543];
  601. }
  602. });
  603. }
  604. });
  605. const _0x3b352c = {
  606. value: true
  607. };
  608. Object.defineProperty(exports, '__esModule', _0x3b352c);
  609. });