Friday, April 04, 2008

Mildly Interesting KML+Google Maps Bug

Google map keys are of course tied to a particular base URL. You can get a key for http://localhost for development, but you may have noticed this isn't necessary: maps will load correctly in http://localhost/ for any map key.

However, you can't load KML into your maps on localhost unless you are using a key for http://localhost. That is, your map will load but the KML overlay wont' be added. That is,

geoXml=new GGeoXml("");

won't add the overlay to your map if you are using mismatched keys. To see this in inaction, try serving up the code sample
from your own web server (using your own key, of course). First try using localhost:8080 and then use This assumes the google key was generated for

No comments: