try{
//添加S3M图层服务
var promise = scene.open(URL_CONFIG.SCENE_JINJIANG);
Cesium.when(promise,function(layers){
//设置相机视角(这里改如何改动)
scene.camera.setView({
destination : new Cesium.Cartesian3.fromDegrees(118.5486,24.8027,80),
orientation : {
heading : 5.295661577745349,
pitch : -0.18831704619320822,
roll : 0
}
});
},function(e){
if (widget._showRenderLoopErrors) {
var title = '渲染时发生错误,已停止渲染。';
widget.showErrorPanel(title, undefined, e);
}
}).then(function(){
//加载kml文件
viewer.dataSources.add(Cesium.KmlDataSource.load('./SampleData/kml/model.kml',{
camera : scene.camera,
canvas : scene.canvas
})).then(function(kmlDatasource){
var entity = kmlDatasource.entities.values[0];
if(entity.path){
entity.path.show = false;
}
});
});
}