import { mainScene } from "@/assets/graphy";
import { MarkerItem } from './MarkerItem.js'
import { SGraphyScene, SMouseEvent } from "@sybotan-web/graphy";
import { dataItemPath, dataItem, dataSpaceItem, dataInterface, PolygonItemInterface, ImgItemInterface } from '@/assets/graphy/SGraphy/dataType.js'   //传入参数的参数接口类型

/**
 * 位置标签绘制旗子
 * 
 * @author haojianlong
 */
export class LocationPointScene extends mainScene {
  /** 
   * 构造函数 
   * 
   * @param data
   */
  constructor(data: dataInterface | null) {
    super(data)
  }

  /**
   * 将旗子添加到列表中
   * 
   * @param flagList 旗子list
   */
  addFlagList(flagList: ImgItemInterface[]): void {
    if (flagList && flagList.length) {
      flagList.map(t => {
        let flag = new MarkerItem(null, t.id, t.name);
        flag.moveTo(t.X, t.Y);
        flag.zOrder = 9999999;
        flag.connect('click', this, this.flagClick)
        this.addItem(flag);
      })
    }
  }

  /**
   * @param item  点击的旗子item
   * @param event 点击的事件
   */
  flagClick(item: MarkerItem, event: SMouseEvent) {
    console.log(this.data)
    console.log(arguments)
    alert(1)
  }


}