Support

Account

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

Solving

Google Maps not displaying

    • weissjl

    • December 11, 2013 at 3:31 am

    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!

    • Elliot

    • December 11, 2013 at 10:25 am

    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

    • weissjl

    • December 12, 2013 at 1:38 am

    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!

    • Elliot

    • December 12, 2013 at 12:40 pm

    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)

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.