This section contains an alphabetical reference for all KML elements defined in KML Version 2.2, as well as elements in the [Google extension namespace](https://developers.google.com/kml/documentation/kmlreference#kmlextensions). The class tree for KML elements is shown below. In this diagram, elements to the right on a particular branch in the tree are *extensions* of the elements to their left. For example, Placemark is a special kind of *Feature* . It contains all of the elements that belong to *Feature*, and it adds some elements that are specific to the Placemark element.

KML is an open standard officially named the OpenGIS® KML Encoding Standard (OGC KML). It is maintained by the Open Geospatial Consortium, Inc. (OGC). The complete specification for OGC KML can be found at <http://www.opengeospatial.org/standards/kml/>.

The complete XML schema for KML is located at <http://schemas.opengis.net/kml/>.

**Note:** Click an element name in this diagram to jump to its entry in the reference section.
![class tree diagram](https://developers.google.com/static/kml/documentation/images/classTree52.gif)

Note that abstract elements (shown in boxes in the diagram) are not actually used in KML files. They are a useful way for a single element to serve as the programmatic foundation for multiple similar (but different) derived elements. Understanding this object-oriented hierarchy is also a good way for you to learn KML, since you can easily see groupings of related elements.

All elements derived from *Object* can have an **id** assigned to them. This **id** is used by the KML update mechanism (see [\<Update\>](https://developers.google.com/kml/documentation/kmlreference#update)) for files loaded with a NetworkLink. It is also used by shared styles (see [\<Style\>](https://developers.google.com/kml/documentation/kmlreference#style)). The **id** is a standard [XML ID](http://www.w3.org/TR/xmlschema11-2/#ID).

Because KML is an XML grammar and file format, tag names are case-sensitive and must appear exactly as shown here. If you're familiar with XML, you will also be interested in the [KML 2.2 Schema](http://schemas.opengis.net/kml/). When you are editing KML text files, you can load this Schema into any XML editor and validate your KML code with it.

**Tip: Viewing KML for Google Earth Features**

Here is a handy feature of Google Earth that makes it easy to view the KML file for any Feature. In Google Earth, you can right-click a Feature in the Places panel and copy it. To view the corresponding KML for the copied object, open your favorite text editor and paste the selection into it.

**Compatibility**

KML versions have a double numbering system: `majorVersion.minorVersion`. All versions with the same `majorVersion` are compatible. For this reason, if you change the namespace to "2.2" (that is, `xmlns="http://www.opengis.net/kml/2.2"`), all KML 2.1 files validate in the [KML 2.2 schema](http://schemas.opengis.net/kml/).

## About this reference

Each reference entry includes a Syntax section that lists the elements contained in the main element. This Syntax section is an informal listing and uses simple shorthand to summarize the elements. This section also contains the following:

- *default values* for each element (or ellipses if it is a complex element or if there is no default value)
- the *type* of the value (see [KML Fields](https://developers.google.com/kml/documentation/kmlreference#kmlfields))

The Syntax section can be copied and used as a template for any non-abstract element in a KML file.

## KML Extension Namespace and the gx prefix

The [OGC KML standard](http://www.opengeospatial.org/standards/kml/) provides a mechanism for extensions - additional elements that contain information beyond what is available in the standard ([learn more about XML namespaces](http://www.w3.org/TR/REC-xml-names/) at w3.org). With the launch of Google Earth 5.0, Google has provided extensions to KML to support a number of new features. These extensions use the **gx** prefix and the following namespace URI:

`xmlns:gx="http://www.google.com/kml/ext/2.2"`

This namespace URI must be added to the `<kml>` element in any KML file using **gx-**prefixed elements:

```
<kml xmlns="http://www.opengis.net/kml/2.2"
 xmlns:gx="http://www.google.com/kml/ext/2.2">
```

Extensions to KML may not be supported in all geo-browsers. If your browser doesn't support particular extensions, the data in those extensions should be silently ignored, and the rest of the KML file should load without errors.

Elements that currently use the **gx** prefix are:

- [gx:altitudeMode](https://developers.google.com/kml/documentation/kmlreference#gxaltitudemode)
- [gx:altitudeOffset](https://developers.google.com/kml/documentation/kmlreference#gxaltitudeoffset)
- [gx:angles](https://developers.google.com/kml/documentation/kmlreference#gxangles)
- [gx:AnimatedUpdate](https://developers.google.com/kml/documentation/kmlreference#gxanimatedupdate)
- [gx:balloonVisibility](https://developers.google.com/kml/documentation/kmlreference#gxballoonvisibility)
- [gx:coord](https://developers.google.com/kml/documentation/kmlreference#gxcoord)
- [gx:delayedStart](https://developers.google.com/kml/documentation/kmlreference#gxdelayedstart)
- [gx:drawOrder](https://developers.google.com/kml/documentation/kmlreference#gxdraworder)
- [gx:duration](https://developers.google.com/kml/documentation/kmlreference#gxduration)
- [gx:FlyTo](https://developers.google.com/kml/documentation/kmlreference#gxflyto)
- [gx:flyToMode](https://developers.google.com/kml/documentation/kmlreference#gxflytomode)
- [gx:h](https://developers.google.com/kml/documentation/kmlreference#gxh)
- [gx:horizFov](https://developers.google.com/kml/documentation/kmlreference#gxhorizfov)
- [gx:interpolate](https://developers.google.com/kml/documentation/kmlreference#gxinterpolate)
- [gx:labelVisibility](https://developers.google.com/kml/documentation/kmlreference#gxlabelvisibility)
- [gx:LatLonQuad](https://developers.google.com/kml/documentation/kmlreference#gxlatlonquad)
- [gx:MultiTrack](https://developers.google.com/kml/documentation/kmlreference#gxmultitrack)
- [gx:vieweroptions](https://developers.google.com/kml/documentation/kmlreference#gxoption)
- [gx:outerColor](https://developers.google.com/kml/documentation/kmlreference#gxoutercolor)
- [gx:outerWidth](https://developers.google.com/kml/documentation/kmlreference#gxouterwidth)
- [gx:physicalWidth](https://developers.google.com/kml/documentation/kmlreference#gxphysicalwidth)
- [gx:Playlist](https://developers.google.com/kml/documentation/kmlreference#gxplaylist)
- [gx:playMode](https://developers.google.com/kml/documentation/kmlreference#gxtourcontrol)
- [gx:SoundCue](https://developers.google.com/kml/documentation/kmlreference#gxsoundcue)
- [gx:TimeSpan](https://developers.google.com/kml/documentation/kmlreference#gxtimespan)
- [gx:TimeStamp](https://developers.google.com/kml/documentation/kmlreference#gxtimestamp)
- [gx:Tour](https://developers.google.com/kml/documentation/kmlreference#gxtour)
- [gx:TourControl](https://developers.google.com/kml/documentation/kmlreference#gxtourcontrol)
- [gx:TourPrimitive](https://developers.google.com/kml/documentation/kmlreference#gxtourprimitive)
- [gx:Track](https://developers.google.com/kml/documentation/kmlreference#gxtrack)
- [gx:ViewerOptions](https://developers.google.com/kml/documentation/kmlreference#gxvieweroptions)
- [gx:w](https://developers.google.com/kml/documentation/kmlreference#gxw)
- [gx:Wait](https://developers.google.com/kml/documentation/kmlreference#gxwait)
- [gx:x](https://developers.google.com/kml/documentation/kmlreference#gxx)
- [gx:y](https://developers.google.com/kml/documentation/kmlreference#gxy)

The complete XML schema for elements in this extension namespace is located at [http://developers.google.com/kml/schema/kml22gx.xsd](https://developers.google.com/static/kml/schema/kml22gx.xsd).

## KML fields

KML uses common XML types such as *boolean, string, double, float,* and *int*. In addition, it defines a number of field element types. The following table lists some of the most commonly used types defined in KML and links to sample elements that use them:

| ***Field Type*** | ***Value*** | ***Example Use*** |
|---|---|---|
| **altitudeModeEnum** | clampToGround, relativeToGround, absolute | See [\<LookAt\>](https://developers.google.com/kml/documentation/kmlreference#lookat) and [\<Region\>](https://developers.google.com/kml/documentation/kmlreference#region) |
| **angle90** | a value ≥−90 and ≤90 | See [\<latitude\>](https://developers.google.com/kml/documentation/kmlreference#latitude) in \<Model\> |
| **anglepos90** | a value ≥0 and ≤90 | See [\<tilt\>](https://developers.google.com/kml/documentation/kmlreference#tilt) in \<LookAt\> |
| **angle180** | a value ≥−180 and ≤180 | See [\<longitude\>](https://developers.google.com/kml/documentation/kmlreference#longitude) in \<Model\> |
| **angle360** | a value ≥−360 and ≤360 | See \<heading\> in [\<Orientation\>](https://developers.google.com/kml/documentation/kmlreference#orientation) |
| **color** | hexBinary value:*aabbggrr* | See any element that extends [*\<ColorStyle\>*](https://developers.google.com/kml/documentation/kmlreference#colorstyle) |
| **colorModeEnum** | normal, random | See any element that extends [*\<ColorStyle\>*](https://developers.google.com/kml/documentation/kmlreference#colorstyle) |
| **dateTime** | *dateTime, date, gYearMonth, gYear* | See [\<TimeSpan\>](https://developers.google.com/kml/documentation/kmlreference#timespan) and [\<TimeStamp\>](https://developers.google.com/kml/documentation/kmlreference#timestamp) |
| **displayModeEnum** | default, hide | See [\<BalloonStyle\>](https://developers.google.com/kml/documentation/kmlreference#balloonstyle) |
| **gridOrigin** | lowerLeft, upperLeft | See [\<PhotoOverlay\>](https://developers.google.com/kml/documentation/kmlreference#photooverlay) |
| **refreshModeEnum** | onChange, onInterval, onExpire | See [\<Link\>](https://developers.google.com/kml/documentation/kmlreference#Link) |
| **shapeEnum** | rectangle, cylinder, sphere | See [\<PhotoOverlay\>](https://developers.google.com/kml/documentation/kmlreference#photooverlay) |
| **styleStateEnum** | normal, highlight | See [\<StyleMap\>](https://developers.google.com/kml/documentation/kmlreference#stylemap) |
| **unitsEnum** | fraction, pixels, insetPixels | See [\<hotSpot\>](https://developers.google.com/kml/documentation/kmlreference#hotspot) in \<IconStyle\>, [\<ScreenOverlay\>](https://developers.google.com/kml/documentation/kmlreference#screenoverlay) |
| **vec2** | x=*double* xunits=*kml:unitsEnum* y=*double* yunits=*kml:unitsEnum* | See [\<hotSpot\>](https://developers.google.com/kml/documentation/kmlreference#hotspot) in \<IconStyle\>, [\<ScreenOverlay\>](https://developers.google.com/kml/documentation/kmlreference#screenoverlay) |
| **viewRefreshEnum** | never, onRequest, onStop, onRegion | See [\<Link\>](https://developers.google.com/kml/documentation/kmlreference#Link) |

## *\<AbstractView\>*

### Syntax

```
<!-- abstract element; do not create -->
<!--AbstractView -->                       <!-- Camera, LookAt -->
  <!-- extends Object -->
  <TimePrimitive>...</TimePrimitive>        <!-- gx:TimeSpan or gx:TimeStamp -->
  <gx:ViewerOptions>
    <gx:option name="" enabled=boolean />   <!-- name="streetview",
                                                      "historicalimagery",
                                                   or "sunlight" -->
  </gx:ViewerOptions>
<-- /AbstractView -->
```

### Description

This is an abstract element and cannot be used directly in a KML file. This element is extended by the [\<Camera\>](https://developers.google.com/kml/documentation/kmlreference#camera) and [\<LookAt\>](https://developers.google.com/kml/documentation/kmlreference#lookat) elements.

### Extends

- [\<Object\>](https://developers.google.com/kml/documentation/kmlreference#object)

### Elements Specific to AbstractView

\<gx:ViewerOptions\>
:   This element enables special viewing modes in Google Earth 6.0 and later. It has one or more `<gx:option>` child elements. The `<gx:option>` element has a `name` attribute and an `enabled` attribute. The `name` specifies one of the following: Street View imagery ("streetview"), historical imagery ("historicalimagery"), and sunlight effects for a given time of day ("sunlight"). The `enabled` attribute is used to turn a given viewing mode on or off.

\<gx:horizFov\>
:   Defines the horizontal field of view of the AbstractView **during
    a tour** . This element has no effect on AbstractViews outside of a
    tour. `<gx:horizFov>` is inserted automatically by the
    Google Earth client (versions 6.1+) during tour recording. Regular
    AbstractViews are assigned a value of **60** ; views within
    Street View are assigned a value of **85** to match the
    standard Street View field of view in Google Earth. Once set, the value
    will be applied to subsequent views, until a new value is specified.

### Extended By

- [\<Camera\>](https://developers.google.com/kml/documentation/kmlreference#camera)
- [\<LookAt\>](https://developers.google.com/kml/documentation/kmlreference#lookat)

## \<gx:altitudeMode\>

|---|
| This element is an extension of the [OGC KML 2.2 standard](http://www.opengeospatial.org/standards/kml/) and is supported in Google Earth 5.0 and later. [Learn more](https://developers.google.com/kml/documentation/kmlreference#kmlextensions) |

### Syntax

```
<gx:altitudeMode>clampToGround</gx:altitudeMode>
  <!-- gx:altitudeModeEnum: relativeToSeaFloor, clampToSeaFloor, relativeToGround, clampToGround, absolute -->
```

### Description

Can be used instead of the OGC KML standard `<altitudeMode>` element, and accepts the following values in addition to the standard altitudeMode values:

- **relativeToSeaFloor** - Interprets the altitude as a value in meters above the sea floor. If the KML feature is above land rather than sea, the altitude will be interpreted as being above the ground.
- **clampToSeaFloor** - The altitude specification is ignored, and the KML feature will be positioned on the sea floor. If the KML feature is on land rather than at sea, **clampToSeaFloor** will instead clamp to ground.

As with `<altitudeMode>`, `<gx:altitudeMode>` affects:

- the altitude coordinate within the `<coordinates>` element
- `<minAltitude>` and `<maxAltitude>` within `<LatLonAltBox>`
- `<altitude>` within `<Location>`, `<GroundOverlay>`, and `AbstractView` (`<LookAt>` and `<Camera>`).

More information about altitude modes is available in the [Altitude Modes](https://developers.google.com/kml/documentation/altitudemode) chapter of the **KML Developer's Guide**.

### Example

![](https://developers.google.com/static/kml/documentation/images/kml_feed_small.png) [altitudemode_reference.kml](https://developers.google.com/static/kml/documentation/kmlfiles/altitudemode_reference.kml)

```
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2"
 xmlns:gx="http://www.google.com/kml/ext/2.2">   <!-- required when using gx-prefixed elements -->

<Placemark>
  <name>gx:altitudeMode Example</name>
  <LookAt>
    <longitude>146.806</longitude>
    <latitude>12.219</latitude>
    <heading>-60</heading>
    <tilt>70</tilt>
    <range>6300</range>
    <gx:altitudeMode>relativeToSeaFloor</gx:altitudeMode>
  </LookAt>
  <LineString>
    <extrude>1</extrude>
    <gx:altitudeMode>relativeToSeaFloor</gx:altitudeMode>
    <coordinates>
      146.825,12.233,400
      146.820,12.222,400
      146.812,12.212,400
      146.796,12.209,400
      146.788,12.205,400
    </coordinates>
  </LineString>
</Placemark>

</kml>
```

## \<gx:AnimatedUpdate\>

|---|
| This element is an extension of the [OGC KML 2.2 standard](http://www.opengeospatial.org/standards/kml/) and is supported in Google Earth 5.0 and later. [Learn more](https://developers.google.com/kml/documentation/kmlreference#kmlextensions) |

### Syntax

```
<gx:AnimatedUpdate id="ID">
  <gx:duration>0.0</gx:duration>     <!-- double, specifies time in seconds -->
  <Update>
    <targetHref>...</targetHref>     <!-- required; can contain a URL or be left blank -->
                                      <!-- (to target elements within the same file) -->
    <Change>...</Change>
    <Create>...</Create>
    <Delete>...</Delete>
  </Update>
  <gx:delayedStart>0</gx:delayedStart>  <!-- double, specifies time in seconds -->
</gx:AnimatedUpdate>
```

### Description

`<gx:AnimatedUpdate>` controls changes during a tour to KML features, using `https://developers.google.com/kml/documentation/kmlreference#update`. Changes to KML features will not modify the DOM - that is, any changes will be reverted when the tour is over, and will not be saved in the KML at any time.

`<gx:AnimatedUpdate>` should also contain a `<gx:duration>` value to specify the length of time in seconds over which the update takes place. Integer, float, and color fields are smoothly animated from original to new value across the duration; boolean, string, and other values that don't lend to interpolation are updated at the end of the duration.

Refer to [Tour timelines](https://developers.google.com/kml/documentation/touring#tourtimelines) in the **Touring** chapter of the **KML Developer's Guide** for information about `<gx:AnimatedUpdate>` and the tour timeline.

\<gx:duration\>
:   Specifies the length of time, in seconds, over which the update takes place.

\<gx:delayedStart\>
:   Specifies the number of seconds to wait (after the inline start position) before starting the update.

### Example

The example below demonstrates a change in icon size. This change will be animated over a 5-second duration.

![](https://developers.google.com/static/kml/documentation/images/kml_feed_small.png) [animatedupdate_example.kml](https://developers.google.com/static/kml/documentation/kmlfiles/animatedupdate_example.kml)

```
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2"
 xmlns:gx="http://www.google.com/kml/ext/2.2">

<Document>
  <name>gx:AnimatedUpdate example</name>

  <Style id="pushpin">
    <IconStyle id="mystyle">
      <Icon>
        <href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>
        <scale>1.0</scale>
      </Icon>
    </IconStyle>
  </Style>

  <Placemark id="mountainpin1">
    <name>Pin on a mountaintop</name>
    <styleUrl>#pushpin</styleUrl>
    <Point>
      <coordinates>170.1435558771009,-43.60505741890396,0</coordinates>
    </Point>
  </Placemark>

  <gx:Tour>
    <name>Play me!</name>

    <gx:Playlist>

      <gx:FlyTo>
        <gx:flyToMode>bounce</gx:flyToMode>
        <gx:duration>3</gx:duration>
        <Camera>
          <longitude>170.157</longitude>
          <latitude>-43.671</latitude>
          <altitude>9700</altitude>
          <heading>-6.333</heading>
          <tilt>33.5</tilt>
        </Camera>
      </gx:FlyTo>

      <gx:AnimatedUpdate>
        <gx:duration>5</gx:duration>
        <Update>
          <targetHref></targetHref>
          <Change>
            <IconStyle targetId="mystyle">
              <scale>10.0</scale>
            </IconStyle>
          </Change>
        </Update>
      </gx:AnimatedUpdate>

      <gx:Wait>
        <gx:duration>5</gx:duration>
      </gx:Wait>

    </gx:Playlist>
  </gx:Tour>

</Document>
</kml>
```

### Extends

- [\<gx:TourPrimitive\>](https://developers.google.com/kml/documentation/kmlreference#gxtourprimitive)

### Contains

- [\<gx:duration\>](https://developers.google.com/kml/documentation/kmlreference#gxduration)
- [\<Update\>](https://developers.google.com/kml/documentation/kmlreference#update)

## \<BalloonStyle\>

### Syntax

```
<BalloonStyle id="ID">
  <!-- specific to BalloonStyle -->
  <bgColor>ffffffff</bgColor>            <!-- kml:color -->
  <textColor>ff000000</textColor>        <!-- kml:color -->
  <text>...</text>                       <!-- string -->
  <displayMode>default</displayMode><!-- kml:displayModeEnum -->
</BalloonStyle>
```

### Description

Specifies how the description balloon for placemarks is drawn. The \<bgColor\>, if specified, is used as the background color of the balloon. See [\<*Feature*\>](https://developers.google.com/kml/documentation/kmlreference#feature) for a diagram illustrating how the default description balloon appears in Google Earth.

### Elements Specific to BalloonStyle

\<bgColor\>
:   Background color of the balloon (optional). Color and opacity (alpha) values are expressed in hexadecimal notation. The range of values for any one color is 0 to 255 (`00` to `ff`). The order of expression is *aabbggrr,* where *aa=alpha* (00 to ff); *bb=blue* (00 to ff); *gg=green* (00 to ff); *rr=red* (00 to ff). For alpha, `00` is fully transparent and `ff` is fully opaque. For example, if you want to apply a blue color with 50 percent opacity to an overlay, you would specify the following: `<bgColor>7fff0000</bgColor>`, where *alpha* =0x7f, *blue* =0xff, *green* =0x00, and *red*=0x00. The default is opaque white (ffffffff).

\<textColor\>
:   Foreground color for text. The default is black (ff000000).

\<text\>
:   Text displayed in the balloon. If no text is specified, Google Earth draws the default balloon (with the Feature \<name\> in boldface, the Feature \<description\>, links for driving directions, a white background, and a tail that is attached to the point coordinates of the Feature, if specified).
:   You can add entities to the \<text\> tag using the following format to refer to a child element of Feature: **$\[name\]** , **$\[description\]** , **$\[address\]** , **$\[id\]** , **$\[Snippet\]** . Google Earth looks in the current Feature for the corresponding string entity and substitutes that information in the balloon. To include *To* *here - From here* driving directions in the balloon, use the **$\[geDirections\]** tag. To prevent the driving directions links from appearing in a balloon, include the \<text\> element with some content, or with $\[description\] to substitute the basic Feature \<description\>.
:   For example, in the following KML excerpt, **$\[name\]** and **$\[description\]** fields will be replaced by the \<name\> and \<description\> fields found in the Feature elements that use this BalloonStyle:

    ```
    <text>This is $[name], whose description is:<br/>$[description]</text>
    ```

**\<displayMode\>**
:   If \<displayMode\> is *default* , Google Earth uses the information supplied in \<text\> to create a balloon . If \<displayMode\> is *hide*, Google Earth does not display the balloon. In Google Earth, clicking the List View icon for a Placemark whose balloon's \<displayMode\> is *hide* causes Google Earth to fly to the Placemark.

### Example

```
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
  <name>BalloonStyle.kml</name>
  <open>1</open>
  <Style id="exampleBalloonStyle">
    <BalloonStyle>
      <!-- a background color for the balloon -->
      <bgColor>ffffffbb</bgColor>
      <!-- styling of the balloon text -->
      <text><![CDATA[
      <b><font color="#CC0000" size="+3">$[name]</font></b>
      <br/><br/>
      <font face="Courier">$[description]</font>
      <br/><br/>
      Extra text that will appear in the description balloon
      <br/><br/>
      <!-- insert the to/from hyperlinks -->
      $[geDirections]
      ]]></text>
    </BalloonStyle>
  </Style>
  <Placemark>
    <name>BalloonStyle</name>
    <description>An example of BalloonStyle</description>
    <styleUrl>#exampleBalloonStyle</styleUrl>
    <Point>
      <coordinates>-122.370533,37.823842,0</coordinates>
    </Point>
  </Placemark>
</Document>
</kml>
```

### Extends

- [\<*ColorStyle*\>](https://developers.google.com/kml/documentation/kmlreference#colorstyle)

### Contained By

- [\<Style\>](https://developers.google.com/kml/documentation/kmlreference#style)

[Back to top](https://developers.google.com/kml/documentation/kmlreference#top)

## \<gx:balloonVisibility\>

|---|
| This element is an extension of the [OGC KML 2.2 standard](http://www.opengeospatial.org/standards/kml/) and is supported in Google Earth 5.0 and later. [Learn more](https://developers.google.com/kml/documentation/kmlreference#kmlextensions) |

### Syntax

```
<gx:balloonVisibility>0</gx:balloonVisibility>    <!-- 0 (not visible) or 1 (visible) -->
```

### Description

Toggles visibility of a description balloon. The balloon to be updated must be identified by the object's XML ID (e.g. `<Placemark targetId="xxx">`).

### Examples

The first example shows `<gx:balloonVisibility>` with a Placemark. When the placemark is loaded, the description balloon is opened.  

![](https://developers.google.com/static/kml/documentation/images/kml_feed_small.png) [balloonvisibility_example.kml](https://developers.google.com/static/kml/documentation/kmlfiles/balloonvisibility_example.kml)

```
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2"
 xmlns:gx="http://www.google.com/kml/ext/2.2">

  <Placemark>
    <name>Eiffel Tower</name>
    <description>
        Located in Paris, France. 
        
        This description balloon opens 
        when the Placemark is loaded.
    </description>
    <gx:balloonVisibility>1</gx:balloonVisibility>
    <Point>
      <coordinates>2.294785,48.858093,0</coordinates>
    </Point>
  </Placemark>

</kml>
```

The second example shows the use of `<gx:balloonVisibility>` within a tour. A number of balloons are opened and closed during the tour, providing information to the viewer.  

![](https://developers.google.com/static/kml/documentation/images/kml_feed_small.png) [balloonvisibility_tourexample.kml](https://developers.google.com/static/kml/documentation/kmlfiles/balloonvisibility_tourexample.kml)

```
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2"
 xmlns:gx="http://www.google.com/kml/ext/2.2">

  <Document>
    <name>balloonVisibility Example</name>
    <open>1</open>

    <gx:Tour>
      <name>Play me</name>
      <gx:Playlist>

        <gx:FlyTo>
          <gx:duration>8.0</gx:duration>
          <gx:flyToMode>bounce</gx:flyToMode>
          <LookAt>
            <longitude>-119.748584</longitude>
            <latitude>33.736266</latitude>
            <altitude>0</altitude>
            <heading>-9.295926</heading>
            <tilt>84.0957450</tilt>
            <range>4469.850414</range>
            <gx:altitudeMode>relativeToSeaFloor</gx:altitudeMode>
          </LookAt>
        </gx:FlyTo>

        <gx:AnimatedUpdate>
          <gx:duration>0.0</gx:duration>
          <Update>
            <targetHref/>
            <Change>
              <Placemark targetId="underwater1">
                <gx:balloonVisibility>1</gx:balloonVisibility>
              </Placemark>
            </Change>
          </Update>
        </gx:AnimatedUpdate>

        <gx:Wait>
          <gx:duration>4.0</gx:duration>
        </gx:Wait>

        <gx:AnimatedUpdate>
          <gx:duration>0.0</gx:duration>
          <Update>
            <targetHref/>
            <Change>
              <Placemark targetId="underwater1">
                <gx:balloonVisibility>0</gx:balloonVisibility>
              </Placemark>
            </Change>
          </Update>
        </gx:AnimatedUpdate>

        <gx:FlyTo>
          <gx:duration>3</gx:duration>
          <gx:flyToMode>smooth</gx:flyToMode>
          <LookAt>
            <longitude>-119.782630</longitude>
            <latitude>33.862855</latitude>
            <altitude>0</altitude>
            <heading>-9.314858</heading>
            <tilt>84.117317</tilt>
            <range>6792.665540</range>
            <gx:altitudeMode>relativeToSeaFloor</gx:altitudeMode>
          </LookAt>
        </gx:FlyTo>

        <gx:AnimatedUpdate>
          <gx:duration>0.0</gx:duration>
          <Update>
            <targetHref/>
            <Change>
              <Placemark targetId="underwater2">
                <gx:balloonVisibility>1</gx:balloonVisibility>
              </Placemark>
            </Change>
          </Update>
        </gx:AnimatedUpdate>

        <gx:Wait>
          <gx:duration>4.0</gx:duration>
        </gx:Wait>

        <gx:AnimatedUpdate>
          <gx:duration>0.0</gx:duration>
          <Update>
            <targetHref/>
            <Change>
              <Placemark targetId="underwater2">
                <gx:balloonVisibility>0</gx:balloonVisibility>
              </Placemark>
            </Change>
          </Update>
        </gx:AnimatedUpdate>

        <gx:FlyTo>
          <gx:duration>3</gx:duration>
          <gx:flyToMode>smooth</gx:flyToMode>
          <LookAt>
            <longitude>-119.849578</longitude>
            <latitude>33.968515</latitude>
            <altitude>0</altitude>
            <heading>-173.948935</heading>
            <tilt>23.063392</tilt>
            <range>3733.666023</range>
            <altitudeMode>relativeToGround</altitudeMode>
          </LookAt>
        </gx:FlyTo>

        <gx:AnimatedUpdate>
          <gx:duration>0.0</gx:duration>
          <Update>
            <targetHref/>
            <Change>
              <Placemark targetId="onland">
                <gx:balloonVisibility>1</gx:balloonVisibility>
              </Placemark>
            </Change>
          </Update>
        </gx:AnimatedUpdate>

        <gx:Wait>
          <gx:duration>4.0</gx:duration>
        </gx:Wait>

      </gx:Playlist>
    </gx:Tour>

    <Placemark id="underwater1">
      <name>Underwater off the California Coast</name>
      <description>
        The tour begins near the Santa Cruz Canyon,
        off the coast of California, USA.
      </description>
      <Point>
        <gx:altitudeMode>clampToSeaFloor</gx:altitudeMode>
        <coordinates>-119.749531,33.715059,0</coordinates>
      </Point>
    </Placemark>

    <Placemark id="underwater2">
      <name>Still swimming...</name>
      <description>We're about to leave the ocean, and visit the coast...</description>
      <Point>
        <gx:altitudeMode>clampToSeaFloor</gx:altitudeMode>
        <coordinates>-119.779550,33.829268,0</coordinates>
      </Point>
    </Placemark>

    <Placemark id="onland">
      <name>The end</name>
      <description>
        <![CDATA[The end of our simple tour.
        Use <gx:balloonVisibility>1</gx:balloonVisibility>
        to show description balloons.]]>
      </description>
      <Point>
        <coordinates>-119.849578,33.968515,0</coordinates>
      </Point>
    </Placemark>


  </Document>
</kml>
```

### Extends

- [\<Feature\>](https://developers.google.com/kml/documentation/kmlreference#feature)

## \<Camera\>

### Syntax

```
<Camera id="ID">
  <!-- inherited from AbstractView element -->
  <TimePrimitive>...</TimePrimitive>  <!-- gx:TimeSpan or gx:TimeStamp -->
  <gx:ViewerOptions>
    <option> name=" " type="boolean">     <!-- name="streetview", "historicalimagery", "sunlight", or "groundnavigation" -->
    </option>
  </gx:ViewerOptions>

  <!-- specific to Camera -->
  <longitude>0</longitude>            <!-- kml:angle180 -->
  <latitude>0</latitude>              <!-- kml:angle90 -->
  <altitude>0</altitude>              <!-- double -->
  <heading>0</heading>                <!-- kml:angle360 -->
  <tilt>0</tilt>                      <!-- kml:anglepos180 -->
  <roll>0</roll>                      <!-- kml:angle180 -->
  <altitudeMode>clampToGround</altitudeMode>
        <!-- kml:altitudeModeEnum: relativeToGround, clampToGround, or absolute -->
        <!-- or, gx:altitudeMode can be substituted: clampToSeaFloor, relativeToSeaFloor -->
</Camera> 
```

### Description

Defines the virtual camera that views the scene. This element defines the position of the camera relative to the Earth's surface as well as the *viewing direction* of the camera. The camera *position* is defined by \<longitude\>, \<latitude\>, \<altitude\>, and either \<altitudeMode\> or \<gx:altitudeMode\>. The *viewing direction* of the camera is defined by \<heading\>, \<tilt\>, and \<roll\>. \<Camera\> can be a child element of any Feature or of \<NetworkLinkControl\>. A parent element cannot contain both a \<Camera\> and a \<LookAt\> at the same time.

\<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. Most importantly, you can tilt the camera view so that you're looking above the horizon into the sky.

\<Camera\> can also contain a TimePrimitive (\<gx:TimeSpan\> or \<gx:TimeStamp\>). Time values in Camera affect historical imagery, sunlight, and the display of time-stamped features. For more information, read [Time with AbstractViews](https://developers.google.com/kml/documentation/time#abstractviews) in the **Time and Animation** chapter of the Developer's Guide.

#### Defining a View

Within a Feature or \<NetworkLinkControl\>, use either a \<Camera\> or a \<LookAt\> object (but not both in the same object). The \<Camera\> object defines the viewpoint in terms of the viewer's position and orientation. The \<Camera\> object allows you to specify a view that is not on the Earth's surface. The \<LookAt\> object defines the viewpoint in terms of what is being viewed. The \<LookAt\> object is more limited in scope than \<Camera\> and generally requires that the view direction intersect the Earth's surface.

The following diagram shows the *X* , *Y* , and *Z* axes, which are attached to the virtual camera.

- The *X* axis points toward the right of the camera and is called the *right vector*.
- The *Y* axis defines the "up" direction relative to the screen and is called the *up vector*.
- The *Z* axis points from the center of the screen toward the eye point. The camera looks down the *−Z* axis, which is called the *view vector*.

![](https://developers.google.com/static/kml/documentation/images/defaultCameraAxes.gif)

### Order of Transformations

The order of rotation is important. By default, the camera is looking straight down the −Z axis toward the Earth. Before rotations are performed, the camera is translated along the *Z* axis to \<altitude\>. The order of transformations is as follows:

1. **\<altitude\>** - translate along the *Z* axis to \<altitude\>
2. **\<heading\>** - rotate around the *Z* axis.
3. **\<tilt\>** - rotate around the *X* axis.
4. **\<roll\>** - rotate around the *Z* axis (again).

Note that each time a rotation is applied, two of the camera axes change their orientation.

### Elements Specific to Camera

\<longitude\>
:   Longitude of the virtual camera (eye point). Angular distance in degrees, relative to the Prime Meridian. Values west of the Meridian range from −180 to 0 degrees. Values east of the Meridian range from 0 to 180 degrees.

\<latitude\>
:   Latitude of the virtual camera. Degrees north or south of the Equator (0 degrees). Values range from −90 degrees to 90 degrees.

\<altitude\>
:   Distance of the camera from the earth's surface, in meters. Interpreted according to the Camera's \<altitudeMode\> or \<gx:altitudeMode\>.

\<heading\>
:   Direction (azimuth) of the camera, in degrees. Default=0 (true North). ([See diagram](https://developers.google.com/kml/documentation/kmlreference#headingdiagram).) Values range from 0 to 360 degrees.

\<tilt\>
:   Rotation, in degrees, of the camera around the *X* axis. A value of 0 indicates that the view is aimed straight down toward the earth (the most common case). A value for 90 for \<tilt\> indicates that the view is aimed toward the horizon. Values greater than 90 indicate that the view is pointed up into the sky. Values for \<tilt\> are clamped at +180 degrees.

\<roll\>
:   Rotation, in degrees, of the camera around the Z axis. Values range from −180 to +180 degrees.

\<altitudeMode\>
:   Specifies how the \<altitude\> specified for the Camera is interpreted. Possible values are as follows:

    - **relativeToGround** - (default) Interprets the \<altitude\> as a value in meters above the ground. If the point is over water, the \<altitude\> will be interpreted as a value in meters above sea level. See [\<gx:altitudeMode\>](https://developers.google.com/kml/documentation/kmlreference#gxaltitudemode) below to specify points relative to the sea floor.
    - **clampToGround** - For a camera, this setting also places the camera **relativeToGround**, since putting the camera exactly at terrain height would mean that the eye would intersect the terrain (and the view would be blocked).
    - **absolute**- Interprets the \<altitude\> as a value in meters above sea level.

\<gx:altitudeMode\>
:   A KML extension in the [Google extension namespace](https://developers.google.com/kml/documentation/kmlreference#kmlextensions), allowing altitudes relative to the sea floor. Values are:

    - **relativeToSeaFloor** - Interprets the \<altitude\> as a value in meters above the sea floor. If the point is above land rather than sea, the \<altitude\> will be interpreted as being above the ground.
    - **clampToSeaFloor** - The \<altitude\> specification is ignored, and the Camera will be positioned on the sea floor. If the point is on land rather than at sea, the Camera will be positioned on the ground.

### Extends

- [\<*AbstractView*\>](https://developers.google.com/kml/documentation/kmlreference#abstractview)

### Contained By

- Any element derived from [\<*Feature*\>](https://developers.google.com/kml/documentation/kmlreference#feature)
- [\<NetworkLinkControl\>](https://developers.google.com/kml/documentation/kmlreference#networklinkcontrol)

[Back to top](https://developers.google.com/kml/documentation/kmlreference#top)

## \<*ColorStyle*\>

### Syntax

```
<!-- abstract element; do not create -->
<!-- ColorStyle id="ID" -->          <!-- IconStyle,LabelStyle,LineStyle,PolyStyle -->
  <color>ffffffff</color>            <!-- kml:color -->
  <colorMode>normal</colorMode>      <!-- kml:colorModeEnum: normal or random -->
<!-- /ColorStyle -->
```

### Description

This is an abstract element and cannot be used directly in a KML file. It provides elements for specifying the color and color mode of extended style types.

### Elements Specific to ColorStyle

\<color\>
:   Color and opacity (alpha) values are expressed in hexadecimal notation. The range of values for any one color is 0 to 255 (`00` to `ff`). For alpha, `00` is fully transparent and `ff` is fully opaque. The order of expression is *aabbggrr,* where *aa=alpha* (00 to ff); *bb=blue* (00 to ff); *gg=green* (00 to ff); *rr=red* (00 to ff). For example, if you want to apply a blue color with 50 percent opacity to an overlay, you would specify the following: `<color>7fff0000</color>`, where *alpha* =0x7f, *blue* =0xff, *green* =0x00, and *red*=0x00.

\<colorMode\>
:   Values for \<colorMode\> are **normal** (no effect) and **random** . A value of **random** applies a random linear scale to the base \<color\> as follows.

- To achieve a truly random selection of colors, specify a base \<color\> of white (ffffffff).
- If you specify a single color component (for example, a value of ff0000ff for *red* ), random color values for that one component (red) will be selected. In this case, the values would range from 00 (*black* ) to ff (*full red*).
- If you specify values for two or for all three color components, a random linear scale is applied to each color component, with results ranging from black to the maximum values specified for each component.
- The opacity of a color comes from the alpha component of \<color\> and is never randomized.

### Extends

- [\<*Object*\>](https://developers.google.com/kml/documentation/kmlreference#object)

### Extended By

- [\<IconStyle\>](https://developers.google.com/kml/documentation/kmlreference#iconstyle)
- [\<LabelStyle\>](https://developers.google.com/kml/documentation/kmlreference#labelstyle)
- [\<LineStyle\>](https://developers.google.com/kml/documentation/kmlreference#linestyle)
- \<[PolyStyle](https://developers.google.com/kml/documentation/kmlreference#polystyle)\>

[Back to top](https://developers.google.com/kml/documentation/kmlreference#top)

## \<*Container*\>

### Syntax

```
<!-- abstract element; do not create -->
<!-- Container id="ID" -->              <!-- Document,Folder -->
  <!-- inherited from Feature element -->
  <name>...</name>                      <!-- string -->
  <visibility>1</visibility>            <!-- boolean -->
  <open>0</open>                        <!-- boolean -->
  <address>...</address>                <!-- string -->
  <AddressDetails xmlns="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0">...
      </AddressDetails>                 <!-- string -->
  <phoneNumber>...</phoneNumber>        <!-- string -->
  <Snippet maxLines="2">...</Snippet>   <!-- string -->
  <description>...</description>        <!-- string -->
  \<AbstractView\>...\</AbstractView\>      <!-- LookAt or Camera -->
  <TimePrimitive>...</TimePrimitive>
  <styleUrl>...</styleUrl>              <!-- anyURI -->
  <StyleSelector>...</StyleSelector>
  <Region>...</Region>
  <Metadata>...</Metadata>
  <atom:author>...<atom:author>   <!-- xmlns:atom="http://www.w3.org/2005/Atom" -->
  <atom:link href=" "/>

  <!-- specific to Container --> 
  <!-- 0 or more Features -->
<!-- /Container -->
```

### Description

This is an abstract element and cannot be used directly in a KML file. A Container element holds one or more Features and allows the creation of nested hierarchies.

### Extends

- [\<*Feature*\>](https://developers.google.com/kml/documentation/kmlreference#feature)

### Extended By

- [\<Document\>](https://developers.google.com/kml/documentation/kmlreference#document)
- [\<Folder\>](https://developers.google.com/kml/documentation/kmlreference#folder)

[Back to top](https://developers.google.com/kml/documentation/kmlreference#top)

## \<Document\>

### Syntax

```
<Document id="ID">
  <!-- inherited from Feature element -->
  <name>...</name>                      <!-- string -->
  <visibility>1</visibility>            <!-- boolean -->
  <open>0</open>                        <!-- boolean -->
  <atom:author>...<atom:author>         <!-- xmlns:atom -->
  <atom:link href=" "/>                 <!-- xmlns:atom -->
  <address>...</address>                <!-- string -->
  <xal:AddressDetails>...</xal:AddressDetails>  <!-- xmlns:xal -->
  <phoneNumber>...</phoneNumber>        <!-- string -->
  <Snippet maxLines="2">...</Snippet>   <!-- string -->
  <description>...</description>        <!-- string -->
  <AbstractView>...</AbstractView>      <!-- Camera or LookAt -->
  <TimePrimitive>...</TimePrimitive>
  <styleUrl>...</styleUrl>              <!-- anyURI -->
  <StyleSelector>...</StyleSelector>
  <Region>...</Region>
  <Metadata>...</Metadata>              <!-- deprecated in KML 2.2 -->
  <ExtendedData>...</ExtendedData>      <!-- new in KML 2.2 -->

  <!-- specific to Document -->
  <!-- 0 or more Schema elements -->
  <!-- 0 or more Feature elements -->
</Document>
```

### Description

A Document is a container for features and styles. This element is required if your KML file uses *shared styles*. It is recommended that you use shared styles, which require the following steps:

- Define all Styles in a Document. Assign a unique **ID** to each Style.
- Within a given Feature or StyleMap, reference the Style's ID using a \<styleUrl\> element.

Note that shared styles are not inherited by the Features in the Document.

Each Feature must explicitly reference the styles it uses in a \<styleUrl\> element. For a Style that applies to a Document (such as ListStyle), the Document itself must explicitly reference the \<styleUrl\>. For example:

```
<Document>
  <Style id="myPrettyDocument">
   <ListStyle> ... </ListStyle>

  </Style>
  <styleUrl#myPrettyDocument">
  ...
</Document> 
```

Do not put shared styles within a Folder.

The following example illustrates use of a shared style.

### Example

```
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
  <name>Document.kml</name>
  <open>1</open>
  <Style id="exampleStyleDocument">
    <LabelStyle>
      <color>ff0000cc</color>
    </LabelStyle>
  </Style>
  <Placemark>
    <name>Document Feature 1</name>
    <styleUrl>#exampleStyleDocument</styleUrl>
    <Point>
      <coordinates>-122.371,37.816,0</coordinates>
    </Point>
  </Placemark>
  <Placemark>
    <name>Document Feature 2</name>
    <styleUrl>#exampleStyleDocument</styleUrl>
    <Point>
      <coordinates>-122.370,37.817,0</coordinates>
    </Point>
  </Placemark>
</Document>
</kml>
```

### Extends

- [\<*Container*\>](https://developers.google.com/kml/documentation/kmlreference#container)

### Contains

- 0 or more elements derived from [\<*Feature*\>](https://developers.google.com/kml/documentation/kmlreference#feature)
- 0 or more elements derived from [\<*StyleSelector*\>](https://developers.google.com/kml/documentation/kmlreference#styleselector)
- 0 or more elements derived from [\<Schema\>](https://developers.google.com/kml/documentation/kmlreference#schema)

[Back to top](https://developers.google.com/kml/documentation/kmlreference#top)

## \<gx:duration\>

|---|
| This element is an extension of the [OGC KML 2.2 standard](http://www.opengeospatial.org/standards/kml/) and is supported in Google Earth 5.0 and later. [Learn more](https://developers.google.com/kml/documentation/kmlreference#kmlextensions) |

### Syntax

```
<gx:duration>0.0</gx:duration>            <!-- double -->
```

### Description

`<gx:duration>` extends `gx:TourPrimitive` by specifying a time-span for events. The time is written as seconds using XML's [double](https://developers.google.com/kml/documentation/kmlreference#tbd) datatype.

#### Duration and \<gx:FlyTo\>

When a duration is included within a `<gx:FlyTo>` element, it specifies the length of time that the browser takes to fly from the previous point to the specified point.

```
<gx:FlyTo>
  <gx:flyToMode>bounce</gx:flyToMode>
  <gx:duration>10.2</gx:duration>

  <!-- AbstractView -->
    ...
  <!-- /AbstractView -->
</gx:FlyTo>
```

#### Duration and \<gx:AnimatedUpdate\>

Specifies the length of time over which the update takes place. Integer, float, and color fields are smoothly animated from original to new value across the duration; boolean, string, and other values that don't lend to interpolation are updated at the end of the duration.

```
<gx:AnimatedUpdate>
  <gx:duration>5.0</gx:duration>
  <Update>

    ....

  </Update>
</gx:AnimatedUpdate>
```

## \<ExtendedData\>

### Syntax

```
<ExtendedData>                       
  <Data name="string">
    <displayName>...</displayName>    <!-- string -->
    <value>...</value>                <!-- string -->
  </Data>
  <SchemaData schemaUrl="anyURI">
    <SimpleData name=""> ... </SimpleData>   <!-- string -->
  </SchemaData>
  <namespace_prefix:other>...</namespace_prefix:other>
</ExtendedData>
```

### Description

The ExtendedData element offers three techniques for adding custom data to a KML Feature (NetworkLink, Placemark, GroundOverlay, PhotoOverlay, ScreenOverlay, Document, Folder). These techniques are

- Adding untyped data/value pairs using the \<Data\> element (basic)
- Declaring new typed fields using the \<Schema\> element and then instancing them using the \<SchemaData\> element (advanced)
- Referring to XML elements defined in other namespaces by referencing the external namespace within the KML file (basic)

These techniques can be combined within a single KML file or Feature for different pieces of data.

For more information, see [Adding Custom Data](https://developers.google.com/kml/documentation/extendeddata) in "Topics in KML."

### Elements Specific to ExtendedData

\<Data name ="*string* "\>
:   Creates an untyped *name/value* pair. The name can have two versions: *name* and *displayName* . The *name* attribute is used to identify the data pair within the KML file. The *displayName* element is used when a properly formatted name, with spaces and HTML formatting, is displayed in Google Earth. In the \<text\> element of \<BalloonStyle\>, the notation**$\[name/displayName\]** is replaced with \<displayName\>. If you substitute the value of the *name* attribute of the \<Data\> element in this format (for example, $\[holeYardage\], the attribute value is replaced with \<value\>. By default, the Placemark's balloon displays the name/value pairs associated with it.
:

    \<displayName\>
    :   An optional formatted version of *name*, to be used for display purposes.

    \<value\>
    :   Value of the data pair.
    :

        ```
        <Placemark>
          <name>Club house</name>
          <ExtendedData>
            <Data name="holeNumber">
              <value>1</value>
            </Data>
            <Data name="holeYardage">
              <value>234</value>
            </Data>
            <Data name="holePar">
              <value>4</value>
            </Data>
          </ExtendedData>
        </Placemark>
        ```


\<SchemaData schemaUrl="*anyURI* "\>
:   This element is used in conjunction with \<Schema\> to add typed custom data to a KML Feature. The Schema element (identified by the *schemaUrl* attribute) declares the custom data type. The actual data objects ("instances" of the custom data) are defined using the SchemaData element.
:   The \<schemaURL\> can be a full URL, a reference to a Schema ID defined in an external KML file, or a reference to a Schema ID defined in the same KML file. All of the following specifications are acceptable:
:   The Schema element is always a child of Document. The ExtendedData element is a child of the Feature that contains the custom data.
:

    \<SimpleData name="*string* "\>
    :   This element assigns a value to the custom data field identified by the *name* attribute. The type and name of this custom data field are declared in the \<Schema\> element.
    :   Here is an example of defining two custom data elements:

\<*namespace_prefix:other\>*
:   This element allows you to add untyped custom data. Be sure to reference the namespace prefix in the \<kml\> element of your file or as an attribute of the \<ExtendedData\> element and to prefix the name of each data element with the namespace prefix. Custom data added in this manner is preserved in the KML file but is not used by Google Earth in any way. It is always saved along with the file.
:   The following example shows using the "camp" namespace prefix:

### Contained By

- Any element derived from [\<*Feature*\>](https://developers.google.com/kml/documentation/kmlreference#feature)

### See Also

- [Schema](https://developers.google.com/kml/documentation/kmlreference#schema)

## \<*Feature*\>

### Syntax

```
<!-- abstract element; do not create -->
<!--Feature id="ID" -->                <!-- Document,Folder,
                                             NetworkLink,Placemark,
                                             GroundOverlay,PhotoOverlay,ScreenOverlay -->
  <name>...</name>                      <!-- string -->
  <visibility>1</visibility>            <!-- boolean -->
  <open>0</open>                        <!-- boolean -->
  <atom:author>...<atom:author>         <!-- xmlns:atom -->
  <atom:link href=" "/>            <!-- xmlns:atom -->
  <address>...</address>                <!-- string -->
  <xal:AddressDetails>...</xal:AddressDetails>  <!-- xmlns:xal -->
  <phoneNumber>...</phoneNumber>        <!-- string -->
  <Snippet maxLines="2">...</Snippet>   <!-- string -->
  <description>...</description>        <!-- string -->
  \<AbstractView\>...\</AbstractView\>      <!-- Camera or LookAt -->
  <TimePrimitive>...</TimePrimitive>    <!-- TimeStamp or TimeSpan -->
  <styleUrl>...</styleUrl>              <!-- anyURI -->
  <StyleSelector>...</StyleSelector>
  <Region>...</Region>
  <Metadata>...</Metadata>              <!-- deprecated in KML 2.2 -->
  <ExtendedData>...</ExtendedData>      <!-- new in KML 2.2 -->
<-- /Feature -->
```

### Description

This is an abstract element and cannot be used directly in a KML file. The following diagram shows how some of a Feature's elements appear in Google Earth.
![](https://developers.google.com/static/kml/documentation/images/ScreenLabels.gif)

### Elements Specific to Feature

\<name\>
:   User-defined text displayed in the 3D viewer as the label for the object (for example, for a Placemark, Folder, or NetworkLink).

\<visibility\>
:   Boolean value. Specifies whether the feature is drawn in the 3D viewer when it is initially loaded. In order for a feature to be visible, the \<visibility\> tag of all its ancestors must also be set to 1. In the Google Earth List View, each Feature has a checkbox that allows the user to control visibility of the Feature.

\<open\>
:   Boolean value. Specifies whether a Document or Folder appears closed or open when first loaded into the Places panel. 0=collapsed (the default), 1=expanded. See also [\<ListStyle\>](https://developers.google.com/kml/documentation/kmlreference#liststyle). This element applies only to Document, Folder, and NetworkLink.

**\<atom:author\>**

:   KML 2.2 supports new elements for including data about the author and related website in your KML file. This information is displayed in geo search results, both in Earth browsers such as Google Earth, and in other applications such as Google Maps. The ascription elements used in KML are as follows:

    - **atom:author** element - parent element for atom:name
    - **atom:name** element - the name of the author
    - **atom:link** element - contains the *href* attribute
    - **href** attribute - URL of the web page containing the KML/KMZ file

    These elements are defined in the Atom Syndication Format. The complete specification is found at [http://atompub.org.](http://www.w3.org/2005/Atom) (see the [sample](https://developers.google.com/kml/documentation/kmlreference#sampleattribution)that follows).  

    The \<atom:author\> element is the parent element for \<atom:name\>, which specifies the author of the KML feature.

**\<atom:link** href="..."**\>**
:   Specifies the URL of the website containing this KML or KMZ file. Be sure to include the namespace for this element in any KML file that uses it: `xmlns:atom="http://www.w3.org/2005/Atom"` (see the [sample](https://developers.google.com/kml/documentation/kmlreference#sampleattribution)that follows).

\<address\>
:   A string value representing an unstructured address written as a standard street, city, state address, and/or as a postal code. You can use the \<address\> tag to specify the location of a point instead of using latitude and longitude coordinates. (However, if a \<Point\> is provided, it takes precedence over the \<address\>.) To find out which locales are supported for this tag in Google Earth, go to the [Google Maps Help](http://maps.google.com/support/bin/answer.py?answer=16634).

\<xal:AddressDetails\>
:   A structured address, formatted as xAL, or [eXtensible Address Language](http://www.oasis-open.org/committees/ciq/ciq.html#6), an international standard for address formatting. \<xal:AddressDetails\> is used by KML for geocoding in Google Maps only. For details, see the [Google Maps API documentation](http://www.google.com/apis/maps/documentation/#Geocoding_Etc). Currently, Google Earth does not use this element; use \<address\> instead. Be sure to include the namespace for this element in any KML file that uses it: `xmlns:xal="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0"`  

\<phoneNumber\>
:   A string value representing a telephone number. This element is used by Google Maps Mobile only. The industry standard for Java-enabled cellular phones is RFC2806.   

    For more information, see
    [http://www.ietf.org/rfc /rfc2806.txt](http://www.google.com/url?sa=D&q=http://www.ietf.org/rfc/rfc2806.txt).

\<Snippet maxLines="2" \>
:   A short description of the feature. In Google Earth, this description is displayed in the Places panel under the name of the feature. If a Snippet is not supplied, the first two lines of the \<description\> are used. In Google Earth, if a Placemark contains both a description and a Snippet, the \<Snippet\> appears beneath the Placemark in the Places panel, and the \<description\> appears in the Placemark's description balloon. This tag does not support HTML markup. \<Snippet\> has a **maxLines** attribute, an integer that specifies the maximum number of lines to display.

\<description\>

:   User-supplied content that appears in the description balloon.

    The supported content for the \<description\> element changed from Google Earth 4.3 to 5.0. Specific information for each version is listed out below, followed by information common to both.

    **Google Earth 5.0**

    Google Earth 5.0 (and later) supports plain text content, as well as full HTML and JavaScript, within description balloons. Contents of the description tag are rendered by the [WebKit](http://webkit.org/) open source web browser engine, and are displayed as they would be in any WebKit-based browser.

    **General restrictions**

    Links to local files are generally not allowed. This prevents malicious code from damaging your system or accessing your data. Should you wish to allow access to your local filesystem, select **Preferences** \> **Allow access to local files and personal data**. Links to image files on the local filesystem are always allowed, if contained within an \<img\> tag.

    Content that has been compressed into a KMZ file can be accessed, even if on the local filesystem.

    Cookies are enabled, but for the purposes of the same-origin policy, local content does not share a domain with any other content (including other local content).

:   **HTML**

    HTML is mostly rendered as it would be in any WebKit browser.

    Targets are ignored when included in HTML written directly into the KML; all such links are opened as if the target is set to _blank. Any specified targets are ignored.

    HTML that is contained in an iFrame, however, or dynamically generated with JavaScript or DHTML, will use target="_self" as the default. Other targets can be specified and are supported.

    The contents of KMZ files, local anchor links, and `;flyto` methods cannot be targeted from HTML contained within an iFrame.

    If the user specifies `width="100%"` for the width of an iFrame, then the iFrame's width will be dependent on all the other content in the balloon---it should essentially be ignored while calculating layout size. This rule applies to any other block element inside the balloon as well.

    **JavaScript**

    Most JavaScript is supported. Dialog boxes can not be created - functions such as alert() and prompt() will not be displayed. They will, however, be written to the system console, as will other errors and exceptions.

    **CSS**

    CSS is allowed. As with CSS in a regular web browser, CSS can be used to style text, page elements, and to control the size and appearance of the description balloon.

    **Google Earth 4.3**

    The \<description\> element supports plain text as well as a subset of HTML formatting elements, including tables (see [KML example](https://developers.google.com/kml/documentation/kmlreference#descriptionexample) below). It does not support other web-based technology, such as dynamic page markup (PHP, JSP, ASP), scripting languages (VBScript, Javascript), nor application languages (Java, Python). In Google Earth release 4.2, video is supported. (See [Example](https://developers.google.com/kml/documentation/kmlreference#samplevideo) below.)

    **Common information**

    If your description contains no HTML markup, Google Earth attempts to format it, replacing newlines with \<br\> and wrapping URLs with anchor tags. A valid URL string for the World Wide Web is automatically converted to a hyperlink to that URL (e.g., *http://www.google.com* ). Consequently, you do not need to surround a URL with the \<a href="http://.."\>\</a\> tags in order to achieve a simple link.

    When using HTML to create a hyperlink around a specific word, or when including images in the HTML, you must use HTML entity references or the CDATA element to escape angle brackets, apostrophes, and other special characters. The CDATA element tells the XML parser to ignore special characters used within the brackets. This element takes the form of:

    ```
    <![CDATA[
      special characters here
    ]]> 
    ```

    If you prefer not to use the CDATA element, you can use entity references to replace all the special characters.

    ```
    <description>
      <![CDATA[
    This is an image
    <img src="icon.jpg">
      ]]>
    </description>
    ```

    *Other Behavior Specified Through Use of the \<a\> Element*

    KML supports the use of two attributes within the \<a\> element: **href** and **type**.

    The anchor element \<a\> contains an *href* attribute that specifies a URL.

    If the *href* is a KML file and has a *.kml* or *.kmz* file extension, Google Earth loads that file directly when the user clicks it. If the URL ends with an extension not known to Google Earth (for example, *.html*), the URL is sent to the browser.

:   The *href* can be a fragment URL (that is, a URL with a # sign followed by a KML identifier). When the user clicks a link that includes a fragment URL, by default the browser flies to the Feature whose ID matches the fragment. If the Feature has a LookAt or Camera element, the Feature is viewed from the specified viewpoint.

    The behavior can be further specified by appending one of the following three strings to the fragment URL:

    - *;flyto* (default) - fly to the Feature
    - *;balloon* - open the Feature's balloon but do not fly to the Feature
    - *;balloonFlyto* - open the Feature's balloon and fly to the Feature

    For example, the following code indicates to open the file *CraftsFairs.kml*, fly to the Placemark whose ID is "Albuquerque," and open its balloon:

    ```
    <description>
      <![CDATA[ 
        <a href="http://myServer.com/CraftsFairs.kml#Albuquerque;balloonFlyto">
          One of the Best Art Shows in the West</a>
      ]]>
    </description> 
    ```

    The *type* attribute is used within the \<a\> element when the *href* does not end in *.kml* or *.kmz*, but the reference needs to be interpreted in the context of KML. Specify the following:

    ```
    type="application/vnd.google-earth.kml+xml" 
    ```

    For example, the following URL uses the `type` attribute to notify Google Earth that it should attempt to load the file, even though the file extension is *.php*:

    ```
    <a href="myserver.com/cgi-bin/generate-kml.php#placemark123"
       type="application/vnd.google-earth.kml+xml">
    ```
:

***\<AbstractView\>***
:   Defines a viewpoint associated with any element derived from Feature. See [\<Camera\>](https://developers.google.com/kml/documentation/kmlreference#camera) and [\<LookAt\>](https://developers.google.com/kml/documentation/kmlreference#lookat).

***\<TimePrimitive\>***
:   Associates this Feature with a period of time ([\<TimeSpan\>](https://developers.google.com/kml/documentation/kmlreference#timespan)) or a point in time ([\<TimeStamp\>](https://developers.google.com/kml/documentation/kmlreference#timestamp)).

\<styleUrl\>
:   URL of a [\<Style\>](https://developers.google.com/kml/documentation/kmlreference#style) or [\<StyleMap\>](https://developers.google.com/kml/documentation/kmlreference#stylemap) defined in a Document. If the style is in the same file, use a **#** reference. If the style is defined in an external file, use a full URL along with # referencing. Examples are

    ```
    <styleUrl>#myIconStyleID</styleUrl>
    ```

    ```
    <styleUrl>http://someserver.com/somestylefile.xml#restaurant</styleUrl>
    ```

    ```
    <styleUrl>eateries.kml#my-lunch-spot</styleUrl>
    ```

\<*StyleSelector*\>
:   One or more Styles and StyleMaps can be defined to customize the appearance of any element derived from Feature or of the Geometry in a Placemark. (See [\<BalloonStyle\>](https://developers.google.com/kml/documentation/kmlreference#balloonstyle), [\<ListStyle\>](https://developers.google.com/kml/documentation/kmlreference#liststyle), [\<StyleSelector\>](https://developers.google.com/kml/documentation/kmlreference#styleselector), [](https://developers.google.com/kml/documentation/kmlreference#balloonstyle)and the styles derived from [\<ColorStyle\>](https://developers.google.com/kml/documentation/kmlreference#colorstyle).) A style defined within a Feature is called an "inline style" and applies only to the Feature that contains it. A style defined as the child of a \<Document\> is called a "shared style." A shared style must have an *id* defined for it. This id is referenced by one or more Features within the \<Document\>. In cases where a style element is defined both in a shared style and in an inline style for a Feature---that is, a Folder, GroundOverlay, NetworkLink, Placemark, or ScreenOverlay---the value for the Feature's inline style takes precedence over the value for the shared style.

\<Region\>
:   Features and geometry associated with a Region are drawn only when the Region is active. See [\<Region\>](https://developers.google.com/kml/documentation/kmlreference#region).

\<Metadata\>
**[\<ExtendedData\>](https://developers.google.com/kml/documentation/kmlreference#extendeddata)**
:   Allows you to add custom data to a KML file. This data can be (1) data that references an external XML schema, (2) untyped data/value pairs, or (3) typed data. A given KML Feature can contain a combination of these types of custom data.

### Sample Use of HTML Elements within a Description

This example illustrates the complete set of HTML elements supported by the \<description\> element **in Google Earth 4.3**. Google Earth 5.0 and later supports full HTML and JavaScript.

```
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Placemark>
  <name>Feature.kml</name>
  <Snippet maxLines="4">
    The snippet is a way of
    providing an alternative
    description that will be
    shown in the List view.
  </Snippet> 
  <description>
    <![CDATA[
      Styles: <i>Italics</i>, <b>Bold</b>, <u>Underlined</u>, 
      <s>Strike Out</s>, subscript<sub>subscript</sub>,
      superscript<sup>superscript</sup>,  
      <big>Big</big>, <small>Small</small>, <tt>Typewriter</tt>,
      <em>Emphasized</em>, <strong>Strong</strong>, <code>Code</code>
      <hr />
      Fonts: 
      <font color="red">red by name</font>, 
      <font color="#408010">leaf green by hexadecimal RGB</font>, 
      <font size=1>size 1</font>, <font size=2>size 2</font>,
      <font size=3>size 3</font>, <font size=4>size 4</font>,
      <font size=5>size 5</font>, <font size=6>size 6</font>, 
      <font size=7>size 7</font>,
      <font face=times>Times</font>, 
      <font face=verdana>Verdana</font>, 
      <font face=arial>Arial</font>
      <br/>
      <hr />
      Links:
      <a href="http://doc.trolltech.com/3.3/qstylesheet.html">
      QT Rich Text Rendering
      </a>
      <br />
      <hr />
      Alignment:
      <br />
      <p align=left>left</p><p align=center>center</p>
      <p align=right>right</p>
      <hr />
      Ordered Lists:
      <br />
      <ol><li>First</li><li>Second</li><li>Third</li></ol>
      <ol type="a"><li>First</li><li>Second</li><li>Third</li></ol>
      <ol type="A"><li>First</li><li>Second</li><li>Third</li></ol>
      <hr />
      Unordered Lists:
      <br />
      <ul><li>A</li><li>B</li><li>C</li></ul>
      <ul type="circle"><li>A</li><li>B</li><li>C</li></ul>
      <ul type="square"><li>A</li><li>B</li><li>C</li></ul>
      <hr />
      Definitions:
      <br />
      <dl>
      <dt>Scrumpy</dt>
      <dd>Hard English cider from the west country</dd>
      <dt>Pentanque</dt>
      <dd>A form of boules where the goal is to throw metal ball as
      close as possible to a jack</dd>
      </dl>
      <hr />
      Block Quote:
      <br />
      <blockquote>
      We shall not cease from exploration<br />
      And the end of all our exploring<br />
      Will be to arrive where we started<br />
      And know the place for the first time
      </blockquote>
      <br />
      <hr />
      Centered:
      <br />
      <center>See, I have a Rhyme assisting<br />
      my feeble brain,<br />
      its tasks oft-times resisting!</center>
      <hr />
      Headings:
      <br />
      <h1>Header 1</h1>
      <h2>Header 2</h2>
      <h3>Header 3</h3>
      <h3>Header 4</h4>
      <h3>Header 5</h5>
      <hr />
      Images:
      <br />
      <img src="icon.jpg"> 
and we have a link http://www.google.com.]]>
  </description>
  <Point>
    <coordinates>-122.378927,37.826793,0</coordinates>
  </Point>
</Placemark>
</kml>
```

### Sample Use of Ascription Elements

This example shows use of the \<atom:author\>, \<atom:name\> and \<atom:link\> elements from the Atom namespace. Note that you need to reference this namespace within the \<kml\> element.

```
<kml xmlns="http://www.opengis.net/kml/2.2"
     xmlns:atom="http://www.w3.org/2005/Atom"> 
  <Document>
    <atom:author>
      <atom:name>J. K. Rowling</atom:name>
    </atom:author>
    <atom:link href="http://www.harrypotter.com" />
    <Placemark>
      <name>Hogwarts</name>
      <Point>
        <coordinates>1,1</coordinates>
      </Point>
    </Placemark>
    <Placemark>
      <name>Little Hangleton</name>
      <Point>
        <coordinates>1,2</coordinates>
      </Point>
    </Placemark>
  </Document>
</kml>
```

### Sample Video

This example shows how to embed a Flash video inside the Balloon.

```
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
  <Document>
    <name>Video Example</name>
    <Style id="sn_blue-dot_copy3">
      <IconStyle>
        <Icon>
          <href>http://www.google.com/intl/en_us/mapfiles/ms/icons/blue-dot.png</href>
        </Icon>
      </IconStyle>
    </Style>
    <Placemark>
      <name>Placemark</name>
      <description>
        <![CDATA[<div style="font-size:larger">
          <div>
            <div style="width: 212px; font-size: 12px;">
              <b>The Spaghetti Film</b>
            </div>
            <div style="font-size: 11px;">
              <a target="_blank" href="http://www.youtube.com/?v=FICUvrVlyXc">
                http://www.youtube.com/?v=FICUvrVlyXc</a><br>
            </div><br>
            <div style="margin-left: auto; margin-right:auto;">
              <object height="175" width="212">
                <param value="http://www.youtube.com/v/FICUvrVlyXc" name="movie">
                <param value="transparent" name="wmode">
                <embed wmode="transparent" type="application/x-shockwave-flash"
                   src="http://www.youtube.com/v/FICUvrVlyXc" height="175"
                   width="212">
               </object>
             </div>
           </div>
          </div>
          <div style="font-size: smaller; margin-top: 1em;">Saved from 
            <a href="http://maps.google.com/ig/add?synd=mpl&pid=mpl&moduleurl=
                http:%2F%2Fwww.google.com%2Fig%2Fmodules%2Fmapplets-youtube.xml&hl=en&gl=us">
                YouTubeVideos</a>
          </div>
         ]]>
      </description>
      <styleUrl>#sn_blue-dot_copy3</styleUrl>
      <Point>
        <coordinates>-93.47875999999999,45.083248,0</coordinates>
      </Point>
    </Placemark>
</Document>
</kml>
```

### Extends

- [\<*Object*\>](https://developers.google.com/kml/documentation/kmlreference#object)

### Extended By

- [\<*Container\>*](https://developers.google.com/kml/documentation/kmlreference#container)
- [\<Overlay\>](https://developers.google.com/kml/documentation/kmlreference#overlay)
- [\<Placemark\>](https://developers.google.com/kml/documentation/kmlreference#placemark)
- \<NetworkLink\>
- \<gx:Tour\>

## \<gx:FlyTo\>

|---|
| This element is an extension of the [OGC KML 2.2 standard](http://www.opengeospatial.org/standards/kml/) and is supported in Google Earth 5.0 and later. [Learn more](https://developers.google.com/kml/documentation/kmlreference#kmlextensions) |

### Syntax

```
<gx:FlyTo id="ID">
  <gx:duration>0.0</gx:duration>         <!-- double -->
  <gx:flyToMode>bounce</gx:flyToMode>    <!-- smooth or bounce -->
  <!-- AbstractView -->                        <!-- Camera or LookAt -->
    ...
  <!-- /AbstractView -->
</gx:FlyTo>
```

### Description

`<gx:FlyTo>` specifies a point in space to which the browser will fly during a tour. It must contain one [AbstractView](https://developers.google.com/kml/documentation/kmlreference#abstractview), and should contain `<gx:duration>` and `<gx:flyToMode>` elements, which specify the time it takes to fly to the defined point from the current point, and the method of flight, respectively.

### \<gx:flyToMode\>

There are two allowed values for `<gx:flyToMode>`: **smooth** , and **bounce**.

- **Smooth** FlyTos allow for an unbroken flight from point to point to point (and on). An unbroken series of smooth FlyTos will begin and end at zero velocity, and will not slow at each point. A series of smooth FlyTos is broken by any of the following elements:
  - `<gx:flyToMode>bounce</gx:flyToMode>`
  - `<gx:Wait>`

  This means that velocity will be zero at the smooth FlyTo immediately preceding either of the above elements. A series of smooth FlyTos is not broken by [\<gx:AnimatedUpdate\>](https://developers.google.com/kml/documentation/gxanimatedupdate) elements.

- **Bounce** FlyTos each begin and end at zero velocity.

### **Example**

```
<gx:FlyTo>
  <gx:duration>2.55</gx:duration>
  <gx:flyToMode>smooth</gx:flyToMode>
  <Camera>
    <longitude>-113.084448</longitude>
    <latitude>36.567081</latitude>
    <altitude>41277.571403</altitude>
    <heading>116.150227</heading>
    <altitudeMode>absolute</altitudeMode>
  </Camera>
</gx:FlyTo>
```

### Extends

- [\<gx:TourPrimitive\>](https://developers.google.com/kml/documentation/kmlreference#gxtourprimitive)

### Contains

- [\<gx:duration\>](https://developers.google.com/kml/documentation/kmlreference#gxduration)
- [\<gx:flyToMode\>](https://developers.google.com/kml/documentation/kmlreference#gxflytomode)
- [\<AbstractView\>](https://developers.google.com/kml/documentation/kmlreference#abstractview)


## \<Folder\>

### Syntax

```
<Folder id="ID">
  <!-- inherited from Feature element -->
  <name>...</name>                      <!-- string -->
  <visibility>1</visibility>            <!-- boolean -->
  <open>0</open>                        <!-- boolean -->
  <atom:author>...<atom:author>         <!-- xmlns:atom -->
  <atom:link href=" "/>            <!-- xmlns:atom -->
  <address>...</address>                <!-- string -->
  <xal:AddressDetails>...</xal:AddressDetails>  <!-- xmlns:xal -->
  <phoneNumber>...</phoneNumber>        <!-- string -->
  <Snippet maxLines="2">...</Snippet>   <!-- string -->
  <description>...</description>        <!-- string -->
  \<AbstractView\>...\</AbstractView\>      <!-- Camera or LookAt -->
  <TimePrimitive>...</TimePrimitive>
  <styleUrl>...</styleUrl>              <!-- anyURI -->
  <StyleSelector>...</StyleSelector>
  <Region>...</Region>
  <Metadata>...</Metadata>              <!-- deprecated in KML 2.2 -->
  <ExtendedData>...</ExtendedData>

  <!-- specific to Folder -->
  <!-- 0 or more Feature elements -->
</Folder>
```

### Description

A Folder is used to arrange other Features hierarchically (Folders, Placemarks, NetworkLinks, or Overlays). A Feature is visible only if it and all its ancestors are visible.

### Example

```
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Folder>
  <name>Folder.kml</name>
  <open>1</open>
  <description>
    A folder is a container that can hold multiple other objects
  </description>
  <Placemark>
    <name>Folder object 1 (Placemark)</name>
    <Point>
      <coordinates>-122.377588,37.830266,0</coordinates>
    </Point>
  </Placemark>
  <Placemark>
    <name>Folder object 2 (Polygon)</name>
    <Polygon>
      <outerBoundaryIs>
        <LinearRing>
          <coordinates>
            -122.377830,37.830445,0
            -122.377576,37.830631,0
            -122.377840,37.830642,0
            -122.377830,37.830445,0
          </coordinates>
        </LinearRing>
      </outerBoundaryIs>
    </Polygon>
  </Placemark>
  <Placemark>
    <name>Folder object 3 (Path)</name>
    <LineString>
      <tessellate>1</tessellate>
      <coordinates>
        -122.378009,37.830128,0 -122.377885,37.830379,0
      </coordinates>
    </LineString>
  </Placemark>
</Folder>
</kml>
```

### Extends

- [\<*Container*\>](https://developers.google.com/kml/documentation/kmlreference#container)

### Contains

- Any element derived from [\<*Feature*\>](https://developers.google.com/kml/documentation/kmlreference#feature)

## \<*Geometry*\>

### Syntax

```
<!-- abstract element; do not create -->
<!-- Geometry id="ID" -->
                                              <!-- Point,LineString,LinearRing,
                                               Polygon,MultiGeometry,Model,
                                               gx:Track -->
<!-- /Geometry -->
```

### Description

This is an abstract element and cannot be used directly in a KML file. It provides a placeholder object for all derived Geometry objects.

### Extends

- [\<*Object*\>](https://developers.google.com/kml/documentation/kmlreference#object)

### Extended By

- [\<Point\>](https://developers.google.com/kml/documentation/kmlreference#point)
- [\<LineString\>](https://developers.google.com/kml/documentation/kmlreference#linestring)
- [\<LinearRing\>](https://developers.google.com/kml/documentation/kmlreference#linearring)
- \<[Polygon](https://developers.google.com/kml/documentation/kmlreference#polygon)\>
- \<[MultiGeometry](https://developers.google.com/kml/documentation/kmlreference#multigeometry)\>
- \<[gx:MultiTrack](https://developers.google.com/kml/documentation/kmlreference#gxmultitrack)\>
- [\<Model\>](https://developers.google.com/kml/documentation/kmlreference#model)
- [\<gx:Track\>](https://developers.google.com/kml/documentation/kmlreference#gxtrack)

## \<GroundOverlay\>

### Syntax

```
<GroundOverlay id="ID">
  <!-- inherited from Feature element -->
  <name>...</name>                      <!-- string -->
  <visibility>1</visibility>            <!-- boolean -->
  <open>0</open>                        <!-- boolean -->
  <atom:author>...<atom:author>         <!-- xmlns:atom -->
  <atom:link href=" "/>                <!-- xmlns:atom -->
  <address>...</address>                <!-- string -->
  <xal:AddressDetails>...</xal:AddressDetails>  <!-- xmlns:xal -->
  <phoneNumber>...</phoneNumber>        <!-- string -->
  <Snippet maxLines="2">...</Snippet>   <!-- string -->
  <description>...</description>        <!-- string -->
  \<AbstractView\>...\</AbstractView\>      <!-- Camera or LookAt -->
  <TimePrimitive>...</TimePrimitive>
  <styleUrl>...</styleUrl>              <!-- anyURI -->
  <StyleSelector>...</StyleSelector>
  <Region>...</Region>
  <Metadata>...</Metadata>              <!-- deprecated in KML 2.2 -->
  <ExtendedData>...</ExtendedData>      <!-- new in KML 2.2 -->

  <!-- inherited from Overlay element -->
  <color>ffffffff</color>                   <!-- kml:color -->
  <drawOrder>0</drawOrder>                  <!-- int -->
  <Icon>...</Icon>

  <!-- specific to GroundOverlay -->
  <altitude>0</altitude>                    <!-- double -->
  <altitudeMode>clampToGround</altitudeMode>
     <!-- kml:altitudeModeEnum: clampToGround or absolute -->
     <!-- or, substitute gx:altitudeMode: clampToSeaFloor or relativeToSeaFloor -->
  <LatLonBox>
    <north>...</north>                      <! kml:angle90 -->
    <south>...</south>                      <! kml:angle90 -->
    <east>...</east>                        <! kml:angle180 -->
    <west>...</west>                        <! kml:angle180 -->
    <rotation>0</rotation>                  <! kml:angle180 -->
  </LatLonBox>
  <gx:LatLonQuad>
    <coordinates>...</coordinates>          <!-- four lon,lat tuples -->
  </gx:LatLonQuad>
</GroundOverlay>
```

### Description

This element draws an image overlay draped onto the terrain. The \<href\> child of \<Icon\> specifies the image to be used as the overlay. This file can be either on a local file system or on a web server. If this element is omitted or contains no \<href\>, a rectangle is drawn using the color and `LatLonBox` bounds defined by the ground overlay.

### Elements Specific to GroundOverlay

\<altitude\>
:   Specifies the distance above the earth's surface, in meters, and is interpreted according to the altitude mode.

\<altitudeMode\>
:   Specifies how the \<altitude\>is interpreted. Possible values are

    - **clampToGround** - (default) Indicates to ignore the altitude specification and drape the overlay over the terrain.
    - **absolute** - Sets the altitude of the overlay relative to sea level, regardless of the actual elevation of the terrain beneath the element. For example, if you set the altitude of an overlay to 10 meters with an absolute altitude mode, the overlay will appear to be at ground level if the terrain beneath is also 10 meters above sea level. If the terrain is 3 meters above sea level, the overlay will appear elevated above the terrain by 7 meters.

\<gx:altitudeMode\>

:   A KML extension in the [Google extension namespace](https://developers.google.com/kml/documentation/kmlreference#kmlextensions), allowing altitudes relative to the sea floor. Values are:

    - **relativeToSeaFloor** - Interprets the \<altitude\> as a value in meters above the sea floor. If the point is above land rather than sea, the \<altitude\> will be interpreted as being above the ground.
    - **clampToSeaFloor** - The \<altitude\> specification is ignored, and the overlay will be draped over the sea floor. If the point is on land rather than at sea, the overlay will be positioned on the ground.

\<LatLonBox\>
:   Specifies where the top, bottom, right, and left sides of a bounding box for the ground overlay are aligned.

    - **\<north\>** Specifies the latitude of the north edge of the bounding box, in decimal degrees from 0 to ±90.
    - **\<south\>** Specifies the latitude of the south edge of the bounding box, in decimal degrees from 0 to ±90.
    - **\<east\>** Specifies the longitude of the east edge of the bounding box, in decimal degrees from 0 to ±180. (For overlays that overlap the meridian of 180° longitude, values can extend beyond that range.)
    - **\<west\>** Specifies the longitude of the west edge of the bounding box, in decimal degrees from 0 to ±180. (For overlays that overlap the meridian of 180° longitude, values can extend beyond that range.)
    - **\<rotation\>** Specifies a rotation of the overlay about its center, in degrees. Values can be ±180. The default is 0 (north). Rotations are specified in a counterclockwise direction.


    ```
    <LatLonBox>
       <north>48.25475939255556</north>
       <south>48.25207367852141</south>
       <east>-90.86591508839973</east>
       <west>-90.8714285289695</west>
       <rotation>39.37878630116985</rotation>
    </LatLonBox> 
    ```

[**\<gx:LatLonQuad\>**](https://developers.google.com/kml/documentation/kmlreference#gxlatlonquad)
:   Used for nonrectangular quadrilateral ground overlays.

### Example

```
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<GroundOverlay>
   <name>GroundOverlay.kml</name>
   <color>7fffffff</color>
   <drawOrder>1</drawOrder>
   <Icon>
      <href>http://www.google.com/intl/en/images/logo.gif</href>
      <refreshMode>onInterval</refreshMode>
      <refreshInterval>86400</refreshInterval>
      <viewBoundScale>0.75</viewBoundScale>
   </Icon>
   <LatLonBox>
      <north>37.83234</north>
      <south>37.832122</south>
      <east>-122.373033</east>
      <west>-122.373724</west>
      <rotation>45</rotation>
   </LatLonBox>
</GroundOverlay>
</kml>
```

### Extends

- [\<*Feature*\>](https://developers.google.com/kml/documentation/kmlreference#feature)
- [\<*Overlay*\>](https://developers.google.com/kml/documentation/kmlreference#overlay)

### Contained By

- [\<Document\>](https://developers.google.com/kml/documentation/kmlreference#document)
- [\<Folder\>](https://developers.google.com/kml/documentation/kmlreference#folder)

## \<Icon\>

### Syntax

```
<Icon id="ID">
  <!-- specific to Icon -->
  <href>...</href>                         <!-- anyURI -->
  <gx:x>0<gx:x/>                           <!-- int -->
  <gx:y>0<gx:y/>                           <!-- int -->
  <gx:w>-1<gx:w/>                          <!-- int -->
  <gx:h>-1<gx:h/>                          <!-- int -->
  <refreshMode>onChange</refreshMode>
    <!-- kml:refreshModeEnum: onChange, onInterval, or onExpire -->
  <refreshInterval>4</refreshInterval>     <!-- float -->
  <viewRefreshMode>never</viewRefreshMode>
    <!-- kml:viewRefreshModeEnum: never, onStop, onRequest, onRegion -->
  <viewRefreshTime>4</viewRefreshTime>     <!-- float -->
  <viewBoundScale>1</viewBoundScale>       <!-- float -->
  <viewFormat>...</viewFormat>             <!-- string -->
  <httpQuery>...</httpQuery>               <!-- string -->
</Icon>
```

### Description

Defines an image associated with an Icon style or overlay. The required [\<href\>](https://developers.google.com/kml/documentation/kmlreference#href) child element defines the location of the image to be used as the overlay or as the icon for the placemark. This location can either be on a local file system or a remote web server. The \<gx:x\>, \<gx:y\>, \<gx:w\>, and \<gx:h\> elements are used to select one icon from an image that contains multiple icons (often referred to as an *icon palette*.

```
<Icon>
  <href>Sunset.jpg</href>   <!-- Here, the image contains only one icon -->
</Icon>
```

```
<Icon>
  <href>/home/mydir/myiconpalette.jpg</href>
  <gx:w>138</gx:w>
  <gx:h>138</gx:h>
    <!-- Since x and y values are omitted, these measurements are made starting at
    the lower-left corner of the icon palette image -->
</Icon>
```

### Elements Specific to Icon

\<href\>
:   An HTTP address or a local file specification used to load an icon.

\<gx:x\>
\<gx:y\>
:   If the \<href\> specifies an icon palette, these elements identify the offsets, in pixels, from the lower-left corner of the icon palette.If no values are specified for x and y, the lower left corner of the icon palette is assumed to be the lower-left corner of the icon to use.

\<gx:w\>
\<gx:h\>
:   If the \<href\> specifies an icon palette, these elements specify the width (\<gx:w\>) and height (\<gx:h\>), in pixels, of the icon to use.

[**\<refreshMode\>**](https://developers.google.com/kml/documentation/kmlreference#refreshmode)
:   For a description of \<refreshMode\> and the other elements listed below, see [\<Link\>](https://developers.google.com/kml/documentation/kmlreference#Link).

[**\<refreshInterval\>**](https://developers.google.com/kml/documentation/kmlreference#refreshinterval)
[**\<viewRefreshMode\>**](https://developers.google.com/kml/documentation/kmlreference#viewrefreshmode)
[](https://developers.google.com/kml/documentation/kmlreference#refreshmode)[**\<viewRefreshTime\>**](https://developers.google.com/kml/documentation/kmlreference#viewrefreshtime)
[**\<viewBoundScale\>**](https://developers.google.com/kml/documentation/kmlreference#viewboundscale)
[**\<viewFormat\>**](https://developers.google.com/kml/documentation/kmlreference#viewformat)
[**\<httpQuery\>**](https://developers.google.com/kml/documentation/kmlreference#httpquery)
[](https://developers.google.com/kml/documentation/kmlreference#viewrefreshmode)
[](https://developers.google.com/kml/documentation/kmlreference#viewrefreshtime)

### Contained By

- [\<GroundOverlay\>](https://developers.google.com/kml/documentation/kmlreference#groundoverlay)
- [\<ScreenOverlay\>](https://developers.google.com/kml/documentation/kmlreference#screenoverlay)
- [\<IconStyle\>](https://developers.google.com/kml/documentation/kmlreference#iconstyle)

## \<IconStyle\>

### Syntax

```
<IconStyle id="ID">
  <!-- inherited from ColorStyle -->
  <color>ffffffff</color>            <!-- kml:color -->
  <colorMode>normal</colorMode>      <!-- kml:colorModeEnum:normal or random -->

  <!-- specific to IconStyle -->
  <scale>1</scale>                   <!-- float -->
  <heading>0</heading>               <!-- float -->
  <Icon>
    <href>...</href>
  </Icon>
  <hotSpot x="0.5"  y="0.5"
    xunits="fraction" yunits="fraction"/>    <!-- kml:vec2 -->
</IconStyle>
```

### Description

Specifies how icons for point Placemarks are drawn, both in the Places panel and in the 3D viewer of Google Earth. The \<Icon\> element specifies the icon image. The \<scale\> element specifies the *x, y* scaling of the icon. The color specified in the \<color\> element of \<IconStyle\> is blended with the color of the \<Icon\>.

### Elements Specific to IconStyle

\<scale\>
:   Resizes the icon.

\<heading\>
:   Direction (that is, North, South, East, West), in degrees. Default=0 (North). ([See diagram](https://developers.google.com/kml/documentation/kmlreference#headingdiagram).) Values range from 0 to 360 degrees.

\<Icon\>
:   A custom Icon. In \<IconStyle\>, the only child element of \<Icon\> is \<href\>:

    - **\<href\>**: An HTTP address or a local file specification used to load an icon.

\<hotSpot x="0.5" y="0.5" xunits="fraction" yunits="fraction"\>
:   Specifies the position within the Icon that is "anchored" to the \<Point\> specified in the Placemark. The *x* and *y* values can be specified in three different ways: as *pixels* (**"pixels"** ), as *fractions* of the icon (**"fraction"** *)* , or as *inset pixels* (**"insetPixels"** ), which is an offset in pixels from the upper right corner of the icon. The *x* and *y* positions can be specified in different ways---for example, *x* can be in pixels and *y* can be a fraction. The origin of the coordinate system is in the lower left corner of the icon.

    - **x** - Either the number of pixels, a fractional component of the icon, or a pixel inset indicating the *x* component of a point on the icon.
    - **y** - Either the number of pixels, a fractional component of the icon, or a pixel inset indicating the *y* component of a point on the icon.
    - **xunits** - Units in which the *x* value is specified. A value of **fraction** indicates the *x* value is a fraction of the icon. A value of **pixels** indicates the *x* value in pixels. A value of **insetPixels** indicates the indent from the right edge of the icon.
    - **yunits** - Units in which the *y* value is specified. A value of **fraction** indicates the *y* value is a fraction of the icon. A value of **pixels** indicates the *y* value in pixels. A value of **insetPixels** indicates the indent from the top edge of the icon.

\<coordinates\>*(required)*
:   Four or more tuples, each consisting of floating point values for *longitude* , *latitude* , and *altitude* . The *altitude* component is optional. Do not include spaces within a tuple. The last coordinate must be the same as the first coordinate. Coordinates are expressed in decimal degrees only.