reference
Timeline

Timeline

Every map controller instance is initialized with a corresponding timeline which is responsible for managing the times used when requesting weather data and animating that weather data across a time series.

Configuration

The following properties are available on Timeline instances:

OptionDescriptionDefault
stateType: AnimationState (readonly)An enumerated value indicating the current state of the animation:

- initial: Animation has been initialized but is not ready for playback.
- loading: Animation is currently loading data required for playback.
- ready: Animation is ready for playback.
- playing: Animation is currently playing.
- paused: Animation is currently paused.
- stopped: Animation is currently stopped.
- completed: Animation has finished playback. This state will not be reached if repeat is enabled.
enabledType: Boolean (readonly)Whether the animation is currently enabled. If false, then the animation will not begin playback or trigger playback-related events.
durationType: Double ()Total duration of the animation in seconds.
delayType: Double ()Delay before playing the animation, in seconds.
endDelayType: Double ()Delay to hold the animation at the end before repeating from the beginning, in seconds.
timeScaleType: Double ()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.1
totalDurationType: Double (readonly)Total duration of the animation, which includes the delay, duration and endDelay values.
elapsedTimeType: Double (readonly)Total time that has elapsed since the animation began playing, in seconds.
positionType: Double (readonly)Current position of the playhead from 0 to 1 where 0 is the start of the animation and 1 is the end.
isAnimatingType: Boolean (readonly)Returns whether the animation is currently animating. Note that this value will be false when the animation is paused. If you want to test if the animation is currently active instead, use isActive.
isPausedType: Boolean (readonly)Returns whether the animation is currently paused.
isActiveType: Boolean (readonly)Returns whether the animation is currently active, meaning its state is either playing or paused.
startDateType: Date ()Start date of the animation. This value must be equal to or earlier than endDate.
endDateType: Date ()End date of the animation. This value must be equal to or later than startDate.
currentDateType: Date (readonly)Date calculated from the playhead's current position.
deltaTimeType: Double (readonly)Total milliseconds between the end and start dates.
containsPastType: Boolean (readonly)Returns whether the timeline contains time in the past.
containsFutureType: Boolean (readonly)Returns whether the timeline contains time in the future.
isPastType: Boolean (readonly)Returns true if the timeline only contains time in the past.
isFutureType: Boolean (readonly)Returns true if the timeline only contains time in the future.

Methods

The following methods are available on Timeline instances:

Controlling Playback

Managing the Time Range

Events

The following events are triggered by Timeline instances.

You can listen for events from your project:

controller.timeline.on(AnimationEvent.play){
    //Handle play event here.
}