CameraState

Use this class to access information about the map in relation to the camera.

Properties

Link copied to clipboard

reason why the camera moved, last time it moved

Link copied to clipboard

how the camera is oriented towards the map

Functions

Link copied to clipboard
suspend fun animateTo(finalPosition: CameraPosition, duration: <Error class: unknown class> = 300.milliseconds)

Animates the camera towards the finalPosition in duration time.

Link copied to clipboard
suspend fun awaitInitialized()

suspends until the map has been initialized

Link copied to clipboard

Returns a position that corresponds to the given offset from the top-left corner of the map composable.

Link copied to clipboard
fun queryRenderedFeatures(offset: DpOffset, layerIds: Set<String>? = null, predicate: Expression<Boolean> = const(true)): List<Feature>

Returns a list of features that are rendered at the given offset from the top-left corner of the map composable, optionally limited to layers with the given layerIds and filtered by the given predicate. The result is sorted by render order, i.e. the feature in front is first in the list.

fun queryRenderedFeatures(rect: DpRect, layerIds: Set<String>? = null, predicate: Expression<Boolean> = const(true)): List<Feature>

Returns a list of features whose rendered geometry intersect with the given rect, optionally limited to layers with the given layerIds and filtered by the given predicate. The result is sorted by render order, i.e. the feature in front is first in the list.

Link copied to clipboard

Returns the smallest bounding box that contains the currently visible area.

Link copied to clipboard

Returns the currently visible area, which is a four-sided polygon spanned by the four points each at one corner of the map composable. If the camera has tilt (pitch), this polygon is a trapezoid instead of a rectangle.

Link copied to clipboard

Returns an offset from the top-left corner of the map composable that corresponds to the given position. This works for positions that are off-screen, too.