Google maps API referrer not allowed

2020-02-06 04:58发布

I am getting the error RefererNotAllowedMapError from some PC's when I load a page on my site.

RefererNotAllowedMapError

The current URL loading the Google Maps JavaScript API has not been added to the list of allowed referrers. Please check the referrer settings of your API key on Google Cloud Console.

See API keys

It works OK on FireFox from 3 out of four of the machines I have tested.

Generally this would mean that the domain is not added as a referer in my API console but it definitely is, and it definitely works on other machines.

Anyone else had this issue or able to provide some guidence?

9条回答
够拽才男人
2楼-- · 2020-02-06 05:53

Creating an new Browser Key fixed it for me. https://console.developers.google.com/projectselector/apis/credentials

RefererNotAllowedMapError Error The current URL loading the Google Maps JavaScript API has not been added to the list of allowed referrers. Please check the referrer settings of your API key on the Google API Console.

See API keys in the Google API Console. For more information, see Best practices for securely using API keys.

查看更多
姐就是有狂的资本
3楼-- · 2020-02-06 05:54

Recreating the API key at console.developers.google.com fixed the issue for me.

查看更多
迷人小祖宗
4楼-- · 2020-02-06 06:00

This gives error because your Google map API key is not a browser key. Create new key as 'browser key'. This option is available when you create a new key.

查看更多
登录 后发表回答