MapViewportState

class MapViewportState(cameraState: CameraState = INIT_CAMERA_STATE)

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

Parameters

cameraState

the initial camera position

Constructors

Link copied to clipboard
fun MapViewportState(cameraState: CameraState = INIT_CAMERA_STATE)

Types

Link copied to clipboard
object Companion

Companion object of MapViewportState.

Functions

Link copied to clipboard
fun easeTo(cameraOptions: CameraOptions, animationOptions: MapAnimationOptions? = null, completionListener: CompletionListener? = null)

Ease the map camera to a given camera options.

Link copied to clipboard
fun flyTo(cameraOptions: CameraOptions, animationOptions: MapAnimationOptions? = null, completionListener: CompletionListener? = null)

Fly the map camera to a given camera options.

Link copied to clipboard
Link copied to clipboard

Move the camera instantaneously as specified by cameraOptions. Any camera animation in progress will be cancelled.

Move the camera instantaneously as specified by block camera options. Any camera animation in progress will be cancelled.

Link copied to clipboard
fun transitionToFollowPuckState(followPuckViewportStateOptions: FollowPuckViewportStateOptions, defaultTransitionOptions: DefaultViewportTransitionOptions = DefaultViewportTransitionOptions.Builder() .build(), completionListener: CompletionListener? = null)

Transition to a new FollowPuckViewportState.

Link copied to clipboard
fun transitionToOverviewState(overviewViewportStateOptions: OverviewViewportStateOptions, defaultTransitionOptions: DefaultViewportTransitionOptions = DefaultViewportTransitionOptions.Builder() .build(), completionListener: CompletionListener? = null)

Transition to a new OverviewViewportState.

Properties

Link copied to clipboard
Link copied to clipboard

The current ViewportStatus that represents the status of the viewport.

Link copied to clipboard

A utility function to get the default CameraOptions defined in the style.