Packagecom.afcomponents.umap.display.markermanager
Classpublic class MarkerManager
InheritanceMarkerManager Inheritance Manager Inheritance MapObjectContainer Inheritance MapObject Inheritance flash.display.Sprite

MarkerManager is a manager used for groups markers on the map.


Example
Here is an example of creating MarkerManager on the map:
 import com.afcomponents.umap.core.UMap;
 import com.afcomponents.umap.styles.MarkerStyle;
 import com.afcomponents.umap.styles.GeometryStyle;
 import com.afcomponents.umap.display.markermanager.MarkerManager;
 import com.afcomponents.umap.overlays.Marker;
 import com.afcomponents.umap.types.LatLng;
 import com.afcomponents.umap.types.LatLngBounds;
  
 // create new UMap object
 var map:UMap = new UMap();
 map.setSize(550, 400);
 this.addChild(map);
  
 // create new MarkerStyle
 var style:MarkerStyle = new MarkerStyle();
 style.fill = GeometryStyle.RGB;
 style.fillAlpha = 0.9;
 style.strokeRGB = 0x0;
 style.strokeAlpha = 1.0;
  
 // create new MarkerManager
 var markerManager:MarkerManager = new MarkerManager();
 markerManager.expandedGroupRadius = 30;
 markerManager.groupRadius = 50;
 markerManager.markerActualSize = 5;
 markerManager.markerZoomScale = 0.8;
 markerManager.openGroupAction = MarkerManager.OPEN_CLICK;
 
 var pos:LatLng;
 var bounds:LatLngBounds = map.getBoundsLatLng();
 var marker:Marker;
  
 // create 25 random Markers
 for (var i:uint = 0; i < 25; i++)
 {
  style.fillRGB = Math.random() * 0xFFFFFF;
  pos = new LatLng(bounds.southWest.lat + Math.random() * bounds.height, bounds.southWest.lng + Math.random() * bounds.width);
  marker = new Marker();
  marker.index = String.fromCharCode(65 + i);
  marker.position = pos;
  marker.setStyle(style);
  map.addOverlay(marker);
 }
 
 // add MarkerManager to map
 map.addManager(manrekManager);
 

Here is what you should see after executing the code:

MarkerManager example

See also

com.afcomponents.umap.styles.MarkerStyle
com.afcomponents.umap.overlays.Marker


Public Properties
 PropertyDefined by
  animation : Boolean
MarkerManager
 InheritedasDisplayObject : DisplayObject
Returns reference to the object as a DisplayObject instance.
MapObject
  autoClose : Boolean
Gets or sets the autoClose flag, which indicates
MarkerManager
 Inheritedcore : UMap
Returns reference to the core UMap object.
MapObject
  defaultGroupStyle : Boolean
MarkerManager
  expandedGroupMarkerCount : Number
MarkerManager
  expandedGroupPattern : String
MarkerManager
  expandedGroupRadius : Number
MarkerManager
  fading : Boolean
Gets or sets the fading flag, which indicates
MarkerManager
  fadingStrength : Number
MarkerManager
  groupRadius : Number
MarkerManager
 Inheritedid : uint
Gets or sets the ID of the object.
MapObject
  manageAllLayers : Boolean
MarkerManager
  markerActualSize : Number
MarkerManager
  markerZoomScale : Number
MarkerManager
 Inheritedname : String
Gets or sets the name of the object.
MapObject
  openGroupAction : String
MarkerManager
  optimization : String
MarkerManager
 Inheritedowner : IMapObjectContainer
Returns reference to the owner container object.
MapObject
  scaleBaloon : Boolean
Gets or sets the scaleBaloon flag, which indicates
MarkerManager
Public Methods
 MethodDefined by
  
MarkerManager(param:Object = null, groupStyle:Object = null)
MarkerManager constructor.
MarkerManager
  
addLayer(layer:Layer, groupStyle:Object = null):Boolean
MarkerManager
 Inherited
addObject(object:IMapObject):void
Adds new IMapObject to the container.
MapObjectContainer
 Inherited
bringForward(object:IMapObject):void
Moves the attached IMapObject forward in the display list.
MapObjectContainer
 Inherited
bringToFront(object:IMapObject):void
Brings the attached IMapObject to the top of the display list.
MapObjectContainer
 Inherited
clearObjects(filter:Class = null):void
Removes all attached objects.
MapObjectContainer
  
closeGroup():Boolean
MarkerManager
  
dispose():void
Releases all the resources accuired by the object.
MarkerManager
  
getGroupIndex(marker:Marker):int
Find an index of a group which contains specified marker.
MarkerManager
  
getGroupMarkers(index:int, layer:Layer = null):Array
MarkerManager
  
