CameraPositionState

class CameraPositionState(position: CameraPosition)

A state object that can be hoisted to control and observe the map's camera state. A CameraPositionState may only be used by a single GoogleMap composable at a time as it reflects instance state for a single view of a map.

Parameters

position

the initial camera position

Constructors

CameraPositionState
Link copied to clipboard
fun CameraPositionState(position: CameraPosition = CameraPosition(LatLng(0.0, 0.0), 0f, 0f, 0f))
the initial camera position

Types

Companion
Link copied to clipboard
object Companion

Functions

animate
Link copied to clipboard
suspend fun animate(update: CameraUpdate, durationMs: Int = MAX_VALUE)
Animate the camera position as specified by update, returning once the animation has completed.
move
Link copied to clipboard
fun move(update: CameraUpdate)
Move the camera instantaneously as specified by update.

Properties

cameraMoveStartedReason
Link copied to clipboard
var cameraMoveStartedReason: CameraMoveStartedReason
The reason for the start of the most recent camera moment, or CameraMoveStartedReason.NO_MOVEMENT_YET if the camera hasn't moved yet or CameraMoveStartedReason.UNKNOWN if an unknown constant is received from the Maps SDK.
isMoving
Link copied to clipboard
var isMoving: Boolean
Whether the camera is currently moving or not.
position
Link copied to clipboard
var position: CameraPosition
Current position of the camera on the map.
projection
Link copied to clipboard
val projection: Projection?
Returns the current Projection to be used for converting between screen coordinates and lat/lng.