Packagecom.afcomponents.umap.core
Classpublic class UMap
InheritanceUMap Inheritance fl.core.UIComponent

UMap component. This is the main core class of the UMap component. To use it simply drag & drop component on the Stage or create component at run-time:
 import com.afcomponents.umap.core.UMap;
  
 var map:UMap = new UMap();
 map.setSize(300,300);
 addChild(map);



Public Properties
 PropertyDefined by
  componentStyle : Object
Defines the component style.
UMap
  control : Control
[read-only] Returns a reference to core.Control object instance.
UMap
  display : Display
[read-only] Returns a reference to core.Display object instance.
UMap
  doubleClickMode : String
Defines an action that should be taken when a user double-clicks the map.
UMap
  embedFonts : Boolean
Defines whether to use embedded font outlines within the map.
UMap
  enableDragging : Boolean
Defines whether map dragging is enabled.
UMap
  enableKeyboardHandler : Boolean
Defines whether to use keyboard to control the map.
UMap
  enableMouseHandler : Boolean
Defines whether to use mouse to control the map.
UMap
  enableScrollWheelZoom : Boolean
Defines whether to use mouse wheel to control the map.
UMap
  enableStrictMode : Boolean
Defines whether component will raise errors when invalid input was recieved.
UMap
  errorSymbol : String
Defines a class name of the symbol in the library that should be used for error indicating.
UMap
  intZoom : uint
[read-only] Returns current zoom level rounded down.
UMap
  language : String
Defines a two-letter ISO code of a language to use with the map.
UMap
  mapType : String
Defines current map type name.
UMap
  panEasing : *
Defines panning easing function.
UMap
  panning : Boolean
[read-only] Returns true if map is auto-panning at the moment.
UMap
  panSpeed : uint
Defines panning speed in 0.1 of a second.
UMap
  ready : Boolean
[read-only] Returns true if map settings have been loaded.
UMap
  targetZoom : Number
[read-only] Returns target zoom level if animateZoom property set to true or current zoom level.
UMap
  zoom : Number
[read-only] Returns current zoom level.
UMap
  zoomAtPointer : Boolean
Defines whether we should zoom in at pointer position rather than at the center of the map.
UMap
  zoomEasing : *
Defines zoom easing function.
UMap
  zoomSpeed : uint
Defines zoom animation speed in 0.1 of a second.
UMap
Public Methods
 MethodDefined by
  
UMap(param:Object = null)
UMap constructor.
UMap
  
Adds new IMapControl object to the GUI.
UMap
  
Adds new IManager object to the managers list.
UMap
  
Adds new IOverlay object to the default layer, invalidates and refreshes it.
UMap
  
Cancels double-click event generation.
UMap
  
Cancels map dragging.
UMap
  
Stops panning animation.
UMap
  
Closes info window that is currently opened.
UMap
  
convertBounds(bounds:*, zoom:Number = 0):*
Converts LatLngBounds to Bitmap Bounds and visa-versa.
UMap
  
dispose():void
Frees all the resources accuired by the component & destroys it.
UMap
  
fromXML(xml:XML):void
Sets the map view, map type & provider from a special UMapSettings KML node.
UMap
  
getBitmapXYFromComponentXY(point:Point, zoom:Number = 0):Point
Converts a point in component coordinates to a point in bitmap coordinates.
UMap
  
getBitmapXYFromLatLng(latlng:LatLng, zoom:Number = 0):Point
Converts a point in geographical coordinates to a point in bitmap coordinates.
UMap
  
Returns a BoundsLatLng object that represents current map view in geographical coordinates.
UMap
  
Returns a Bounds object that represents current map view in bitmap coordinates.
UMap
  
getBoundsZoomLevel(bounds:LatLngBounds, offset:Point = null, decimal:Boolean = false):Number
Retruns zoom level, at which map view can fit the specified bounds rectangle.
UMap
  
Returns a LatLng object that holds geographical coordinates of the center point.
UMap
  
getCenterXY():Point
Returns a Point object that holds bitmap coordinates of the center point.
UMap
  
getComponentXYFromBitmapXY(point:Point, zoom:Number = 0):Point
Converts a point in bitmap coordinates to a point in component coordinates.
UMap
  
getComponentXYFromLatLng(latlng:LatLng, zoom:Number = 0):Point
Converts a point in geographical coordinates to a point in component coordinates.
UMap
  
Retursn reference to the default layer.
UMap
  
