Package com.mapbox.maps.plugin.animation

Types

CameraAnimationsLifecycleListener
Link copied to clipboard

Interface responsible to notify about any CameraAnimator lifecycle events registered in CameraAnimationsPlugin. Those events are:

  • animator is about to start

  • animator is about to cancel already running animator of same type

  • animator is about to end

  • animator is about to cancel

interface CameraAnimationsLifecycleListener
CameraAnimationsPlugin
Link copied to clipboard

Interface to interact with Camera Animations plugin

interface CameraAnimationsPlugin : MapPlugin
CameraAnimationsPluginImpl
Link copied to clipboard

CameraAnimationsPluginImpl is designed to rule all the animations happening to the map driven by changing CameraOptions. It is responsible for:

  • Storing all the ValueAnimator's that could be run. Only specific camera animators could be used in this plugin.

  • Controlling animation execution - only one ValueAnimator of certain type could be run at a time. If some another animation with same CameraAnimator.type is about to start previous one will be cancelled.

  • Giving possibility to listen to CameraOptions values changes during animations via listeners.

  • If several animations of different CameraAnimator.type are running simultaneously map camera will be updated only on oldest animation update (the oldest is the one that was started first). That actually means that animation start order matters. High-level animations flyTo and easeTo will always trigger camera center animator first.

CameraAnimationsPluginImpl is NOT thread-safe meaning all animations must be started from one thread. However, it doesn't have to be the UI thread.

class CameraAnimationsPluginImpl : CameraAnimationsPlugin
CameraAnimatorChangeListener
Link copied to clipboard

Interface to get updated non-nullable animator values.

fun fun interface CameraAnimatorChangeListener<T>
CameraAnimatorNullableChangeListener
Link copied to clipboard

Interface to get updated animator values including nulls.

fun fun interface CameraAnimatorNullableChangeListener<T>
CameraAnimatorOptions
Link copied to clipboard

Class responsible for storing options used by all CameraAnimator's from CameraAnimationsPlugin. CameraAnimatorOptions.Builder should be used to create options object via DSL function cameraAnimatorOptions.

class CameraAnimatorOptions<T>
CameraAnimatorsFactory
Link copied to clipboard

CameraAnimatorsFactory stands for storing default animation options. Provides default animators for "easeTo", "scaleBy", "pitchBy", "moveBy", "rotateBy" animations

class CameraAnimatorsFactory
CameraAnimatorType
Link copied to clipboard

Enum class representing all possible camera animator types.

enum CameraAnimatorType : Enum<CameraAnimatorType>
Cancelable
Link copied to clipboard

Interface describing cancelable animation set for high-level functions like flyTo, easeTo etc.

fun fun interface Cancelable
MapAnimationOptions
Link copied to clipboard

Map transition options which are used to configure animation if using high-level API like CameraAnimationsPlugin.easeTo, CameraAnimationsPlugin.flyTo etc MapAnimationOptions.Builder should be used to create options object via DSL function mapAnimationOptions.

class MapAnimationOptions
MapAnimationOwnerRegistry
Link copied to clipboard

Registry for all plugins using Camera Animation system. This means that all animations controlled by any plugin will create animators with their owner.

object MapAnimationOwnerRegistry

Functions

easeTo
Link copied to clipboard

Extension easeTo() for MapPluginExtensionsDelegate Ease the map camera to a given camera options and animation options.

fun MapPluginExtensionsDelegate.easeTo(cameraOptions: CameraOptions, animationOptions: MapAnimationOptions?): Cancelable
flyTo
Link copied to clipboard

Extension flyTo() function for MapPluginExtensionsDelegate Fly the map camera to a given camera options.

fun MapPluginExtensionsDelegate.flyTo(cameraOptions: CameraOptions, animationOptions: MapAnimationOptions?): Cancelable
moveBy
Link copied to clipboard

Extension moveBy() function for MapPluginExtensionsDelegate Move the map by a given screen coordinate with optional animation.

fun MapPluginExtensionsDelegate.moveBy(screenCoordinate: ScreenCoordinate, animationOptions: MapAnimationOptions?): Cancelable
pitchBy
Link copied to clipboard

Extension pitchBy() function for MapPluginExtensionsDelegate Pitch the map by with optional animation.

fun MapPluginExtensionsDelegate.pitchBy(pitch: Double, animationOptions: MapAnimationOptions?): Cancelable
rotateBy
Link copied to clipboard

Extension rotateBy() function for MapPluginExtensionsDelegate Rotate the map by with optional animation.

fun MapPluginExtensionsDelegate.rotateBy(first: ScreenCoordinate, second: ScreenCoordinate, animationOptions: MapAnimationOptions?): Cancelable
scaleBy
Link copied to clipboard

Extension scaleBy() function for MapPluginExtensionsDelegate Scale the map by with optional animation.

fun MapPluginExtensionsDelegate.scaleBy(amount: Double, screenCoordinate: ScreenCoordinate?, animationOptions: MapAnimationOptions?): Cancelable

Properties

camera
Link copied to clipboard

Extension val for MapView to get the Camera Animations plugin instance.