Commit 94125b79 by 张杰

增加搜索点右键设置圆心功能

1 parent 78f8633c
...@@ -163,12 +163,13 @@ export default { ...@@ -163,12 +163,13 @@ export default {
self.autoCenterMarker.on("rightclick", (e) => { self.autoCenterMarker.on("rightclick", (e) => {
if (self.mapObj.getAllOverlays("circle").length) { if (self.mapObj.getAllOverlays("circle").length) {
window.mapMenu.contextMenu.open(self.mapObj, e.lnglat); self.contextMenu.open(self.mapObj, e.lnglat);
self.contextMenuPositon = e.lnglat; //右键菜单位置 self.contextMenuPositon = e.lnglat; //右键菜单位置
} }
}); });
AMap.event.addListener(self.auto, "select", (e) => { AMap.event.addListener(self.auto, "select", (e) => {
console.log(e.poi)
if (e.poi && e.poi.location) { if (e.poi && e.poi.location) {
self.mapObj.setCenter(e.poi.location); self.mapObj.setCenter(e.poi.location);
self.autoCenterMarker.setPosition(e.poi.location); self.autoCenterMarker.setPosition(e.poi.location);
...@@ -198,7 +199,7 @@ export default { ...@@ -198,7 +199,7 @@ export default {
contextMenu.open(self.mapObj, e.lnglat); contextMenu.open(self.mapObj, e.lnglat);
self.contextMenuPositon = e.lnglat; self.contextMenuPositon = e.lnglat;
}); });
self.contextMenu = contextMenu
//contextMenu.open(self.mapObj, lnglat); //contextMenu.open(self.mapObj, lnglat);
}, },
drawFence() { drawFence() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!