I have some code that generates a Google Map to show a marker based on the location field supplied via a custom field named ‘event_map’. It works great.
<?php
$location = get_field(‘event_map’);
if( !empty($location) ):
?>
<div class=”acf-map”>
<div class=”marker” data-lat=”<?php echo $location[‘lat’]; ?>” data-lng=”<?php echo $location[‘lng’]; ?>”></div>
</div>
<?php endif; ?>
I now want to add a map that shows ALL of the markers from ALL of the posts. How would I go about doing this assuming all of my posts have a field called ‘event_map’ to draw location data from? I am stumped and any help appreciated.