CameraOptions interface

The options for setting the map control's camera.

Extends

Properties

bearing

The bearing of the map (rotation) in degrees. When the bearing is 0, 90, 180, or 270 the top of the map container will be north, east, south or west respectively. default 0

center

The position to align the center of the map view with. default [0, 0]

centerOffset

A pixel offset to apply to the center of the map. This is useful if you want to programmatically pan the map to another location or if you want to center the map over a shape, then offset the maps view to make room for a popup. Default [0, 0].

maxBounds

A bounding box in which to constrain the viewable map area to. Users won't be able to pan the center of the map outside of this bounding box. Set maxBounds to null or undefined to remove maxBounds Default undefined.

maxZoom

The maximum zoom level that the map can be zoomed into during the animation. Must be between 0 and 24, and greater than or equal to minZoom. default 20

minZoom

The minimum zoom level that the map can be zoomed out to during the animation. Must be between 0 and 24, and less than or equal to maxZoom. default 1

pitch

The pitch (tilt) of the map in degrees between 0 and 60, where 0 is looking straight down on the map. default 0

zoom

The zoom level of the map view. default 1

Property Details

bearing

The bearing of the map (rotation) in degrees. When the bearing is 0, 90, 180, or 270 the top of the map container will be north, east, south or west respectively. default 0

bearing?: number

Property Value

number

center

The position to align the center of the map view with. default [0, 0]

center?: Position

Property Value

centerOffset

A pixel offset to apply to the center of the map. This is useful if you want to programmatically pan the map to another location or if you want to center the map over a shape, then offset the maps view to make room for a popup. Default [0, 0].

centerOffset?: Pixel

Property Value

maxBounds

A bounding box in which to constrain the viewable map area to. Users won't be able to pan the center of the map outside of this bounding box. Set maxBounds to null or undefined to remove maxBounds Default undefined.

maxBounds?: BoundingBox

Property Value

maxZoom

The maximum zoom level that the map can be zoomed into during the animation. Must be between 0 and 24, and greater than or equal to minZoom. default 20

maxZoom?: number

Property Value

number

minZoom

The minimum zoom level that the map can be zoomed out to during the animation. Must be between 0 and 24, and less than or equal to maxZoom. default 1

minZoom?: number

Property Value

number

pitch

The pitch (tilt) of the map in degrees between 0 and 60, where 0 is looking straight down on the map. default 0

pitch?: number

Property Value

number

zoom

The zoom level of the map view. default 1

zoom?: number

Property Value

number