Returns a reference to the info window that is currently opened.
UMap
  
getLanguage():String
Returns a two-letter ISO language code that will be used by the map.
UMap
  
getLatLngFromBitmapXY(point:Point, zoom:Number = 0):LatLng
Converts a point in bitmap coordinates to a point in geographical coordinates.
UMap
  
getLatLngFromComponentXY(point:Point, zoom:Number = 0):LatLng
Converts a point in component coordinates to a point in geographical coordinates.
UMap
  
getManager(name:String):IManager
Searches for an IManager object with specfied name that was attached to a managers list.
UMap
  
getManagers():Array
Returns an Array holding all the IManager objects attached to managers list.
UMap
  
getMouseBitmapXY(zoom:Number = 0, limitBitmap:Boolean = true):Point
Returns bitmap point of the mouse pointer.
UMap
  
getMouseLatLng(zoom:Number = 0, limitBitmap:Boolean = true):LatLng
Returns geographical position of the mouse pointer.
UMap
  
getOverlay(id_or_name:*):IOverlay
Searches for an IOverlay object with specfied name or id, that was attached to a default layer.
UMap
  
getOverlays():Array
Returns an Array holding all the IOverlay objects attached to default layer.
UMap
  
Returns an object that holds previously saved position.
UMap
  
lockMapView(lock:Boolean = true):void
Freeze the map view.
UMap
  
openInfoWindow(param:Object = null, style:Object = null):IInfoWindow
Opens new info window with the specified parameters and style.
UMap
  
panByXY(distance:Point, immediate:Boolean = false):void
Pans the map view by a certain distance in pixels.
UMap
  
panTo(latlng:LatLng, immediate:Boolean = false):void
Pans the map to the specified point.
UMap
  
removeManager(manager:IManager):void
Removes specified IManager object from the managers list.
UMap
  
removeOverlay(overlay:IOverlay):void
Removes specified IOverlay object from the default layer.
UMap
  
Pans the map to the prviously saved center & zoom level.
UMap
  
savePosition():void
Saves current map center coordinates and zoom level.
UMap
  
setBounds(bounds:LatLngBounds, offset:Point = null, immediate:Boolean = false, maxZoomLevel:Number = 0):Boolean
Sets the map view position and zoom, so that it fits the specified LatLngBounds rectangle.
UMap
  
setCenter(latlng:LatLng, zoom:Number = 0):void
Sets the map view to the given center, optionally also sets the zoom level.
UMap
  
setComponentStyle(style:Object):void
Sets the component style.
UMap
  
setMapType(mapTypeName:String):void
Attempts to change the map type by it's name.
UMap
  
setProvider(providerClassOrInstance:*):Boolean
Sets the provider for the UMap either by Class reference or a IProvider instance.
UMap
  
setZoom(zoom:Number, immediate:Boolean = false):void
Sets the map zoom level.
UMap
  
toXML(afcTags:Boolean = false):XML
Returns XML data in KML 2.1 format, which describes all the Overlays attached to the map.
UMap
  
zoomIn(delta:Number):void
Increases the map zoom level.
UMap
  
zoomOut(delta:Number):void
Decreases the map zoom level.
UMap
  
zoomTo(latlng:LatLng, zoom:Number, immediate:Boolean = false):void
Zoom the map to a given point & zoom level.
UMap
Events
 EventSummaryDefined by
   Dispatched when user drags the map.UMap
   Dispatched when user starts dragging the map.UMap
   Dispatched when user stops dragging the map.UMap
   Dispatched when info window has been closed.UMap
   Dispatched when info window has been opened.UMap
   Dispatched when the map has been clicked.UMap
   Dispatched when the map has been double clicked.UMap
   Dispatched when automatic panning of the map has been finished.UMap
  
pan
Dispatched when the map view is panning.UMap
   Dispatched when the map view starts panning.UMap
   Dispatched when the map view stops panning.UMap
   Dispatched when map property has changed.UMap
   Dispatched when the map has entered ready state.UMap
   Dispatched when UMap map type changes.UMap
   Dispatched when UMap center position changes.UMap
   Dispatched when UMap zoom level changes.UMap
   Dispatched when the map zoom is changing.UMap
   Dispatched when the map zoom starts changing.UMap
   Dispatched when the map zoom stops changing.UMap
Property detail
componentStyleproperty
componentStyle:Object  [read-write]

Defines the component style.

Implementation
    public function get componentStyle():Object
    public function set componentStyle(value:Object):void

