Skip to content

Instantly share code, notes, and snippets.

@KBuon
Created May 30, 2017 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KBuon/80315cc1a5a29b2a8fdf42dc08c368a4 to your computer and use it in GitHub Desktop.
Save KBuon/80315cc1a5a29b2a8fdf42dc08c368a4 to your computer and use it in GitHub Desktop.
var czml = [{
"id" : "document",
"name" : "CZML Model",
"version" : "1.0"
}, {
"id" : "aircraft model",
"name" : "Cesium Air",
"position" : {
"cartographicDegrees" : [-77, 37, 10000]
},
"model": {
"gltf" : "../../SampleData/models/CesiumAir/Cesium_Air.glb",
"scale" : 2.0,
"minimumPixelSize": 128
}
}];
var viewer = new Cesium.Viewer('cesiumContainer');
var dataSourcePromise = viewer.dataSources.add(Cesium.CzmlDataSource.load(czml));
dataSourcePromise.then(function(dataSource){
viewer.trackedEntity = dataSource.entities.getById('aircraft model');
}).otherwise(function(error){
window.alert(error);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment