Embed Google Earth into your Website's Maps

Posted: May 30th, 2008
 

Google has released a browser plugin which allows their popular Google Earth maps to be directly embedded into your website’s Google Maps. The functionality works similar to the Satellite or Terrain maps as an extra button appears which allows visitors to your webpage a view through Google Earth while panning, tilting, and zooming in and out of the map.

Google Earth Plugin

The plugin is slow to load and very cpu intensive, however in time I’m sure Google will work to improve this as users become more accustom to expecting this type of mapping functionailty without having to open another application.

Adding the Google Earth button to your website’s map is as simple as adding the following 3 lines of javascript:

map.addMapType(G_SATELLITE_3D_MAP);
map.addControl(new GHierarchicalMapTypeControl());
map.addControl(new GLargeMapControl());

This is just the beginning as there will be many more mapping functions added that integrate with web browsers as well as Google’s other browser based software. An example of what can be done with the Google Earth plugin is the Monster Milktruck application. Although a fun and basic game, this serves as an example of the many possibilities of what’s to come.

Monster Milktruck

 

Earth Bowls

Posted: January 10th, 2008
 

If you’ve ever wanted a fruit bowl that is designed to the contours of any part of the world, one can now be ordered from the Fluidforms website and customized using Google Earth. Once you’ve selected the section of the world you want and scaled Google Earth to the appropriate dimensions, the bowl is then carved from a block of wood, following the contours of the section of earth you selected.

To see the process of how this is done, check out the Fluidforms Earth Bowl Manual.

Earth Bowls

 

Integrating KML into Google Maps

Posted: December 31st, 2007
 

After getting a GPS unit over the holidays, I was keen to try mapping out a hiking trail on the Vancouver Trails site. After importing the tracks into MapSource and cleaning a few points up, I saved the file in .gpx format and imported that into Google Earth. It looked great!

From here, I could right-click on the data folder and export it to .kml or .kmz format.

To integrate KML files into Google Maps on your website, add the following lines of javascript after the map.addControl calls:

var kml = new GGeoXml("kml-file.kml");
map.addOverlay(kml);

The first file that I exported to .kml from Google Earth was over 250K and included thousands of lines of useless style code. So, I exported the Tracks as one file and then the Waypoints as another file and used the code above twice, once to load each file. Both of those files combined were much smaller at just 21K combined.

The only thing left was to export everything into one .kmz file and provide a link under the map so that users could click and the link would open the map into Google Earth automatically. Click here to open the Capilano Canyon file in Google Earth.

Capilano Canyon Map