Viewing 5 replies - 1 through 5 (of 5 total)
  • maikunari

    (@maikunari)

    Hi Colin,

    I had the exact same issue, notice in this screenshot the very top JS error showing on your site,
    http://cl.ly/0Q410k382m2F – that’s the problem, the google maps api is getting called twice, once by the plugin and once by your theme.

    UPDATE:
    The way I solved the issue was by adding the CODE SNIPPETS plugin then dequeueing the script from my theme, for your theme you’ll add this code:

    /*
    Dequeue the google maps api - it's already being called by the simplemaps plugin
    */
    function wpdocs_dequeue_script() {
       wp_dequeue_script( 'google_map_api' ); // update this to the ID of the enqueue in your functions.php file
    }
    add_action( 'wp_print_scripts', 'wpdocs_dequeue_script', 100 );

    Hope that helps!

    Thread Starter colinratcliffe

    (@colinratcliffe)

    That worked perfectly. Thanks for taking the time to help out!

    maikunari

    (@maikunari)

    Awesome, you’re very welcome! Don’t forget to mark the post as resolved.

    Also, to the plugin developers, would it be possible to add a check to make sure the theme hasn’t already called the API? As there are a lot of themes with maps added to the contact page that call the API.

    Hi,

    I’m also having the same issues except my map doesn’t show up at all! I can see it’s a javascript error but can anyone help with the error?

    http://stylepool.ca/store-locator/

    Thanks in advance.

    Deniz

    Plugin Contributor Michael Torbert

    (@hallsofmontezuma)

    WordPress Virtuoso

    We’re looking into seeing how we can handle this issue. Unfortunately a lot of themes decide to call the Google Maps API on every page load.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Cant zoom / interact with map.’ is closed to new replies.