cameraForCoordinateBounds

open override fun cameraForCoordinateBounds(bounds: CoordinateBounds, padding: EdgeInsets, bearing: Double?, pitch: Double?): CameraOptions

Convert to a camera options from a given LatLngBounds, 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 world bounds. 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

bounds

The LatLngBounds 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