Description
Class hierarchy
esri.tasks.RouteTask
Constructor
Properties
| url |
String
|
URL to the ArcGIS Server REST resource that represents a network analysis service. To obtain the URL, use Services Directory. |
Methods
Events
Constructor Detail
esri.tasks.RouteTask(url)
Creates a new RouteTask object.
Parameters:
|
<String>
url |
Required |
URL to the ArcGIS Server REST resource that represents a network analysis service. To obtain the URL, use Services Directory.
|
Properties Detail
URL to the ArcGIS Server REST resource that represents a network analysis service. To obtain the URL, use
Services Directory.
Methods Detail
solve(params, callback?, errback?)
Solves the route against the route layer with the route parameters.
Input Parameters:
|
<RouteParameters> params |
Required |
Route parameters used as input to generate the route. |
|
<Function> callback |
Optional |
The function to call when the method has completed. The arguments in the function are the same as the onSolveComplete event. |
|
<Function> errback |
Optional |
An error object is returned if an error occurs during task execution. |
Events Detail
Fires when an error occurs when executing the task.
Arguments:
onSolveComplete(routeResults, barriers, message)
Fires when RouteTask.solve() has completed. This is the same signature returned if the optional callback is specified.
Arguments:
|
<RouteResult[]> routeResults
|
Array of route results.
|
|
<Graphic[]> barriers
|
Array of graphics representing the barriers. Barriers are returned only if RouteParameters.returnBarriers is true. For the list of attributes returned for each barrier, see the "Barrier properties" section in Finding the best route.
|
|
<GPMessage[]> message
|
Message received when solve is completed. If a route cannot be solved, the message returned by the server identifies the route that could not be solved.
|