Home › Forums › Front-end Issues › ACF front-end form Google Maps + Regular Maps › Reply To: ACF front-end form Google Maps + Regular Maps
Hi @len
For the page with a front end form, could you please remove the Google Maps script inclusion? Then, instead of this code:
$(document).ready(function(){
$('.acf-map').each(function(){
// create map
map = new_map( $(this) );
});
});
Could you please use the following code instead?
acf.add_action('load', function( $el ){
$('.acf-map').each(function(){
// create map
map = new_map( $(this) );
});
});
This code will make sure that ACF’s assets are loaded first, including the Google Maps script inclusion by ACF. This page should give you more idea about it: https://www.advancedcustomfields.com/resources/adding-custom-javascript-fields/.
I hope this helps 🙂
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.