GeoRoveFlight

new Cesium.GeoRoveFlight(options)

相机漫游(本类已废弃,参见GeoRoveFly类
Name Type Description
options Object optional 参数选项:
Name Type Default Description
viewer Viewer optional 三维球
path Array optional 飞行路径的节点数组,每个节点包括坐标和方向,例如[{position: Cesium.Cartesian3.fromDegrees(114.39, 30.47, 272.46),direction: new Cesium.Cartesian3(-0.5483434682364607, -0.8139196091849253, 0.19197476559868001),up: new Cesium.Cartesian3(-0.5835248610655802, 0.5368464509435076, 0.6093394986604392)},...]
duration Number (path.length-1)/0.2 optional 飞行时间,单位秒
interpolationDegree Number 2 optional 埃尔米特多项式插值函数的插值次幂。值越大,则插值后的路线越平滑,相应地飞行时会有更少的卡顿感,但同时也会更偏离预定路线。
loop Boolean false optional 是否循环飞行
pathShown Boolean false optional 是否显示飞行路径
pointShown Boolean false optional 是否显示节点
Author:
  • liuhonglei
Example:
var path = [{
     position: Cesium.Cartesian3.fromDegrees(114.39222804286993, 30.473932433076616, 272.4612584594381),
     direction: new Cesium.Cartesian3(-0.5483434682364607, -0.8139196091849253, 0.19197476559868001),
     up: new Cesium.Cartesian3(-0.5835248610655802, 0.5368464509435076, 0.6093394986604392)         
},{
     position: Cesium.Cartesian3.fromDegrees(114.40375798698935, 30.47301102760486, 270.00649404640154),
     direction: new Cesium.Cartesian3(0.4571462230521806, -0.5982630086882772, 0.6581023500827029),
     up: new Cesium.Cartesian3(-0.2296189857290432, 0.6354704873344242, 0.7371922280651871)
},{
     position: Cesium.Cartesian3.fromDegrees(114.40684118514893, 30.483968044045348, 330.3477190403835),
     direction: new Cesium.Cartesian3(0.6588258673871792, 0.22416615131004097, -0.7181211687928264),
     up: new Cesium.Cartesian3(-0.08728486152030862, 0.970903746585025, 0.22299611614676693)
},{
     position: Cesium.Cartesian3.fromDegrees(114.39791932341643, 30.47757410924091, 410.7639149310394),
     direction: new Cesium.Cartesian3(0.5842945401159882, -0.5042076544048352, -0.6359044988284169),
     up: new Cesium.Cartesian3(0.48718089751039184, 0.8446017459897573, -0.2220420315436304)
}];
var geoRoveFlight = new Cesium.GeoRoveFlight({
     viewer: viewer,
     path: path,
     duration: 15,
     interpolationDegree: 3,
     pathShown: false,
     pointShown: false
});
// 开始飞行
geoRoveFlight.play();
// 暂停飞行
geoRoveFlight.pause();
// 继续飞行
geoRoveFlight.continue();
// 重新飞行
geoRoveFlight.replay();
// 飞行结束事件
geoRoveFlight.onFlyCompleted.addEventListener(function(e) {
     console.log(e);
});