Google Maps

Elixir wrapper around Google Maps APIs

Build StatusHex VersionLicense

Services

Methods

Installation

If available in Hex, the package can be installed as:

  1. Add google_maps to your list of dependencies in mix.exs:
def deps do
  [{:google_maps, "~> 0.9"}]
end
  1. Ensure google_maps is started before your application:
def application do
  [applications: [:google_maps]]
end
  1. In your application’s config/config.exs, add:
config :google_maps,
  api_key: "YOUR API KEY HERE"

Or you can use GOOGLE_MAPS_API_KEY system environment variable when running in iex.

If separate API keys are needed per request, they can be set through key option, i.e.:

GoogleMaps.directions("Toronto", "Montreal", key: API_KEY_1)

Development

You’ll need a Google API key with all relevant APIs (see above) enabled. Add your key to the environment as specified above.

Then run tests:

mix deps.get test

mix test