Support

Account

Home Forums Front-end Issues Front-end form Google Maps in Tab

Solved

Front-end form Google Maps in Tab

  • 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:)

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Front-end form Google Maps in Tab’ is closed to new replies.