Keyhole Markup Language

Developer's Guide

This section includes pages with additional information on key KML elements and how to use them.

KMZ FilesUpdated
Learn how to package up (and compress) your KML file and all its related images, overlays, icons, and sound files into one tidy unit that can be posted or emailed as a single entity.
Touring
Google Earth 5.0 introduces touring: KML-controlled movement through space and time. Touring-related elements are contained in the Google extension namespace.
Altitude Modes
With the introduction of elements in the Google extension namespace, Google Earth 5.0 can take viewers underwater with new clampToSeaFloor and relativeToSeaFloor altitude modes. This chapter also discusses the traditional, above-ground modes.
Time and Animation
Any Feature in KML can have time data associated with it. When a KML file contains a Feature with TimeSpan or TimeStamp elements, Google Earth displays a time slider. Using the slider and play button, the user can "play" the entire sequence or can select individual time periods for display.
Cameras
The Camera element provides an additional way to specify the viewpoint for a Feature. Cameras are used with PhotoOverlays, another feature added in KML 2.2. <Camera> provides full six-degrees-of-freedom control over the view, so you can position the Camera in space and then rotate it around the x, y, and z axes.
PhotoOverlays
The PhotoOverlay element allows you to geographically locate a photograph on the Earth and to specify the placement and orientation of the Camera that views this PhotoOverlay. The PhotoOverlay can be a simple 2D rectangle, a partial or full cylinder, or a sphere (for spherical panoramas). The ImagePyramid child element of PhotoOverlay provides for efficient handling of arbitrarily large photographs in Google Earth.
Sky Data in KML
Now you can display celestial data in Google Earth. This page describes how to set up your KML file to view the sky, with tips on converting standard celestial coordinates to display in Google Earth, Sky mode.
Adding Custom Data
You can add custom data to KML Features in three different ways, depending on the kind of custom data. The new ExtendedData element allows you to add your own untyped data, typed data, or arbitrary XML data to a KML Feature. Google Earth preserves this information along with the file. Untyped data and typed data contain display elements that can be used for style templates and entity replacement in the balloon.
Models
Three-dimensional objects can be modeled naturally in their own coordinate space and exported as COLLADA™ files, then imported into Google Earth and placed on the Earth's surface.
Regions
Regions provide culling and level-of-detail behavior that allow you to fine-tune how your data is presented in Google Earth. When used with NetworkLinks, Regions enable streaming of very large datasets, with "smart" loading of data at multiple levels of resolution (see the section on Super-Overlays). You can also simulate Google Earth's layers using Regions.
Updates
You can incrementally update data loaded by NetworkLinks—changing, adding, and deleting KML data that was previously loaded into Google Earth.
Expiration
This page discusses how to prevent KML data from becoming stale, through the use of HTTP headers and KML expiration times.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.