The behaviour a time zone lookup backend implements.
TzWorld answers lookups by calling the running backend, normally
TzWorld.Backend.SpatialIndex. A custom backend implements these
callbacks, runs in the application's supervision tree registered under
its module name, and is made the default with:
config :tz_world, default_backend: MyApp.TzWorldBackendTzWorld validates points before it calls a backend, so a backend
always receives a Geo.Point whose coordinates are numbers within
range.
Summary
Types
A point whose coordinates are {lng, lat}.
Latitude in degrees, from -90 to 90.
Longitude in degrees, from -180 to 180.
Callbacks
Returns every time zone at a point, as {:ok, time_zones} with an
empty list if no time zone contains it.
Reloads the time zone data after mix tz_world.update has installed a
new release.
Returns the time zone at a point: {:ok, time_zone}, or
{:error, :time_zone_not_found} if no time zone contains it.
Returns the version of the loaded time zone data, as {:ok, version}.
Types
@type geo() :: Geo.Point.t()
A point whose coordinates are {lng, lat}.
@type lat() :: number()
Latitude in degrees, from -90 to 90.
@type lng() :: number()
Longitude in degrees, from -180 to 180.
Callbacks
Returns every time zone at a point, as {:ok, time_zones} with an
empty list if no time zone contains it.
Reloads the time zone data after mix tz_world.update has installed a
new release.
Returns the time zone at a point: {:ok, time_zone}, or
{:error, :time_zone_not_found} if no time zone contains it.
Returns the version of the loaded time zone data, as {:ok, version}.