Google Map API Key Error "Your Site URL To Be Authorized"
Solution 1:
I Dont know if this will help anyone but I spent a good hour trying to figure out this problem and ended up realizing I had the wrong API enabled. You need Google Maps JavaScript API enabled.Also sometimes you need to specify https.
Solution 2:
1.Leave it blank 2.You need to enable the google maps api for your project.
Solution 3:
You need to enable the google maps api for your project.
if your API key have no limitation and it still not work - trying to add
signed_in=true
to url. It helps for me.
Solution 4:
This error means that the current URL loading the Maps JavaScript API has not been added to the list of allowed referrers. Please check the referrer settings of your API key in the Cloud Console. (source: https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error)
Go to the Google Cloud credentials page to add your website url: https://console.cloud.google.com/projectselector2/google/maps-apis/credentials
Select the API key that you want to set a restriction on. The API key property page appears.
Under Key restrictions, set the following restrictions:
- Application restrictions:
- To accept requests from the list of website that you supply, select HTTP referrers (web sites) from the list of Application restrictions.
- Specify one or more referrer web sites. For example,
*.google.com
accepts all sites ending ingoogle.com
, such ashttps://developers.google.com
. Note: file:// referers need a special representation to be added to the key restriction. Thefile://
part should be replaced with__file_url__
before being added to the key restriction. For example,file:///path/to/
should be formatted as__file_url__//path/to/*
. After enablingfile:// referers
, it is recommended you regularly check your usage, to make sure it matches your expectations.
- Application restrictions:
Save your changes
You must include an API key with every Maps JavaScript API request. In the following example, replace YOUR_API_KEY with your API key.
<script async defer src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap"></script>
(source: https://developers.google.com/maps/documentation/javascript/get-api-key#restrict_key)
Post a Comment for "Google Map API Key Error "Your Site URL To Be Authorized""