Undocumented Google map trick

An article on Ogle Earth alerts us to a neat trick to get a location from Google Maps to Google Earth. Simply add ‘&output=kml’ to the URL of the map you are viewing, (be sure to click the ‘Link to this page’ on the map first!). I created this simple javascript gMaps2kml bookmarklet, that seems to do the trick, so drag it to your bookmark bar and enjoy*.

Unfortunately, I have problems with getting this to work in Firefox (1.5) whether I use the bookmarklet or manually paste the parameter. It always generates the same kml file of a location in New York. Safari, Opera and Camino don’t have this problem! I’ll have to keep you posted of this one. A friend with a similar setup doesn’t have the same problem – might be a firefox extension issue.

* Note: that the resulting kml files are simply called ‘maps’ with no extension, so this may cause you grief, but it’s easily fixed by adding the extension.

Update: Barry Hunter over at nearby.org.uk, who originally documented the hack, has improved on my bookmarklet, by searching the DOM for the ‘link’, so you don’t have to click ‘Link to this Page’ anymore. He’s posted it in a comment below, but I’ll put it here as well. gMaps2kml2. Isn’t that neat?

7 replies on “Undocumented Google map trick”

  1. Nice.

    The first thing I thought after reading the ‘&output=kml’ tip was a bookmarklet. But seeing that I don’t know anything about Java, it was a matter of waiting for someone to do it.

    Now your bookmarklet lives in my bookmark bar. Thanks.

  2. That’s such a cool idea! If interested I have extended it slightly to work without having to click the ‘link to this map link’ first, as it tries to read the url direct from there! Hoping that it will let me post a javascript link here: gMaps2kml2 [tested in IE and firefox] (if it doesn’t work will add it as an update to my blog)

  3. Barry, you got in ahead of me! I was going to have a go at getting the URL directly from the link when I found a spare half hour. Well done! your link now replaces mine on my toolbar!

  4. An additional tip explained here lets you open any location in any Google-maps-based mashup with Google Earth. No need for that with Tagzania as all our pages have KML, but useful for things that you may find elsewhere, a crime spot in Chicagcrime.org, a nice house in Housingmaps.com…

    The set of Tagzania bookmarklets for different sites (Multimap, Yahoo Maps Beta…) could also be adapted for direct KML downloading

Comments are closed.