get Distance Matrix
Distance Matrix Get distances and durations for a matrix of origins and destinations, based on the recommended route between start and end points for a specified travel mode.
Return
DistanceMatrixResponse
Parameters
The starting point for calculating travel distance. You can supply one or more locations separated by the pipe character (|), in the form of latitude/longitude coordinates. They are used unchanged to calculate distance. Ensure that no space exists between the latitude and longitude values. In order to reduce URL size, encoded polylines are also supported using `enc:encoded-polyline:`
One or more locations to use as the finishing point for calculating travel distance. The options for the destinations parameter are the same as for the origins parameter, described above. In order to reduce URL size, encoded polylines are also supported using `enc:encoded-polyline:`
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 element values that will be part of the API response (distance and/or duration). if not specified default is `distance` (optional)
Specifies the method to compute the route between the start point and the end point: - `time`: fastest route (default) - `distance`: shortest route (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