通过加载用iDesktop客户端生成的fpf文件,web3D场景可以正常实现飞行效果。但通过js动态创建飞行站点的方式却不行,不知道是啥原因。大概的代码在下面,请你们帮我看看问题出在哪,或者给我一个可用的demo(要jquery版的,vue不会用...)
var myRoute = new Cesium.Route({routeName: 'stop1', isFlyLoop: true});
//手动添加多个站点位置,大概代码如下
var i = 1;
var camera = viewer.camera;
var stop = new Cesium.RouteStop({
point: camera._position,
heading: camera.heading,
tilt: camera.pitch,
speed: 8,
duration: 4,
distanceToNext: 36,
stopName: 'stop' + i++
});
myRoute.addStop(stop);
var routes = new Cesium.RouteCollection(viewer.entities);
routes.addRoute(myRoute);
var flyManager = new Cesium.FlyManager({
scene: viewer.scene,
routes: routes
});
flyManager.readyPromise.then(function () {
//死活进不来这个回调,在里面写alert语句也不执行
flyManager.play();
});