Support

Account

Home Forums ACF PRO Error 'render_map is not defined' causing google map field to not show anything

Solved

Error 'render_map is not defined' causing google map field to not show anything

  • Hey,

    I’m using the google map field within a flexible content field to allow my client to add maps where they want.

    I seem to have got it 99% working but i’m getting the error;
    “Uncaught ReferenceError: render_map is not defined”

    Currently I can see the container of the map showing but somethings stopping the render happening.

    I have included the JS from the documentation in this order;

      <script src="<?php bloginfo('template_url'); ?>/a/js/source/vendor/_jquery-1.11.1.js"></script> <!-- jQuery -->
      <script src="<?php bloginfo('template_url'); ?>/a/js/source/vendor/_gmaps-api.js"></script> <!-- Google maps API -->
      <script src="<?php bloginfo('template_url'); ?>/a/js/source/vendor/_acf-gmaps.js"></script> <!-- ACF google maps code -->
      <script src="<?php bloginfo('template_url'); ?>/a/js/source/_script.js"></script> <!-- jQuery for google maps -->
    

    and this is the php i have to display the map;

    
                  
                	<?php elseif(get_row_layout() == "map"): ?> <!-- Map Field -->
                  
                    <?php 
                     
                    $location = get_sub_field('map');
                     
                    if( !empty($location) ):
                    ?>
                      <div class="acf-map">
                      	<div class="marker" data-lat="<?php echo $location['lat']; ?>" data-lng="<?php echo $location['lng']; ?>"></div>
                      </div>
                    <?php endif; ?>  
    
    
  • Sorry, turns out I had things in the wrong order, thanks anyway!

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

You must be logged in to reply to this topic.

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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.