updateCameraPositionTo

fun CameraPositionState.updateCameraPositionTo(boundingBox: BoundingBoxViewData?, coroutineScope: CoroutineScope, animate: Boolean = false, padding: Int = 2, onMoveFinished: () -> Unit = {})

Commands the CameraPositionState to update its position in the map to focus on a specific area.

Parameters

boundingBox

the bounding box containing the target area to move the camera to. If null, the function does nothing.

coroutineScope

used to launch a coroutine for animated camera movements.

animate

whether to animate the camera movement. Defaults to false.

padding

the padding (in dp) applied around the bounding box when framing the camera view. Defaults to 2.

onMoveFinished

a callback fired when the camera movement finishes (including animations). Defaults to an empty function.