View Source LibLatLon (LibLatLon v0.8.0)

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

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

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.

Functions

Link to this function

lookup(value, provider \\ default_provider(), opts \\ %{})

View Source
@spec 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"
}