The Google Maps API server rejected your request

匿名 (未验证) 提交于 2019-12-03 01:57:01

问题:

I m working on an application which renders google maps on an image as below

Google Maps (Scotland)

The map is not getting rendered and when I right click on the source of image and click the url, I get the following message

"The Google Maps API server rejected your request. This site or IP is not authorized to use this API key."

I have checked the API Access on https://code.google.com/apis/console the API key seems to be all correct. Just wondering how to fix the site and IP bit?

See below the settings in google API console

回答1:

Make sure you have enabled "Static Maps API" service in addition to "Google Maps API".



回答2:

Make sure you have enabled the Google Maps related Services ("Google Maps Embed API" and "Static Maps API") like bellow:

And then mark them:

In the new layout you find it here:



回答3:

It works for me when I enable "Google Maps Embed API" and "Static Maps API"



回答4:

Make sure you have a Browser key in the Simple API Access section, and make sure the Referers is set to Any referer allowed



回答5:

I had the same issue. I used this instead of this and that resolved the issue. Some other api parameters didn't work on the second URL either (specifically marker styles), guessing the old API is deprecated

Would also recommend using https as opposed to http. This way your users wont get cert warnings if they view the page over SSL



回答6:

Activate Google Map Key here: https://console.developers.google.com/apis/api/maps_embed_backend/overview?project=[your-project]

It will enable your map instantly.



回答7:

As commented by Pointy, you need to use an API key with all referrers allowed in order to use Static Maps.

You can achieve that just by removing all the referrers from the list of authorized referrers. Or just create a new API key and use it without further configuration.

More info at the Documentation



回答8:

Not only you need to enable google static API, but also you need to include your api_key in the link.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!