Home › Forums › Add-ons › Repeater Field › Google map – unique marker ID for hovering › Reply To: Google map – unique marker ID for hovering
Hi @mathieu
In the example you shared, the code uses an XML file to provide the locations. It’s located here: http://www.geocodezip.com/example.xml. The code to call it is this one:
downloadUrl("example.xml", function(doc) {
So the only thing you need to do is to generate an XML file and add the location from your Google Map custom field. To get the location (latitude and longitude), you can do it like this:
<?php
$location = get_sub_field('location');
?>
<marker lat="<?php echo $location['lat']; ?>" lng="<?php echo $location['lng']; ?>" html="Some stuff to display in the<br>Third Info Window" label="Marker Three" />
To learn more about it, please take a look at this page: https://www.advancedcustomfields.com/resources/google-map/. Unfortunately, customizing Google Map is not related to ACF anymore. If you need further support, please take a look at their support forum. I’m sorry for the inconvenience.
I hope this makes sense. Thanks 🙂
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.