Welcome to the developer documentation for the Google Earth API. The Google Earth Plug-in and its JavaScript API let you embed the full power of Google Earth and its 3D rendering capabilities into your web pages. Just like in the Google Maps API, you can draw markers and lines—but in 3D!
See the Google Earth API developer forum if you have have questions about the API after reading this developer guide.
This documentation is designed for people familiar with JavaScript programming and object-oriented programming concepts. The Google Earth API is modelled after KML, so you should also consult Google's KML documentation.
Before you can use the API, you must first install the Google Earth Plug-in.
Note: Your users will also need to install the plugin to interact with Google Earth on your web site.
The Google Earth Plug-in is currently available for the following web browsers and operating systems:
Although the plugin and API may work correctly on other browsers that support NPAPI with npruntime extensions, these browsers are not officially supported.
To begin using the Google Earth API:
To uninstall the Google Earth Plug-in on Windows, from the Start menu, select Google Earth Plug-in and then Uninstall.
To uninstall the Google Earth Plug-in on Mac, follow the uninstallation steps as listed on the FAQ.
You can either use the Google Earth API by itself or you can use it together with the Google Maps API. If you already have Google Maps embeded in your web page, you can enhance it by giving your users the option to view the contents in either Google Maps or in the Google Earth Plug-in. By incorporating the Google Earth Plug-in, users will have the option to display the information in 3D, while also viewing terrain, geometry, and many other Google Earth features.
The canonical Google Earth API example is Hello, Earth. Take a look at this sample in the Basic Topics section of this Developer's Guide for an idea of what Earth API code looks like.
Most of the examples in this documentation show only relevant JavaScript code, not the full HTML file. You can plug the JavaScript code into your own skeleton HTML file, or you can visit the following resources for Earth API samples:
If your code doesn't seem to be working, here are some approaches that might help you solve your problems:
If you need more information about Google Earth, KML, or Google Maps, refer to the following: