First time I’ve ever had to deal with Google Maps field requiring an API key. I’ve used API keys on embeded maps before, but never with ACF? Website has been online for a while, errors suddenly popped up with the field today.
What should I do?
First, you need to get the API key if you haven’t had it. This page should give you more idea about it: https://developers.google.com/maps/documentation/javascript/get-api-key.
After that, you need to add the API key to ACF settings. You can do it by following this guide: https://www.advancedcustomfields.com/resources/google-map/#google-map%20api.
I hope this helps 🙂
Hi James,
Thanks for the tip! I got it to work fairly easily, but I have an issue with the geolocation not working anymore. I’ll have to look at the Google documentation to see how to resolve this.
Plese keep in mind that Google Map field will set the map center to Melbourne if you didn’t set the Center option on the field editor page. If you need to use Google Map geolocation feature, you can try to modify the map arguments or use Javascript to modify the map. This page should give you more idea about it: https://www.advancedcustomfields.com/resources/adding-custom-javascript-fields/.
I hope this helps 🙂
I don’t know how it’s called in GM, but it’s the functionnality which transforms an address into lat/lng coordinates. It’s not working anymore, and I’m wondering which feature I should activate in the GM API.
Do you mean the address search box on the Google Map field? I’ve attached a screenshot for your reference. If that is what you were talking about, it’s possible that there’s conflict on your site. In this case, could you please try to reproduce the issue on one of the WordPress’ stock themes (like Twenty Sixteen) with other plugins deactivated? If it disappears, then you can activate the theme and plugins one by one to see which one causes the issue.
Also, could you please check the Console tab of the developer tools in your browser for any error messages on the page?
Thanks 🙂
Is it possible to restrict which countries the search field returns results for? I know this is possible using the suggest/autocomplete google API but a pointer to any hooks/filters in ACF PRo for this would be helpful…
The topic ‘Google Maps field no API key?’ is closed to new replies.
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.