See also

controlproperty 
control:Control  [read-only]

Returns a reference to core.Control object instance.

Implementation
    public function get control():Control
displayproperty 
display:Display  [read-only]

Returns a reference to core.Display object instance.

Implementation
    public function get display():Display
doubleClickModeproperty 
doubleClickMode:String  [read-write]

Defines an action that should be taken when a user double-clicks the map. Possible values include pan, zoom or none.

The default value is pan.

Implementation
    public function get doubleClickMode():String
    public function set doubleClickMode(value:String):void
embedFontsproperty 
embedFonts:Boolean  [read-write]

Defines whether to use embedded font outlines within the map. Currently this property effects only CopyrightControl. Copyright control text will be always displayed in 10pt _sans font.

The default value is false.

Implementation
    public function get embedFonts():Boolean
    public function set embedFonts(value:Boolean):void
enableDraggingproperty 
enableDragging:Boolean  [read-write]

Defines whether map dragging is enabled.

The default value is true.

Implementation
    public function get enableDragging():Boolean
    public function set enableDragging(value:Boolean):void
enableKeyboardHandlerproperty 
enableKeyboardHandler:Boolean  [read-write]

Defines whether to use keyboard to control the map.

The default value is true.

Implementation
    public function get enableKeyboardHandler():Boolean
    public function set enableKeyboardHandler(value:Boolean):void
enableMouseHandlerproperty 
enableMouseHandler:Boolean  [read-write]

Defines whether to use mouse to control the map.

The default value is true.

Implementation
    public function get enableMouseHandler():Boolean
    public function set enableMouseHandler(value:Boolean):void
enableScrollWheelZoomproperty 
enableScrollWheelZoom:Boolean  [read-write]

Defines whether to use mouse wheel to control the map. Mouse wheel will not work if enableMouseHandler is set to false.

The default value is true.

Implementation
    public function get enableScrollWheelZoom():Boolean
    public function set enableScrollWheelZoom(value:Boolean):void
enableStrictModeproperty 
enableStrictMode:Boolean  [read-write]

Defines whether component will raise errors when invalid input was recieved.

The default value is false.

Implementation
    public function get enableStrictMode():Boolean
    public function set enableStrictMode(value:Boolean):void
errorSymbolproperty 
errorSymbol:String  [read-write]

Defines a class name of the symbol in the library that should be used for error indicating. For best viewing experince your symbol should be 256x256 pixels. For error text output, your symbol should contain a TextField named errorMessage. Leave this parameter blank or type in "default" to use the default symbol.

The default value is "default".

Implementation
    public function get errorSymbol():String
    public function set errorSymbol(value:String):void
intZoomproperty 
intZoom:uint  [read-only]

Returns current zoom level rounded down.

Implementation
    public function get intZoom():uint
languageproperty 
language:String  [read-write]

Defines a two-letter ISO code of a language to use with the map. Please note, that you should setup this proepry right after you create the component. Please put auto if you want Flash to determine the language automatically.

The default value is "auto".

Implementation
    public function get language():String
    public function set language(value:String):void
mapTypeproperty 
mapType:String  [read-write]

Defines current map type name. Use setMapType() function to change it.

The default value is "map".

Implementation
    public function get mapType():String
    public function set mapType(value:String):void
panEasingproperty 
panEasing:*  [read-write]

Defines panning easing function. You can pass a String value (it should be in the list) or a any easing function reference.

The default value is Regular.easeOut.

Implementation
    public function get panEasing():*
    public function set panEasing(value:*):void
panningproperty 
panning:Boolean  [read-only]

Returns true if map is auto-panning at the moment.

Implementation
    public function get panning():Boolean
panSpeedproperty 
panSpeed:uint  [read-write]

Defines panning speed in 0.1 of a second. The higher the number, the lower the speed of panning. For example, if panSpeed = 5, it will take half a second to pan the map to a specific point.

The default value is 3.

Implementation
    public function get panSpeed():uint
    public function set panSpeed(value:uint):void
readyproperty 
ready:Boolean  [read-only]

Returns true if map settings have been loaded.

Implementation
    public function get ready():Boolean
targetZoomproperty 
targetZoom:Number  [read-only]

Returns target zoom level if animateZoom property set to true or current zoom level.

Implementation
    public function get targetZoom():Number
zoomproperty 
zoom:Number  [read-only]

Returns current zoom level.

