Google maps API referrer not allowed

前端 未结 9 558
长发绾君心
长发绾君心 2020-12-11 00:43

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

RefererNotAllowedMapError

<
相关标签:
9条回答
  • 2020-12-11 01:14

    The solution to every/such Maps Javascript API error varies for different scenarios for different developers. A list of errors with detailed description is given by google here

    Nevertheless please refer the below snap:

    1. As you can see above under Application restrictions just by selecting the HTTP referrers won't do. You have to add a URL(i.e the URL of the website from which the api will be called to render the map).
    2. Now the exact page(in my case the contact us page) which is gonna make the request to the api needs to be mentioned in the url and not just the domain.
    3. Please go through the examples given in the documentation on the right
    4. Adding a /* after the domain url like http://www.telesuprecon.com/* will make the request possible from any page within your website.
    0 讨论(0)
  • 2020-12-11 01:22

    Note the DOT at the beginning of the expression, it's a char!

    *.stackoverflow.com/* // this will not work with http://stackoverflow.com

    You will also have to add:

    *://stackoverflow.com/* // now it will cover all domain variation

    0 讨论(0)
  • 2020-12-11 01:26

    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.

    0 讨论(0)
提交回复
热议问题