Hi There,
I’ve been searching for a solution, but haven’t found one. I using the acf frond-end form in a bootstrap Tab, and since it is hidden on the time that the page loads, the map isn’t initializing correctly.
I found some solutions to this problem for the map you create yourself, like explained here:
https://www.advancedcustomfields.com/resources/google-map/
But that didn’t fix the problem, since it is the actual field. I also tried
google.maps.event.trigger(map, “resize”)
When the tab opens, but that doesn’t work either.
How do i get the map to show correctly? Thanks in advance!
Hi @len
ACF store the Google Maps field object in the acf.fields.google_map
object. So, I believe you can resize it like this:
google.maps.event.trigger(acf.fields.google_map.map, 'resize');
I hope this helps 🙂
You are an absolute hero! Works like a charm:)