Implementation
    public function get zoom():Number
zoomAtPointerproperty 
zoomAtPointer:Boolean  [read-write]

Defines whether we should zoom in at pointer position rather than at the center of the map.

The default value is false.

Implementation
    public function get zoomAtPointer():Boolean
    public function set zoomAtPointer(value:Boolean):void
zoomEasingproperty 
zoomEasing:*  [read-write]

Defines zoom easing function. You can pass a String value (it should be in the list) or a any easing function reference.

The default value is Regular.easeOut.

Implementation
    public function get zoomEasing():*
    public function set zoomEasing(value:*):void
zoomSpeedproperty 
zoomSpeed:uint  [read-write]

Defines zoom animation speed in 0.1 of a second. The higher the number, the lower the speed of zooming. For example, if zoomnSpeed = 5, it will take half a second to zoom the map to a specific point.

The default value is 3.

Implementation
    public function get zoomSpeed():uint
    public function set zoomSpeed(value:uint):void
Constructor detail
UMap()constructor
public function UMap(param:Object = null)

UMap constructor. Initializes the UMap component. Loads the defaults for the properties, and the attempts to load parameters specified in the param object.

Parameters
param:Object (default = null)

Example
In this example we create UMap component and initialize it via param object:
  import com.afcomponents.umap.core.UMap;
  import com.afcomponents.umap.types.Size;
   
  var map:UMap = new UMap({size:new Size(300,300), animatePan:true});
  addChild(map);
  

Method detail
addControl()method
public function addControl(control:IMapControl):IMapControl

Adds new IMapControl object to the GUI.

Parameters
control:IMapControl — Target IMapControl object to add.

Returns
IMapControl — Reference to added IMapControl object.
addManager()method 
public function addManager(manager:IManager):IManager

Adds new IManager object to the managers list.

Parameters
manager:IManager — Target IManager object to add.

Returns
IManager — Reference to added IManager object.
addOverlay()method 
public function addOverlay(overlay:IOverlay):IOverlay

Adds new IOverlay object to the default layer, invalidates and refreshes it.

Parameters
overlay:IOverlay — Target IOverlay object to add.

Returns
IOverlay — Reference to added IOverlay object.
cancelDoubleClick()method 
public function cancelDoubleClick():void

Cancels double-click event generation. Call this function each time mouse button is released to cancel the double-click.

cancelDragging()method 
public function cancelDragging():void

Cancels map dragging. Call this function each time mouse button is pressed to cancel the dragging.

cancelPanning()method 
public function cancelPanning():void

Stops panning animation.

closeInfoWindow()method 
public function closeInfoWindow():void

Closes info window that is currently opened.

convertBounds()method 
public function convertBounds(bounds:*, zoom:Number = 0):*

Converts LatLngBounds to Bitmap Bounds and visa-versa. Additionally you can specify zoom level at which the conversion should be performed, otherwise current zoom level will be used.

Parameters
bounds:* — LatLngBounds or Bounds object.
 
zoom:Number (default = 0) — Zoom level at which the conversion should be performed.

Returns
* — Bounds or LatLngBounds object as the result of conversion; null if an error occured.
dispose()method 
public function dispose():void

Frees all the resources accuired by the component & destroys it.

fromXML()method 
public function fromXML(xml:XML):void

Sets the map view, map type & provider from a special UMapSettings KML node.

Parameters
xml:XML — UMapSettings node.

Example
Here is sample UMapSettings node:
  <umap:UMapSettings xmlns="http://earth.google.com/kml/2.1" xmlns:umap="http://www.afcomponents.com/as3/umap">
    <center>{longitude},{latitude},0.00000000</center>
    <zoom>1</zoom>
    <type>road</type>
    <provider>com.afcomponents.umap.providers.microsoft::MicrosoftProvider</provider>
  </umap:UMapSettings>

getBitmapXYFromComponentXY()method 
public function getBitmapXYFromComponentXY(point:Point, zoom:Number = 0):Point

Converts a point in component coordinates to a point in bitmap coordinates.

Parameters
point:Point — A point in component coordinates.
 
zoom:Number (default = 0) — Zoom level at which the conversion should be performed, current zoom level is used if this parameter has been omitted.

Returns
Point — A point in bitmap coordinates.
getBitmapXYFromLatLng()method 
public function getBitmapXYFromLatLng(latlng:LatLng, zoom:Number = 0):Point

Converts a point in geographical coordinates to a point in bitmap coordinates.

