Commit 4e1e3d53 authored by yaqizhang's avatar yaqizhang

地图标点

parent 5bd418ce
......@@ -14,7 +14,8 @@ export const DEVICE_TYPE = {
REGEULATORBOX: "2",
VALUEWELL: "3",
FLOWMETER: "4",
DUTYPERSON: "5"
DUTYPERSON: "5",
WORKORDER: "6"
};
class gaodeMap {
// 所有线的数组
......@@ -107,8 +108,9 @@ class gaodeMap {
map: map,
offset: new AMap.Pixel(-13, -30)
});
marker.content = this.getMarketContent(data);
this.setMarkerIcon(marker);
if(DEVICE_TYPE.WORKORDER != markerType){
marker.content = this.getMarketContent(data);
marker.on("mouseover", infoOpen);
marker.on("mouseout", infoClose);
marker.setExtData(data);
......@@ -138,6 +140,9 @@ class gaodeMap {
editWindow.form.longitude = e.lnglat.lng;
editWindow.form.latitude = e.lnglat.lat;
});
}
this.markers.push(marker);
map.setZoom("11");
//map.setFitView();
......@@ -207,6 +212,7 @@ class gaodeMap {
dom.remove();
return html;
}
}
/* let html = "<div>" +
......@@ -288,6 +294,14 @@ class gaodeMap {
marker.setIcon(icon);
break;
}
case DEVICE_TYPE.WORKORDER: {
let icon = new AMap.Icon({
//size: new AMap.Size(51, 23),
image: require("../assets/images/zhibaorenyuan.png"),
});
marker.setIcon(icon);
break;
}
}
}
......
......@@ -140,7 +140,7 @@
import { listBasicsInfo, getBasicsInfo, delBasicsInfo, addBasicsInfo, updateBasicsInfo, exportBasicsInfo } from "@/api/workOrder/basicsInfo";
import gaodeMap from "utils/gaodeMap.js"
import {map} from "utils/gaodeMap.js"
import {map, DEVICE_TYPE} from "utils/gaodeMap.js"
export default {
name: "BasicsInfo",
components: {
......@@ -214,6 +214,9 @@ export default {
},
mounted(){
let map = new gaodeMap("平山");
let data = {longitude:"114.208371",latitude:"38.267036"}
map.addMarker(DEVICE_TYPE.WORKORDER,data)
},
methods: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment