# ViewState

The visible part of the map.

This is an interface exported by `@mapcairn/core`, checked against version 0.2.0.

## Signature

```ts
import type { ViewState } from "@mapcairn/core";
 
interface ViewState
```

## Properties

### bearing

```ts
readonly bearing: number;
```

Degrees clockwise from north that the top of the map points to, in the range [0, 360).

### center

```ts
readonly center: LatLng;
```

The position at the middle of the map.

### zoom

```ts
readonly zoom: number;
```

The normalised zoom: the 256 px tile convention, the same for every engine.

## Remarks

`zoom` is always the normalised zoom: the 256 px tile convention
 used by OpenStreetMap tile numbering. MapLibre counts 512 px tiles, so
 its adapter subtracts one on the way in and adds one on the way out.
 `bearing` is degrees clockwise from north, in the range [0, 360).

## See also

- [`LatLng`](https://docs.mapcairn.com/api/core/LatLng.md)

Source: [packages/core/src/ports/geometry.ts:38](https://github.com/MapCairn/mapcairn/blob/main/packages/core/src/ports/geometry.ts#L38)
