solveRoute

solveRoute

solveRoute(requestOptionsISolveRouteOptions): Promise<ISolveRouteResponse>

Used to find the best way to get from one location to another or to visit several locations. See the REST Documentation for more information.

Use dark colors for code blocksCopy
          
1
2
3
4
5
6
7
8
9
10
import { solveRoute } from '@esri/arcgis-rest-routing';

solveRoute({
  stops: [
    [-117.195677, 34.056383],
    [-117.918976, 33.812092],
   ],
   authentication
})
  .then(response) // => {routes: {features: [{attributes: { ... }, geometry:{ ... }}]}
Parameters
ParameterTypeNotes
requestOptions
ISolveRouteOptions

Options to pass through to the routing service.

Returns 
Promise<ISolveRouteResponse>

A Promise that will resolve with routes and directions for the request.

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