http://www.google.com/apis/maps/documentation/
This class is used to manage visibility of hundreds of markers on a map, based on the map's current viewport and zoom level.
Constructor | Description |
---|---|
GMarkerManager(map, opts?) | Creates a new marker manager that controlls visibility of markers for the specified map. (Since 2.67) |
Methods | Return Value | Description |
---|---|---|
addMarkers(markers, minZoom, maxZoom?) | none | Adds a batch of markers to this marker manager. The markers are not added to the map, until the refresh() method is called. Once placed on a map, the markers are shown if they fall within the map's current viewport and the map's zoom level is greater than or equal to the specified minZoom. If the maxZoom was given, the markers are automatically removed if the map's zoom is greater than the one specified. (Since 2.67) |
addMarker(marker, minZoom, maxZoom?) | none | Adds a single marker to a collection of markers controlled by this manager. If the marker's location falls within the map's current viewport and the map's zoom level is within the specified zoom level rage, the marker is immediately added to the map. Similar to the addMarkers method, the minZoom and the optional maxZoom parameters specify the range of zoom levels at which the marker is shown. (Since 2.67) |
refresh() | none | Forces the manager to update markers shown on the map. This method must be called if markers were added using the addMarkers method. (Since 2.67) |
getMarkerCount(zoom) | Number | Returns the total number of markers potentially visible at the given zoom level. This may include markers at lower zoom levels. (Since 2.67) |
Events | Arguments | Description |
---|---|---|
changed | bounds, markerCount | This event is fired when markers managed by a manager have been added to or removed from the map. The event handler function should be prepared to accept two arguments. The fist one is the rectangle definining the bounds of the visible grid. The second one carries the number of markers currently shown on the map. |