I have a problem with my Google Maps API key. I get an alert saying "This web site needs a different Google Maps API key.
" When I prees OK to the alert the map are loading and working fine.
The same problem is already posted: Google Maps API key not working
I have tried to request the API key for both "http://www.domain.com" and "http://domain.com" but I still get the alert. When I follow the instructions from their FQA and use alert(window.location.host) I get www.domain.com but the api key generator will only accept the domain if the prefix is http://
Does anyone have a solution to this?
Note that the Maps Embed API, Maps SDK for Android, and Maps SDK for iOS currently have no usage limits and are at no charge (usage of the API or SDKs is not applied against your $200 monthly credit). Can I use the Google Cloud Platform $300 no charge trial with Google Maps Platform?
Go to the Google Maps Platform > Credentials page. On the Credentials page, click Create credentials > API key. The API key created dialog displays your newly created API key. Click Close.
API keys are not strictly secret as they are often embedded into client side code or mobile applications that consume Google Cloud APIs. Still,they should be secured and should never be treated as public information.
I found out that is was a generel encoding error in my google maps api script tag. I got the alert error when I had a script tag like this:
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=MyGoogleMapsApiKey" type="text/javascript"></script>
The problem here is the duplicated amp;
wich was generated from a scriptmanager in asp.net. So the &
was replaced with &
.
The script tag should look like this:
<script src="http://maps.google.com/maps?file=api&v=2&key=MyGoogleMapsApiKey" type="text/javascript"></script>
So if you are using a scriptmanager to add script tags or in any other way dynamically adding script tags to your pages, wach out for duplicated amp;
.
You have to sign up for the new google API key for your new domain, I used to get the same error message, because I use the old API with the new domain, please click the following link to register your new API key for the new domain.
http://code.google.com/apis/maps/signup.html
Hope this can help.
Vutha
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With