The Google Maps API key used on this web site was registed for a different website. you can generate a new key for this web site at http://www.google.com/apis/maps/
Google won’t differential between 127.0.0.1, localhost, your machines name or IP address eta… its purely domain based authentication. Kinda sucks if you are hosting via server aliases, a bit like your use case here…
A solution that would reduce this problem would be… Do not add the GMap.js to the page . Instead load a script, which looks at the document.location, when the location is matched to a Name Value Pair location/APIKey inject the GMap.js into the head with the matched APIKey appended to it. Still not the best but would help.
Injecting JS could be done like this… (credit to OpenLayers).
var gMapSrc = " http://google.com/xxxxxxx?APIKey=“+ apiKey;
if (/MSIE/.test(navigator.userAgent) || /Safari/.test(navigator.userAgent)) {
document.write(”";
} else {
var s = document.createElement(“script”);
s.src = gMapSrc;
var h = document.getElementsByTagName(“head”).length ?
document.getElementsByTagName(“head”)[0] :
document.body;
h.appendChild(s);
The Google Maps API key used on this web site was registed for a
different website. you can generate a new key for this web site at http://www.google.com/apis/maps/
Thanks Andrew; the bug report is that the short cut installed in the start menu is to 127.0.0.1 and not localhost; as I recall localhost has to be added in the hosts file - so unless we can get a google key for 127.0.0.1 we will have to find another way to make the demo work (perhaps the installer can modify the hosts file?)
Google won't differential between 127.0.0.1 <http://127.0.0.1/>, localhost, your machines name or IP address eta... its purely domain based authentication. Kinda sucks if you are hosting via server aliases, a bit like your use case here...
A solution that would reduce this problem would be.... Do not add the GMap.js to the page <head>. Instead load a script, which looks at the document.location, when the location is matched to a Name Value Pair location/APIKey inject the GMap.js into the head with the matched APIKey appended to it. Still not the best but would help.
Injecting JS could be done like this.... (credit to OpenLayers).
var gMapSrc = " http://google.com/xxxxxxx?APIKey="\+ apiKey;
if (/MSIE/.test(navigator.userAgent) || /Safari/.test(navigator.userAgent)) {
document.write("<script src='"+gMapSrc + "'></script>";
} else {
var s = document.createElement("script");
s.src = gMapSrc;
var h = document.getElementsByTagName("head").length ?
document.getElementsByTagName("head")[0] :
document.body;
h.appendChild(s);
On 9/10/07, *Jody Garnett * <jgarnett@anonymised.com <mailto:jgarnett@anonymised.com>> wrote:
The Google Maps API key used on this web site was registed for a
different website. you can generate a new key for this web site at http://www.google.com/apis/maps/
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
------------------------------------------------------------------------
The Google Maps API key used on this web site was registed for a different website. you can generate a new key for this web site at http://www.google.com/apis/maps/
Ouch, you're right, we should fix the shortcut created by the installer.
And we should state that the demo works only on localhost in the
description.