cameraForCoordinates

open override fun cameraForCoordinates(coordinates: List<Point>, padding: EdgeInsets, bearing: Double?, pitch: Double?): CameraOptions

Convert to a camera options from a given list of points, padding, bearing and pitch values.

In order for this method to produce correct results MapView must be already measured and inflated to have correct width and height values. Calling this method in Activity.onCreate will lead to incorrect results.

This API isn't supported by Globe projection and will return a no-op result matching the current camera center. See com.mapbox.maps.extension.style.projection.generated.setProjection and com.mapbox.maps.extension.style.projection.generated.getProjection

Return

Returns the converted camera options

Parameters

coordinates

The List of coordinates to take in account when converting

padding

The additional padding to take in account when converting

bearing

The optional bearing to take in account when converting

pitch

The optional pitch to take in account when converting

open override fun cameraForCoordinates(coordinates: List<Point>, camera: CameraOptions, box: ScreenBox): CameraOptions

Convenience method that returns the camera options object for given arguments

In order for this method to produce correct results MapView must be already measured and inflated to have correct width and height values. Calling this method in Activity.onCreate will lead to incorrect results.

Returns the camera options object for given arguments with zoom adjusted to fit \p coordinates into \p box, so that coordinates on the left, top and right of \p camera.center fit into \p box. Returns the provided camera options object unchanged upon error.

This API isn't supported by Globe projection and will return a no-op result matching the current camera center. See com.mapbox.maps.extension.style.projection.generated.setProjection and com.mapbox.maps.extension.style.projection.generated.getProjection

Return

Returns the camera options object with the zoom level adjusted to fit \p coordinates into \p box.

Parameters

coordinates

The coordinates representing the bounds of the map

box

The box into which \p coordinates should fit

camera

The camera for which zoom should be adjusted. Note that \p camera.center is required.