maps_matrix_api v0.1.0 MapsMatrixApi
MapsMAtrixApi is a simple interface to Googles Distance Matrix Api
Link to this section Summary
Types
A address that will be transformed and geocoded to latitude and longitude
A latitude and longitude pair in a tuple or comma-separated string format
A tuple with an id of a known place
A specific point, which can be an address, a latitude/longitude coord or a place id tupple
Functions
Retrives the maps matrix from one point to another
Retrives the disntace from one point to another
Link to this section Types
A address that will be transformed and geocoded to latitude and longitude.
A latitude and longitude pair in a tuple or comma-separated string format.
A tuple with an id of a known place.
A specific point, which can be an address, a latitude/longitude coord or a place id tupple.
Link to this section Functions
Retrives the maps matrix from one point to another.
Args:
origin
- The coordinates latitude, longitude value, address, or place ID from which the calculation will be executed. If an address is passed the string will be transformed into a latitude, longitude coordinate.destination
— The coordinates latitude, longitude value, address, or place ID from which the calculation will be executed. If an address is passed the string will be transformed into a latitude, longitude coordinate.
Options:
departure_time
— Specifies the desired time of departure. You can specify the time as an integer in seconds since midnight, January 1, 1970 UTC. Alternatively, you can specify a value ofnow
, which sets the departure time to the current time (correct to the nearest second). The departure time may be specified in two cases:- For requests where the travel mode is transit: You can
optionally specify one of
departure_time
orarrival_time
. If neither time is specified, thedeparture_time
defaults to now (that is, the departure time defaults to the current time). - For requests where the travel mode is driving: You can specify
the
departure_time
to receive a route and trip duration (response field:duration_in_traffic
) that take traffic conditions into account. This option is only available if the request contains a valid API key, or a valid Google Maps APIs Premium Plan client ID and signature. Thedeparture_time
must be set to the current time or some time in the future. It cannot be in the past.
- For requests where the travel mode is transit: You can
optionally specify one of
units
— Specifies the unit system to use displaying results.
Examples
iex> MapsMatrixApi.get()
:world
Retrives the disntace from one point to another.
Args:
origin
- The coordinates latitude, longitude value, address, or place ID from which the calculation will be executed. If an address is passed the string will be transformed into a latitude, longitude coordinate.destination
— The coordinates latitude, longitude value, address, or place ID from which the calculation will be executed. If an address is passed the string will be transformed into a latitude, longitude coordinate.
Options:
departure_time
— Specifies the desired time of departure. You can specify the time as an integer in seconds since midnight, January 1, 1970 UTC. Alternatively, you can specify a value ofnow
, which sets the departure time to the current time (correct to the nearest second). The departure time may be specified in two cases:- For requests where the travel mode is transit: You can
optionally specify one of
departure_time
orarrival_time
. If neither time is specified, thedeparture_time
defaults to now (that is, the departure time defaults to the current time). - For requests where the travel mode is driving: You can specify
the
departure_time
to receive a route and trip duration (response field:duration_in_traffic
) that take traffic conditions into account. This option is only available if the request contains a valid API key, or a valid Google Maps APIs Premium Plan client ID and signature. Thedeparture_time
must be set to the current time or some time in the future. It cannot be in the past.
- For requests where the travel mode is transit: You can
optionally specify one of
units
— Specifies the unit system to use displaying results.
Examples
iex> MapsMatrixApi.get()
:world
timezone(coordinate(), options()) :: Response.t()