CameraAnimationsPlugin

Interface to interact with Camera Animations plugin

interface CameraAnimationsPlugin : MapPlugin

Functions

addCameraAnchorChangeListener
Link copied to clipboard

Add camera anchor change listener

abstract fun addCameraAnchorChangeListener(listener: CameraAnimatorNullableChangeListener<ScreenCoordinate?>)
addCameraAnimationsLifecycleListener
Link copied to clipboard

Add given CameraAnimationsLifecycleListener for capturing all events about animators lifecycle.

abstract fun addCameraAnimationsLifecycleListener(listener: CameraAnimationsLifecycleListener)
addCameraBearingChangeListener
Link copied to clipboard

Add camera bearing change listener

abstract fun addCameraBearingChangeListener(listener: CameraAnimatorChangeListener<Double>)
addCameraCenterChangeListener
Link copied to clipboard

Add camera center change listener

abstract fun addCameraCenterChangeListener(listener: CameraAnimatorChangeListener<Point>)
addCameraPaddingChangeListener
Link copied to clipboard

Add camera padding change listener

abstract fun addCameraPaddingChangeListener(listener: CameraAnimatorChangeListener<EdgeInsets>)
addCameraPitchChangeListener
Link copied to clipboard

Add camera pitch change listener

abstract fun addCameraPitchChangeListener(listener: CameraAnimatorChangeListener<Double>)
addCameraZoomChangeListener
Link copied to clipboard

Add camera zoom change listener

abstract fun addCameraZoomChangeListener(listener: CameraAnimatorChangeListener<Double>)
calculateScaleBy
Link copied to clipboard

Utility method to calculate scale by using the amount and current zoom

abstract fun calculateScaleBy(amount: Double, currentZoom: Double): Double
cancelAllAnimators
Link copied to clipboard

Cancel all animators except ones owned by exceptOwnerList list.

abstract fun cancelAllAnimators(exceptOwnerList: List<String>)
cleanup
Link copied to clipboard

Called when the map is destroyed. Should be used to cleanup plugin resources for that map.

open override fun cleanup()
createAnchorAnimator
Link copied to clipboard

Create CameraAnchorAnimator

abstract fun createAnchorAnimator(options: CameraAnimatorOptions<ScreenCoordinate>, block: ValueAnimator.() -> Unit?): ValueAnimator
createBearingAnimator
Link copied to clipboard

Create CameraBearingAnimator. Current map camera option will be applied on animation start if not specified explicitly with options.startValue.

abstract fun createBearingAnimator(options: CameraAnimatorOptions<Double>, useShortestPath: Boolean, block: ValueAnimator.() -> Unit?): ValueAnimator
createCenterAnimator
Link copied to clipboard

Create CameraCenterAnimator. Current map camera option will be applied on animation start if not specified explicitly with options.startValue.

abstract fun createCenterAnimator(options: CameraAnimatorOptions<Point>, block: ValueAnimator.() -> Unit?): ValueAnimator
createPaddingAnimator
Link copied to clipboard

Create CameraPaddingAnimator. Current map camera option will be applied on animation start if not specified explicitly with options.startValue.

abstract fun createPaddingAnimator(options: CameraAnimatorOptions<EdgeInsets>, block: ValueAnimator.() -> Unit?): ValueAnimator
createPitchAnimator
Link copied to clipboard

Create CameraPitchAnimator. Current map camera option will be applied on animation start if not specified explicitly with options.startValue.

abstract fun createPitchAnimator(options: CameraAnimatorOptions<Double>, block: ValueAnimator.() -> Unit?): ValueAnimator
createZoomAnimator
Link copied to clipboard

Create CameraZoomAnimator

abstract fun createZoomAnimator(options: CameraAnimatorOptions<Double>, block: ValueAnimator.() -> Unit?): ValueAnimator
easeTo
Link copied to clipboard

Ease the map camera to a given camera options.

abstract fun easeTo(cameraOptions: CameraOptions, animationOptions: MapAnimationOptions?): Cancelable
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
flyTo
Link copied to clipboard

Fly the map camera to a given camera options.

This method implements an “optimal path” animation, as detailed in:

Van Wijk, Jarke J.; Nuij, Wim A. A. “Smooth and efficient zooming and panning.” INFOVIS ’03. pp. 15–22. The online documentation.

