# zoomTo

Command (Map).

Centres the map on a point at a given zoom level (2D, north-up)

Moves the map to a chosen position and zoom level. The client application decides what the driver
is looking at (a delivery point, a depot entrance, the whole of the next sector) rather than leaving
them to pan and pinch while driving.

The view switches to a north-up 2D view centred on the point, and stops following the vehicle. The
driver gets the usual recenter control to resume tracking whenever they want.

**Worth knowing**

- Because the camera stops following the vehicle, this is for a moment of orientation, not a
  driving view.

## Command

```json
{
  "jsonrpc": "2.0",
  "method": "zoomTo",
  "params": {
    "lat": 43.6961,
    "long": 7.2716,
    "zoomLevel": 15.0
  },
  "id": "1"
}
```

- `lat` / `long` WGS84 coordinates of the new map centre. Note the key is `long` here, not `lon` as in [`startGuidance`](https://docs.benomad.com/benav-rnc/commands/start-guidance.md) waypoints.
- `zoomLevel` Map zoom level. Accepted from `2.5` upwards and clamped to the range the map supports (maximum `22.5`).

## Response

### Success

```json
{
  "jsonrpc": "2.0",
  "result": {},
  "id": "1"
}
```

### Error

Generic errors, plus:

- `-32602 invalid.params` - coordinates outside the WGS84 range, or a `zoomLevel` below 2.5.
- `-2 application.not.ready` - the map is not attached yet.
