This continues to be an issue for me. I’ve added the line “$api[‘callback’] = ‘Function.prototype’;” to my function.
For some reason though, the callback is not getting appended to the script reference when it’s published to the site, just the API key like so:
<script async src=”https://maps.googleapis.com/maps/api/js?key=API_KEY”></script>
That’s the part that is a mystery. It sounds like it’s working for some of you but not all of us.
<sigh>
@youdaman I’ve been corresponding with support on this issue. Switching the order that I was enqueuing the scripts cleared the error on the public site (i.e. enqueuing <script src=”https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY”></script> before acfmap.js)
I’ve also added the callback to the filter.
My new issue is now a Google API error using the map field in the WP admin. Support is still assisting with that but no resolution yet. Because of that error, it seems to be preventing me from setting and then pulling the lat/lng data from the fields.
I’ll update this post when that’s resolved.
Thanks @youdaman. That got rid of of the callback error.
Now, I’m seeing an error from the acfmap.js (from this example https://www.advancedcustomfields.com/resources/google-map/):
Uncaught ReferenceError: google is not defined.
Seems to be preventing the map from rendering on the page.
Thanks @saggi. That callback reference isn’t working for me either.
Oddly, I’ve used the ACF map on other sites without that callback reference and they’re working fine. Not sure what’s different.
Same issue here. Did you find a solution @saggi?
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.