Elixir client for the Apple Maps Server API.
The public surface is intentionally small:
AppleMapsServer.search("coffee")
AppleMapsServer.search_autocomplete("cof")
AppleMapsServer.geocode("1 Infinite Loop, Cupertino, CA")
AppleMapsServer.reverse_geocode(%{latitude: 37.3318, longitude: -122.0312})
AppleMapsServer.token()Configuration
config :apple_maps_server,
maps_id: System.get_env("APPLE_MAPS_ID"),
team_id: System.get_env("APPLE_TEAM_ID"),
key_id: System.get_env("APPLE_MAPS_KEY_ID"),
private_key: System.get_env("APPLE_MAPS_PRIVATE_KEY"),
base_url: "https://maps-api.apple.com",
token_ttl_seconds: 300Every function also accepts per-call opts that override the application config.
Summary
Functions
Directions from an origin to a destination. Origin/destination may be a free-text
address or a "lat,lon" string.
ETAs from an origin to up to ten destinations. destinations accepts either
a "lat,lon|lat,lon" string or a list of such coordinate strings — the list
form is joined with the | delimiter Apple expects.
Forward-geocode a free-text address.
Reverse-geocode a coordinate pair.
Search for places matching a free-text query. See Apple docs for full parameter list.
Return autocomplete suggestions for a partial query.
Return a cached-per-call Apple Maps access token (after the JWT → token exchange).
Types
Functions
Directions from an origin to a destination. Origin/destination may be a free-text
address or a "lat,lon" string.
ETAs from an origin to up to ten destinations. destinations accepts either
a "lat,lon|lat,lon" string or a list of such coordinate strings — the list
form is joined with the | delimiter Apple expects.
Forward-geocode a free-text address.
Reverse-geocode a coordinate pair.
Search for places matching a free-text query. See Apple docs for full parameter list.
Return autocomplete suggestions for a partial query.
Return a cached-per-call Apple Maps access token (after the JWT → token exchange).