Hi.

First thing you need to do is keep a reference to each marker that you
have added to your map.
A simple array of markers is perfect, let's call it 'myMarkers'.

Now add an event listener to your map, listen for the 'moveend' event:

GEvent.addListener(myMap, 'moveend', function(){
 // the map bounds have changed
 // get the map bounds
 var bounds=myMap.getBounds();
 // loop thru all of your markers finding which ones are within the
maps bounds
 var i=myMarkers.length;
 while(i--){
  if(bounds.containsLatLng(myMarkers[i].getLatLng())){
   // show the list item for this marker
  } else {
   // hide the list item for this marker
  }
 }
});

http://code.google.com/apis/maps/documentation/javascript/v2/reference.html#GLatLngBounds

http://code.google.com/apis/maps/documentation/javascript/v2/reference.html#GMarker

Martin.


On Jun 17, 8:12 am, FandaR <[email protected]> wrote:
> Hello,
> How can I retrieve a list of markers on the actual map window? If
> someone moves or zooms the map, it should refresh the list with the
> markers that are currently on the screen.
>
> Thank You

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API V2" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.

Reply via email to