Where applicable, local variable documentation begins with the associated variable or function in van Wijk (2003).

abstract fun flyTo(cameraOptions: CameraOptions, animationOptions: MapAnimationOptions?): Cancelable
hashCode
Link copied to clipboard
open override fun hashCode(): Int
initialize
Link copied to clipboard

Called when the plugin is first added to the map.

open override fun initialize()
moveBy
Link copied to clipboard

Move the map by a given screen coordinate with optional animation.

abstract fun moveBy(screenCoordinate: ScreenCoordinate, animationOptions: MapAnimationOptions?): Cancelable
onDelegateProvider
Link copied to clipboard

Provides all map delegate instances.

open override fun onDelegateProvider(delegateProvider: MapDelegateProvider)
pitchBy
Link copied to clipboard

Pitch the map by with optional animation.

abstract fun pitchBy(pitch: Double, animationOptions: MapAnimationOptions?): Cancelable
playAnimatorsSequentially
Link copied to clipboard

Play given ValueAnimator's sequentially

abstract fun playAnimatorsSequentially(vararg animators: Array<out ValueAnimator>)
playAnimatorsTogether
Link copied to clipboard

Play given ValueAnimator's together

abstract fun playAnimatorsTogether(vararg animators: Array<out ValueAnimator>)
registerAnimators
Link copied to clipboard

Register an animator

abstract fun registerAnimators(vararg cameraAnimators: Array<out ValueAnimator>)
removeCameraAnchorChangeListener
Link copied to clipboard

Remove camera anchor change listener

abstract fun removeCameraAnchorChangeListener(listener: CameraAnimatorNullableChangeListener<ScreenCoordinate?>)
removeCameraAnimationsLifecycleListener
Link copied to clipboard

Remove given CameraAnimationsLifecycleListener for capturing all events about animators lifecycle.

abstract fun removeCameraAnimationsLifecycleListener(listener: CameraAnimationsLifecycleListener)
removeCameraBearingChangeListener
Link copied to clipboard

Add camera bearing change listener

abstract fun removeCameraBearingChangeListener(listener: CameraAnimatorChangeListener<Double>)
removeCameraCenterChangeListener
Link copied to clipboard

Remove camera center change listener

abstract fun removeCameraCenterChangeListener(listener: CameraAnimatorChangeListener<Point>)
removeCameraPaddingChangeListener
Link copied to clipboard

Remove camera padding change listener

abstract fun removeCameraPaddingChangeListener(listener: CameraAnimatorChangeListener<EdgeInsets>)
removeCameraPitchChangeListener
Link copied to clipboard

Remove camera pitch change listener

abstract fun removeCameraPitchChangeListener(listener: CameraAnimatorChangeListener<Double>)
removeCameraZoomChangeListener
Link copied to clipboard

Remove camera zoom change listener

abstract fun removeCameraZoomChangeListener(listener: CameraAnimatorChangeListener<Double>)
rotateBy
Link copied to clipboard

Rotate the map by with optional animation.

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

Scale the map by with optional animation.

abstract fun scaleBy(amount: Double, screenCoordinate: ScreenCoordinate?, animationOptions: MapAnimationOptions?): Cancelable
toString
Link copied to clipboard
open override fun toString(): String
unregisterAnimators
Link copied to clipboard

Unregister all animators

abstract fun unregisterAnimators(vararg cameraAnimators: Array<out ValueAnimator>, cancelAnimators: Boolean)

Properties

anchor
Link copied to clipboard

Map camera anchor value. Default value is NULL meaning center of given map view. Left-top corner is represented as ScreenCoordinate (0.0, 0.0).

If anchor is set to some specific value (set directly or by some running anchor animation) it will be used as anchor for all upcoming animations even if they do not animate anchor directly.

Note: If anchor animator is started and no start value is specified explicitly and anchor = NULL - then start value will be set to ScreenCoordinate(0.0, 0.0) automatically and it will be start point for interpolation.

abstract var anchor: ScreenCoordinate?
debugMode
Link copied to clipboard

If debug mode is enabled extra logs will be written about animation lifecycle and some other events that may be useful for debugging.

abstract var debugMode: Boolean

Inheritors

CameraAnimationsPluginImpl
Link copied to clipboard