相机动画

指定每个节点的到达时刻
const animation = new CameraAnimation({
viewer,
path: new CameraAnimationPath([
{
pos: {
'lng': 113.52890566794646,
'lat': 22.802434358398788,
'height': 199.99999999928067,
'heading': 360,
'pitch': -90,
'roll': 0,
},
time: new Date(),
},
{
pos: {
'lng': 113.52890566794646,
'lat': 22.802444358398788,
'height': 199.99999999928067,
'heading': 360,
'pitch': -20,
'roll': 0,
},
time: new Date(new Date().getTime() + 10000),
isKeyNode: true,
},
{
pos: {
'lng': 113.52890566794646,
'lat': 22.802445358398788,
'height': 199.99999999928067,
'heading': 190,
'pitch': -20,
'roll': 0,
},
time: new Date(new Date().getTime() + 20000),
},
]),
onEnd: (a) => {
console.log('end', a);
},
onReachNode: (a) => {
console.log('onReachNode', a);
},
});
// 启动
animation.start();

// 暂停
// const pauseTime = animation.pause()
// 继续
// animation.resume(pauseTime)
// 停止
// animation.stop()
按照指定的速度和角速度自动生成每个节点的到达时刻
const animation = new CameraAnimation({
viewer,
path: new CameraAnimationPath([
{
'lng': 113.52890566794646,
'lat': 22.802434358398788,
'height': 199.99999999928067,
'heading': 360,
'pitch': -90,
'roll': 0,
},{
'lng': 113.52890566794646,
'lat': 22.802444358398788,
'height': 199.99999999928067,
'heading': 360,
'pitch': -20,
'roll': 0,
}, {
'lng': 113.52890566794646,
'lat': 22.802445358398788,
'height': 199.99999999928067,
'heading': 190,
'pitch': -20,
'roll': 0,
}
], 20, 10),
onEnd: (a) => {
console.log('end', a);
},
onReachNode: (a) => {
console.log('onReachNode', a);
},
});
// 启动
animation.start();

// 暂停
// const pauseTime = animation.pause()
// 继续
// animation.resume(pauseTime)
// 停止
// animation.stop()

Constructors

Properties

Methods

Constructors

Properties

runningAnimation?: CameraAnimation

当前运行中的动画

status: CameraAnimationStatus = CameraAnimationStatus.stop

动画的状态

Methods

  • 暂停动画,返回值可用来下次start的时候从停止的位置开始

    Returns undefined | JulianDate

    停止时动画运行到的时刻,可传入start的time字段用于从中途继续动画

  • 从传入的时刻开始恢复动画

    Parameters

    • time: JulianDate

      恢复的时刻

    Returns void

  • 相机开始沿着动画轨迹移动,通过time可以控制启动时的位置

    Parameters

    • Optionaltime: JulianDate

      //开始动画的时刻位置

    Returns void

    
    
  • 停止动画,返回值可用来下次start的时候从停止的位置开始

    Returns undefined | JulianDate

    停止时动画运行到的时刻,可传入start的time字段用于从中途继续动画