Hi there.
It appears the Google Maps API is being loaded more than once on the page – as a result of this, an error is thrown and the map’s functionality is affected.
Please visit our documentation on how to resolve this issue (http://www.wpgmaps.com/documentation/troubleshooting/how-to-solve-the-maps-api-loading-more-than-once-on-a-site/) and let me know if this helps at all?
Thanks Jarryd,
We activated “Do not load the Google Maps API” and the map does show up now.
However, it’s a plain map that doesn’t show our 3 office locations anymore. The main reason we used your pluggin (as opposed to the basic map embedded in our theme) was the ability to show the 3 locations (plus the neat colour controls).
Therefore, the fix is not really working for us. Any other suggestions?
Take care.
Hi there
The Google Maps API (loaded from your theme) seems to be loading after our scripts are run on the site.
I would recommend taking a look in your theme’s functions.php file and see if you can find this Google Maps API call, and change it to load it in the head instead, by setting the last parameter of the wp_register_script to ‘true’
Does this help at all?
Thanks Jarryd. We appreciate your help very much.
Nothing in the theme’s function.php.
However, we found the following in the theme’s footer.php – which seems to be a dynamic loading of the Google Maps API:
===
http://maps.google.com/maps/api/js?sensor=false”
===
Any advice?
Looks like I’m not calling Google Maps API in the functions.php file. I’m simply using a shortcode for the map in a template php file. The maps seem to load on the website, but not in the wp-admin panel of the plugin itself.
I just tried adding the following to my functions.php file without any success:
add_action( 'wp_enqueue_scripts', 'add_google_maps_javascript' );
function add_google_maps_javascript() {
wp_enqueue_script(
'twentyfifteen-maps-google-maps',
'https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places&signed_in=true&key=MY_API_KEY',
array(),
'1.0.0',
true
);
}
Any suggestions?
Ah yes. By adding it into the functions.php file, I introduce a new error:
You have included the Google Maps API multiple times on this page. This may cause unexpected errors.
Hi Perry.
Our plugin will load the Google Maps API on the pages that contain the map on them. I have however responded to your ticket to assist you further with this.
Hi Jarryd,
Not sure you saw my reply yesterday before perryazedo posted his 3 notes. Here is a copy for your convenience:
Thanks Jarryd. We appreciate your help very much.
Nothing in the theme’s function.php.
However, we found the following in the theme’s footer.php – which seems to be a dynamic loading of the Google Maps API:
===
http://maps.google.com/maps/api/js?sensor=false”
===
Any advice?
Further to my above post, here is the complete command in the footer.php file:
<?php wp_enqueue_script( “google_maps_api”, “http://maps.google.com/maps/api/js?sensor=false”); ?>
Hi emellina
Sorry I missed your post!
Please comment out that enqueue and let me know if this helps?
You can change that line of code to the following:
<?php // wp_enqueue_script( "google_maps_api", "http://maps.google.com/maps/api/js?sensor=false"); ?>
Hi Jarryd,
Sorry it took us so long to test it. We got carried away…
Commenting out the line did the trick. Everything seems fine now.
Thanks so much!!
Hi @emellina
Not a problem at all. Glad to hear you came right with this.