I want to access to some entities in my czml data source for keep tracking in the viewer but after the loading, as one of the options for camera. I know that I can access entities in my czml file while I am loading them, but I don't know how I can access to them after loading. Here I have an example:
var viewer = new Cesium.Viewer('cesiumContainer');
var czmlDataSource = new Cesium.CzmlDataSource();
viewer.dataSources.add(czmlDataSource);
czmlDataSource.load('../../SampleData/Vehicle.czml').then(function(){
var myEntity= czmlDataSource.entities.getById('Vehicle');
viewer.trackedEntity=myEntity;
});
This code works fine, but I want to give option to the viewer to choose the camera, then I need to have access to Vehicle after I finished loading, I tried several methods, but non of them works. I have some example bellow:
var viewer = new Cesium.Viewer('cesiumContainer');
var czmlDataSource = new Cesium.CzmlDataSource();
viewer.dataSources.add(czmlDataSource);
czmlDataSource.load('../../SampleData/Vehicle.czml');
var myEntity= czmlDataSource.entities.getById('Vehicle');
viewer.trackedEntity=myEntity;
Do you know how I can define an entity from those which are already in my czml file?