Home Forums Front-end Issues ACF Google Maps Rendering Reply To: ACF Google Maps Rendering

  • Hi thank you so much for this solution @jasonblackdog.

    I have had same issue and have used exact same code with partial success. I have multiple tabs with multiple maps, the first map on click renders correctly but then all other maps after render out in the middle of the ocean instead of the actual location.
    So I am guessing this is re-centering problem? Not quite sure

      $( 'a[data-toggle="tab"]' ).one( "click", function() {
            render_map( $(this));
      $(window).resize(function() {
            $('.acf-map').height($(window).height() - 170);
            //center = map.getCenter(); ???
            //map.setCenter(center);  ???

    I have also added this in too under the center_map() call

    google.maps.event.addListenerOnce(map, 'idle', function(){
         google.maps.event.trigger(map, 'resize');