ViewportPlugin

interface ViewportPlugin : MapPlugin

The Viewport plugin allows to track objects on a map.

It provides a structured approach to organizing camera management logic into states and transitions between them.

at any given time, the viewport is either:

  • idle (not updating the camera)

  • in a state (camera is being managed by a ViewportState)

  • transitioning (camera is being managed by a ViewportTransition)

Functions

addStatusObserver
Link copied to clipboard
abstract fun addStatusObserver(viewportStatusObserver: ViewportStatusObserver)
Adds ViewportStatusObserver to observe the status change.
cleanup
Link copied to clipboard
open fun cleanup()
Called when the map is destroyed.
equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
open fun hashCode(): Int
idle
Link copied to clipboard
abstract fun idle()
Immediately goes to IDLE state canceling all ongoing transitions.
initialize
Link copied to clipboard
open fun initialize()
Called when the plugin is first added to the map.
makeDefaultViewportTransition
Link copied to clipboard
abstract fun makeDefaultViewportTransition(options: DefaultViewportTransitionOptions = DefaultViewportTransitionOptions.Builder().build()): DefaultViewportTransition
Create a default ViewportTransition instance with provided DefaultViewportTransitionOptions.
makeFollowPuckViewportState
Link copied to clipboard
abstract fun makeFollowPuckViewportState(options: FollowPuckViewportStateOptions = FollowPuckViewportStateOptions.Builder().build()): FollowPuckViewportState
makeImmediateViewportTransition
Link copied to clipboard
abstract fun makeImmediateViewportTransition(): ViewportTransition
Create a ViewportTransition instance that transition to the target ViewportState immediately.
makeOverviewViewportState
Link copied to clipboard
abstract fun makeOverviewViewportState(options: OverviewViewportStateOptions): OverviewViewportState
Create an OverviewViewportState instance with provided OverviewViewportStateOptions.
onDelegateProvider
Link copied to clipboard
open fun onDelegateProvider(delegateProvider: MapDelegateProvider)
Provides all map delegate instances.
removeStatusObserver
Link copied to clipboard
abstract fun removeStatusObserver(viewportStatusObserver: ViewportStatusObserver)
toString
Link copied to clipboard
open fun toString(): String
transitionTo
Link copied to clipboard
abstract fun transitionTo(targetState: ViewportState, transition: ViewportTransition? = null, completionListener: CompletionListener? = null)
Executes a transition to requested state.

Properties

defaultTransition
Link copied to clipboard
abstract var defaultTransition: ViewportTransition
DefaultViewportTransition with default options.
options
Link copied to clipboard
abstract var options: ViewportOptions
Options that impact the ViewportPlugin.
status
Link copied to clipboard
abstract val status: ViewportStatus
Returns current ViewportStatus.

Inheritors

ViewportPluginImpl
Link copied to clipboard