| Package | com.afcomponents.umap.overlays |
| Class | public class KMLLayer |
| Inheritance | KMLLayer Layer MapObjectContainer MapObject flash.display.Sprite |
| Subclasses | GeoRSSLayer, GPXLayer |
import com.afcomponents.umap.core.UMap;
import com.afcomponents.umap.overlays.KMLLayer;
// create map & attach it to stage
var map:UMap = new UMap();
map.setSize(300,300);
addChild(map);
// create new layer
var kml:KMLLayer = new KMLLayer();
kml.load("http://www.afcomponents.com/components/g_map/olympic_host_cities.kml");
map.addOverlay(kml);| 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 | |
| autoShow : Boolean
Gets or sets the autoShow property.
| KMLLayer | ||
![]() | core : UMap
Returns reference to the core UMap object.
| MapObject | |
![]() | description : String
Gets or sets the description text for the layer.
| Layer | |
| expanded : Boolean
A flag which controls how this KML layer should be returned by toXML() method.
| KMLLayer | ||
![]() | id : uint
Gets or sets the ID of the object.
| MapObject | |
![]() | info : IInfoWindow
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 | |
| keepXML : Boolean
Defines whether to keep XML in memory after downloading.
| KMLLayer | ||
| loader : URLLoader [read-only]
Returns a reference to the Loader object that is used for loading data from an external source.
| KMLLayer | ||
| loading : Boolean [read-only]
Returns
true if data from external source is being loaded. | KMLLayer | ||
| maxZoomLevel : Number
Gets or sets the maxZoomLevel property.
| KMLLayer | ||
![]() | name : String
Gets or sets the name of the object.
| Layer | |
| networkLinks : uint [read-only]
Returns an array which holds references to the linked KMLLayers.
| KMLLayer | ||
![]() | owner : IMapObjectContainer
Returns reference to the owner container object.
| MapObject | |
| source : String [read-only]
Returns URL of the layer's source data.
| KMLLayer | ||
| url : String
Defines the URL that should be exported via <networkLink> tag.
| KMLLayer | ||
![]() | visible : Boolean
Gets or sets the Layer's visibility.
| Layer | |
| xml : XML [read-only]
Returns a reference to the XML object with KML data.
| KMLLayer | ||
| Method | Defined by | ||
|---|---|---|---|
|
KMLLayer(param:Object = null)
KML Layer constructor.
| KMLLayer | ||
![]() |
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 | |
|
cancel():void
Cancels the loading progress in this KMLLayer and all the linked KMLLayers.
| KMLLayer | ||
![]() |
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.
| KMLLayer | ||
|
[static]
Creates new KMLLayer from XML object in KML 2.2 format.
| KMLLayer | ||
![]() |
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 | |
|
load(source:*):Boolean
Loads KML data from the specified source.
| KMLLayer | ||
![]() |
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.
| KMLLayer | ||
![]() |
updateMapType(mapType:IMapType):void
Invoked when map type has been changed.
| 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 | |
| Method | Defined by | ||
|---|---|---|---|
|
createCircle(xml:XML):Circle
Creates Circle object specified by the xml data in KML 2.1 format.
| KMLLayer | ||
|
createMarker(xml:XML):Marker
Creates Marker object specified by the xml data in KML 2.1 format.
| KMLLayer | ||
|
createNetworkLink(xml:XML):KMLLayer
Creates KMLLayer object specified by the xml data in KML 2.2 format.
| KMLLayer | ||
|
createPolygon(xml:XML):Polygon
Creates Polygon object specified by the xml data in KML 2.1 format.
| KMLLayer | ||
|
createPolyline(xml:XML):Polyline
Creates Polyline object specified by the xml data in KML 2.1 format.
| KMLLayer | ||
| Event | Summary | Defined by | ||
|---|---|---|---|---|
Dispatched when an KMLLayer has finished loading KML from an external source. | KMLLayer | |||
Dispatched if a call to URLLoader.load()
attempts to access data over HTTP and the current Flash Player environment
is able to detect and return the status code for the request. | KMLLayer | |||
Dispatched if a call to URLLoader.load()
results in a fatal error that terminates the download. | KMLLayer | |||
Dispatched when the download operation commences following
a call to the URLLoader.load() method. | KMLLayer | |||
Dispatched when KMLLayer enters ready state. | KMLLayer | |||
| Dispatched when data is received as the download operation progresses. | KMLLayer | |||
Dispatched if a call to URLLoader.load()
attempts to load data from a server outside the security sandbox. | KMLLayer | |||
| autoShow | property |
autoShow:Boolean [read-write]
Gets or sets the autoShow property.
Please note that this flag is ineffictive after Event.COMPLETE.
public function get autoShow():Boolean
public function set autoShow(value:Boolean):void
| expanded | property |
expanded:Boolean [read-write]
A flag which controls how this KML layer should be returned by toXML() method.
If the expanded property is set to true, or source of the layer was
set by XML data, then KML layer returned as a normal Layer with all it's contents.
Otherwise only a NetworkLink is returned with the source URL.
The default value is <code>false</code>.
public function get expanded():Boolean
public function set expanded(value:Boolean):void
See also
| keepXML | property |
keepXML:Boolean [read-write]Defines whether to keep XML in memory after downloading.
The default value is <code>false</code>.
public function get keepXML():Boolean
public function set keepXML(value:Boolean):void
| loader | property |
loader:URLLoader [read-only]Returns a reference to the Loader object that is used for loading data from an external source.
Implementation public function get loader():URLLoader
| loading | property |
loading:Boolean [read-only]
Returns true if data from external source is being loaded.
public function get loading():Boolean
| maxZoomLevel | property |
maxZoomLevel:Number [read-write]
Gets or sets the maxZoomLevel property.
Please note that this flag is ineffictive after Event.COMPLETE.
public function get maxZoomLevel():Number
public function set maxZoomLevel(value:Number):void
| networkLinks | property |
networkLinks:uint [read-only]Returns an array which holds references to the linked KMLLayers.
Implementation public function get networkLinks():uint
| source | property |
source:String [read-only]Returns URL of the layer's source data. If the layer has been loaded from XML object, returns "" (empty string).
Implementation public function get source():String
| url | property |
url:String [read-write]
Defines the URL that should be exported via <networkLink> tag.
This property is also set when you call load(URI) method.
public function get url():String
public function set url(value:String):void
| xml | property |
xml:XML [read-only]Returns a reference to the XML object with KML data.
Implementation public function get xml():XML
| KMLLayer | () | constructor |
public function KMLLayer(param:Object = null)
KML Layer constructor.
If the source properties is specified in the param object,
KML layer start loading right away.
Otherwie use load(source) method to load KML data.
Here is a list of properties you can specify in the param object:
| Property | Type | Default | Description |
|---|---|---|---|
autoShow |
Boolean |
true | Defines whether to show layer content after loading. |
maxZoomLevel |
Number |
13 | Defines the maximum zoom level for the auto show procedure. |
source |
* |
A source with the KML data. See load() function for additional details. |
|
expanded |
Boolean |
false |
Defines whether toXML() method should return full KML <Container> node, rather than a <NetworkLink> node. |
keepXML |
Boolean |
false |
Defines whether to keep XML data in memory after it has been loaded. To access stored XML data, use xml property. |
param:Object (default = null) — Object that contains additional parameters for the KMLLayer.
|
See also
| cancel | () | method |
public function cancel():voidCancels the loading progress in this KMLLayer and all the linked KMLLayers.
| createCircle | () | method |
protected function createCircle(xml:XML):CircleCreates Circle object specified by the xml data in KML 2.1 format. Override this function to create custom Circles.
Parametersxml:XML — XML data which describes the Circle.
|
Circle —
Circle object.
|
See also
| createMarker | () | method |
protected function createMarker(xml:XML):MarkerCreates Marker object specified by the xml data in KML 2.1 format. Override this function to create custom Markers.
Parametersxml:XML — XML data which describes the Marker.
|
Marker —
Marker object.
|
See also
| createNetworkLink | () | method |
protected function createNetworkLink(xml:XML):KMLLayerCreates KMLLayer object specified by the xml data in KML 2.2 format. Override this function to create custom KMLLayer.
Parametersxml:XML — XML data which describes the external asset.
|
KMLLayer —
KMLLayer object.
|
See also
| createPolygon | () | method |
protected function createPolygon(xml:XML):PolygonCreates Polygon object specified by the xml data in KML 2.1 format. Override this function to create custom Polygons.
Parametersxml:XML — XML data which describes the Polygon.
|
Polygon —
Polygon object.
|
See also
| createPolyline | () | method |
protected function createPolyline(xml:XML):PolylineCreates Polyline object specified by the xml data in KML 2.1 format. Override this function to create custom Polylines.
Parametersxml:XML — XML data which describes the Polyline.
|
Polyline —
Polyline object.
|
See also
| dispose | () | method |
public override function dispose():voidReleases all the resources accuired by the object.
| fromXML | () | method |
public static function fromXML(xml:XML, param:Object = null, classObject:Class = null):KMLLayerCreates new KMLLayer from XML object in KML 2.2 format.
Parametersxml:XML — XML object with root <NetworkLink> node
which <Link> node with an URI to an external asset.
|
|
param:Object (default = null) — Default parameter Object that will be passed to the object's constructor.
|
|
classObject:Class (default = null) — Custom class object that will be instantiated instead of the default one.
|
KMLLayer —
New KMLLayer object.
|
<NetworkLink id="ID"> <!-- inherited from Feature element --> <name>...</name> <!-- string --> <visibility>1</visibility> <!-- boolean --> <!-- specific to NetworkLink --> <Link> <href>...</href> <!-- string --> </Link>
| load | () | method |
public function load(source:*):BooleanLoads KML data from the specified source.
The source can be one of the following:
String that specifies URL to an external KML file.URLRequest object that contains path to a KML file.XML object that contains data in KML format.source:* — A source with KML data.
|
Boolean — A value of true if the source has been accepted; false if it was not.
|
| toXML | () | method |
public override 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.
|
| complete | event |
flash.events.Event
Dispatched when an KMLLayer has finished loading KML from an external source.
Defines the value of the type property of a complete 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 Event object with an event listener. |
target | The network object that has completed loading. |
| httpStatus | event |
flash.events.HTTPStatusEvent
Dispatched if a call to URLLoader.load()
attempts to access data over HTTP and the current Flash Player environment
is able to detect and return the status code for the request. (Some browser environments
may not be able to provide this information.) Note that the httpStatus event
(if any) is sent before (and in addition to) any complete
or error event.
Defines the value of the type property of a httpStatus 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 Event object with an event listener. |
status | The HTTP status code returned by the server. |
target | The network object receiving an HTTP status code. |
| ioError | event |
flash.events.IOErrorEvent
Dispatched if a call to URLLoader.load()
results in a fatal error that terminates the download.
Defines the value of the type property of an ioError 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 Event object with an event listener. |
target | The network object experiencing the input/output error. |
text | Text to be displayed as an error message. |
| open | event |
flash.events.Event
Dispatched when the download operation commences following
a call to the URLLoader.load() method.
Defines the value of the type property of an open 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 Event object with an event listener. |
target | The network object that has opened a connection. |
| overlayReady | event |
com.afcomponents.umap.events.OverlayEvent
com.afcomponents.umap.events.OverlayEvent.READY
Dispatched when KMLLayer enters ready state.
This happens after all data from this Layer and all linked layers has been loaded.
The OverlayEvent.READY constant defines the value of the type property of an
overlayReady 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. |
target | The Overlay instance that has entered ready state. |
param | null |
| progress | event |
flash.events.ProgressEvent
Dispatched when data is received as the download operation progresses.
Defines the value of the type property of a progress event object.
This event has the following properties:
| Property | Value |
|---|---|
bubbles | false |
bytesLoaded | The number of items or bytes loaded at the time the listener processes the event. |
bytesTotal | The total number of items or bytes that ultimately will be loaded if the loading process succeeds. |
cancelable | false; there is no default behavior to cancel. |
currentTarget | The object that is actively processing the Event object with an event listener. |
target | The network object reporting progress. |
| securityError | event |
flash.events.SecurityErrorEvent
Dispatched if a call to URLLoader.load()
attempts to load data from a server outside the security sandbox.
The SecurityErrorEvent.SECURITY_ERROR constant defines the value of the type property of a securityError 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 Event object with an event listener. |
target | The network object reporting the security error. |
text | Text to be displayed as an error message. |