Controls which camera interactions are enabled/disabled.
The mode of the camera to automatically set the minimum zoom level based on the size of the scene.
The current bearing of the camera in degrees clockwise from North. 0 degrees is North, 90 degrees is East, 180 degrees is South, and 270 degrees is West.
The current pan boundary of the camera.
The current center coordinate (Coordinate) of the camera.
The current elevation of the camera in meters.
The maximum pitch of the camera in degrees.
The maximum zoom level of the camera in mercator zoom levels.
The minimum pitch of the camera in degrees.
The minimum zoom level of the camera in mercator zoom levels.
The camera's current pan mode.
The current pitch of the camera in degrees.
The current zoom level of the camera in mercator zoom levels.
ExperimentalAnimate the camera's elevation to a specified elevation.
The target elevation in meters.
Optionaloptions: TCameraAnimationOptionsOptional settings for the camera animation.
Animates the camera to a specific target.
The camera target (TCameraTarget) to animate to.
Optionaloptions: TCameraAnimationOptionsOptional animation options (see TCameraAnimationOptions).
A promise that resolves when the animation is complete.
Focuses the camera on a specific target or array of targets.
The target(s) to focus on, either a single element or an array of elements.
Optionaloptions: TFocusOnOptionsOptional settings for focusing the camera (see TFocusOnOptions).
A promise that resolves when the camera animation is complete.
Get the camera transform that can be used to focus on a target or array of targets. Similar to Camera.focusOn but returns the transform directly.
The target(s) to get the camera transform for.
Optionaloptions: TFocusOnOptionsOptional settings for the camera transform.
The camera transform which can then be passed to Camera.set or Camera.animateTo.
Instantly sets the camera to a specific target.
The camera target (TCameraTarget) to set.
Toggle the mode of the camera to automatically set the minimum zoom level based on the size of the scene. It will be automatically disabled when the minimum zoom level is set manually.
The new value for the auto min zoom level mode.
ExperimentalSet the camera's elevation in meters.
The new elevation in meters.
Update the maximum pitch of the camera in degrees.
The new maximum pitch.
Update the maximum zoom level of the camera in mercator zoom levels.
The new maximum zoom level.
Update the minimum pitch of the camera in degrees.
The new minimum pitch.
Update the minimum zoom level of the camera in mercator zoom levels.
The new minimum zoom level.
ExperimentalSet the camera's pan mode. 'elevation' moves the camera up and down, while 'default' allows the camera to pan in all directions.
The new pan mode.
Define an area of the screen that is safe for the camera. Anything outside the safe area is assumed to be covered in some way. The camera will not place any map elements there when calling Camera.focusOn.
The padding to apply. Can specify individual sides and optionally the type.
type: 'pixel' (absolute pixels) or 'portion' (fraction of canvas, 0-1). Defaults to 'pixel'.
Camera in Mappedin JS
The Camera class controls the map's viewpoint, including position, pitch, bearing, and zoom. It can instantly reposition or animate to a new location, and can focus on one or more map elements.
Features
Example Usage
Advanced
getFocusOnTransformto calculate the camera transform before applying it.interactions.setto enable/disable pan, zoom, or rotation.More Information
This class is accessed using MapView.Camera.