Parameters
latlng:LatLng — A point in component coordinates.
 
zoom:Number (default = 0) — Zoom level at which the conversion should be performed, current zoom level is used if this parameter has been omitted.

Returns
Point — A point in geographical coordinates.
getBoundsLatLng()method 
public function getBoundsLatLng():LatLngBounds

Returns a BoundsLatLng object that represents current map view in geographical coordinates.

Returns
LatLngBounds — An object that represents current map view in geographical coordinates.
getBoundsXY()method 
public function getBoundsXY():Bounds

Returns a Bounds object that represents current map view in bitmap coordinates.

Returns
Bounds — An object that represents current map view in bitmap coordinates.
getBoundsZoomLevel()method 
public function getBoundsZoomLevel(bounds:LatLngBounds, offset:Point = null, decimal:Boolean = false):Number

Retruns zoom level, at which map view can fit the specified bounds rectangle. By defualt, the function will return integer zoom, but you can iverride it with the decimal flag.

Parameters
bounds:LatLngBounds — Target bounds rectangle.
 
offset:Point (default = null) — Flag which indicates whether returned zoom level should be decimal (true), or integer (false).
 
decimal:Boolean (default = false)

Returns
Number — Zoom level, at which map view can fit the specified bounds rectangle, or -1 if an error occured.
getCenter()method 
public function getCenter():LatLng

Returns a LatLng object that holds geographical coordinates of the center point.

Returns
LatLng — An object that holds geographical coordinates of the center point.
getCenterXY()method 
public function getCenterXY():Point

Returns a Point object that holds bitmap coordinates of the center point.

Returns
Point — An object that holds bitmap coordinates of the center point.
getComponentXYFromBitmapXY()method 
public function getComponentXYFromBitmapXY(point:Point, zoom:Number = 0):Point

Converts a point in bitmap coordinates to a point in component coordinates.

Parameters
point:Point — A point in bitmap coordinates.
 
zoom:Number (default = 0) — Zoom level at which the conversion should be performed, current zoom level is used if this parameter has been omitted.

Returns
Point — A point in component coordinates.
getComponentXYFromLatLng()method 
public function getComponentXYFromLatLng(latlng:LatLng, zoom:Number = 0):Point

Converts a point in geographical coordinates to a point in component coordinates.

Parameters
latlng:LatLng — A point in geographical coordinates.
 
zoom:Number (default = 0) — Zoom level at which the conversion should be performed, current zoom level is used if this parameter has been omitted.

Returns
Point — A point in component coordinates.
getDefaultLayer()method 
public function getDefaultLayer():Layer

Retursn reference to the default layer. All overlays that are added via UMap.addOverlay() function calls are added to this layer.

Returns
Layer — Reference to the default layer.
getInfoWindow()method 
public function getInfoWindow():IInfoWindow

Returns a reference to the info window that is currently opened.

Returns
IInfoWindow — Reference to the opened info window.
getLanguage()method 
public function getLanguage():String

Returns a two-letter ISO language code that will be used by the map. Unlike language property this method always returns a valid language code.

Returns
String — Two-letter ISO language code.
getLatLngFromBitmapXY()method 
public function getLatLngFromBitmapXY(point:Point, zoom:Number = 0):LatLng

Converts a point in bitmap coordinates to a point in geographical coordinates.

Parameters
point:Point — A point in bitmap coordinates.
 
zoom:Number (default = 0) — Zoom level at which the conversion should be performed, current zoom level is used if this parameter has been omitted.

Returns
LatLng — A point in geographical coordinates.
getLatLngFromComponentXY()method 
public function getLatLngFromComponentXY(point:Point, zoom:Number = 0):LatLng

Converts a point in component coordinates to a point in geographical coordinates.

Parameters
point:Point — A point in component coordinates.
 
zoom:Number (default = 0) — Zoom level at which the conversion should be performed, current zoom level is used if this parameter has been omitted.

Returns
LatLng — A point in geographical coordinates.
getManager()method 
public function getManager(name:String):IManager

Searches for an IManager object with specfied name that was attached to a managers list.

Parameters
name:String — Name of an IManager object.

Returns
IManager — Reference to the first found IManager object or null if nothing was found.
getManagers()method 
public function getManagers():Array

Returns an Array holding all the IManager objects attached to managers list.

Returns
Array — An Array holding all the IManager objects.
getMouseBitmapXY()method 
public function getMouseBitmapXY(zoom:Number = 0, limitBitmap:Boolean = true):Point

