import config from "@/api/config.js"; import * as KMap from "@/utils/ol-map/KMap"; import * as util from "@/common/ol_common.js"; import Point from "ol/geom/Point.js"; import Feature from "ol/Feature"; import VectorLayer from "ol/layer/Vector.js"; import WKT from "ol/format/WKT.js"; import ScaleLine from "ol/control/ScaleLine"; import { useRouter } from "vue-router"; import eventBus from "@/api/eventBus"; /** * @description 地图层对象 */ class HomeMap { constructor() { let that = this; let vectorStyle = new KMap.VectorStyle(); this.vectorStyle = vectorStyle; } initMap(location, target) { let level = 19.2; let coordinate = util.wktCastGeom(location).getFirstCoordinate(); this.kmap = new KMap.Map(target, level, coordinate[0], coordinate[1], null, 6, 22); eventBus.emit('homeMap:init', this.kmap); } } export default HomeMap;