cameraForCoordinateBounds

open override fun cameraForCoordinateBounds(bounds: CoordinateBounds, boundsPadding: EdgeInsets?, bearing: Double?, pitch: Double?, maxZoom: Double?, offset: ScreenCoordinate?): CameraOptions

Deprecated

Deprecated

Replace with

cameraForCoordinates(coordinates, camera, coordinatesPadding, maxZoom, offset, result)

Convert the given bounds, boundsPadding, bearing and pitch values to CameraOptions. Note that this method takes into account the current map padding in addition to the boundsPadding provided in parameters.

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.

Return

the converted CameraOptions. Padding is absent in the returned CameraOptions as the zoom level already accounts for the boundsPadding provided.

Parameters

bounds

The CoordinateBounds of the camera.

boundsPadding

The amount of padding in EdgeInsets to add to the given bounds.

bearing

The bearing of the camera.

pitch

The pitch of the camera.

maxZoom

The maximum zoom level allowed in the returned camera options.

offset

The center of the given bounds relative to map center in pixels.