Packagecom.yahoo.maps.api.managers
Classpublic class MarkerManager

This class manages the markers which have been added to the map.



Public Properties
 PropertyDefined by
  markerContainer : Sprite
[read-only] Returns the marker container in which markers are shown on.
MarkerManager
  markers : Array
[read-only] An Array of the markers currently active on the map.
MarkerManager
Public Methods
 MethodDefined by
  
MarkerManager(container:Sprite, map:IYahooMap)
Creates a new MarkerManager object.
MarkerManager
  
addMarker(marker:Marker):void
Adds a marker to the markerContainer, placed on the map based on its latlon or address property.
MarkerManager
  
destroy():void
Prepares this object for garbage-collection.
MarkerManager
  
Returns a BoundingBox object that contains all the markers currently active in the manager.
MarkerManager
  
getMarkersById(groupId:String):Array
Returns an array of markers whose groupId property match the provided groupId search string.
MarkerManager
  
Returns an array of markers currently added to the stage.
MarkerManager
  
Returns an array of markers that are visible on the stage.
MarkerManager
  
refresh():void
Refreshes the position of all markers based on its stored latitude and longitude.
MarkerManager
  
Removes all markers from the markerContainer and the manager, and prepares the marker for garbage collection.
MarkerManager
  
removeMarker(marker:Marker):void
Removes a marker from the map and the manager.
MarkerManager
  
resetPosition(marker:Marker):void
Resets the position of the marker on the map based on its stored latitude and longitude, then sets the visibility of the marker based on its minZoom and maxZoom properties.
MarkerManager
Property detail
markerContainerproperty
markerContainer:Sprite  [read-only]

Returns the marker container in which markers are shown on.

Implementation
    public function get markerContainer():Sprite
markersproperty 
markers:Array  [read-only]

An Array of the markers currently active on the map.

Implementation
    public function get markers():Array
Constructor detail
MarkerManager()constructor
public function MarkerManager(container:Sprite, map:IYahooMap)

Creates a new MarkerManager object.

Parameters
container:Sprite
 
map:IYahooMap
Method detail
addMarker()method
public function addMarker(marker:Marker):void

Adds a marker to the markerContainer, placed on the map based on its latlon or address property. The location in which the marker is placed is based on priority, if a latlon value exists, the marker will use that over an address. If no latlon or address is present, an error will be thrown.

Parameters
marker:Marker
destroy()method 
public function destroy():void

Prepares this object for garbage-collection.

getMarkerBounds()method 
public function getMarkerBounds():BoundingBox

Returns a BoundingBox object that contains all the markers currently active in the manager.

Returns
BoundingBox
getMarkersById()method 
public function getMarkersById(groupId:String):Array

Returns an array of markers whose groupId property match the provided groupId search string.

Parameters
groupId:String

Returns
Array
getMarkersOnStage()method 
public function getMarkersOnStage():Array

Returns an array of markers currently added to the stage.

Returns
Array
getVisibleMarkers()method 
public function getVisibleMarkers():Array

Returns an array of markers that are visible on the stage.

Returns
Array
refresh()method 
public function refresh():void

Refreshes the position of all markers based on its stored latitude and longitude.

removeAllMarkers()method 
public function removeAllMarkers():void

Removes all markers from the markerContainer and the manager, and prepares the marker for garbage collection.

removeMarker()method 
public function removeMarker(marker:Marker):void

Removes a marker from the map and the manager.

Parameters
marker:Marker
resetPosition()method 
public function resetPosition(marker:Marker):void

Resets the position of the marker on the map based on its stored latitude and longitude, then sets the visibility of the marker based on its minZoom and maxZoom properties.

Parameters
marker:Marker