Google Maps API Key alert
google-maps
Solution
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;`.
Problem
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?