@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}
});
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.
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.
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.
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.
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.
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.
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.
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.