| Package | com.afcomponents.umap.display.markermanager |
| Class | public class MarkerManager |
| Inheritance | MarkerManager Manager MapObjectContainer MapObject flash.display.Sprite |
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:
See also
| Property | Defined by | ||
|---|---|---|---|
| animation : Boolean | MarkerManager | ||
![]() | asDisplayObject : DisplayObject
Returns reference to the object as a DisplayObject instance.
| MapObject | |
| autoClose : Boolean
Gets or sets the autoClose flag, which indicates
| MarkerManager | ||
![]() | core : 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 | ||
![]() | id : uint
Gets or sets the ID of the object.
| MapObject | |
| manageAllLayers : Boolean | MarkerManager | ||
| markerActualSize : Number | MarkerManager | ||
| markerZoomScale : Number | MarkerManager | ||
![]() | name : String
Gets or sets the name of the object.
| MapObject | |
| openGroupAction : String | MarkerManager | ||
| optimization : String | MarkerManager | ||
![]() | owner : IMapObjectContainer
Returns reference to the owner container object.
| MapObject | |
| scaleBaloon : Boolean
Gets or sets the scaleBaloon flag, which indicates
| MarkerManager | ||
| Method | Defined by | ||
|---|---|---|---|
|
MarkerManager(param:Object = null, groupStyle:Object = null)
MarkerManager constructor.
| MarkerManager | ||
|
| MarkerManager | ||
![]() |
addObject(object:IMapObject):void
Adds new IMapObject to the container.
| MapObjectContainer | |
![]() |
bringForward(object:IMapObject):void
Moves the attached IMapObject forward in the display list.
| MapObjectContainer | |
![]() |
bringToFront(object:IMapObject):void
Brings the attached IMapObject to the top of the display list.
| MapObjectContainer | |
![]() |
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 | ||
![]() |
getObject(id_or_name:*, filter:Class = null):IMapObject
Searches for an object with specified id or name.
| MapObjectContainer | |
![]() |
getObjectById(id:uint, filter:Class = null):IMapObject
Searches for an object with specified id.
| MapObjectContainer | |
![]() |
getObjectByName(name:String, matchCase:Boolean = false, filter:Class = null):IMapObject
Searches for an object with specified name.
| MapObjectContainer | |
![]() |
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 | ||
![]() |
isOwnerVisible():Boolean
Recursevly checks visibility of parent objects
| MapObjectContainer | |
|
open group by marker
| MarkerManager | ||
|
openGroupByIndex(index:int, layer:Layer = null):Boolean
| MarkerManager | ||
|
openInfoWindow(marker:Marker):Boolean
| MarkerManager | ||
![]() |
ready():void
| Manager | |
![]() |
remove():void
Removes the object from the owner container object.
| MapObject | |
|
removeLayer(layer:Layer):Boolean
| MarkerManager | ||
![]() |
removeObject(object:IMapObject):void
Removes IMapObject from the container.
| MapObjectContainer | |
![]() |
sendBackward(object:IMapObject):void
Sends the attached IMapObject backward in the display list.
| MapObjectContainer | |
![]() |
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 | ||
![]() |
setOwner(owner:IMapObjectContainer):void
Adds the object to the specified IMapObjectContainer.
| MapObjectContainer | |
|
setStyle(style:Object):void
| MarkerManager | ||
![]() |
toString():String
Returns a textual representation of the object.
| MapObject | |
![]() |
updateComponentProperty(property:String, value:*):void
| Manager | |
![]() |
updateMapType(mapType:IMapType):void
| Manager | |
![]() |
updatePosition(latlng:LatLng):void
| Manager | |
![]() |
updateSize(width:Number, height:Number):void
| Manager | |
![]() |
updateZoom(zoom:Number):void
| Manager | |
| Event | Summary | Defined 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 | |||
| Constant | Defined 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 | ||
| animation | property |
animation:Boolean [read-write]Implementation
public function get animation():Boolean
public function set animation(value:Boolean):void
| autoClose | property |
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
| defaultGroupStyle | property |
defaultGroupStyle:Boolean [read-write]Implementation
public function get defaultGroupStyle():Boolean
public function set defaultGroupStyle(value:Boolean):void
| expandedGroupMarkerCount | property |
expandedGroupMarkerCount:Number [read-write]Implementation
public function get expandedGroupMarkerCount():Number
public function set expandedGroupMarkerCount(value:Number):void
| expandedGroupPattern | property |
expandedGroupPattern:String [read-write]Implementation
public function get expandedGroupPattern():String
public function set expandedGroupPattern(value:String):void
| expandedGroupRadius | property |
expandedGroupRadius:Number [read-write]Implementation
public function get expandedGroupRadius():Number
public function set expandedGroupRadius(value:Number):void
| fading | property |
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
| fadingStrength | property |
fadingStrength:Number [read-write]Implementation
public function get fadingStrength():Number
public function set fadingStrength(value:Number):void
| groupRadius | property |
groupRadius:Number [read-write]Implementation
public function get groupRadius():Number
public function set groupRadius(value:Number):void
| manageAllLayers | property |
manageAllLayers:Boolean [read-write]Implementation
public function get manageAllLayers():Boolean
public function set manageAllLayers(value:Boolean):void
| markerActualSize | property |
markerActualSize:Number [read-write]Implementation
public function get markerActualSize():Number
public function set markerActualSize(value:Number):void
| markerZoomScale | property |
markerZoomScale:Number [read-write]Implementation
public function get markerZoomScale():Number
public function set markerZoomScale(value:Number):void
| openGroupAction | property |
openGroupAction:String [read-write]Implementation
public function get openGroupAction():String
public function set openGroupAction(value:String):void
| optimization | property |
optimization:String [read-write]Implementation
public function get optimization():String
public function set optimization(value:String):void
| scaleBaloon | property |
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
| 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:
| Property | Type | Default | Description |
|---|---|---|---|
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 |
param:Object (default = null) — Object that holds all the properites of a markerManager you wish to override upon its creation.
|
|
groupStyle:Object (default = null) |
| addLayer | () | method |
public function addLayer(layer:Layer, groupStyle:Object = null):BooleanParameters
layer:Layer |
|
groupStyle:Object (default = null) |
Boolean |
| closeGroup | () | method |
public function closeGroup():BooleanReturns
Boolean |
| dispose | () | method |
public override function dispose():voidReleases all the resources accuired by the object.
| getGroupIndex | () | method |
public function getGroupIndex(marker:Marker):intFind an index of a group which contains specified marker.
Parametersmarker:Marker — - target Marker.
|
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):ArrayParameters
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.
|
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):ObjectParameters
index:int |
|
layer:Layer (default = null) |
Object |
| getLayerStyle | () | method |
| getStyle | () | method |
public function getStyle():ObjectReturns
Object |
| groupCountByIndex | () | method |
public function groupCountByIndex(index:int, layer:Layer = null):intParameters
index:int |
|
layer:Layer (default = null) |
int |
| init | () | method |
public override function init():void
| openGroup | () | method |
public function openGroup(marker:Marker):Booleanopen group by marker
Parametersmarker:Marker |
Boolean — true if marker is a member of group, false it is single.
|
| openGroupByIndex | () | method |
public function openGroupByIndex(index:int, layer:Layer = null):BooleanParameters
index:int |
|
layer:Layer (default = null) |
Boolean |
| openInfoWindow | () | method |
| removeLayer | () | method |
| setGroupStyle | () | method |
public function setGroupStyle(index:int, layer:Layer = null):BooleanParameters
index:int |
|
layer:Layer (default = null) |
Boolean |
| setLayerStyle | () | method |
| setStyle | () | method |
public function setStyle(style:Object):voidParameters
style:Object |
| groupClick | event |
com.afcomponents.umap.events.GroupEvent
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:
| Property | Value |
|---|---|
bubbles | false |
cancelable | false; there is no default behavior to cancel. |
markerGroup | The MarkerGroup instance over which click event occured. |
index | The index of MarkerGroup |
| groupClose | event |
com.afcomponents.umap.events.GroupEvent
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:
| Property | Value |
|---|---|
bubbles | false |
cancelable | false; there is no default behavior to cancel. |
markerGroup | The MarkerGroup instance over which close event occured. |
index | The index of MarkerGroup |
| groupCreate | event |
com.afcomponents.umap.events.GroupEvent
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:
| Property | Value |
|---|---|
bubbles | false |
cancelable | false; there is no default behavior to cancel. |
markerGroup | The MarkerGroup instance over which create event occured. |
index | The index of MarkerGroup |
| groupDestroy | event |
com.afcomponents.umap.events.GroupEvent
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:
| Property | Value |
|---|---|
bubbles | false |
cancelable | false; there is no default behavior to cancel. |
markerGroup | The MarkerGroup instance over which destroy event occured. |
index | The index of MarkerGroup |
| groupDoubleClick | event |
com.afcomponents.umap.events.GroupEvent
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:
| Property | Value |
|---|---|
bubbles | false |
cancelable | false; there is no default behavior to cancel. |
markerGroup | The MarkerGroup instance over which double click event occured. |
index | The index of MarkerGroup |
| groupError | event |
com.afcomponents.umap.events.GroupEvent
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:
| Property | Value |
|---|---|
bubbles | false |
cancelable | false; there is no default behavior to cancel. |
markerGroup | The MarkerGroup instance over which error event occured. |
index | The index of MarkerGroup |
| groupIconOut | event |
com.afcomponents.umap.events.GroupEvent
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:
| Property | Value |
|---|---|
bubbles | false |
cancelable | false; there is no default behavior to cancel. |
currentTarget |
The object that is actively processing the OverlayEvent object with an event listener. |
markerGroup | The MarkerGroup instance over which roll out event occured. |
index | The index of MarkerGroup |
| groupIconOver | event |
com.afcomponents.umap.events.GroupEvent
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:
| Property | Value |
|---|---|
bubbles | false |
cancelable | false; there is no default behavior to cancel. |
markerGroup | The MarkerGroup instance over which roll over event occured. |
index | The index of MarkerGroup |
| groupOpen | event |
com.afcomponents.umap.events.GroupEvent
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:
| Property | Value |
|---|---|
bubbles | false |
cancelable | false; there is no default behavior to cancel. |
markerGroup | The MarkerGroup instance over which open event occured. |
index | The index of MarkerGroup |
| OPEN_CLICK | constant |
public static const OPEN_CLICK:String = "openClick"
| OPEN_NONE | constant |
public static const OPEN_NONE:String = "openNone"
| OPTIMIZE_SPEED | constant |
public static const OPTIMIZE_SPEED:String = "optimizeSpeed"
| OPTIMIZE_VIEW | constant |
public static const OPTIMIZE_VIEW:String = "optimizeView"