solveRoute
FunctionsolveRoute(requestOptions: ISolveRouteOptions): 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.
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
Parameter | Type | Notes |
---|---|---|
request | ISolveRouteOptions | Options to pass through to the routing service. |
Returns
Promise<ISolveRouteResponse>
A Promise that will resolve with routes and directions for the request.