I want to check if marker is on mapview or out of the map.
I am putting marker of the map and not able to check if it on currentView or not. I have tried below code.
this.map.getBounds().contains(e.layer.getLatLng());
but it is returning me true.
map is returning its old lat lng i.e bounds (I think so)
map.getBounds().contains(myMarker.getLatLng())
map.getBounds():返回当前地图视图的 LatLngBounds。
latLngBounds.contains():退货true
如果矩形包含给定点。
myMarker.getLatLng():返回标记的当前地理位置。
也可以看看:使用传单从地图角度估计面积
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)