跳到主要内容

flywave-map-controls.cameraanimation

Home > @flywave/flywave-map-controls > CameraAnimation

CameraAnimation class

Abstract class used as base to define camera animations.

Signature:

export declare abstract class CameraAnimation 

Constructors

Constructor

Modifiers

Description

(constructor)(mapView, name)

Creates a new CameraAnimation object.

Properties

Property

Modifiers

Type

Description

duration

protected

number

Duration of a whole animation in milliseconds. Defaults to 10 seconds.

easing

protected

(amount: number) => number

Easing function that control acceleration. Defaults to [[EasingFunction.Linear]].

isRunning

readonly

boolean

Returns true if the animation is being played.

mapView

protected

MapView

name?

string

(Optional)

onFinished?

protected

() => void

(Optional) Callback that gets triggered once the animation ends.

repeat

protected

number

Number of times the animation should be repeated. Defaults to 0.

running

protected

boolean

True if animation is being played.

stopped

protected

boolean

True if the animation has been interrupted.

tween?

protected

TWEEN.Tween<GeoCoordinates | Record<string, number>>

(Optional) Tweening controller.

Methods

Method

Modifiers

Description

start(time, onFinished)

abstract

Start the animation.

stop()

abstract

update(time)

Update function is to be called before the next frame is rendered.