![Check out Enfold](https://kriesi.at/wp-content/themes/kriesi/images/banner-enfold.jpg)
-
AuthorPosts
-
September 26, 2018 at 3:00 pm #1014765
Hi,
I wonder if you can help me with this, I am getting a loading error for Google maps (see link) …I have created an API key & set up a billing account with Google. I have written to Google support who replied with this…
//
….Hello there,You are using a WP-hosted website and I am not sure if you will be able to change the scripts in your HTML page.
The script that calls the JS API is missing an API key [1]:
<script id=”av-google-maps-api” type=”text/javascript” src=”https://maps.googleapis.com/maps/api/js?v=3.30&callback=aviaOnGoogleMapsLoaded”></script>
But it is also specifying a version (v=3.30) that is deprecated [2].
You can see these errors in the dev tool from the console tab:[1] https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys
[2] https://developers.google.com/maps/documentation/javascript/error-messages#retired-versionYou need to enable the API key for the script and change the version accordingly.
Regards,
//I wonder if you have any advice on this as I am not clear what to do.
Many thanks
NickSeptember 27, 2018 at 2:58 am #1015068Hey Niky67,
Thank you for using Enfold.
Did you put the API key in the theme’s Google Services panel? The “gmap_api” is blank when I checked the page’s markup. Please review the documentation.
// https://kriesi.at/documentation/enfold/google-map/
Best regards,
IsmaelSeptember 27, 2018 at 12:14 pm #1015256Hi Ismael,
I had put the API key in the theme’s Google Services panel – several times yesterday – & tried creating different API’s – strange in the end nothing got saved…perhaps the last tab I closed did not have this saved.?!
Today I have tried to set up the Goole maps service in the website DDI2018.org and another website on another hosting platform IAVSD2019.se
On both sites, I get the “Could not connect to Google Maps with this API Key” Troubleshooting text…..
Troubleshooting:
Check if you typed the key correctly.
If you use the restriction setting on Google try to remove that, wait a few minutes for google to apply your changes and then check again if the key works here.
If it does, you probably have a syntax error in your referrer url
If none of this helps: deactivate all plugins and then check if the API works by using the button above. If thats the case then one of your plugins is interfering.I will be grateful if you have any suggestions, I have enabled billing with Google and tried with and without restriction settings.
Many thanks in advance.
NickSeptember 27, 2018 at 1:20 pm #1015267Hi,
Please try to add this code to your child theme functions.php:
<script id='avia_gmaps_framework_globals' type='text/javascript'> /* <![CDATA[ */ var avia_framework_globals = avia_framework_globals || {}; avia_framework_globals.gmap_api = '[YOURAPIKEY (with no spaces)]'; avia_framework_globals.gmap_maps_loaded = 'https://maps.googleapis.com/maps/api/js?v=3.30&key=[YOURAPIKEY (with no spaces)]&callback=aviaOnGoogleMapsLoaded'; avia_framework_globals.gmap_builder_maps_loaded = 'https://maps.googleapis.com/maps/api/js?v=3.30&key=[YOURAPIKEY (with no spaces)]&callback=av_builder_maps_loaded'; avia_framework_globals.gmap_backend_maps_loaded = 'https://maps.googleapis.com/maps/api/js?v=3.30&callback=av_backend_maps_loaded'; avia_framework_globals.gmap_source = 'https://maps.googleapis.com/maps/api/js?v=3.30&key=[YOURAPIKEY (with no spaces)]'; avia_framework_globals.gmap_avia_api = 'http://qcgn.ca/wp-content/themes/enfold/framework/js/conditional_load/avia_google_maps_api.js'; /* ]]> */ </script>
and replace all occurrences of “[YOURAPIKEY (with no spaces)]” with your api key. Make sure no blank spaces are before or after the key.
Best regards,
PeterOctober 4, 2018 at 5:31 pm #1017975Same issue, I’ve run the above code, no joy.
October 8, 2018 at 2:52 am #1018761Hi,
@BSHosts: Please create a new thread with the site url and the login credentials. Review the docs when you have the time.// https://kriesi.at/documentation/enfold/google-map/
Best regards,
IsmaelOctober 9, 2018 at 7:02 pm #1019612Hi Ismael,
Thank you for the link I think I have been through it thoroughly but as yet I am still getting a “Could not connect to Google maps” message after clicking the “Check API Key”. I have screenshots of confirmation that I have generated an API key and enabled billing…will be thankful for any assistance you can provide.
Br
NickOctober 10, 2018 at 5:01 am #1019751Hi,
I don’t see an API key in your Enfold > Google Services panel. Please add it there then I’ll validate it and see what comes up.
Best regards,
IsmaelOctober 10, 2018 at 7:56 am #1019820Hi Ismael,
This is interesting, this is the second website I have sent you (approx 10days ago I sent you another website DDI2018.org) and you noted the same thing. This time with IAVSD2019.se I double checked everything before sending you the details.
I have just tried again using another browser (previously Chrome) now Explorer on Windows 10 and I get the same error message – “Could not connect to Google Maps with this API Key.”I am not too sure what is meant or how to resolve the point in the Troubleshooting about the “Google restriction setting” – if this is where the problem may be?
Many thanks
NickOctober 10, 2018 at 8:20 am #1019827This is where you set the URLs the maps are restricted to.
-
This reply was modified 5 years, 11 months ago by
chiliharstad.
October 11, 2018 at 4:05 am #1020128Hi,
@Niky67: I’m checking the “iavsd2019” site because it is the one that is accessible. Where did you put the API key? It’s not in the Enfold > Google Services panel. (see private field)Best regards,
IsmaelOctober 11, 2018 at 10:36 am #1020253Hi Ismael,
In my last two replies, I have supplied you with respective login details and keys…Please note with the two sites in question IAVSD and DDI, I have tried to save the API key in the Enfold – Google Services panel – but it does not seem register.
Thanks
NickOctober 12, 2018 at 4:41 am #1020563Hi,
Sorry about that. I didn’t see the API key. This is what I get when I validate the key.
Google Maps JavaScript API error: RefererNotAllowedMapError https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error Your site URL to be authorized: https://iavsd2019.se/wp-admin/admin.php?page=avia
The “RefererNotAllowedMapError” error means that the site has not been included to the list of the allowed http referrers.
// https://cloud.google.com/docs/authentication/api-keys#api_key_restrictions
Add these two in the list.
http://*.iavsd2019.se/* https://*.iavsd2019.se/*
Best regards,
IsmaelOctober 12, 2018 at 12:04 pm #1020690Hi Ismael,
Thank you for your recent mail. I have added the URLs to the key restrictions list and waited for Google to process this, however, I still get the same error message in Enfolds Google Services Panel.
Could not connect to Google Maps with this API Key.
Troubleshooting:
Check if you typed the key correctly.
If you use the restriction setting on Google try to remove that, wait a few minutes for Google to apply your changes and then check again if the key works here. If it does, you probably have a syntax error in your referrer URL
If none of this helps: deactivate all plugins and then check if the API works by using the button above. If that’s the case then one of your plugins is interfering.After checking the API Key that was saved it seems to disappear when the page is loaded again…
I wonder if you any further ideas here?Thanks
NickOctober 15, 2018 at 7:23 am #1021431Hi,
Thanks for the update.
Try to remove the asterisk sign before the domain name.
http://iavsd2019.se/* https://iavsd2019.se/*
That should work.
Best regards,
IsmaelOctober 15, 2018 at 3:08 pm #1021610Hi Ismael,
Thank you for your recent advice. I noticed there was an Enfold update so first I installed that and then I made the adjustment you recommended at Google maps this does not seem to have resolved the problem. Now when I click Check API Key it does not load (just spins).
Thanks
NickOctober 16, 2018 at 2:06 pm #1022197Hi,
I’ve have added the API key in your database manually but it’s still producing the same error — referrer not allowed. We may need to check the project in your Google account directly.
It seems that your Google API key is not configured correctly
The key is probably either restricted to the wrong domain or the domain syntax you entered is wrong.
Please check your API key here
The domain that should be allowed is:
https://iavsd2019.se/*Did you add “https://iavsd2019.se/*” as one of the http referrers?
Best regards,
Ismael-
This reply was modified 5 years, 10 months ago by
Ismael.
October 17, 2018 at 12:10 pm #1022710Hi Ismael,
I have been in contact with Google support during the last days… I will now copy and paste the last interactions I’ve had, perhaps you might see something!!!
(Please note at this stage even though we have just been addressing iavsd2019.se I have previously tried to activate Google maps on another website, using Enfold, ddi2018.org)Br
NickOctober 17, 2018 at 3:59 pm #1022827Hi,
Thanks for the update. The API key that you provided doesn’t end with “WQN4”. Did he check the project or the API key that is related to the “iavsd2019” site? Did you create separate projects for each site?
Best regards,
IsmaelOctober 17, 2018 at 5:16 pm #1022916Hi Ismael,
Yes I know the API for iavsd2019.se does not end in “WQN4” it ends in “XdmM”…I was pointing this out to support at Google!
And yes I have created two separate projects for each site. Both of which are not accepting their respective API keys in the Enfold panel?Br
NickOctober 18, 2018 at 11:52 am #1023301Hi,
What did they tell you about the “iavsd2019” project? Did they check that? Can we access your Gmail account?
Please upgrade to version 4.5 while you’re waiting for their response.Best regards,
IsmaelOctober 18, 2018 at 12:43 pm #1023320Hi Ismael,
This is the response from Google support…
————–
Hey Nick thank you for your additional information.I had no way to check the API keys against the websites you are referring to so if you would be so kind to list the exact pages where I can see the issue/s that would be great.
This will speed up the troubleshooting process tremendously and hopefully we can close the case and solve the problem quickly.Look forward to your response.
Regards,
Vin
—————
At this point, I am not too sure how to list the pages…which pages? The API keys are not being accepted…so I have not made any pages.Yes, I have already updated the theme to 4.5 for iavsd2019.
Thanks
NickOctober 18, 2018 at 12:56 pm #1023330Hi Ismael
Please see the Private content for Gmail
Many thanks
NickOctober 19, 2018 at 11:09 am #1023834Hi,
Thanks for the info. There is another authentication that I won’t be able to get past. Let’s start again.
Remove the “iavsd2019” project and create a new one. Follow the instructions in the docs starting from step 1. Let’s make sure that the project is using v3 instead of v2.// https://kriesi.at/documentation/enfold/google-map/
Create a new project here: https://console.developers.google.com/projectcreate
Best regards,
IsmaelNovember 8, 2018 at 12:47 pm #1031209Hi Ismael,
I am still trying to get iavsd209.se working with Google Maps, I have tried to delete older registrations of API keys and have waited some days in the hope Google clears the system.
I have made a new account and managed to successfully register the API key with Enfold ;-) however when I try to create a map and go to fetch coordinates I get this error message….” — It seems that your Google API key is not configured correctly
The key is probably either restricted to the wrong domain or the domain syntax you entered is wrong.
Please check your API key here
The domain that should be allowed is:
https://iavsd2019.se/*Do you have any suggestions here?
Thanks
NickNovember 12, 2018 at 5:41 am #1032430Hi,
I know I’ve been asking this over and over throughout the thread. Did you add the “https://iavsd2019.se/*” as an allowed http referrer? I’m still seeing the same error in the console..
Google Maps JavaScript API error: DeletedApiProjectMapError maps.googleapis.com/maps/api/js?v=3.30&key=API KEY HERE-YV-XdmM:51
https://developers.google.com/maps/documentation/javascript/error-messages#deleted-api-project-map-errorPlease check your functions.php file and remove/disable every functions or codes that are related to google maps.
Best regards,
IsmaelNovember 14, 2018 at 6:33 am #1033355Hi Ismael,
Yes we have been backwards and forwards over the allowed http referrer and I tried the recent configuration with one * at the end and this was not the answer. My question here is, for future reference, what is the best way to express this ie. as Google expresses with the “https://*.iavsd201.se/*” or as you suggest in your recent correspondence i.e. without the *. before the website name?
I have checked the functions.php file and I see there is a different Google map API !!! – I hope this is where the problem resides and now finally this can get this working.
I am now wondering which is the best most effective way to put this right so that the correct API key gets registered here…
I know you are suggesting to remove/disable any functions or codes here but would it work to…
1. Download the functions.php file from the Enfold folder open it in my editor and copy and paste the correct API key in place of the wrong API key save this and upload this file to replace the existing file?
or
2. Copy and paste the correct API key over the wrong API key via the WordPress Editor in Enfold: Theme Functions (functions.php)?
(are both of these approaches the same and achieve the same result?)OR
3. Is it necessary to remove/disable every function or code that relates to google maps to in order to reset this?4. If items were removed/disabled in the functions.php file would the correct API key need reactivating in Enfold Google Service panel?
Rather than try things I write to you for advice on the best procedure in order to avoid not making any mistakes that make things worse.
I hope that this is where the crux of the problem lies and it is now able to be put right. I think the initial problem may have been in the earlier API key I had not registered Google’s new billing correctly.My thanks for your help.
Br
NickNovember 14, 2018 at 11:29 am #1033444Hi,
The API key in your functions.php file overrides the one inside the Google Services panel, so you have to disable or remove it completely. Just create a backup in case we need it again. After removing the code, go back to Google Services panel and revalidate the key. You don’t really need to do this but it might be good to re-update the API key in the database. Let us know how it goes.
And in the off chance that it’s still not working, get the code backup and replace the API key with the new one and add it back to your functions.php file.
Best regards,
IsmaelNovember 14, 2018 at 12:35 pm #1033471Hi Ismael,
All working now! Thank you for your patience and help.
Br
NickNovember 15, 2018 at 9:01 am #1033842 -
This reply was modified 5 years, 11 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.