| Package | com.esri.ags.tasks |
| Class | public class RouteTask |
| Inheritance | RouteTask BaseTask flash.events.EventDispatcher |
| Since : | ArcGIS API for Flex 1.2 |
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 and a "route" layer. A "route" layer is a layer of type "esriNAServerRouteLayer", for example, http://tasks.arcgisonline.com/ArcGIS/rest/services/NetworkAnalysis/ESRI_Route_EU/NAServer/Route.
See also
| Property | Defined By | ||
|---|---|---|---|
![]() | autoNormalize : Boolean
If true, normalizes the geometries across the central meridian. | BaseTask | |
![]() | concurrency : String
Value that indicates how to handle multiple calls to the same task. | BaseTask | |
![]() | disableClientCaching : 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 | |
![]() | method : String
URL request method to use. | BaseTask | |
![]() | proxyURL : String
The URL to proxy the request through. | BaseTask | |
![]() | requestTimeout : int
The request timeout in seconds. | BaseTask | |
![]() | showBusyCursor : Boolean
If true, a busy cursor is displayed while a service is executing. | BaseTask | |
| solveLastResult : RouteSolveResult [read-only]
The result returned from last call to the solve function. | RouteTask | ||
![]() | token : String
Token for accessing a secure task. | BaseTask | |
![]() | url : String
URL of the task. | BaseTask | |
| Method | Defined By | ||
|---|---|---|---|
RouteTask(url:String = null)
Creates a new RouteTask instance. | RouteTask | ||
solve(routeParameters:RouteParameters, responder:IResponder = null):AsyncToken
Solve the route. | RouteTask | ||
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| Dispatched when a RouteTask fails. | RouteTask | |||
| Dispatched on success. | RouteTask | |||
| solveLastResult | property |
solveLastResult:RouteSolveResult [read-only] The result returned from last call to the solve function.
This property can be used as the source for data binding.
public function get solveLastResult():RouteSolveResult| RouteTask | () | Constructor |
public function RouteTask(url:String = null)Creates a new RouteTask instance.
Parametersurl:String (default = null) — [optional] URL to the ArcGIS Server REST resource that represents a route service.
|
| solve | () | method |
public function solve(routeParameters:RouteParameters, responder:IResponder = null):AsyncTokenSolve the route.
Parameters
routeParameters:RouteParameters — The criteria used to solve the route.
| |
responder:IResponder (default = null) — The responder to call on result or fault.
|
AsyncToken |
| fault | Event |
mx.rpc.events.FaultEventmx.rpc.events.FaultEvent.FAULTDispatched when a RouteTask fails.
| solveComplete | Event |
com.esri.ags.events.RouteEventcom.esri.ags.events.RouteEvent.SOLVE_COMPLETEDispatched on success.
Defines the value of thetype property of an solveComplete event object.