Find routes between two or more locations and optionally get driving directions. The RouteTask uses ArcGIS Server network analysis services to calculate routes. Network analysis services allow you to solve simple routing problems as well as complex ones that take into account multiple stops, barriers, and time windows.
To work directly with the RouteTask, the basic pattern is:
The name of the class.more details
The options to be used for data requests.more details
The ArcGIS Server REST service URL (usually of a Feature Service Layer or Map Service Layer) for use in a task.more details
The name of the class. The declared class name is formatted as
The options to be used for data requests. These options can also be controlled through the
The ArcGIS Server REST service URL (usually of a Feature Service Layer or Map Service Layer) for use in a task.
Solves the route against the route layer with the route parameters.more details
Solves the route against the route layer with the route parameters.Parameters:params RouteParameters
Route parameters used as input to generate the route.requestOptions Objectoptional
Additional options to be used for the data request (will override requestOptions defined during construction).Returns:
Type Description Promise<RouteResult> When resolved, returns an instance of RouteResult.