Commit db28bd7d authored by 纪泽龙's avatar 纪泽龙

Merge branch 'develop_jzl'

parents 54e22055 5d8b5187
......@@ -221,7 +221,7 @@ class gaodeMap {
const ind = that.markers.indexOf(marker);
if (ind >= 0) {
that.markers.splice(ind, 1);
console.log(that.markers)
console.log(that.markers);
}
}
});
......@@ -968,5 +968,51 @@ class gaodeMap {
this.mouseTool.close();
map.remove(this.markerOverlays);
}
// 只上图没功能
onlyLine(obj) {
const { coordinates, pipeName } = obj;
let polyline = new AMap.Polyline({
path: eval(coordinates),
strokeColor: "#80d8ff",
strokeWeight: 4,
strokeOpacity: 0.9,
zIndex: 50,
bubble: true,
geodesic: true,
extData: {
type: "line",
//当前line状态 0:正常状态 1:正在编辑状态
isState: 0,
lineData: obj
}
});
let infoWindow = new AMap.InfoWindow({
isCustom:true,
content: `<span style='border:1px solid #80d8ff;background:#fff'>${pipeName}</span>`,
anchor: "left-top",
offset: new AMap.Pixel(20, -20),
});
polyline.on("mouseover", e => {
const options = polyline.getOptions();
options.strokeColor = "#FF5A67";
polyline.setOptions(options);
infoWindow.open(map, e.lnglat);
});
polyline.on("mouseout", e => {
const options = polyline.getOptions();
options.strokeColor = "#80d8ff";
polyline.setOptions(options);
infoWindow.close();
});
map.add(polyline);
const path = eval(coordinates)[0];
// map.setFitView();
map.setCenter([+path[0],+path[1]], false)
// const lntlat = eval(coordinates)[0];
// map.panTo(lntlat)
// 信息窗体
}
}
export default gaodeMap;
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