To add multiple markers on a Google Map in Webflow using the Google Maps API, follow these structured steps:
```html
<script src="https://maps.googleapis.com/maps/api/js?key=YOURAPIKEY"></script>
<script>
function initMap() {
var locations = [
{ lat: 37.7749, lng: -122.4194, title: 'San Francisco' },
{ lat: 34.0522, lng: -118.2437, title: 'Los Angeles' },
{ lat: 40.7128, lng: -74.0060, title: 'New York' }
];
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 4,
center: locations[0]
});
locations.forEach(function(location) {
new google.maps.Marker({
position: { lat: location.lat, lng: location.lng },
map: map,
title: location.title
});
});
}
document.addEventListener('DOMContentLoaded', initMap);
</script>
```
YOURAPIKEY with your actual API key.
map to match the document.getElementById('map') reference in your code.
To display multiple markers on a Google Map in Webflow, obtain a Google Maps API key, add the Google Maps script to your Webflow project, and implement the JavaScript code to initialize the map and markers. Ensure the map is visible by correctly setting up your div structure and styling in Webflow.