Returns bitmap point of the mouse pointer. If mouse pointer is out of the map view, returns null. Additionally you can specify a zoom level at which to perform the calculation.

Parameters
zoom:Number (default = 0) — Zoom level at which the calculation should be performed, current zoom level is used if this parameter has been omitted.
 
limitBitmap:Boolean (default = true) — Limits the mouse pointer in the map bitmap, specify a value of false to cancel limitation.

Returns
Point — A point bitmap coordinates, or null if pointer is out of the map view.
getMouseLatLng()method 
public function getMouseLatLng(zoom:Number = 0, limitBitmap:Boolean = true):LatLng

Returns geographical position of the mouse pointer. If mouse pointer is out of the map view, returns null. Additionally you can specify a zoom level at which to perform the calculation.

Parameters
zoom:Number (default = 0) — Zoom level at which the calculation should be performed, current zoom level is used if this parameter has been omitted.
 
limitBitmap:Boolean (default = true) — Limits the mouse pointer in the map bitmap, specify a value of false to cancel limitation.

Returns
LatLng — A point geographical coordinates, or null if pointer is out of the map view.
getOverlay()method 
public function getOverlay(id_or_name:*):IOverlay

Searches for an IOverlay object with specfied name or id, that was attached to a default layer.

Parameters
id_or_name:* — Either name of an IOverlay object or it's id.

Returns
IOverlay — Reference to the first found IOverlay object or null if nothing was found.
getOverlays()method 
public function getOverlays():Array

Returns an Array holding all the IOverlay objects attached to default layer.

Returns
Array — An Array holding all the IOverlay objects.
getSavedPosition()method 
public function getSavedPosition():Object

Returns an object that holds previously saved position.

Returns
Object
lockMapView()method 
public function lockMapView(lock:Boolean = true):void

Freeze the map view. This is achieved by disabling mouse dragging & scroll wheel zoom, keyboard controls, and double click action.

To unlock the view call lockMapview(false). When unlocking the map view, all handlers will be reenbled and the double click mode will be returned to DoubleClickMode.PAN.

Parameters
lock:Boolean (default = true) — Defines whether to lock (true) or unlock the map view (false).
openInfoWindow()method 
public function openInfoWindow(param:Object = null, style:Object = null):IInfoWindow

Opens new info window with the specified parameters and style.

Parameters
param:Object (default = null) — Object that defines info window parameters.
 
style:Object (default = null) — Object that defines info window style.

Returns
IInfoWindow — Reference to the opened info window.
panByXY()method 
public function panByXY(distance:Point, immediate:Boolean = false):void

Pans the map view by a certain distance in pixels. If the target point is in the current map view and animatePan property is set to true, panning occurs with the smooth animation. Otherwise, or if immediate flag is set to true, map view changes instantly.

Map fires MapEvent.PAN_START when panning starts, MapEvent.PAN_STOP when panning ends and MapEvent.PAN during the panning animation.

Parameters
distance:Point — panning distance in pixels
 
immediate:Boolean (default = false) — flag that indicates whether to change the map view instantly

See also

panTo()method 
public function panTo(latlng:LatLng, immediate:Boolean = false):void

Pans the map to the specified point. If the point is in the current map view and animatePan property is set to true, panning occurs with the smooth animation. Otherwise, or if immediate flag is set to true, map view changes instantly.

Map fires MapEvent.PAN_START when panning starts, MapEvent.PAN_STOP when panning ends and MapEvent.PAN during the panning animation.

Parameters
latlng:LatLng — target panning point
 
immediate:Boolean (default = false) — flag that indicates whether to change the map view instantly

See also

removeManager()method 
public function removeManager(manager:IManager):void

Removes specified IManager object from the managers list.

Parameters
manager:IManagerIManager that should be removed.
removeOverlay()method 
public function removeOverlay(overlay:IOverlay):void

Removes specified IOverlay object from the default layer.

Parameters
overlay:IOverlayIOverlay that should be removed.
returnToSavedPosition()method 
public function returnToSavedPosition():void

Pans the map to the prviously saved center & zoom level.

savePosition()method 
public function savePosition():void

Saves current map center coordinates and zoom level. Use returnToSavedPosition() method to pan back to saved map view.

setBounds()method 
public function setBounds(bounds:LatLngBounds, offset:Point = null, immediate:Boolean = false, maxZoomLevel:Number = 0):Boolean

