Support

Account

Home Forums Backend Issues (wp-admin) Google Maps not displaying

Solving

Google Maps not displaying

  • Hi there –

    First of all, thanks a million for this plugin. It works fabulously.

    I’m having some trouble with the Google Maps plugin.

    I set it up exactly as demonstrated on this page.

    I installed the script calls in the header.php file. (I made the javascript a separate .js file, which is able to be read from the page as it renders.)

    I added the following to the single.php page…

    <?php 
     
    						$location = get_field('location');
    						 
    						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; ?>

    I see the map within the post on WP… but nothing is rendering on the page.

    Any help would be really appreciated!

  • Hi @weissjl

    If your code does not produce the desired result, you must debug your code line by line to find out where and what is going wrong.

    Here is a simple thread about debugging in PHP:
    http://stackoverflow.com/questions/888/how-do-you-debug-php-scripts

    Next, you will need to debug your JS to make sure it is also working as expected. You can check your console log for any errors. Any JS error will prevent your JS code from working, so make sure you fix them all.

    Good luck

    Thanks
    E

  • Thanks for getting back to me – quick question – do I need to use both the location plugin and the maps field? Or just one? Thanks!

  • Hi @weissjl

    Please remove the 3rd party location field plugin. Only use the google map field available in the ACF.

    Thanks
    E

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

The topic ‘Google Maps not displaying’ is closed to new replies.