LocationPointScene.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. var __extends = (this && this.__extends) || (function () {
  2. var extendStatics = function (d, b) {
  3. extendStatics = Object.setPrototypeOf ||
  4. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  5. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  6. return extendStatics(d, b);
  7. };
  8. return function (d, b) {
  9. extendStatics(d, b);
  10. function __() { this.constructor = d; }
  11. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  12. };
  13. })();
  14. import { mainScene } from "@/assets/graphy";
  15. import { MarkerItem } from './MarkerItem.js';
  16. /**
  17. * 位置标签绘制旗子
  18. *
  19. * @author haojianlong
  20. */
  21. var LocationPointScene = /** @class */ (function (_super) {
  22. __extends(LocationPointScene, _super);
  23. /**
  24. * 构造函数
  25. *
  26. * @param data
  27. */
  28. function LocationPointScene(data) {
  29. return _super.call(this, data) || this;
  30. }
  31. /**
  32. * 将旗子添加到列表中
  33. *
  34. * @param flagList 旗子list
  35. */
  36. LocationPointScene.prototype.addFlagList = function (flagList) {
  37. var _this = this;
  38. if (flagList && flagList.length) {
  39. flagList.map(function (t) {
  40. var flag = new MarkerItem(null, t.id, t.name);
  41. flag.moveTo(t.X, t.Y);
  42. flag.zOrder = 9999999;
  43. flag.connect('click', _this, _this.flagClick);
  44. _this.addItem(flag);
  45. });
  46. }
  47. };
  48. /**
  49. * @param item 点击的旗子item
  50. * @param event 点击的事件
  51. */
  52. LocationPointScene.prototype.flagClick = function (item, event) {
  53. console.log(this.data);
  54. console.log(arguments);
  55. alert(1);
  56. };
  57. return LocationPointScene;
  58. }(mainScene));
  59. export { LocationPointScene };