getGroupStyle(index:int, layer:Layer = null):Object
MarkerManager
  
getLayerStyle(layer:Layer):Object
MarkerManager
 Inherited
getObject(id_or_name:*, filter:Class = null):IMapObject
Searches for an object with specified id or name.
MapObjectContainer
 Inherited
getObjectById(id:uint, filter:Class = null):IMapObject
Searches for an object with specified id.
MapObjectContainer
 Inherited
getObjectByName(name:String, matchCase:Boolean = false, filter:Class = null):IMapObject
Searches for an object with specified name.
MapObjectContainer
 Inherited
getObjects(filter:Class = null):Array
Returns an array of IMapObjects that where added to the container.
MapObjectContainer
  
getStyle():Object
MarkerManager
  
groupCountByIndex(index:int, layer:Layer = null):int
MarkerManager
  
init():void
MarkerManager
 Inherited
isOwnerVisible():Boolean
Recursevly checks visibility of parent objects
MapObjectContainer
  
openGroup(marker:Marker):Boolean
open group by marker
MarkerManager
  
openGroupByIndex(index:int, layer:Layer = null):Boolean
MarkerManager
  
openInfoWindow(marker:Marker):Boolean
MarkerManager
 Inherited
ready():void
Manager
 Inherited
remove():void
Removes the object from the owner container object.
MapObject
  
removeLayer(layer:Layer):Boolean
MarkerManager
 Inherited
removeObject(object:IMapObject):void
Removes IMapObject from the container.
MapObjectContainer
 Inherited
sendBackward(object:IMapObject):void
Sends the attached IMapObject backward in the display list.
MapObjectContainer
 Inherited
sendToBack(object:IMapObject):void
Sends the attached IMapObject to the bottom of the display list.
MapObjectContainer
  
setGroupStyle(index:int, layer:Layer = null):Boolean
MarkerManager
  
setLayerStyle(layer:Layer, style:Object):void
MarkerManager
 Inherited
Adds the object to the specified IMapObjectContainer.
MapObjectContainer
  
setStyle(style:Object):void
MarkerManager
 Inherited
toString():String
Returns a textual representation of the object.
MapObject
 Inherited
updateComponentProperty(property:String, value:*):void
Manager
 Inherited
updateMapType(mapType:IMapType):void
Manager
 Inherited
updatePosition(latlng:LatLng):void
Manager
 Inherited
updateSize(width:Number, height:Number):void
Manager
 Inherited
updateZoom(zoom:Number):void
Manager
Events
 EventSummaryDefined by
   Dispatched when the group marker has been clicked.MarkerManager
   Dispatched when the marker group has been closed.MarkerManager
   Dispatched when the marker group has been created.MarkerManager
   Dispatched when the marker group has been destroyed.MarkerManager
   Dispatched when the group marker has been double clicked.MarkerManager
   Diispatched when the error has been occurred.MarkerManager
   Dispatched when user rolls out the group marker.MarkerManager
   Dispatched when user rolls over the group marker.MarkerManager
   Dispatched when the marker group has been opened.MarkerManager
Public Constants
 ConstantDefined by
  OPEN_CLICK : String = "openClick"
[static]
MarkerManager
  OPEN_NONE : String = "openNone"
[static]
MarkerManager
  OPTIMIZE_SPEED : String = "optimizeSpeed"
[static]
MarkerManager
  OPTIMIZE_VIEW : String = "optimizeView"
[static]
MarkerManager
Property detail
animationproperty
animation:Boolean  [read-write]

Implementation
    public function get animation():Boolean
    public function set animation(value:Boolean):void
autoCloseproperty 
autoClose:Boolean  [read-write]

Gets or sets the autoClose flag, which indicates

Implementation
    public function get autoClose():Boolean
    public function set autoClose(value:Boolean):void
defaultGroupStyleproperty 
defaultGroupStyle:Boolean  [read-write]

Implementation
    public function get defaultGroupStyle():Boolean
    public function set defaultGroupStyle(value:Boolean):void
expandedGroupMarkerCountproperty 
expandedGroupMarkerCount:Number  [read-write]

Implementation
    public function get expandedGroupMarkerCount():Number
    public function set expandedGroupMarkerCount(value:Number):void
expandedGroupPatternproperty 
expandedGroupPattern:String  [read-write]

Implementation
    public function get expandedGroupPattern():String
    public function set expandedGroupPattern(value:String):void
expandedGroupRadiusproperty 
expandedGroupRadius:Number  [read-write]

Implementation
    public function get expandedGroupRadius():Number
    public function set expandedGroupRadius(value:Number):void
fadingproperty 
fading:Boolean  [read-write]

