Home › Forums › General Issues › Solution needed for slow Google Maps loading. › Reply To: Solution needed for slow Google Maps loading.
Rather than having users download the map image and then load the actual map I was thinking, how about I leave a white space where the map will be rendered and then load the google maps.
The main problem I am running into now is adding to src=”https://maps.googleapis.com/maps/api/js?key=KEYHERE&callback=initMap” &callback=initMap does not work. It gives some sort of console error “_.te”
I figure it is not seeing the function initMap that is in the jquery code on the https://www.advancedcustomfields.com/resources/google-map/ page.
When I use the js css and html code on this site:
https://developers.google.com/maps/documentation/javascript/overview#maps_map_simple-javascript
I am able to include the &callback=initMap in the src field and the map loads last and the performance in core web vitals is 95%+. Without the &callback=initMap I am unable to get the performance rating above 80%.
Any suggestions on how to get &callback=initMap working with ACF Google Maps?
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.