We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inmap.getMap().addEventListener("click",function(e){ // alert(e.point.lng + "," + e.point.lat); }); 监听了地图的点击事件,请问依据哪个字段可以判断当前点击的是地图还是动画圆点呢?
The text was updated successfully, but these errors were encountered:
我回头来回答下
Sorry, something went wrong.
我来给个思路,如果要监听圆点的点击事件,可以直接类似这样
event:{ onMouseClick(){} }
如果需要判断用户是点击在圆点以外的地图区域,可以参考下面一段逻辑
let prevClickEvent=null
event:{ onMouseClick(item,event){ prevClickEvent= event } }
inmap.getMap().addEventListener("click",function(e){ if(e===prevClickEvent){ console.log('点击的是上面的 overlay ') } console.log('点击的是上面 overlay 以外的地图区域') });
我这边测试的结果是,两边用的 event 指向同一个对象,所以可以直接这么判断. @ywj1721158614
event
No branches or pull requests
inmap.getMap().addEventListener("click",function(e){
// alert(e.point.lng + "," + e.point.lat);
});
监听了地图的点击事件,请问依据哪个字段可以判断当前点击的是地图还是动画圆点呢?
The text was updated successfully, but these errors were encountered: