route

AMD: require(["esri/rest/route"], (route) => { /* code goes here */ });
ESM: import * as route from "@arcgis/core/rest/route";
Object: esri/rest/route
Since: ArcGIS API for JavaScript 4.19

Find routes between two or more locations and optionally get driving directions. The route module 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 route, the basic pattern is:

  1. Define the URL to the ArcGIS Server REST resource
  2. Configure the parameters
  3. Solve the route and then specify what to do with its results and handle any errors that may be returned.

Method Overview

Name Return Type Summary Object
Promise<RouteResult>more details

Solves the route against the route layer with the route parameters.

more detailsroute

Method Details

solve(url, params, requestOptions){Promise<RouteResult>}

Solves the route against the route layer with the route parameters.

Parameters:
url String

URL to the ArcGIS Server REST resource that represents a network analysis service.

Route parameters used as input to generate the route.

requestOptions Object
optional

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.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.