Google Maps 2 Google Earth — now scalable

Sunday, April 23, 2006 (21:02 UTC)

A great hint from Nearby.co.uk's Barry Hunter on Google Earth Community: You can append "&output=kml" to any Google Maps URL to have Google return a placemark in a KML file that opens automatically in Google Earth. This appears to be an undocumented feature — Google Maps' API pages don't appear to have it.

For example, here where I live in Stockholm, more or less, in Google Maps.

That's using the URL you get by clicking on "Link to this page" in Maps. Now here is where I live in Stockholm in Google Earth.

Barry's suggested query format in his hint returns a more verbose page in Google Maps.

And if you append "&output=kml", the KML returned is also more descriptive with a link back to the Maps version.

Experimenting a little, it turns out that by using Barry's format, you can have Google Earth fly to any address or place name its database knows. For example, Berlin, Germany in Maps (look, no coordinates). Berlin, Germany in Google Earth (again, no coordinates).

I haven't found a way to encode views in a query, so your Google Earth view is always from above.

What's so new about this? Generating KML from a server query has certainly been done before — in fact, it was Ogle Earth's very first mashup, back in July 2005 (direct link. You can also use it via yubnub.) The problem with running PHP off www.ogleearth.com is that it is not exactly scalable if everybody uses it. But appending "&output=kml" to Google Maps is.

Finally, the caveats: This method also still pollutes your desktop/download area with KML files, and it isn't a "transparent" solution, in the sense that we're mixing magisteria here, piggybacking on web protocols to get to Google Earth's coordinate space. But it's the closest yet to linking seamlessly from the web to Google Earth.

[Update 2006-04-25: Barry tells how he found this hack.]

[Update 2006-05-07: The hack gets its own javascript bookmarklet over here.]

Permalink | Del.icio.us | Connotea

Comments

Yeah. I just can't figure out why Google doesn't allow a feature to show a "Fly to" (using GE) button on Google Maps if you have GE installed. Someone should write a real quick Firefox extension for GE users to do this. Barry?

Posted by: Frank Taylor at 21:44 UTC, April 23, 2006

There used to be the MutantMaps toolbar for Firefox, but the latest API changes seem to have broken it.

Posted by: Stefan at 21:52 UTC, April 23, 2006

That's a great find. This makes me so happy.

It should be noted (at least in my experience) that the KML file generated is always named "maps" and lacks the KML extension following the name.

Is there an article or technique that can do the reverse: turn a KML/KMZ file into a google map with all the locations viewed on Google Earth.

Posted by: Robert at 0:48 UTC, April 24, 2006

I'm having mixed success on my mac. It works find in all my mac browsers except Firefox, which always throws up the same kml location in NY City.
I created a simple javascript bookmarklet, but the spam filter won't let me include it here as a link, so you'll have to visit my blog at woowoowoo.com

Posted by: woowoowoo at 2:09 UTC, April 26, 2006

Woowoowoo,

I'm away from my Mac right now, but on a hunch, have you tried downloading the latest version of the Mac client released a few days ago? I will test this later tonight.

Posted by: Stefan at 14:36 UTC, April 26, 2006

No, that wasns't it. It works on my Firefox on Mac...

Posted by: Stefan at 15:59 UTC, April 26, 2006

It doesn't work for me (Firefox on PC)
I get a KML file but it's always the zipcode in my city, nothing more.

It must be a GE setting. I hope someone figures it out.

Posted by: Jim Mitchell at 1:49 UTC, May 08, 2006

Jim, make sure you've clicked on "link to this page first" if you're doing it manually instead of with the bookmarklet.

Posted by: Stefan at 5:47 UTC, May 08, 2006

I tried the exact steps but it didn't work for me either. Firefox on PC. I always get my default location.

Later I entered the my search query and tried again then it worked.

You have to search for the location then click 'Link to this page' button. Then add &output=kml to the URL.

Posted by: Rk at 19:15 UTC, May 08, 2006

When you had set a position as a default location f.e. in firefox this method doesn't work. Clear your google-cookies (or all) and it works.

Posted by: BeneathTheSurface at 10:06 UTC, May 09, 2006

When you had set a position as a default location f.e. in firefox this method doesn't work. Clear your google-cookies (or all) and it works.

Posted by: BeneathTheSurface at 10:09 UTC, May 09, 2006

Only just made the connection, but you can also label the destination like this!

Posted by: Barry Hunter at 9:30 UTC, May 11, 2006

Very nice finding there!

Your Stockholm link worked like a breeze for me, under the following circumstances and actions:

I use Firefox 1.5 on Win XP and have the latest GE 4.0 beta installed.
Clicking on the link to your Google Maps position takes me to GM, as expected. I then click "link to this page. In the FF address field I add '&output=kml' and press enter.

I'm offered to download the KML file and select to "open in Google Earth", which I do.
GE starts, loads the KML file and takes me to your position on GE. Your area is shown at a slightly different scale.

Posted by: Petit at 22:31 UTC, July 27, 2006

To use yoiur kml files in Google Maps use the following url, replacing the 'www.yourdomain.com' with your machines IP or name and 'yourfile.kml' with the name of your kml file.

http://maps.google.com/maps?f=q&hl=en&q=http://www.yourdomain.com/yourfile.kml"

NB. Some kml tags like style don't seem to be understood by Google Maps.

Posted by: John Preston at 19:21 UTC, September 05, 2006

I can't get that to work, I have got cookies blocked, is this why is doesnt work,

Posted by: katoey at 7:37 UTC, November 13, 2006

more of 1500 Google Earth coordinates, ready to paste in "TO FLY" Option, wow!... All places!!

http://ar.geocities.com/coordenadasgoogle/coordinates.html

Posted by: Gustav at 9:43 UTC, March 20, 2007

More of 1500 Google Earth coordinates, ready to paste in "TO FLY" Option, wow!... All places!!

http://ar.geocities.com/coordenadasgoogle/coordinates.html

Luck!

Posted by: Gustav at 0:15 UTC, March 22, 2007

how do you get to Google earth

Posted by: kasandra at 0:53 UTC, September 29, 2008

Post a comment





Remember Me?


(you may use HTML tags for style, and also <a>)

Note: After your comment has been submitted, you may need to reload the page before it becomes visible.

Search Ogle Earth:
Ogle Earth brings you news about virtual globes, with a special focus on Google Earth. By Stefan Geens. Email me. Last tracked here:
Get updates via email:

NeoGeo Jobs

Ogle Earth: Recent posts

Archives