Camera class

Inheritance
Implementers

Constructors

Camera.fromJsObject(CameraJsImpl jsObject)
Creates a new Camera from a jsObject.

Properties

hashCode int
The hash code for this object.
no setterinherited
jsObject → CameraJsImpl
JS object.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

cameraForBounds(LngLatBounds bounds, [dynamic options]) CameraOptions
@memberof MapboxMap# @param {LatLngBoundsLike} bounds Calculate the center for these bounds in the viewport and use the highest zoom level up to and including MapboxMap#getMaxZoom() that fits in the viewport. LatLngBounds represent a box that is always axis-aligned with bearing 0. @param options @param {number | PaddingOptions} options.padding The amount of padding in pixels to add to the given bounds. @param {PointLike} options.offset=[0, 0] The center of the given bounds relative to the map's center, measured in pixels. @param {number} options.maxZoom The maximum zoom level to allow when the camera would transition to the specified bounds. @returns {CameraOptions | void} If map is able to fit to provided bounds, returns CameraOptions with center, zoom, and bearing. If map is unable to fit, method will warn and return undefined. @example var bbox = [-79, 43, -73, 45]; var newCameraTransform = map.cameraForBounds(bbox, { padding: {top: 10, bottom:25, left: 15, right: 5} });
easeTo(dynamic options, [dynamic eventData]) MapboxMap
Changes any combination of center, zoom, bearing, and pitch, with an animated transition between old and new values. The map will retain its current values for any details not specified in options.
fire(Event event, [dynamic properties]) → dynamic
inherited
fitBounds(LngLatBounds bounds, [Map<String, dynamic>? options, dynamic eventData]) MapboxMap
Pans and zooms the map to contain its visible area within the specified geographical bounds. This function will also reset the map's bearing to 0 if bearing is nonzero.
fitScreenCoordinates(Point p0, Point p1, num bearing, [dynamic options, dynamic eventData]) MapboxMap
Pans, rotates and zooms the map to to fit the box made by points p0 and p1 once the map is rotated to the specified bearing. To zoom without rotating, pass in the current map bearing.
flyTo(dynamic options, [String? eventData]) MapboxMap
Changes any combination of center, zoom, bearing, and pitch, animating the transition along a curve that evokes flight. The animation seamlessly incorporates zooming and panning to help the user maintain her bearings even after traversing a great distance.
getBearing() num
Returns the map's current bearing. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up.
getCenter() LngLat
Returns the map's geographical centerpoint.
getPitch() num
Returns the map's current pitch (tilt).
getZoom() num
Returns the map's current zoom level.
isEasing() bool
jumpTo(CameraOptions options, [dynamic eventData]) MapboxMap
Changes any combination of center, zoom, bearing, and pitch, without an animated transition. The map will retain its current values for any details not specified in options.
listens(String type) → dynamic
Returns a true if this instance of Evented or any forwardeed instances of Evented have a listener for the specified type.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
off(String type, [dynamic layerIdOrListener, Listener? listener]) MapboxMap
Removes a previously registered event listener.
inherited
on(String type, [dynamic layerIdOrListener, Listener? listener]) MapboxMap
Adds a listener to a specified event type.
inherited
once(String type, Listener listener) MapboxMap
Adds a listener that will be called only once to a specified event type.
inherited
panBy(Point offset, [AnimationOptions? options, dynamic eventData]) MapboxMap
Pans the map by the specified offset.
panTo(LngLat lnglat, [AnimationOptions? options, dynamic eventData]) MapboxMap
Pans the map to the specified location, with an animated transition.
resetNorth([AnimationOptions? options, dynamic eventData]) MapboxMap
Rotates the map so that north is up (0° bearing), with an animated transition.
resetNorthPitch([AnimationOptions? options, dynamic eventData]) MapboxMap
Rotates and pitches the map so that north is up (0° bearing) and pitch is 0°, with an animated transition.
rotateTo(num bearing, [AnimationOptions? options, dynamic eventData]) MapboxMap
Rotates the map to the specified bearing, with an animated transition. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up.
setBearing(num bearing, [dynamic eventData]) MapboxMap
Sets the map's bearing (rotation). The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up.
setCenter(LngLat center, [dynamic eventData]) MapboxMap
Sets the map's geographical centerpoint. Equivalent to jumpTo({center: center}).
setEventedParent([Evented? parent, dynamic data]) → dynamic
Bubble all events fired by this instance of Evented to this parent instance of Evented.
inherited
setPitch(num pitch, [dynamic eventData]) MapboxMap
Sets the map's pitch (tilt). Equivalent to jumpTo({pitch: pitch}).
setZoom(num zoom, [dynamic eventData]) MapboxMap
Sets the map's zoom level. Equivalent to jumpTo({zoom: zoom}).
snapToNorth([AnimationOptions? options, dynamic eventData]) MapboxMap
Snaps the map so that north is up (0° bearing), if the current bearing is close enough to it (i.e. within the bearingSnap threshold).
stop() MapboxMap
Stops any animated transition underway.
toString() String
A string representation of this object.
inherited
zoomIn([AnimationOptions? options, dynamic eventData]) MapboxMap
Increases the map's zoom level by 1.
zoomOut([AnimationOptions? options, dynamic eventData]) MapboxMap
Decreases the map's zoom level by 1.
zoomTo(num zoom, [AnimationOptions? options, dynamic eventData]) MapboxMap
Zooms the map to the specified zoom level, with an animated transition.

Operators

operator ==(Object other) bool
The equality operator.
inherited