Sets the map view position and zoom, so that it fits the specified LatLngBounds rectangle.

Parameters
bounds:LatLngBounds — Target bounds rectangle.
 
offset:Point (default = null) — A flag which defines whether to set bounds immediately (true), or use animation. To control animation, use animatePan and animateZoom properties.
 
immediate:Boolean (default = false) — If specified, defines the maximum zoom level that can be set. Prevents "too close" zooming.
 
maxZoomLevel:Number (default = 0)

Returns
Boolean — A value of false an error occured while trying to set new bounds; false if has not.
setCenter()method 
public function setCenter(latlng:LatLng, zoom:Number = 0):void

Sets the map view to the given center, optionally also sets the zoom level. When map center point changes, DisplayEvent.UPDATE_POSITION is fired. When zoom level changes, DisplayEvent.UPDATE_ZOOM is fired.

Parameters
latlng:LatLng — new center point
 
zoom:Number (default = 0) — new zoom level

Example
Here is how you can set center of the map:
  import com.afcomponents.umap.core.UMap;
  import com.afcomponents.umap.types.LatLng;
  
  var map:UMap = new UMap();
  map.setSize(300, 300);
  map.setCenter(new LatLng(30,-20));
  addChild(map);

setComponentStyle()method 
public function setComponentStyle(style:Object):void

Sets the component style. After setting new style, invalidates the component.

Parameters
style:Object — An object which defines new component style.
setMapType()method 
public function setMapType(mapTypeName:String):void

Attempts to change the map type by it's name. It the map is not ready, new map type will be saved and checked after Control will enter ready state. When map type changes, DisplayEvent.UPDATE_MAP_TYPE is fired.

Parameters
mapTypeName:String — New map type name.

See also


Example
Here is how you can change the map type:
  import com.afcomponents.umap.core.UMap;
  
  var map:UMap = new UMap();
  map.setSize(300, 300);
  map.setMapType("satellite");
  addChild(map);

setProvider()method 
public function setProvider(providerClassOrInstance:*):Boolean

Sets the provider for the UMap either by Class reference or a IProvider instance.

Parameters
providerClassOrInstance:* — Class or IProvider Object instance that defines the new provider for UMap.

Returns
Boolean — A value of true if the provider change was successfull; false if it was not.

Example
  import com.afcomponents.umap.providers.Providers;
  map.setProvider(Providers.MICROSOFT);

setZoom()method 
public function setZoom(zoom:Number, immediate:Boolean = false):void

Sets the map zoom level. When zoom level changes, DisplayEvent.UPDATE_ZOOM is fired. If smoothZoom property is set to false, the zoom level will be rounded up to the nearest integer.

Parameters
zoom:Number — Target zoom level.
 
immediate:Boolean (default = false) — A flag which defines whether to set zoom immediately. Used only when animatePan is set to true.
toXML()method 
public function toXML(afcTags:Boolean = false):XML

Returns XML data in KML 2.1 format, which describes all the Overlays attached to the map.

Parameters
afcTags:Boolean (default = false) — Flag that determines whether to generate KML data with extended AFC tags.

Returns
XML — XML data or null if an error occured.
zoomIn()method 
public function zoomIn(delta:Number):void

Increases the map zoom level. If delta is specified increases zoom level by delta, otherwise increases zoom level by 1. If smoothZoom property is set to false, the zoom level will be rounded up to the nearest integer. When zoom level changes, DisplayEvent.UPDATE_ZOOM is fired.

Parameters
delta:Number — Zoom in amount.
zoomOut()method 
public function zoomOut(delta:Number):void

Decreases the map zoom level. If delta is specified decreases zoom level by delta, otherwise decreases zoom level by 1. If smoothZoom property is set to false, the zoom level will be rounded up to the nearest integer. When zoom level changes, DisplayEvent.UPDATE_ZOOM is fired.

Parameters
delta:Number — Zoom out amount.
zoomTo()method 
public function zoomTo(latlng:LatLng, zoom:Number, immediate:Boolean = false):void

Zoom the map to a given point & zoom level. This function differs from

Parameters
latlng:LatLng — Target zoom level.
 
zoom:Number — A flag which defines whether to set zoom immediately. Used only when animatePan is set to true.
 
immediate:Boolean (default = false)
Event detail
dragevent 
Event object type: com.afcomponents.umap.events.MapEvent
MapEvent.type property = com.afcomponents.umap.events.MapEvent.DRAG

