`AltitudeMode` is the property that defines a map element's vertical placement.
It determines if an object is rendered relative to the terrain, relative to
above-ground features (like buildings), or at an absolute height above sea
level.

`AltitudeMode` is the property that determines where elements that you add to
the 3D map, such as markers, polylines, polygons, and models, are rendered
relative to the earth's surface. Additionally, `AltitudeMode` controls where
the camera is positioned during `flyCameraTo` and `flyCameraAround` animations.

> [!IMPORTANT]
> **Key Point:** `AltitudeMode` defaults to `CLAMP_TO_GROUND` when not specified for geometry, like markers and polylines. For camera positioning, `AltitudeMode` defaults to `ABSOLUTE`.

The following guide provides information on using `AltitudeMode` effectively,
and considerations for factors that impact how elements are rendered.

## Digital elevation models

Feature placement is governed by two underlying Digital Elevation Models (DEMs)
accessible in the API:

- **Digital Terrain Model (DTM) / "Ground"**: A "bare-earth" view showing the elevation of the underlying terrain, with above-ground objects removed.
- **Digital Surface Model (DSM) / "Mesh"**: A surface representation that includes terrain elevation plus above-ground features like buildings and trees.

The following image shows the difference between the DTM and DSM renderings of
an urban area:

![Image showing side-by-side DTM and DSM views of the Colosseum](https://developers.google.com/static/maps/documentation/javascript/3d/images/dtm-vs-dsm.png)

## `AltitudeMode` options

The choice of `AltitudeMode` determines how the feature's altitude value (if
supplied) is interpreted relative to the digital elevation models.

- **`ABSOLUTE`** : Renders the object relative to the mean sea level, calculated using [EGM96](https://en.wikipedia.org/wiki/Earth_Gravitational_Model).
- **`CLAMP_TO_GROUND`**: Renders the object directly on the DTM (Ground), ignoring any provided altitude and following the terrain.
- **`RELATIVE_TO_GROUND`**: Renders the object relative to the DTM (Ground) surface.
- **`RELATIVE_TO_MESH`**: Renders the object relative to the DSM (Mesh)---the highest surface, including ground, buildings, and water.

## Altitude values in relative modes

When using relative modes (`RELATIVE_TO_GROUND` or `RELATIVE_TO_MESH`), the
supplied altitude value is an offset from the chosen base surface, not a fixed
height above sea level. For example, an altitude of 100 will place the feature
100 meters above the DTM or DSM.

If the feature data doesn't include an altitude, a relative mode like
`RELATIVE_TO_MESH` will place the feature directly on top of the mesh/surface.
However, for polylines and polygons, the connections between points will be
straight lines, which might cause the line to pass through the mesh between
points if you don't use interpolation.