I check like this:
enter code here
var point = new g.LatLng(parseFloat(lat),parseFloat(lng));
var bounds = map.getBounds();
if (bounds.contains(point))
{
the point is in the viewport
}
But when I change the zoom level, thefore the coordinates of the viewport, the “invisible” point is NOT detected as “visible”, I mean in the viewport.
Point is not a marker !
I wrote a hack that might work in your scenario. As far as I tested, it works when there’s not a lot of the world repeated. I know this hack is unreliable if the world is displayed twice or more. So if you can set the map’s minZoom, you would prevent such cases.
The idea is to divide the map in a left and right half, and check whether the marker is in either half.
Here’s the hack, use carefully
http://jsfiddle.net/QeR2D/3/