Gets or sets the fading flag, which indicates

Implementation
    public function get fading():Boolean
    public function set fading(value:Boolean):void
fadingStrengthproperty 
fadingStrength:Number  [read-write]

Implementation
    public function get fadingStrength():Number
    public function set fadingStrength(value:Number):void
groupRadiusproperty 
groupRadius:Number  [read-write]

Implementation
    public function get groupRadius():Number
    public function set groupRadius(value:Number):void
manageAllLayersproperty 
manageAllLayers:Boolean  [read-write]

Implementation
    public function get manageAllLayers():Boolean
    public function set manageAllLayers(value:Boolean):void
markerActualSizeproperty 
markerActualSize:Number  [read-write]

Implementation
    public function get markerActualSize():Number
    public function set markerActualSize(value:Number):void
markerZoomScaleproperty 
markerZoomScale:Number  [read-write]

Implementation
    public function get markerZoomScale():Number
    public function set markerZoomScale(value:Number):void
openGroupActionproperty 
openGroupAction:String  [read-write]

Implementation
    public function get openGroupAction():String
    public function set openGroupAction(value:String):void
optimizationproperty 
optimization:String  [read-write]

Implementation
    public function get optimization():String
    public function set optimization(value:String):void
scaleBaloonproperty 
scaleBaloon:Boolean  [read-write]

Gets or sets the scaleBaloon flag, which indicates

Implementation
    public function get scaleBaloon():Boolean
    public function set scaleBaloon(value:Boolean):void
Constructor detail
MarkerManager()constructor
public function MarkerManager(param:Object = null, groupStyle:Object = null)

MarkerManager constructor.

Creates new MarkerManager object with the default parameters. Properties defined in param object will override the default values.

Here is a list of properties you can specify in the param object:

PropertyTypeDefaultDescription
name String markerManager Specifies markerManager's name.
groupRadius Number 30
expandedGroupRadius Number 30
expandedGroupPattern String ExpandedGroupPattern.SPIRAL
animation Boolean true A flag, that specifies whether
autoClose Boolean true A flag, that specifies whether
fading Boolean true A flag, that specifies whether
fadingStrength Number 0.5
scaleBaloon Boolean false A flag, that specifies whether
markerZoomScale Number 0.5
markerActualSize Number 3


Parameters
param:Object (default = null) — Object that holds all the properites of a markerManager you wish to override upon its creation.
 
groupStyle:Object (default = null)
Method detail
addLayer()method
public function addLayer(layer:Layer, groupStyle:Object = null):Boolean

Parameters
layer:Layer
 
groupStyle:Object (default = null)

Returns
Boolean
closeGroup()method 
public function closeGroup():Boolean

Returns
Boolean
dispose()method 
public override function dispose():void

Releases all the resources accuired by the object.

getGroupIndex()method 
public function getGroupIndex(marker:Marker):int

Find an index of a group which contains specified marker.

Parameters
marker:Marker — - target Marker.

Returns
int — index of group which contains a marker, -2 - if the marker wasn't found, -1 - if the marker isn't group(single).
getGroupMarkers()method 
public function getGroupMarkers(index:int, layer:Layer = null):Array

Parameters
index:int — - index of a group on a layer
 
layer:Layer (default = null) — - Layer which contains a group, if omitted the default layer will be used.

Returns
Array — array of markers which are contained in the group, null if the group with this index on the target layer wasn't found
getGroupStyle()method 
public function getGroupStyle(index:int, layer:Layer = null):Object

Parameters
index:int
 
layer:Layer (default = null)

Returns
Object
getLayerStyle()method 
public function getLayerStyle(layer:Layer):Object

Parameters
layer:Layer

Returns
Object
getStyle()method 
public function getStyle():Object

Returns
Object
groupCountByIndex()method 
public function groupCountByIndex(index:int, layer:Layer = null):int

Parameters
index:int
 
layer:Layer (default = null)

Returns
int
init()method 
public override function init():void

openGroup()method 
public function openGroup(marker:Marker):Boolean

open group by marker

Parameters
marker:Marker

Returns
Boolean — true if marker is a member of group, false it is single.
openGroupByIndex()method 
public function openGroupByIndex(index:int, layer:Layer = null):Boolean

Parameters
index:int
 
layer:Layer (default = null)

Returns
Boolean
openInfoWindow()method 
public function openInfoWindow(marker:Marker):Boolean

Parameters
marker:Marker

Returns
Boolean
removeLayer()method 
public function removeLayer(layer:Layer):Boolean

Parameters
layer:Layer

Returns
Boolean
setGroupStyle()method 
public function setGroupStyle(index:int, layer:Layer = null):Boolean

