Timeline

class Timeline(opts: AnimationOptions, controller: MapController) : TimeAnimation

A TimeAnimation that manages and controls one or more individual animations. Using a timeline, you can control the playback of multiple animations at once and keep them in sync.

Constructors

Link copied to clipboard
constructor(opts: AnimationOptions, controller: MapController)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Whether the animation should always play from the beginning. When false, the animation will resume from its current position when restarted. Defaults to false.

Link copied to clipboard

Whether the animation should begin playing immediately.

Link copied to clipboard
val config: State<AnimationOptions>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Duration to wait before starting the animation, in seconds.

Link copied to clipboard
Link copied to clipboard

Duration the animation should take to complete, in seconds.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var end: Date

End date of the timeline's time range.

Link copied to clipboard

DDuration to hold the end of the animation before repeating, in seconds.

Link copied to clipboard
val eventFlow: MutableSharedFlow<Event>
Link copied to clipboard
val id: String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val liveState: LiveData<AnimationState>
Link copied to clipboard
open override var position: Double
Link copied to clipboard

Whether the animation should restart after completing playback.

Link copied to clipboard
var start: Date

Start date of the timeline's time range.

Link copied to clipboard
val state: AnimationState
Link copied to clipboard
open val TAG: String
Link copied to clipboard

Factor used to scale the time of the animation where a value of 1 is normal speed, 0.5 is half speed, and 2 is double speed, etc. Only positive values are allowed.

Link copied to clipboard

Functions

Link copied to clipboard
fun clampDateRange(min: Date, max: Date)

Restricts the animation to a specific date range relative to the overall start and end date. This is useful if you want to limit the animation to a subset of the overall time range without changing the overall start and end date values.

Link copied to clipboard
fun disable()
Link copied to clipboard
fun enable()
Link copied to clipboard
open override fun goTo(position: Double, useTotalDuration: Boolean)

Update the map to reflect a position on the timeline from 0.0 to 1.0

Link copied to clipboard
open override fun goToDate(date: Date)

Advances the playhead to the specified date where date is within the time range between the timeline's startDate and endDate values.

Link copied to clipboard
fun goToOffset(offset: Long)

Advances the playhead past the start time by the given number of milliseconds.

Link copied to clipboard
fun off(event: String, listener: (Any) -> Unit)
Link copied to clipboard
fun on(event: String, listener: (Any) -> Unit)
Link copied to clipboard
open override fun pause()

Pauses the animation at its current position.

Link copied to clipboard
open override fun play(positionInput: Double?)

Begins playing the animation.

Link copied to clipboard
fun playFromDate(fromDate: Date)

Begins playing the animation from the specified date where date is within the time range between the timeline's startDate and endDate values.

Link copied to clipboard
open override fun reset()

Stops playing the animation if currently playing and updates the playhead back to its original starting position.

Link copied to clipboard
open override fun restart()
Link copied to clipboard
open override fun resume()

Resumes playing the animation from its current position, such as after being paused.

Link copied to clipboard
fun setEndDateUsingOffset(offset: Long, relativeTo: Date = Date())

Updates the timeline end date by applying the specified time offset to the relative date. If no relative date is provided, then the current time and date will be used.

Link copied to clipboard
fun setEndDateUsingRelativeTime(offset: String, relativeTo: Date = Date())

Updates the timeline end date by calculating the date using a relative time string, such as "-2 hours" or "1 day".

Link copied to clipboard
fun setStartDateUsingOffset(offset: Long, relativeTo: Date = Date())

Updates the timeline start date by applying the specified time offset to the relative date. If no relative date is provided, then the current time and date will be used.

Link copied to clipboard
fun setStartDateUsingRelativeTime(offset: String, relativeTo: Date = Date())

Updates the timeline start date by calculating the date using a relative time string, such as "-2 hours" or "1 day".

Link copied to clipboard
open override fun stop()

Stops playing the animation. The timeline position will be updated to the time closest to the current time, which may be at the start or end of the time range or somewhere in between.

Link copied to clipboard
open override fun toggle()

Toggles the current state of the animation between paused and playing if currently active.

Link copied to clipboard
fun trigger(event: Event)
fun trigger(event: String)
fun trigger(event: Event, valueMap: Map<String, Tile<TileData>>)
fun trigger(event: TimeSeriesEvent, dates: Array<Date>)

fun trigger(event: Event, intervalArray: MutableList<TimeInterval>, placeHolder: Int)

Renamed from trigger in js since type-erasure caused signature clash

Link copied to clipboard
fun triggerAny(event: String, data: Any)
Link copied to clipboard
fun triggerDates(event: String, dates: Map<String, Date>)
Link copied to clipboard
fun triggerDatesArray(event: String, dates: Array<Date>)
Link copied to clipboard
fun triggerDatesList(event: String, dates: List<Date>)