Packagecom.afcomponents.umap.display.routemanager
Classpublic class RouteManager
InheritanceRouteManager Inheritance Manager Inheritance MapObjectContainer Inheritance MapObject Inheritance flash.display.Sprite
ImplementsIManager



Public Properties
 PropertyDefined by
 InheritedasDisplayObject : DisplayObject
Returns reference to the object as a DisplayObject instance.
MapObject
 Inheritedcore : UMap
Returns reference to the core UMap object.
MapObject
 Inheritedid : uint
Gets or sets the ID of the object.
MapObject
  name : String
[write-only]
RouteManager
 Inheritedowner : IMapObjectContainer
Returns reference to the owner container object.
MapObject
  routeResults : RouteResults
[read-only] Returns last routing results.
RouteManager
Public Methods
 MethodDefined by
  
RouteManager(service:* = null, options:Object = null)
Initialized the route manager.
RouteManager
 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
 Inherited
dispose():void
Releases all the resources accuired by the object.
MapObjectContainer
  
doRoute(locations:Array, options:Object = null):Boolean
Performs the route query for the specified locations.
RouteManager
  
getAllManeuvers(results:RouteResults = null):Array
RouteManager
 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
  
RouteManager
 Inherited
init():void
Manager
 Inherited
isOwnerVisible():Boolean
Recursevly checks visibility of parent objects
MapObjectContainer
 Inherited
ready():void
Manager
 Inherited
remove():void
Removes the object from the owner container object.
MapObject
 Inherited
removeObject(object:IMapObject):void
Removes IMapObject from the container.
MapObjectContainer
  
resultsToPolyline(results:RouteResults, param:Object = null, style:Object = null):Polyline
[static] Returns a Polyline which connects all route points of the specified RouteResults object.
RouteManager
 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
 Inherited
Adds the object to the specified IMapObjectContainer.
MapObjectContainer
  
setService(service:*, options:Object = null):void
Sets new service type.
RouteManager
  
showResults(results:RouteResults = null, layer:Layer = null):Polyline
Adds results polyline to the map and shows it.
RouteManager
 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
Public Constants
 ConstantDefined by
  BING_SERVICE : Class
[static]
RouteManager
  CLOUD_MADE_SERVICE : Class
[static]
RouteManager
  DEFAULT_SERVICE : Class
[static]
RouteManager
  MAP_QUEST_SERVICE : Class
[static]
RouteManager
Property detail
nameproperty
name:String  [write-only]Implementation
    public function set name(value:String):void
routeResultsproperty 
routeResults:RouteResults  [read-only]

Returns last routing results.

Implementation
    public function get routeResults():RouteResults
Constructor detail
RouteManager()constructor
public function RouteManager(service:* = null, options:Object = null)

Initialized the route manager. You can specify the route service type and the default service options via constructor parameters.

Parameters
service:* (default = null)Class or IRouteService object instance.
 
options:Object (default = null) — Default service parameters.

Example
  import com.afcomponents.umap.display.routemanager.RouteManager;
  
  // create RouteManager
  var rm:RouteManager = new RouteManager(RouteManager.MAP_QUEST_SERVICE, {clientId:12345, password:secret"});
  map.addManager(rm);
  
  // find & display route from Denver to New York
  var start:GeoAddress = new GeoAddress();
  start.country = "US";
  start.state = "CO";
  start.city = "Denver";
  start.latlng = new LatLng(39.740112, -104.984856);
  
  var end:GeoAddress = new GeoAddress();
  end.country = "US";
  end.state = "NY";
  end.city = "New York";
  end.latlng = new LatLng(40.720409, -73.994637);
  
  rm.doRoute([start, end]);
  
  

Method detail
doRoute()method
public function doRoute(locations:Array, options:Object = null):Boolean

Performs the route query for the specified locations. The points should be specifed in the service required format. Additional query properties can be specified in the options parameter.

Parameters
locations:Array — 2 or more route points.
 
options:Object (default = null) — Additional query parameters.

Returns
Boolean — A value of true if query paramters has been accepted by the service and the execution began; false if it was not.
getAllManeuvers()method 
public function getAllManeuvers(results:RouteResults = null):ArrayParameters
results:RouteResults (default = null)

Returns
Array
getService()method 
public function getService():*

Returns
*
resultsToPolyline()method 
public static function resultsToPolyline(results:RouteResults, param:Object = null, style:Object = null):Polyline

Returns a Polyline which connects all route points of the specified RouteResults object.

Parameters
results:RouteResults — Target routing results.
 
param:Object (default = null) — Default parameters object for the created Polyline.
 
style:Object (default = null) — Default polyline style object.

Returns
Polyline — A Polyline object which connects all route points.
setService()method 
public function setService(service:*, options:Object = null):void

Sets new service type. Service parameter can be either a Class or IRouteService instance. If you set service as a Class, additionally you can specify default service options.

Parameters
service:* — Either a Class or IRouteService instance.
 
options:Object (default = null) — service options.
showResults()method 
public function showResults(results:RouteResults = null, layer:Layer = null):Polyline

Adds results polyline to the map and shows it. If the results parameter is omitted, shows previous results.

Parameters
results:RouteResults (default = null) — Valid RouteResults object or null, if previous results should be shown
 
layer:Layer (default = null) — A Layer object to which resulting polyline should be attached. By default attached to the route layer.

Returns
Polyline — A Polyline object
Constant detail
BING_SERVICEconstant
public static const BING_SERVICE:Class
CLOUD_MADE_SERVICEconstant 
public static const CLOUD_MADE_SERVICE:Class
DEFAULT_SERVICEconstant 
public static const DEFAULT_SERVICE:Class
MAP_QUEST_SERVICEconstant 
public static const MAP_QUEST_SERVICE:Class