http://ask.supermap.com/45167您参考一下这个示例,我把demo发到您邮箱
谢谢你 demo已经收到 但是还有个问题初始化的routes必须是从fpf文件获取的吗 我下面的代码飞行路线还是不能就绪 麻烦你看看
function createRoute(){ var points = [ { x: -2171344.723338279, y: 4377959.80232244, z: 4098721.336955562, altitude: 12.1466047512367, duration: 11.623106459071682, heading: 6.260995919619558, index:0 }, {x: -2171169.8676460185, y: 4377629.486154237, z: 4099166.3742857995, altitude: 11.9067202266306, duration: 2.33481700746625, heading: 1.5032975505359112, index: 1 },{ x: -2171270.9222274018, y: 4377571.519001535, z: 4099173.8714142498, duration:27.964990729795865, altitude: 11.3402135549113, duration: 27.964990729795865, heading: 6.23512687249191, index: 2 }, { x: -2170826.2708207886, y: 4376790.892322471, z: 4100245.3231774312, duration:10.117379370970378, altitude: 12.9608774511144, duration: 10.117379370970378, heading: 4.708079892084067, index: 3 },{ x: -2170373.4830572223, y: 4377016.453704289, z: 4100242.370629808, duration:11.157674687612483, altitude: 11.7588377837092, duration: 11.157674687612483, heading: 3.205987951731911, index: 4 },{ altitude: 16.9397405888885, duration: 10, heading: 0.038466827467274554, index: 5, x: -2172484.643769956, y: 4376066.739786139, z: 4100146.0999029814 } ] var routes = new Cesium.RouteCollection(); var route = new Cesium.Route({ isStopVisible:true, isFlyLoop:false, isLineVisible:true, routeName:"测试点1", speed:50, isAlongline:true, totalDuration:100, tiltfree:false }); for(var k = 0; k < points.length ;k++){ var position = Cesium.Cartesian3.fromDegrees(points[k].x, points[k].y, points[k].z); var name = "测试站" + k; var routeStop = new Cesium.RouteStop({ point:position, heading:scene.camera.heading, tilt:0, stopName:name, speed:50, waitTime: 0, index:points[k].index, duration: points[k].duration, altitude:points[k].altitude }) route.addStop(routeStop); } routes.addRoute(route); var flyManager = new Cesium.FlyManager({ scene: scene, routes: routes }); Cesium.when(flyManager.readyPromise, function() { var allStops = flyManager.getAllRouteStops(); }); }