Tagged: google maps, jquery error
-
AuthorPosts
-
September 13, 2018 at 11:01 pm #1009701
HI
I have a lot of maps on my site, and I am suddenly getting this error on all of them:Error: In order for WP Google Maps to work, jQuery must be installed. A check was done and jQuery was not present. Please see the jQuery troubleshooting section of our site for more information.
I tried their troubleshooting by putting this code into my header.php
<?php wp_enqueue_script("jquery"); ?>
but that did not change anything.I can’t find any other settings – there is something in the google maps plugin I am using that allows it to override the jquery, but that also didn’t work. Can you see what the trouble is? I have not seen this before, and have not changed anything that would have to do with the maps.
thanks
Nancy- This topic was modified 6 years, 2 months ago by Munford.
September 13, 2018 at 11:37 pm #1009714Hey Munford,
Have you tried disabling all active plugins to see if the issue resolves?
Best regards,
Jordan ShannonSeptember 13, 2018 at 11:57 pm #1009724Hi JOrdan,
No, I have a lot of plugins…I will test it a bit. This just happened with no new plugins or settings changed.
thanks
NancySeptember 14, 2018 at 2:19 pm #1009894I got this message from google maps support:
It appears that the minification of scripts on the site is causing jQuery to load too late for the maps scripts to function properly. Please try disabling minification to see if that fixes it.Not sure where those setting are though…
can you take a look?
thanks
NancySeptember 15, 2018 at 10:36 am #1010068Hi,
I deactivated the javascript compression option on your website (Enfold > Theme Options > Performance) but the error is still there. However jquery is loaded in the head section for sure, also all Enfold javascripts (which also use the default wordpress jquery version) work just fine. I’m pretty sure it’s not a jquery issue. Also the console outputs following error:
wp-google-maps.min.js?ver=7.10.33:1 Uncaught ReferenceError: google is not defined at wp-google-maps.min.js?ver=7.10.33:1
If it’s a jquery issue the error message would be “jquery not defined” or so.
Best regards,
PeterSeptember 15, 2018 at 1:37 pm #1010114thanks for your help….
ok so…what can I do?
google map support keeps saying: You may want to try disabling Combine JS.but you looked at that.
confused
NancySeptember 15, 2018 at 1:47 pm #1010117Hi,
I checked the website again – jquery is loaded at the top on line 104. It’s not combined with other scripts.You can also try another plugin like: https://wordpress.org/plugins/leaflet-map/ – I use it on my websites and it works really well.
Best regards,
PeterSeptember 15, 2018 at 2:32 pm #1010125do you think it’s a plugin failure? We have hundreds of maps so the idea of rebuilding them all in another plugin is not too attractive.
thanks for your help
NancySeptember 15, 2018 at 2:53 pm #1010130Hi,
I’m not sure if it’s a plugin failure but it’s not a jquery issue because jquery is loaded before the google maps js code.
Best regards,
DudeSeptember 18, 2018 at 11:59 am #1011217HI again
so after trouble shooting I figured out the conflict (and error with some dynamic text code/conditional fields on the contact form 7 on many pages).
I am now seeing the error “You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors.” I have the API key in the enfold theme options already, so I thought I could turn that off the “Do not load the Google Maps API (Only check this if your theme loads the Google Maps API by default)” in the google map plugin settings, but then the maps disappear again with that jquery error (even though the jquery is loading fine.)
What are the best practices here? Should I ignore the multiple API warning?
And I still see the jquery error loading on the page below before the map loads, so there is still something weird going on.
thanks for your help as always,Nancy
- This reply was modified 6 years, 2 months ago by Munford.
September 18, 2018 at 2:18 pm #1011297Hi,
I’d ignore these warning as long as the maps are displayed.
And I still see the jquery error loading on the page below before the map loads, so there is still something weird going on.
I think this is some sort of fallback screen which is always visible before the map is fully loaded. After the map loaded it covers the fallback message.
You can also add this code to the child theme functions.php to deactivate the theme maps api:
add_filter('avf_load_google_map_api_prohibited', 'avf_load_google_map_api_prohibited_true', 10, 1); function avf_load_google_map_api_prohibited_true($prohibited) { $prohibited = true; return $prohibited; }
It may break the theme maps – so be careful and check if the theme maps work afterwards.
Best regards,
PeterSeptember 18, 2018 at 5:02 pm #1011391HI
thanks
there was an issue that the API I had in the plugin was different than the one in the theme settings, but even after updating that I am still seeing the “multiple API” error
– I think I will just leave it as it is for now.
best
Nancy -
AuthorPosts
- You must be logged in to reply to this topic.