views:

143

answers:

1

Here are some points: 1) I have some markers on the map and records associated with it on the right panel besides the map. They are connected via numeric id, which is stored as a property of marker. 2) All the markers are stored in an array. 3) When the user zooms in the map, records, associated to only visible markers should be shown on the right panel.

So, how to get the list of all visible markers on the current zoom level? I've searched over the internet and didn't find something useful. Some kind of what I'm trying to achieve could be found here

+3  A: 

Use GMap2.getBounds() to find the bounding box. The use GLatLngBounds.containsLatLng() to check each marker to see if it is visible.

Wai Yip Tung
thank you, it worked. for another seekers of solution, don't forget to pass GMarker.getLatLng()
nefo_x