Retrieves directions and estimated travel time based on the specified start and end points.
- MapKit JS 5.0+
Directionsobject that specifies details for the directions you want to retrieve.
A callback function that receives the directions, returned asynchronously.
A request ID, which you can pass to
cancel to abort a pending request.
To get directions, provide a
Directions object when you call the
Directions are returned asynchronously via a callback function. This callback function is invoked with two arguments,
error and on failure and data on success.
error contains an error code and a text description of the error and
data is a
Directions object with the following two properties:
requestis the request object associated with this response.
routescontains an array of up to three
Routeobjects returned by the server.