Fork me on GitHub
Show:

AnimationInterface

Summary

Creates a new Animation that will use a Layer Strategy for specific implementation support.

Constructor

aeris.maps.animations.AnimationInterface

Syntax

aeris.maps.animations.AnimationInterface

()

Summary

Methods

getCurrentTime

Syntax

getCurrentTime

() ?Date

Summary

Returns:

?Date:

Current time of the animation. Returns null if the animation has not yet initialized.

getFrom

Syntax

getFrom

() Date

Summary

Returns:

Date:

getTo

Syntax

getTo

() Date

Summary

Returns:

Date:

goToTime

Syntax

goToTime

(
  • time
)

Summary

Go to a specific time in the animation.

Parameters:

  • time Number

    The time to go to (timestamp)

hasMap

Syntax

hasMap

() Boolean

Summary

Is the animated object set to a map?

Returns:

isAnimating

Syntax

isAnimating

() Boolean

Summary

Returns:

next

Syntax

next

() Undefined

Summary

Go to the next step in the animation.

Returns:

pause

Syntax

pause

() Undefined

Summary

Pause the animation.

Returns:

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:

setTo

Syntax

setTo

(
  • to
)

Summary

Parameters:

start

Syntax

start

() Undefined

Summary

Start the animation.

Returns:

stop

Syntax

stop

() Undefined

Summary

Stop the animation.

Returns:

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.