相机动画
指定每个节点的到达时刻 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() Copy
指定每个节点的到达时刻 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() Copy
按照指定的速度和角速度自动生成每个节点的到达时刻 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()
Static
Optional
当前运行中的动画
动画的状态
暂停动画,返回值可用来下次start的时候从停止的位置开始
停止时动画运行到的时刻,可传入start的time字段用于从中途继续动画
从传入的时刻开始恢复动画
恢复的时刻
相机开始沿着动画轨迹移动,通过time可以控制启动时的位置
//开始动画的时刻位置
Copy
停止动画,返回值可用来下次start的时候从停止的位置开始
相机动画
Example
Example