Parameters
index:int
 
layer:Layer (default = null)

Returns
Boolean
setLayerStyle()method 
public function setLayerStyle(layer:Layer, style:Object):void

Parameters
layer:Layer
 
style:Object
setStyle()method 
public function setStyle(style:Object):void

Parameters
style:Object
Event detail
groupClickevent 
Event object type: com.afcomponents.umap.events.GroupEvent
GroupEvent.type property = com.afcomponents.umap.events.GroupEvent.GROUP_CLICK

Dispatched when the group marker has been clicked.

The GroupEvent.GROUP_CLICK constant defines the value of the type property of an groupClick event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
markerGroupThe MarkerGroup instance over which click event occured.
indexThe index of MarkerGroup
groupCloseevent  
Event object type: com.afcomponents.umap.events.GroupEvent
GroupEvent.type property = com.afcomponents.umap.events.GroupEvent.GROUP_CLOSE

Dispatched when the marker group has been closed.

The GroupEvent.GROUP_CLOSE constant defines the value of the type property of an groupClose event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
markerGroupThe MarkerGroup instance over which close event occured.
indexThe index of MarkerGroup
groupCreateevent  
Event object type: com.afcomponents.umap.events.GroupEvent
GroupEvent.type property = com.afcomponents.umap.events.GroupEvent.GROUP_CREATE

Dispatched when the marker group has been created.

The GroupEvent.GROUP_CREATE constant defines the value of the type property of an groupCreate event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
markerGroupThe MarkerGroup instance over which create event occured.
indexThe index of MarkerGroup
groupDestroyevent  
Event object type: com.afcomponents.umap.events.GroupEvent
GroupEvent.type property = com.afcomponents.umap.events.GroupEvent.GROUP_DESTROY

Dispatched when the marker group has been destroyed.

The GroupEvent.GROUP_DESTROY constant defines the value of the type property of an groupDestroy event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
markerGroupThe MarkerGroup instance over which destroy event occured.
indexThe index of MarkerGroup
groupDoubleClickevent  
Event object type: com.afcomponents.umap.events.GroupEvent
GroupEvent.type property = com.afcomponents.umap.events.GroupEvent.GROUP_DOUBLE_CLICK

Dispatched when the group marker has been double clicked.

The GroupEvent.GROUP_DOUBLE_CLICK constant defines the value of the type property of an groupDoubleClick event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
markerGroupThe MarkerGroup instance over which double click event occured.
indexThe index of MarkerGroup
groupErrorevent  
Event object type: com.afcomponents.umap.events.GroupEvent
GroupEvent.type property = com.afcomponents.umap.events.GroupEvent.GROUP_ERROR

Diispatched when the error has been occurred.

The GroupEvent.GROUP_ERROR constant defines the value of the type property of an groupError event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
markerGroupThe MarkerGroup instance over which error event occured.
indexThe index of MarkerGroup
groupIconOutevent  
Event object type: com.afcomponents.umap.events.GroupEvent
GroupEvent.type property = com.afcomponents.umap.events.GroupEvent.GROUP_ICON_OUT

Dispatched when user rolls out the group marker.

The GroupEvent.GROUP_ICON_OUT constant defines the value of the type property of an groupIconOut event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTarget The object that is actively processing the OverlayEvent object with an event listener.
markerGroupThe MarkerGroup instance over which roll out event occured.
indexThe index of MarkerGroup
groupIconOverevent  
Event object type: com.afcomponents.umap.events.GroupEvent
GroupEvent.type property = com.afcomponents.umap.events.GroupEvent.GROUP_ICON_OVER

Dispatched when user rolls over the group marker.

The GroupEvent.GROUP_ICON_OVER constant defines the value of the type property of an groupIconOver event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
markerGroupThe MarkerGroup instance over which roll over event occured.
indexThe index of MarkerGroup
groupOpenevent  
Event object type: com.afcomponents.umap.events.GroupEvent
GroupEvent.type property = com.afcomponents.umap.events.GroupEvent.GROUP_OPEN

Dispatched when the marker group has been opened.

The GroupEvent.GROUP_OPEN constant defines the value of the type property of an groupOpen event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
markerGroupThe MarkerGroup instance over which open event occured.
indexThe index of MarkerGroup
Constant detail
OPEN_CLICKconstant
public static const OPEN_CLICK:String = "openClick"

OPEN_NONEconstant 
public static const OPEN_NONE:String = "openNone"

OPTIMIZE_SPEEDconstant 
public static const OPTIMIZE_SPEED:String = "optimizeSpeed"

OPTIMIZE_VIEWconstant 
public static const OPTIMIZE_VIEW:String = "optimizeView"