Google Maps
Google Maps gives your app the same maps, address lookups, and directions people already trust on their phones. In an app you build with Appsanic, you use it to show a map screen, turn an address into a point on that map (geocoding), draw a route between two places, and hand a user off for turn-by-turn directions. It is the agent's default mapping provider, so most location features work the moment the connector is in place.
What you get by connecting it
Connect Google Maps once and the agent gains these capabilities across every project in the account:
- Map screens from static map images. The agent renders maps as Google's static map images, which run in the live preview, in Expo Go, and on real devices with no special build.
- Geocoding. Turn an address into coordinates, or coordinates into an address, for search bars and pin placement.
- Routes. Calculate and draw a route between two points as a line on the map.
- Turn-by-turn handoff. For full navigation, the app hands off to the Google Maps app on the device via a deep link, rather than rebuilding navigation inside your app.
All of the above run on the single API key you connect. For more on how these pieces fit together in a screen, see Maps and location.
Connecting it
Google Maps connects with one API key (a long string beginning with AIza).
- Open the Google Cloud Console and pick or create a project.
- Enable the Maps SDKs your app needs (the static map, geocoding, and routes services).
- Go to APIs & Services then Credentials and create an API key, or copy an existing one.
- Restrict the key to your app's bundle ID (and package name on Android). The key is meant to be embedded, so restrictions are what stop it being abused.
- In Appsanic, go to Dashboard then Connectors then Google Maps and paste the key in. You can also connect it directly from a build through the in-chat connect card.
Once saved, the key is shown as dots rather than its value. The connector page has a Test connection control to re-check the key against Google any time, and a Disconnect control to remove it.
Keys and security
Google Maps is a just connect connector. The API key is public by design and safe to embed, so the agent places it directly where the app needs it. There is no server-side relay, and there is no account access toggle for this connector, because the agent does not act inside your Google Cloud account on your behalf.
Even though the key is meant to be embedded, restrict it to your app's identifier. An unrestricted key can be picked up and used by anyone, while an app-restricted key still passes the Appsanic connection test by design.
Like every managed connector, the stored key is encrypted at rest with AES-256-GCM. The browser only ever sees that a secret exists, never its value, and the agent never asks you for the key in chat.
Useful links
- Google Maps Platform documentation: https://developers.google.com/maps/documentation
- Appsanic guide: Maps and location
Next
Read Maps and location for the full picture of building map and location features into your app.
