AbstractAnimation
Summary
A partially implemented AnimationInterface.
Constructor
aeris.maps.animations.AbstractAnimation
Syntax
aeris.maps.animations.AbstractAnimation
-
opt_options
Summary
Parameters:
-
opt_options
Object
Item Index
Methods
Properties
Methods
getTo
Syntax
getTo
()
Summary
goToTime
Syntax
goToTime
-
time
Summary
Sets the current time to the specified time.
Classes extending {aeris.maps.animations.AbstractAnimation} should probably do something more useful here.
Parameters:
-
time
Date
keepCurrentTimeInBounds_
Syntax
keepCurrentTimeInBounds_
()
private
Summary
Makes sure that the current time is always within
the from
and to
bounds of the animation.
normalizeTimeBounds_
Syntax
normalizeTimeBounds_
()
private
Summary
pause
Syntax
pause
()
Summary
Stop animation the layer, and stay at the current frame.
preload
Syntax
Summary
Begin preloading assets required to run the animation.
Returns:
Resolves when preloading is complete.
previous
Syntax
Summary
Go to the previous step in the animation.
Returns:
setSpeed
Syntax
setSpeed
-
speed
Summary
Set the animation speed.
Every second, [timestep] * [speed] milliseconds of tiles are animated.
So with a timestep of 360,000 (6 minutes), and a speed of 2: every second, 12 minutes of tiles will be animated.
Setting a negative speed will cause the animation to run in reverse.
Also see {aeris.maps.animations.AbstractAnimation}#setTimestamp
Parameters:
-
speed
Number
setTimestep
Syntax
setTimestep
-
timestep
Summary
Sets the animation timestep.
See {aeris.maps.animations.AbstractAnimation}#setSpeed for more information on how to use setTimestep and setSpeed to affect your animation speed.
Parameters:
-
timestep
NumberTimestep, in milliseconds.
start
Syntax
start
()
Summary
Start animating the layer.
Every second, the layer is animated up by timestep * speed milliseconds.
stop
Syntax
stop
()
Summary
Stop animating the layer, and return to the most recent frame
Properties
animationClock_
Syntax
Summary
A reference to the timer created by window.setInterval
currentTime_
Syntax
currentTime_
Number Timestamp
private
Summary
The time of the current animation frame.
endDelay_
Syntax
endDelay_
number Milliseconds.
private
Summary
Time to wait before repeating animation loop.
speed_
Syntax
Summary
Number of minutes of weather data to display within a second.
Events
change:time
Syntax
change:time
Summary
When current time of the animation changes.
Event Payload:
-
time
Date
load:complete
Syntax
load:complete
Summary
Fires when all animation tile frames are loaded.
Waiting to start an animation until this event is triggered will ensure smooth animations.
If an animation is started before all tile frames are loaded, tiles which are not yet loaded will not render until they are loaded.
load:progress
Syntax
load:progress
Summary
Fires to indicate progress in preloading tiles.
Useful for rendering loading UI to the user, or if you want to buffer an animation to a certain % done.
Event Payload:
-
Percent
Numbercomplete (where 1.0 is 100%).
load:times
Syntax
load:times
Summary
Fires when tile times are loaded for this animation.
Event Payload:
-
A
Array.list of timestamps. for which animation frames will be created.