import * as KMap from '@/utils/ol-map/KMap.js'
import * as util from '@/common/ol_common.js'
import config from '@/api/config.js'
/**
 * @description 地图层对象
 */
class IndexMap {
  constructor() {
    let that = this;
    let vectorStyle = new KMap.VectorStyle();
    this.vectorStyle = vectorStyle;
  }

  initMap(location, target) {
    let level = 18;
    let coordinate = util.wktCastGeom(location).getFirstCoordinate();
    this.kmap = new KMap.Map(target, level, coordinate[0], coordinate[1], null, 12, 22);
    let xyz = config.base_img_url + "map/lby/{z}/{x}/{y}.png";
    this.mapLayer = this.kmap.addXYZLayer(xyz, { minZoom: 14.6, maxZoom: 22, name: "ol-map-clearness" }, 2);
  }
}

export default IndexMap;
