Fork me on GitHub
Show:

AbstractAnimation

Summary

A partially implemented AnimationInterface.

Constructor

aeris.maps.animations.AbstractAnimation

Syntax

aeris.maps.animations.AbstractAnimation

(
  • opt_options
)

Summary

Parameters:

  • opt_options Object
    • from Date

      Starting time for the animation.

    • to Date

      Ending time for the animation.

    • limit Number=

      Maximimum number of time intervals to load.

    • timestep Number
    • speed Number

      Number of minutes of weather data to display within a second.

    • endDelay Number

      Milliseconds to pause between animation loops.

Methods

getCurrentTime

Syntax

getCurrentTime

() ?Date

Summary

Returns:

?Date:

getFrom

Syntax

getFrom

() Date

Summary

Returns:

Date:

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:

hasMap

Syntax

hasMap

() Boolean

Summary

Is the animated object set to a map?

Returns:

isAnimating

Syntax

isAnimating

() Boolean

Summary

Returns:

Boolean:

True, if the animation is currently running.

keepCurrentTimeInBounds_

Syntax

keepCurrentTimeInBounds_

() private

Summary

Makes sure that the current time is always within the from and to bounds of the animation.

next

Syntax

next

() Undefined

Summary

Go to the next step in the animation.

Returns:

normalizeTimeBounds_

Syntax

normalizeTimeBounds_

() private

Summary

pause

Syntax

pause

()

Summary

Stop animation the layer, and stay at the current frame.

preload

Syntax

preload

() Promise

Summary

Begin preloading assets required to run the animation.

Returns:

Promise:

Resolves when preloading is complete.

previous

Syntax

previous

() Undefined

Summary

Go to the previous step in the animation.

Returns:

setFrom

Syntax

setFrom

(
  • from
)

Summary

Parameters:

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:

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 Number

    Timestep, in milliseconds.

setTo

Syntax

setTo

(
  • to
)

Summary

Parameters:

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

animationClock_

Number private

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.

from_

Syntax

from_

Date protected

Summary

Animation start time.

limit_

Syntax

limit_

Number protected

Summary

Max number of time "frames" to load and render.

speed_

Syntax

speed_

Number private

Summary

Number of minutes of weather data to display within a second.

timestep_

Syntax

timestep_

Number private

Summary

Milliseconds between animation frames.

to_

Syntax

to_

Date protected

Summary

Animation end time.

Default: Current time.

Events

change:from

Syntax

change:from

Summary

Event Payload:

change:time

Syntax

change:time

Summary

When current time of the animation changes.

Event Payload:

change:to

Syntax

change:to

Summary

Event Payload:

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:error

Syntax

load:error

Summary

Event Payload:

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 Number

    complete (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.