Hi everyone,
I am loading some entities (points) through CZML. Once the loading is done, I am adding all of them iteratively in addToolBarMenu and attaching an onlick event with them. This part works good and I am able to see all the entities in a drop-down.
Now when I try to click/select any of them from the drop-down, associated onclick function is called which should make that entity as trackedEntity but it just disappears all the entities. Here is my code snippet:
var entities_selection = ;
var promise = Cesium.CzmlDataSource.load(‘entities.czml’);
promise.then(function(dataSource) {
viewer.dataSources.add(dataSource);
//Get the array of entities
var entities = dataSource.entities.values;
for (let i = 0; i < entities.length; i++) {
let entity = entities[i];
entities_selection.push({
text : 'Entity: ’ + entity.name,
onselect : function() {
viewer.trackedEntity = undefined;
viewer.trackedEntity = entity;
}
});
}
Sandcastle.addToolbarMenu(entities_selection);
});
Correct behavior is that on selection of any entity from the drop-down, system should make it as trackedEntity. However, it just disappears all the entities. They do exist invisibly i.e. selection indicator shows me the movement of point over time but they are not visible.
Any guess why I am getting this behavior?