get Route
Route Get distance, duration and path (as a polyline) for a pair of origin and destination, based on the recommended route between those two points for a specified travel mode.
Return
DistanceRouteResponse
Parameters
The starting point. It should be supplied in the form of latitude/longitude coordinates. Ensure that no space exists between the latitude and longitude values.
The ending point for the route. It should be supplied in the form of latitude/longitude coordinates. Ensure that no space exists between the latitude and longitude values.
Specifies the mode of transport to use when calculating distance (optional)
The language code, indicating in which language the results should be returned, if possible. If language is not supplied, the Distance API service will use the navigator language or “en”. (optional)
Specifies the unit system parameter to use when expressing distance as text. Two different units supported: * `metric` (default) returns distances in kilometers and meters * `imperial` returns distances in miles and feet (optional)
Specifies if alternative routes should be returned. default is `false`. Depending on the calculated route, alternatives may not be provided. `alternatives` and `waypoints` can not be used at the same time. (optional)
A list of points by which the route should pass (route response is divided into legs, one leg corresponding to a route between two waypoints). Waypoints should be separated by | character. Optionally, you may pass `optimize:true` as the first argument within the waypoints parameter. This way the provided route is optimized by rearranging the waypoints in a more efficient order based on distance or time according to the method parameter. The route start point and end point order is not changed, their position is considered fixed. `alternatives` and `waypoints` can not be used at the same time. (optional)
Specifies the method to compute the route between the start point and the end point: - `time`: fastest route (default) - `distance`: shortest route (optional)
Specifies if maneuver instructions should be returned (roadbook). Valid values are `none` and `full` (default is `none`) (optional)
The list of features that you want to avoid. Valid values are `tolls`, `highways`, `ferries` or polygons coordinates whose vertex latlng are separated by a semicolon. To add multiple polygons, separate them with the `|` character. (optional)
Throws
If the request is not correctly configured
Rethrows the OkHttp execute method exception
If the API returns an informational or redirection response
If the API returns a client error response
If the API returns a server error response