Packagecom.esri.ags.tasks
Classpublic class RouteTask
InheritanceRouteTask Inheritance BaseTask Inheritance flash.events.EventDispatcher

Helps you solve a routing problem by finding a least-cost path between multiple locations using a network service exposed by the ArcGIS Server REST API (available in ArcGIS Server 9.3.1 and later). You can route between two or more locations, optionally avoiding barriers, finding best sequence and getting driving directions.

The "cost" (of the least-cost path) is calculated based on an impedance attribute which you define in a network dataset. Impedance can be time or distance, or even a more abstract variable such as "scenic value".

Note: RouteTask, and other routing related classes, were added in version 1.2 and requires ArcGIS Server 9.3.1 or above (with a "route" layer).

See also

RouteParameters
RouteSolveResult
com.esri.ags.events.RouteEvent
Concepts - Routing tasks
Live Sample - Routing.
Live Sample - Routing with driving directions.
Solve (Operation) in REST documentation


Public Properties
 PropertyDefined by
 Inheritedconcurrency : String = "multiple"
Value that indicates how to handle multiple calls to the same task.
BaseTask
 InheriteddisableClientCaching : Boolean
If true, adds a timestamp parameter ("_ts") to the REST request to prevent the request from being loaded from the browser's cache.
BaseTask
 InheritedproxyURL : String
The URL to proxy the request through.
BaseTask
 InheritedrequestTimeout : Number = -1
The request timeout in seconds.
BaseTask
 InheritedshowBusyCursor : Boolean = false
If true, a busy cursor is displayed while a service is executing.
BaseTask
  solveLastResult : RouteSolveResult
The last route result of the solve function.
RouteTask
 Inheritedtoken : String
Token for accessing a secure task.
BaseTask
 Inheritedurl : String
URL of the task.
BaseTask
Public Methods
 MethodDefined by
  
RouteTask(url:String = null)
Creates a new RouteTask instance.
RouteTask
  
solve(routeParameters:RouteParameters, responder:IResponder = null):AsyncToken
Solve the route.
RouteTask
Events
 EventSummaryDefined by
   Dispatched when a RouteTask fails.RouteTask
   Dispatched on success.RouteTask
Property detail
solveLastResultproperty
public var solveLastResult:RouteSolveResult

The last route result of the solve function.

This property can be used as the source for data binding.

Constructor detail
RouteTask()constructor
public function RouteTask(url:String = null)

Creates a new RouteTask instance.

Parameters
url:String (default = null) — [optional] URL to the ArcGIS Server REST resource that represents a route service.
Method detail
solve()method
public function solve(routeParameters:RouteParameters, responder:IResponder = null):AsyncToken

Solve the route.

Parameters
routeParameters:RouteParameters — The criteria used to solve the route.
 
responder:IResponder (default = null) — The responder to call on result or fault.

Returns
AsyncToken
Event detail
faultevent 
Event object type: mx.rpc.events.FaultEvent

Dispatched when a RouteTask fails.

solveCompleteevent  
Event object type: com.esri.ags.events.RouteEvent
RouteEvent.type property = com.esri.ags.events.RouteEvent.SOLVE_COMPLETE

Dispatched on success.

Defines the value of the type property of an solveComplete event object.