Home › Forums › General Issues › Multiple Google Map Marker Icons › Reply To: Multiple Google Map Marker Icons
Hi @atmacmillan
What do you mean by unsolve?
The way I would do this is use the code found in the documentation here:
http://www.advancedcustomfields.com/resources/google-map/
And to add support for your custom icons you can add a third data parameter to the marker div:
<div class="marker" data-lat="<?php echo $location['lat']; ?>" data-lng="<?php echo $location['lng']; ?>" data-icon="<?php echo $image['url']; ?>"></div>
And in the JS function for the markers:
// var
var latlng = new google.maps.LatLng( $marker.attr('data-lat'), $marker.attr('data-lng') );
var icon = $marker.attr('data-icon');
// create marker
var marker = new google.maps.Marker({
position : latlng,
map : map,
icon : icon
});
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.