Two weeks ago when I was trawling through my regular blog list I stumbled across
this article from Google, which detailed some modifications the Geo Developer team have made with the integration of Maps and Google Earth. Essentially it allows you to view your Google Map (embedded in your webpage) using the Google Earth interface i.e. you can view your map in 3D and "fly" through the terrain.

The functionality in this updated version is very cool - it even integrates with the existing pin/polygon line API, allowing you to plot all of your applications data using the usual Maps APIs, hit the "Earth" button, and as if by magic you are seamlessly transported into a 3D representation of the current map view complete with all your data (markers etc) - very cool.

Here is the basic code to get you up and running:

//...
// the code below should be in a JS
// function that is called by onload
//...

if (GBrowserIsCompatible()) {

//create map
map = new GMap2($("map"));

//set default view to G_PHYSICAL_MAP, which looks cool,
//and add the large style map control
map.setMapType(G_PHYSICAL_MAP);
map.addControl(new GLargeMapControl());

//add the new G_SATELLITE_3D_MAP to the mix
map.addMapType(G_SATELLITE_3D_MAP);

//add the GMapTypeControl to the UI to allow
//the new "Earth" view to be selected
map.addControl(new GMapTypeControl());

}

// other functions...

You may need to do some tweaking in order to get all of the data representation working correctly - all of my custom pins appear correctly, but I can't get the pin clustering images I blogged about recently to display properly...

Viewing the Google Map in G_SATELLITE_3D_MAP Earth-style does require a small plugin installation in your browser (which may hamper deployment in some organisations), but so far I haven't heard of any particular problems with any browser...

Daniel

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Daniel Bryant (Director) | Tai-Dev Ltd
www.tai-dev.co.uk - IT Consultancy Services Specialising in JEE, Web 2.0 and RDBMS