Skip to main content

Interface: ViewState

Defined in: spec/types.ts:88

Properties​

bearing?​

optional bearing?: number

Defined in: spec/types.ts:106


cameraAngleTransitionMs?​

optional cameraAngleTransitionMs?: number

Defined in: spec/types.ts:114

Eases the camera, over this many milliseconds, when pitch or bearing changes from one spec to the next — tilting into a 3D view rather than snapping to it. Omit it (or 0) to jump, as before. Centre and zoom changes still jump. A viewer's reduced-motion setting turns the ease into a jump.


center?​

optional center?: LngLat

Defined in: spec/types.ts:89


maxZoomIn?​

optional maxZoomIn?: number

Defined in: spec/types.ts:97

Highest zoom level the user can reach by zooming in. Acts as a camera ceiling: interactive zoom, setView, and programmatic zoom are all clamped to this value. Higher numbers mean closer to the ground. When omitted, MapLibre's default maximum (22) applies.


maxZoomOut?​

optional maxZoomOut?: number

Defined in: spec/types.ts:104

Lowest zoom level the user can reach by zooming out. Acts as a camera floor: interactive zoom, setView, and programmatic zoom are all clamped to this value. Lower numbers mean farther from the ground. When omitted, MapLibre's default minimum (0) applies.


pitch?​

optional pitch?: number

Defined in: spec/types.ts:105


projection?​

optional projection?: "mercator" | "vertical-perspective"

Defined in: spec/types.ts:115


zoom?​

optional zoom?: number

Defined in: spec/types.ts:90