> ## Documentation Index
> Fetch the complete documentation index at: https://docs.elementlabs.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Camera

> Set the altitudes the map works between, the area it covers, and how every camera movement looks.

## Purpose

`configs/camera.jsonc` controls where the camera can go and how it gets there: the altitude the map
opens at, the limits it stays within, the area of the world it covers, and the timing of each
movement.

## Options

### Altitude and view

| Key            | Default   | Meaning                                                                                                                         |
| -------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `fov`          | `50.0`    | The camera's field of view, in degrees. Lower shows less ground and flattens perspective; higher shows more and exaggerates it. |
| `farClip`      | `12000.0` | How far the camera renders. Below the altitude range the map uses, distant terrain is cut off.                                  |
| `nearClip`     | `0.1`     | How close to the camera something must be before it stops being drawn.                                                          |
| `minHeight`    | `15.0`    | The lowest altitude above ground the camera can reach.                                                                          |
| `maxHeight`    | `9200.0`  | The highest altitude the camera can reach.                                                                                      |
| `groundOffset` | `10.0`    | The clearance kept above the terrain, so the camera does not clip into hills.                                                   |
| `openHeight`   | `3000.0`  | The altitude the map opens at.                                                                                                  |

### The area the map covers

| Key           | Default   | Meaning                                |
| ------------- | --------- | -------------------------------------- |
| `bounds.minX` | `-4000.0` | The western edge the camera can reach. |
| `bounds.minY` | `-4000.0` | The southern edge.                     |
| `bounds.maxX` | `4600.0`  | The eastern edge.                      |
| `bounds.maxY` | `8000.0`  | The northern edge.                     |

The defaults cover the whole map. Narrow them to keep players inside the part of the world your
server uses.

### Opening and closing

| Key              | Default       | Meaning                                                           |
| ---------------- | ------------- | ----------------------------------------------------------------- |
| `open.duration`  | `1.0`         | Seconds the camera takes to rise from the player to the map view. |
| `open.ease`      | `"inOutQuad"` | How that movement accelerates.                                    |
| `close.duration` | `1.0`         | Seconds the camera takes to return to the player.                 |
| `close.ease`     | `"inOutQuad"` | How that movement accelerates.                                    |

### Moving to a marker

Used when a player clicks a marker or a legend entry.

| Key                    | Default       | Meaning                                                                                          |
| ---------------------- | ------------- | ------------------------------------------------------------------------------------------------ |
| `focus.panDuration`    | `0.7`         | Seconds spent moving across to the marker, at the current altitude.                              |
| `focus.zoomDuration`   | `0.7`         | Seconds spent descending afterwards.                                                             |
| `focus.zoomHeight`     | `120.0`       | The altitude above ground the camera ends at.                                                    |
| `focus.ease`           | `"inOutQuad"` | How both movements accelerate.                                                                   |
| `focus.prefetchRadius` | `150.0`       | How wide an area around the destination is loaded in advance, so the ground is drawn on arrival. |

### Settling onto a marker

The magnet: when the camera stops with a marker near the centre of the screen, it slides so the
marker sits exactly in the centre.

| Key                 | Default       | Meaning                                                                                       |
| ------------------- | ------------- | --------------------------------------------------------------------------------------------- |
| `snap.magnet`       | `true`        | Whether the camera settles onto a marker at all. Set to `false` to disable it.                |
| `snap.duration`     | `0.35`        | Seconds the settling movement takes.                                                          |
| `snap.ease`         | `"inOutQuad"` | How it accelerates.                                                                           |
| `snap.farDistance`  | `800.0`       | Beyond this distance the movement counts as long, and `zoomOutFirst` applies.                 |
| `snap.zoomOutFirst` | `true`        | For a long movement, rise to `openHeight` first rather than travelling low across the ground. |

### Easing names

Every `ease` key accepts the same set of names. Each family below has three forms: `in…` accelerates
at the start only, `out…` decelerates at the end only, and `inOut…` does both.

| Family                    | Names                                     | Character                                     |
| ------------------------- | ----------------------------------------- | --------------------------------------------- |
| None                      | `linear`                                  | Constant speed, no acceleration.              |
| Sine                      | `inSine`, `outSine`, `inOutSine`          | The gentlest curve.                           |
| Quad, Cubic, Quart, Quint | `inQuad` … `inOutQuint`                   | Progressively sharper, in that order.         |
| Expo                      | `inExpo`, `outExpo`, `inOutExpo`          | Very slow start, very fast finish.            |
| Circ                      | `inCirc`, `outCirc`, `inOutCirc`          | Sharper than Quad, with a rounded finish.     |
| Back                      | `inBack`, `outBack`, `inOutBack`          | Overshoots slightly and comes back.           |
| Elastic                   | `inElastic`, `outElastic`, `inOutElastic` | Oscillates around the target before settling. |
| Bounce                    | `inBounce`, `outBounce`, `inOutBounce`    | Bounces at the end.                           |

`inOutQuad` is used throughout the defaults. `Back`, `Elastic` and `Bounce` overshoot the target, so
they suit opening and closing better than they suit settling onto a marker.

A name that is not in the table falls back to `inOutQuad` without any message. Check the spelling if
a movement does not change after an edit.

## Example

A map limited to the city, opening lower and moving faster:

```jsonc theme={null}
{
  "namespace": "camera",
  "configVersion": 1,
  "scope": "client",
  "values": {
    "openHeight": 1200.0,
    "open": { "duration": 0.6 },
    "close": { "duration": 0.6 },
    "bounds": {
      "minX": -2000.0,
      "minY": -3500.0,
      "maxX": 1500.0,
      "maxY": 1200.0
    }
  }
}
```

Groups are merged key by key, so `"open": { "duration": 0.6 }` keeps the shipped easing.

## Applying changes

```text theme={null}
restart element_map
```

## Safety

| Key                               | Stay within                              | Why                                                                                               |
| --------------------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------- |
| `openHeight`                      | Between `minHeight` and `maxHeight`      | Outside the range it is clamped, so the map opens somewhere other than where you set.             |
| `minHeight`                       | Above `0`, and at least `groundOffset`   | Lower lets the camera reach ground level, where terrain fills the screen.                         |
| `maxHeight`                       | At or below `farClip`                    | Above the render distance, the ground stops being drawn and the map shows empty space.            |
| `farClip`                         | At or above `maxHeight`                  | Same reason, from the other side.                                                                 |
| `fov`                             | Roughly `30` to `70`                     | Outside that, the view distorts noticeably at the edges.                                          |
| `nearClip`                        | Roughly `0.05` to `1.0`                  | Larger values cut away anything directly under the camera, which is visible when zoomed in close. |
| `bounds`                          | `minX` below `maxX`, `minY` below `maxY` | Reversed or equal values leave no area to move in and the camera cannot be dragged.               |
| `open.duration`, `close.duration` | Roughly `0.3` to `2.0`                   | Very short is jarring; very long delays the map every time it is opened.                          |

Duration values are seconds, not milliseconds. `1.0` is one second; `1000` is roughly seventeen
minutes of camera movement before the map becomes usable.

## Related

* [Configuration](/products/map/configuration/index)
* [Controls](/products/map/configuration/controls)
* [Visual treatment](/products/map/configuration/visual)
