园林绿化
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.

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