To add a custom map marker to Google Maps in Webflow, you need to use the Google Maps JavaScript API and reference your custom marker icon. Webflow doesn’t have native support for this, so it requires minimal code embedding.
In Webflow, open your page settings.
Scroll to "Before
tag" and embed this line, replacing YOUR_API_KEY
with your real API key:
https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap
Add this as a Script tag with async defer
, and set initMap
as your map load callback.
Create a div with an ID (e.g., id="custom-map"
) where the map will appear.
Add this JavaScript code in the Before tag section as well:
Do not include raw HTML tags here; use inline script in Webflow.
Example:
```
```
#custom-map
div—Google Maps requires defined dimensions to load properly.width: 100%
, height: 400px
.To use a custom map marker in Webflow, embed the Google Maps JavaScript API with a callback, reference your icon URL in the marker config, and load the map in a styled div. This approach enables full customization of Google Maps in Webflow-compatible pages.