| Package | com.afcomponents.umap.overlays |
| Class | public class Layer |
| Inheritance | Layer MapObjectContainer MapObject flash.display.Sprite |
| Implements | IMapObjectContainer, IOverlay |
| Subclasses | KMLLayer |
import com.afcomponents.umap.core.UMap;
import com.afcomponents.umap.overlays.Layer;
import com.afcomponents.umap.overlays.Marker;
import com.afcomponents.umap.types.LatLng;
// create map & attach it to stage
var map:UMap = new UMap();
map.setSize(300,300);
addChild(map);
// create new layer
var layer:Layer = new Layer();
// add markers
layer.addOverlay(new Marker({position:new LatLng(10,10), index:"A"}));
layer.addOverlay(new Marker({position:new LatLng(-10,-10), index:"B"}));
// add layer to the map
map.addOverlay(layer);| Property | Defined by | ||
|---|---|---|---|
![]() | asDisplayObject : DisplayObject
Returns reference to the object as a DisplayObject instance.
| MapObject | |
| autoCloseInfo : Boolean
Gets or sets the autCloseInfo flag, which indicates whether to close
info window automatically when user clicks somewhere on the map.
| Layer | ||
| autoInfo : Boolean
Gets or sets the autInfo flag, which indicates whether to open info window automatically upon mouse click.
| Layer | ||
![]() | core : UMap
Returns reference to the core UMap object.
| MapObject | |
| description : String
Gets or sets the description text for the layer.
| Layer | ||
![]() | id : uint
Gets or sets the ID of the object.
| MapObject | |
| info : IInfoWindow
[read-only]
Return referens to opened InfoWindow
| Layer | ||
| infoParam : Object
Gets or sets the info window param object.
| Layer | ||
| infoStyle : Object
Gets or sets the info window style object associated with the Overlay.
| Layer | ||
| name : String [write-only]
Gets or sets the name of the object.
| Layer | ||
![]() | owner : IMapObjectContainer
Returns reference to the owner container object.
| MapObject | |
| visible : Boolean
Gets or sets the Layer's visibility.
| Layer | ||
| Method | Defined by | ||
|---|---|---|---|
|
Layer(param:Object = null)
Layer constructor.
| Layer | ||
![]() |
addObject(object:IMapObject):void
Adds new IMapObject to the container.
| MapObjectContainer | |
|
Adds new IOverlay to this Layer, invalidates and refreshes it.
| Layer | ||
![]() |
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 | |
|
clearOverlays():void
Removes all attached overlays from the layer.
| Layer | ||
|
Creates an exact copy of this Layer with the attached Overlays and returns it to the user.
| Layer | ||
|
dispose():void
Releases all the resources accuired by the object.
| Layer | ||
|
[static]
Creates new Layer from XML object in KML 2.1 format.
| Layer | ||
|
Retruns Overlay bounds in geographical coordinates.
| Layer | ||
|
getBoundsXY(zoom:Number = 0):Bounds
Retruns Overlay bounds in bitmap coordinates.
| Layer | ||
![]() |
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 | |
|
getOverlay(id_or_name:*):IOverlay
Searches for an IOverlay object with specified id or name.
| Layer | ||
|
getOverlays():Array
Returns an array of IOverlay objects that where added to the Layer.
| Layer | ||
|
hide():void
Hides the Layer.
| Layer | ||
|
invalidate():void
Schedules the Layer for invalidation in 1 frame after this call.
| Layer | ||
![]() |
isOwnerVisible():Boolean
Recursevly checks visibility of parent objects
| MapObjectContainer | |
|
redraw():void
Invalidates Overlays attached to the Layer.
| Layer | ||
|
refresh(full:Boolean = false):void
Refreshes the position of the Overlays attached to the Layer.
| Layer | ||
![]() |
remove():void
Removes the object from the owner container object.
| MapObject | |
![]() |
removeObject(object:IMapObject):void
Removes IMapObject from the container.
| MapObjectContainer | |
|
removeOverlay(overlay:IOverlay):void
Removes target IOverlay from the Layer.
| Layer | ||
![]() |
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 | |
|
setOwner(owner:IMapObjectContainer):void
Adds the object to the specified IMapObjectContainer.
| Layer | ||
|
show():void
Shows the Layer.
| Layer | ||
![]() |
toString():String
Returns a textual representation of the object.
| MapObject | |
|
toXML(full:Boolean = true, afcTags:Boolean = false):XML
Builds an XML object in KML 2.1 format that describes the Overlay & it's style.
| Layer | ||
|
updatePosition(latlng:LatLng):void
Invoked when the map position has been updated.
| Layer | ||
|
updateZoom(zoom:Number):void
Invoked when map the zoom has been updated.
| Layer | ||
| autoCloseInfo | property |
autoCloseInfo:Boolean [read-write]Gets or sets the autCloseInfo flag, which indicates whether to close info window automatically when user clicks somewhere on the map.
Implementation public function get autoCloseInfo():Boolean
public function set autoCloseInfo(value:Boolean):void
| autoInfo | property |
autoInfo:Boolean [read-write]Gets or sets the autInfo flag, which indicates whether to open info window automatically upon mouse click.
Implementation public function get autoInfo():Boolean
public function set autoInfo(value:Boolean):void
| description | property |
description:String [read-write]Gets or sets the description text for the layer.
Implementation public function get description():String
public function set description(value:String):void
| info | property |
info:IInfoWindow [read-only]Return referens to opened InfoWindow
Implementation public function get info():IInfoWindow
| infoParam | property |
infoParam:Object [read-write]Gets or sets the info window param object.
Implementation public function get infoParam():Object
public function set infoParam(value:Object):void
| infoStyle | property |
infoStyle:Object [read-write]Gets or sets the info window style object associated with the Overlay.
Implementation public function get infoStyle():Object
public function set infoStyle(value:Object):void
| name | property |
name:String [write-only]Gets or sets the name of the object.
Implementation public function set name(value:String):void
| visible | property |
visible:Boolean [read-write]Gets or sets the Layer's visibility.
Implementation public function get visible():Boolean
public function set visible(value:Boolean):void
| Layer | () | constructor |
public function Layer(param:Object = null)
Layer constructor. Creates new Layer container object.
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 |
Layer(id) | Specifies layer's name. |
description |
String |
null | Specifies layers's description. |
description |
String |
null | Specifies layers's description. | infoParam |
Object |
null | Children overlays will use this param object in |
infoStyle |
Object |
null | Children overlays will use this style object in |
autoInfo |
Boolean |
true | A flag, that specifies whether info window should popup automatically when user clicks the overlay. |
autoCloseInfo |
Boolean |
true | A flag, that specifies whether info window should be closed when user clicks somewhere on the map. |
param:Object (default = null) — Object that contains additional creation parameters for the Layer.
|
| addOverlay | () | method |
public function addOverlay(overlay:IOverlay):IOverlayAdds new IOverlay to this Layer, invalidates and refreshes it.
Parametersoverlay:IOverlay — Target IOverlay object to add.
|
IOverlay —
Reference to added IOverlay object.
|
| clearOverlays | () | method |
public function clearOverlays():voidRemoves all attached overlays from the layer.
| clone | () | method |
public function clone():IOverlayCreates an exact copy of this Layer with the attached Overlays and returns it to the user. Please note that it doesn't attach new Layer to the same or any other parent.
ReturnsIOverlay —
New Layer with the same properties and clones of the children.
|
| dispose | () | method |
public override function dispose():voidReleases all the resources accuired by the object.
| fromXML | () | method |
public static function fromXML(xml:XML):LayerCreates new Layer from XML object in KML 2.1 format.
Parametersxml:XML — XML object with root <Container> node container several <Placemark> nodes.
|
Layer —
New Layer object.
|
| getBoundsLatLng | () | method |
public function getBoundsLatLng():LatLngBoundsRetruns Overlay bounds in geographical coordinates.
ReturnsLatLngBounds —
Overlay bounding rectangle in geographical coordinates.
|
| getBoundsXY | () | method |
public function getBoundsXY(zoom:Number = 0):Bounds
Retruns Overlay bounds in bitmap coordinates. Use zoom parameter to specify zoom level for bounds conversion.
zoom:Number (default = 0) — Defines the zoom level at which to perform bounds conversion; if omitted, current zoom level will be used.
|
Bounds —
Overlay bounding rectangle in bitmap coordinates.
|
| getOverlay | () | method |
public function getOverlay(id_or_name:*):IOverlay
Searches for an IOverlay object with specified id or name.
Please also consider using getObjectById(), and getObjectByName() methods with IOverlay filter.
id_or_name:* — ID or name of the object. If you pass a Number object will be searched by it's ID.
If you pass a String object will be searched by it's name and the letter case will not match.
|
IOverlay —
Reference to the found Overlay or null if it was not found.
|
See also
| getOverlays | () | method |
public function getOverlays():ArrayReturns an array of IOverlay objects that where added to the Layer.
ReturnsArray — An Array holding all the attached objects.
|
| hide | () | method |
public function hide():void
Hides the Layer.
Fires OverlayEvent.HIDE & OverlayEvent.CHAGNED events if visibility has been changed.
| invalidate | () | method |
public function invalidate():voidSchedules the Layer for invalidation in 1 frame after this call.
| redraw | () | method |
public function redraw():voidInvalidates Overlays attached to the Layer.
| refresh | () | method |
public function refresh(full:Boolean = false):void
Refreshes the position of the Overlays attached to the Layer.
If the full paramter is set to true then bitmap coordinates for this overlay are recalculated.
Otherwise overlay will be repositioned using previuosly calculated coordinates.
full:Boolean (default = false) — Indicates whether to perform full refresh.
|
| removeOverlay | () | method |
public function removeOverlay(overlay:IOverlay):voidRemoves target IOverlay from the Layer.
Parametersoverlay:IOverlay — Reference to the IOverlay object that should be removed.
|
| setOwner | () | method |
public override function setOwner(owner:IMapObjectContainer):voidAdds the object to the specified IMapObjectContainer.
If the object was previosly attached to a container, object will be removed from it.
If you specify null instead of the owner, IllegalOperationError will be thrown.
owner:IMapObjectContainer — New owner of the object.
|
| show | () | method |
public function show():void
Shows the Layer.
Fires OverlayEvent.SHOW & OverlayEvent.CHAGNED events if visibility has been changed.
| toXML | () | method |
public function toXML(full:Boolean = true, afcTags:Boolean = false):XML
Builds an XML object in KML 2.1 format that describes the Overlay & it's style.
Flag full indicates whether to build a complete KML data or just a container.
full:Boolean (default = true) — A value of true if you want to return a full KML file with header;
false if you want to get only a container with style and placemark nodes.
|
|
afcTags:Boolean (default = false) — Flag that determines whether to generate KML data with extended AFC tags.
|
XML — XML object in KML 2.1 format.
|
| updatePosition | () | method |
public function updatePosition(latlng:LatLng):voidInvoked when the map position has been updated.
Parameterslatlng:LatLng — Geographical coordinates of the new map center.
|
| updateZoom | () | method |
public function updateZoom(zoom:Number):voidInvoked when map the zoom has been updated.
Parameterszoom:Number — New zoom level.
|