Skip Navigation

[Resolved] Google Maps API not working

This support ticket is created 5 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 8 replies, has 2 voices.

Last updated by Luo Yang 5 years, 4 months ago.

Assisted by: Luo Yang.

Author
Posts
#1311889

I added a Google Maps API key. The settings page under Toolset said that it "appeared to be configured properly", but the map never started working without the watermark and the "This page can't load Google Maps correctly" message. Then after a couple of hours, the Toolset settings now read "REQUEST_DENIED - API keys with referer restrictions cannot be used with this API."

I cannot figure out why this isn't working. The API key is correct. And the restriction is set to hidden link as specified in the instructions.

#1311967

Hello,

It might be a problem in your google API key restriction, there is a dot missing in the URL you mentioned above, please regenerate the API key with your actually domain name, for example:

<em><u>hidden link</u></em>
<em><u>hidden link</u></em>
#1316757

This doesn't seem to have been the issue. I'm getting:
REQUEST_DENIED - API keys with referer restrictions cannot be used with this API.

According to this thread:
https://toolset.com/forums/topic/google-maps-api-with-referer-restrictions/

...this issue was to be fixed in 1.5. I am using 1.8.3

#1316783

Thanks for the details, I have checked that thread in our to-do list, here are the feedback from our developers:

1) We use some client-side requests to Google API (e.g. loading Maps JS library) and some server-side requests (e.g. Geocoding API to translate addresses to lat/lng).

2) Officially, these 2 types of requests need different restrictions (you can check in Google developer console when creating restrictions that you can choose either HTTP referrers (web sites) or IP addresses (web servers, cron jobs, etc.)

3) That it somehow still works sometimes with HTTP referrers and server-side requests is a glitch in Google API. 🙂 🙁 It officially shouldn't, and in cases with multiple domains doesn't.

To fix this, you can enter a second API key for Google Maps, see our document:
https://toolset.com/documentation/user-guides/display-on-google-maps/creating-a-google-maps-api-key/#problems-with-displaying-markers-on-google-maps

Section "Known Issues"

#1318165

This is still not working. I added a second key, unrestricted. But I still get:

REQUEST_DENIED - This API project is not authorized to use this API.

#1318675

The problem you mentioned above is abnormal, please check these:
1) In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2019, and test again

2) Also check if there is any PHP/JS error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/

3) If the problem still persists, please provide a test site with the same problem, and fill below private message box with credentials and FTP access

Thanks

#1318711

I have tried the credentials you provided above, it is not valid, I get this error message:
ERROR: Invalid email address.

Please check it, make sure it is a valid account. thanks

#1319249

These credentials should be working now.

#1319773
api-key.JPG

Thanks for the details, I can log into your website and see the problem, so I have tried my own google map API key in your website:
Dashboard-> Toolset-> Settings-> Maps
in the input box "For added protection of your API keys, you may want to set up a 2nd key for server-side requests:".
Fill my map API key, it works fine, display below message:
Google API seems to be configured properly.

See screenshot api-key.JPG

So it should be a problem of your google map API key, please follow our document to setup a new map API key, and don't apply any HTTP referrers restrictions on it:
https://toolset.com/documentation/user-guides/display-on-google-maps/creating-a-google-maps-api-key/