Google Maps API 3 - Check if marker is in view

I see that there is a getVisible call, but that only checks if the marker is on the map NOT if the marker is in the current view.

I want to check if the marker is in the current view bounds?

Answers


I guess you want

map.getBounds().contains(marker.getPosition())

You need to tell map that your markers should be contained within view by adding following code

google.maps.event.addListener(map, 'bounds_changed', function() {
    map.getBounds().contains(marker.getPosition()) 
});

Here bound_changed event is triggered.


Need Your Help

Send keys through SendInput in user32.dll

c# sendkeys user32 sendinput

I am using this board as a keyboard for demo purposes.

Building a scala app with maven (that has java source mixed in)

java maven-2 scala

I have an application where I would like to have mixed Java and Scala source (actually its migrating a java app to scala - but a bit at a time).