Google maps api 3 如果点在地图上可见

Google maps api 3 如果点在地图上可见,google-maps-api-3,Google Maps Api 3,如何知道一个点在我的地图上是否可见 var point=new google.maps.LatLng(parseFloat(lat),parseFloat(lng)); 如果map.getbounds()包含(点).如果按可见,则表示点位于地图的可见区域(视口)内 我以为getBounds不在V3中?!api参考链接现在已失效^^@mtness在这里:)-> // assuming you initialized your map var point = new google.maps.Lat

如何知道一个点在我的地图上是否可见

var point=new google.maps.LatLng(parseFloat(lat),parseFloat(lng));
如果map.getbounds()包含(点).

如果按可见,则表示点位于地图的可见区域(视口)内


我以为getBounds不在V3中?!api参考链接现在已失效^^@mtness在这里:)->
// assuming you initialized your map

var point = new google.maps.LatLng(parseFloat(lat),parseFloat(lng));
var currentBounds = map.getBounds() // get bounds of the map object's viewport

if(currentBounds.contains(point)){
    // your location is inside your map object's viewport
}else{
    // your location is out of the bounds of the map's visible viewport
}