ex_google v0.2.0 ExGoogle.Maps.Api View Source

API wrapper for google maps

Link to this section Summary

Functions

Use google maps api to perform geocoding and reverse geocoding

Link to this section Functions

Link to this function

search(params)

View Source
search(map()) :: {:ok, binary()} | {:error, binary()}

Use google maps api to perform geocoding and reverse geocoding

The first params map can consist of any field that google map supports. While the examples below show few parameters, passing any parameters that google maps api supports works.

Examples

alias ExGoogle.Maps.Api, as: Maps
# google maps reverse geocoding
Maps.search(%{latlng: "40.714224,-73.961452"})

# google maps geocoding
Maps.search(%{address: "1600 Amphitheatre Parkway, Mountain View, CA"})

# Advanced parameters
Maps.search(%{latlng: "40.714224,-73.961452", location_type: "ROOFTOP|RANGE_INTERPOLATED|GEOMETRIC_CENTER", result_type: "street_address"})