Dispatched when user drags the map.

The MapEvent.DRAG constant defines the value of the type property of an drag 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.
targetReference to the core.UMap instance.
latlngGeographical coordinates of the map center point.
paramnull
dragStartevent  
Event object type: com.afcomponents.umap.events.MapEvent
MapEvent.type property = com.afcomponents.umap.events.MapEvent.DRAG_START

Dispatched when user starts dragging the map.

The MapEvent.DRAG_START constant defines the value of the type property of an dragStart 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.
targetReference to the core.UMap instance.
latlngGeographical coordinates of the map center point.
paramnull
dragStopevent  
Event object type: com.afcomponents.umap.events.MapEvent
MapEvent.type property = com.afcomponents.umap.events.MapEvent.DRAG_STOP

Dispatched when user stops dragging the map.

The MapEvent.DRAG_STOP constant defines the value of the type property of an dragStop 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.
targetReference to the core.UMap instance.
latlngGeographical coordinates of the map center point.
paramnull
infoWindowCloseevent  
Event object type: com.afcomponents.umap.events.MapEvent
MapEvent.type property = com.afcomponents.umap.events.MapEvent.INFO_WINDOW_CLOSE

Dispatched when info window has been closed.

The MapEvent.INFO_WINDOW_CLOSE constant defines the value of the type property of an infoWindowClose 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.
targetReference to the core.UMap instance.
latlngGeographical coordinates of the map center point.
paramReference to the closed info window.
infoWindowOpenevent  
Event object type: com.afcomponents.umap.events.MapEvent
MapEvent.type property = com.afcomponents.umap.events.MapEvent.INFO_WINDOW_OPEN

Dispatched when info window has been opened.

The MapEvent.INFO_WINDOW_OPEN constant defines the value of the type property of an infoWindowOpen 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.
targetReference to the core.UMap instance.
latlngGeographical coordinates of the map center point.
paramReference to the opened info window.
mapClickevent  
Event object type: com.afcomponents.umap.events.MapEvent
MapEvent.type property = com.afcomponents.umap.events.MapEvent.CLICK

Dispatched when the map has been clicked.

The MapEvent.CLICK constant defines the value of the type property of an mapClick 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.
targetReference to the core.UMap instance.
latlngGeographical coordinates of the click.
paramnull
mapDoubleClickevent  
Event object type: com.afcomponents.umap.events.MapEvent
MapEvent.type property = com.afcomponents.umap.events.MapEvent.DOUBLE_CLICK

Dispatched when the map has been double clicked.

The MapEvent.DOUBLE_CLICK constant defines the value of the type property of an mapDoubleClick 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.
targetReference to the core.UMap instance.
latlngGeographical coordinates of the double click.
paramnull
moveEndevent  
Event object type: com.afcomponents.umap.events.MapEvent
MapEvent.type property = com.afcomponents.umap.events.MapEvent.MOVE_END

Dispatched when automatic panning of the map has been finished.

The MapEvent.MOVE_END constant defines the value of the type property of an moveEnd 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.
targetReference to the core.UMap instance.
latlngGeographical coordinates of the map center point.
paramnull
panevent  
Event object type: com.afcomponents.umap.events.MapEvent
MapEvent.type property = com.afcomponents.umap.events.MapEvent.PAN

Dispatched when the map view is panning.

The MapEvent.ZOOM constant defines the value of the type property of a zoom 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.
targetReference to the core.UMap instance.
latlngGeographical coordinates of the map center point.
paramObject which describes zoom animation: startZoom, targetZoom, currentZoom
panStartevent  
Event object type: com.afcomponents.umap.events.MapEvent
MapEvent.type property = com.afcomponents.umap.events.MapEvent.PAN_START

Dispatched when the map view starts panning.

The MapEvent.PAN_START constant defines the value of the type property of a panStart 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.
targetReference to the core.UMap instance.
latlngGeographical coordinates of the map center point.
paramnull
panStopevent  
Event object type: com.afcomponents.umap.events.MapEvent
MapEvent.type property = com.afcomponents.umap.events.MapEvent.PAN_STOP

Dispatched when the map view stops panning.

The MapEvent.PAN_STOP constant defines the value of the type property of a panStop 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.
targetReference to the core.UMap instance.
latlngGeographical coordinates of the map center point.
paramnull
propertyChangedevent  
Event object type: com.afcomponents.umap.events.MapEvent
MapEven