示例图:
我要鼠标移到div的时候不能对地图进行操作:
// 把以下内容 写在地图加载完后 页面渲染完后的方法里
let _this = this
let leftResultDiv = document.getElementById('leftResult'); //获取div的dom
setTimeout(() => {
leftResultDiv.onmouseover = function () { //监听鼠标移入
_this.map.dragging.disable(); //地图拖拽
_this.map.doubleClickZoom.disable(); //禁止双击放大地图
_this.map.scrollWheelZoom.disable(); //禁止鼠标滑轮滚动放大缩小地图
}
});
setTimeout(() => {
leftResultDiv.onmouseout = function () {
_this.map.dragging.enable(); //enable 开启
_this.map.doubleClickZoom.enable()
_this.map.scrollWheelZoom.enable();
}
});