- Geocode addresses and reverse-geocode coordinates
- Calculate routes and travel times with the Routes API
- Search for and retrieve details about places and businesses with the Places API (New)
- Embed interactive and static maps
- Validate addresses and snap GPS traces to roads
- Pull environmental data (Weather, Air Quality, Pollen, and Solar) for any location
- Use Aerial View, Geolocation, Elevation, Time Zone, Route Optimization, and Area Insights
Common use cases and example apps
How Google Maps Platform connections work
Google Maps Platform uses a two-key model because some APIs run on the server and others in the browser:- Server API key: private, restricted by API. Used by Lovable’s connector gateway to call server-side APIs like Geocoding, Routes, Places, Weather, and Air Quality. Never exposed to the browser. The gateway also attaches a per-workspace tracking ID for usage attribution.
- Browser API key: public, restricted by website referrer. Marked as Public in the connection form and injected into your project as a public environment variable named
VITE_LOVABLE_CONNECTOR_GOOGLE_MAPS_BROWSER_KEY. Used by the frontend for the Maps JavaScript API and Places Autocomplete.
REQUEST_DENIED. Use the gateway instead.
How to connect Google Maps Platform
Workspace admins and owners can connect Google Maps Platform. When adding a connection, you can choose between:- Managed by Lovable: no Google Cloud account or API keys required. For prototyping on
*.lovable.apponly. Not for production; server-side gateway requests are rate limited to at most 12,000 per day per workspace. - Your own credentials: bring your own server and browser API keys. Required for custom domains and when going live to production.
Managed by Lovable
Choose this option for the fastest setup, ideal for prototyping. You don’t need a Google Cloud account or API keys. Lovable provides and manages the credentials for you. To connect Google Maps Platform:Open the connector
Add a connection
Name the connection
Google Maps Platform Managed. This name is only used in Lovable to identify the connection.Choose managed credentials
Set access
Connect
*.lovable.app domains.
Your own credentials
Bring your own credentials when you need a custom domain, want to manage Google Cloud billing directly, or want full control over which APIs are enabled and how each key is restricted. You can create multiple Google Maps Platform connections using different keys, which is useful for separating environments or attaching different Google Cloud billing accounts.Prerequisites
Before connecting, make sure you have:- A Google Cloud project with billing enabled
- The Google Maps Platform APIs you plan to use enabled in that project (see Step 1)
- Permission to create and manage API keys in that project
- Your project’s domains, including its
*.lovable.appURL and any custom domains - Lovable workspace admin or owner role
Step 1: Enable the Google Maps Platform APIs you need
In the Google Cloud Console, enable only the APIs your app uses. For the browser key, enable the frontend APIs:- Maps JavaScript API
- Places API (New)
- Maps Static API
- Maps Embed API
- Geocoding API
- Routes API
- Places API (New)
- Address Validation API
- Aerial View API
- Air Quality API
- Geolocation API
- Maps Elevation API
- Maps Platform Datasets API
- Places Aggregate API (Area Insights)
- Pollen API
- Roads API
- Route Optimization API
- Solar API
- Time Zone API
- Weather API
Step 2: Create the server API key
The server key is called by Lovable’s connector gateway. Restrict it by API, not by referrer or IP.Open credentials
Create the key
Name the key
Lovable Google Maps Platform server key.Edit the key
Restrict by API
Leave application restrictions off
Save and copy
AIza and is 39 characters long.Step 3: Create the browser API key
The browser key is referrer-restricted and exposed to the frontend as a public environment variable. In the Lovable connection form, this field is marked Public with the caption “This value will be publicly visible in your published app.”Create the key
Name the key
Lovable Google Maps Platform browser key.Edit the key
Restrict by website referrer
https://your-project.lovable.app/*https://yourdomain.com/*andhttps://www.yourdomain.com/*(any custom domains)
Restrict by API
Save and copy
Step 4: Connect Google Maps Platform to Lovable
Open the connector
Add a connection
Name the connection
Google Maps Platform Prod.Choose your own credentials
Add the server key
Add the browser key
Set access
Connect
VITE_LOVABLE_CONNECTOR_GOOGLE_MAPS_BROWSER_KEY. The connection form validates the key format (it must match AIza followed by 35 alphanumeric characters) but does not verify that the keys actually work against Google’s APIs. Always test one backend request and one frontend map load after setup.
Limitations
The Google Maps Platform connector has the following limitations:- The managed connection only works on
*.lovable.appdomains. Use your own credentials for custom domains and for production. - The managed connection is rate limited to at most 12,000 server-side gateway requests per day per workspace and is not intended for production workloads.
- The browser key is only authorized for the Maps JavaScript API and Places API (New). All other Google Maps Platform APIs must be called from the server through Lovable’s gateway.
- Billing and quotas are managed in Google Cloud, not Lovable. Set budget alerts and quota caps in the Google Cloud console.
- The connector does not support per-end-user authentication, each connection uses a single shared set of keys for the workspace.
- The connection-creation form validates the key format only, not API restrictions or referrer rules. Always test a real request after setup.
- The Lovable connector gateway does not expose a public list of egress IPs, so IP-based restrictions on the server key are not supported.
Common issues
- Maps fail to render with
RefererNotAllowedMapError. The browser key’s website restrictions don’t include the domain the app is actually being served on. Add the exact origin (including subdomain and protocol) in the Google Cloud credentials page. - Server-side calls return
REQUEST_DENIED. Either the API isn’t enabled in the Google Cloud project, or the server key’s API restrictions don’t include the API being called. Re-check both in the Google Cloud console. GeocoderorDirectionsServicecalls fail when called from the browser. The browser key isn’t authorized for Geocoding, Routes, or other server-side APIs. Move those calls to the server so they route through Lovable’s gateway with the server key.- Maps fail on a custom domain with the managed connection. Expected, the managed browser key is locked to
*.lovable.app. Switch to your own credentials and add the custom domain to the browser key’s referrer restrictions. - Server-side calls return
429 Too Many Requestson the managed connection. The workspace has hit the managed connection’s daily gateway limit (12,000 requests per day). Wait for the limit to reset, reduce call volume, or switch to Your own credentials for production traffic.
How to unlink projects from a connection
Editors and above can remove specific projects from a connection without deleting the connection entirely. The connection will remain available for other projects. To unlink projects:Open Connectors
Open the connection
Select projects
Confirm
How to delete a connection
Workspace admins and owners can delete connections. Other members can delete a connection if they created it, or if they have been explicitly granted access to it. Before deleting, review the Linked projects section to see which projects are currently using the connection. To delete a connection:Open Connectors
Open the connection
Review linked projects
Delete