1.添加模型
this.$http.get("。。。。地址rest/realspace/datas.rjson").then(res=>{
for(var i=0;i<res.data.length;i++){
const url = "。。。。地址rest/realspace/datas/" + res.data[i].name + "/config";
Viewer.scene.addS3MTilesLayerByScp(url, {name: res.data[i].name});
}
});
2. fpf回放
try {
var routes = new Cesium.RouteCollection(Viewer.entities);
routes.fromFile("./*****.fpf");
this.flyManager = new Cesium.FlyManager({
scene: Viewer.scene,
routes: routes
});
this.flyManager.stopArrived.addEventListener(function (routeStop) {
routeStop.waitTime = 1;
});
this.flyManager.readyPromise.then(function () {
var currentRoute = this.flyManager.currentRoute;
currentRoute.isLineVisible = true;
currentRoute.isStopVisible = true;
var allStops = this.flyManager.getAllRouteStops();
console.log(allStops);
});
}catch (e){
console.log(e);
}
if (this.flyManager) {
setTimeout(function(){
console.log("开始运行");
this.flyManager.play();
},1000);
}