# Interface View

interface View {
center: number[];
constrainOnlyCenter: boolean;
constrainResolution: boolean;
constrainRotation: number | boolean;
enableRotation: boolean;
extent: number[];
maxResolution: number;
maxZoom: number;
minResolution: number;
minZoom: number;
multiWorld: boolean;
projection: string;
resolution: number;
resolutions: number[];
rotation: number;
showFullExtent: boolean;
smoothExtentConstraint: boolean;
smoothResolutionConstraint: boolean;
zoom: number;
zoomFactor: number;
}

- Defined in src/options.js:438

#####
Index

### Properties

center
constrainOnlyCenter
constrainResolution
constrainRotation
enableRotation
extent
maxResolution
maxZoom
minResolution
minZoom
multiWorld
projection
resolution
resolutions
rotation
showFullExtent
smoothExtentConstraint
smoothResolutionConstraint
zoom
zoomFactor

## Properties

### center

center: number[]

The initial center for the view. If a user projection is not set, the coordinate system for the center is specified with the `projection` option. Layer sources will not be fetched if this is not set, but the center can be set later with #setCenter.

- Defined in src/options.js:440

### constrainOnlyCenter

constrainOnlyCenter: boolean

If true, the extent constraint will only apply to the view center and not the whole extent.

- Defined in src/options.js:454

### constrainResolution

constrainResolution: boolean

If true, the view will always animate to the closest zoom level after an interaction; false means intermediary zoom levels are allowed.

- Defined in src/options.js:483

### constrainRotation

constrainRotation: number | boolean

Rotation constraint. `false` means no constraint. `true` means no constraint, but snap to zero near zero. A number constrains the rotation to that number of values. For example, `4` will constrain the rotation to 0, 90, 180, and 270 degrees.

- Defined in src/options.js:444

### enableRotation

enableRotation: boolean

Enable rotation. If `false`, a rotation constraint that always sets the rotation to zero is used. The `constrainRotation` option has no effect if `enableRotation` is `false`.

- Defined in src/options.js:448

### extent

extent: number[]

The extent that constrains the view, in other words, nothing outside of this extent can be visible on the map.

- Defined in src/options.js:452

### maxResolution

maxResolution: number

The maximum resolution used to determine the resolution constraint. It is used together with `minResolution` (or `maxZoom`) and `zoomFactor`. If unspecified it is calculated in such a way that the projection's validity extent fits in a 256x256 px tile. If the projection is Spherical Mercator (the default) then `maxResolution` defaults to `40075016.68557849 / 256 = 156543.03392804097`.

- Defined in src/options.js:459

### maxZoom

maxZoom: number

The maximum zoom level used to determine the resolution constraint. It is used together with `minZoom` (or `maxResolution`) and `zoomFactor`. Note that if `minResolution` is also provided, it is given precedence over `maxZoom`.

- Defined in src/options.js:471

### minResolution

minResolution: number

The minimum resolution used to determine the resolution constraint. It is used together with `maxResolution` (or `minZoom`) and `zoomFactor`. If unspecified it is calculated assuming 29 zoom levels (with a factor of 2). If the projection is Spherical Mercator (the default) then `minResolution` defaults to `40075016.68557849 / 256 / Math.pow(2, 28) = 0.0005831682455839253`.

- Defined in src/options.js:465

### minZoom

minZoom: number

The minimum zoom level used to determine the resolution constraint. It is used together with `maxZoom` (or `minResolution`) and `zoomFactor`. Note that if `maxResolution` is also provided, it is given precedence over `minZoom`.

- Defined in src/options.js:475

### multiWorld

multiWorld: boolean

If `false` the view is constrained so only one world is visible, and you cannot pan off the edge. If `true` the map may show multiple worlds at low zoom levels. Only used if the `projection` is global. Note that if `extent` is also provided it is given precedence.

- Defined in src/options.js:479

### projection

projection: string

The main projection.

- Defined in src/options.js:439

### resolution

resolution: number

The initial resolution for the view. The units are `projection` units per pixel (e.g. meters per pixel). An alternative to setting this is to set `zoom`. Layer sources will not be fetched if neither this nor `zoom` are defined, but they can be set later with #setZoom or #setResolution.

- Defined in src/options.js:497

### resolutions

resolutions: number[]

Resolutions to determine the resolution constraint. If set the `maxResolution`, `minResolution`, `minZoom`, `maxZoom`, and `zoomFactor` options are ignored.

- Defined in src/options.js:502

### rotation

rotation: number

The initial rotation for the view in radians (positive rotation clockwise, 0 means North).

- Defined in src/options.js:505

### showFullExtent

showFullExtent: boolean

Allow the view to be zoomed out to show the full configured extent. By default, when a view is configured with an extent, users will not be able to zoom out so the viewport exceeds the extent in either dimension. This means the full extent may not be visible if the viewport is taller or wider than the aspect ratio of the configured extent. If showFullExtent is true, the user will be able to zoom out so that the viewport exceeds the height or width of the configured extent, but not both, allowing the full extent to be shown.

- Defined in src/options.js:489

### smoothExtentConstraint

smoothExtentConstraint: boolean

If true, the extent constraint will be applied smoothly, i.e. allow the view to go slightly outside of the given `extent`.

- Defined in src/options.js:456

### smoothResolutionConstraint

smoothResolutionConstraint: boolean

If true, the resolution min/max values will be applied smoothly, i. e. allow the view to exceed slightly the given resolution or zoom bounds.

- Defined in src/options.js:486

### zoom

zoom: number

Only used if `resolution` is not defined. Zoom level used to calculate the initial resolution for the view.

- Defined in src/options.js:507

### zoomFactor

zoomFactor: number

The zoom factor used to compute the corresponding resolution.

- Defined in src/options.js:509