LibLatLon v0.4.1 LibLatLon View Source

This module is basically the only module consumers of this library should be interested in.

There is a single function exported: [LibLatLon.lookup/3].

Link to this section Summary

Functions

Pass anything to lookup using default provider and with default options. Pass a provider as the second argument to use a specific provider. Pass options map like %{language: "es"} as a last parameter to tune the provider’s response. NB: options are provider-specific

Link to this section Functions

Link to this function lookup(value, provider \\ LibLatLon.Providers.OpenStreetMap, opts \\ %{}) View Source
lookup(any(), atom(), %{}) ::
  {:ok, LibLatLon.Info.t()} |
  {:error, any()}

Pass anything to lookup using default provider and with default options. Pass a provider as the second argument to use a specific provider. Pass options map like %{language: "es"} as a last parameter to tune the provider’s response. NB: options are provider-specific.

Examples

iex> LibLatLon.lookup(
...>   {42, 3.14159265},
...>   LibLatLon.Providers.Dummy,
...>   %{extended: true}).details
%{
  city: "Barcelona",
  city_district: "Sant Martí",
  country: "España",
  country_code: "es",
  county: "BCN",
  postcode: "08020",
  road: "Avinguda del Litoral",
  state: "CAT",
  suburb: "la Vila Olímpica del Poblenou"
}