import store from '@/util/store'

class MapUtil {
  /**
   * 选择船舶
   */
  public chooseShip (data: any,isArea?: boolean) {
    const shipFun: any = store.getMapFun()
    let shipmes = data
    let lon = shipmes.n / 600000
    let lat = shipmes.a / 600000
    if (isArea) {
      shipFun.showShips(shipmes.i)
    } else {
      shipFun.addShip([data], 2, data.map)
    }
    shipFun.setCenter([lon, lat])
    shipFun.addSelectByCoor([lon, lat])
  }
}

export default new MapUtil()
