is there any method or way to get the children entities by parent entity.
This is sample code:
var boxes = entities.add(new Cesium.Entity());
var spheres = entities.add(new Cesium.Entity());
for (var i = 0; i < 5; ++i) {
var height = 100000.0 + (200000.0 * i);
entities.add({
id:"boxes_" + i.toString(),
parent : boxes,
position : Cesium.Cartesian3.fromDegrees(-106.0, 45.0, height),
box : {
dimensions : new Cesium.Cartesian3(90000.0, 90000.0, 90000.0),
material : Cesium.Color.fromRandom({alpha : 1.0})
}
});
entities.add({
id:"spheres_"+i.toString(),
parent : spheres,
position : Cesium.Cartesian3.fromDegrees(-98.0, 45.0, height),
ellipsoid : {
radii : new Cesium.Cartesian3(67500.0, 67500.0, 67500.0),
material : Cesium.Color.fromRandom({alpha : 1.0})
}
});
}
so in above i am putting the boxes and spheres in seperate parent entity, than i loop through upto parent entity children length.
so, how i get the length and the children entity.
right now i am using this weird things i.e is private variables in cesium.
var entityName = spheres._children[0].id;
var sphereLength = spheres._children.length;
viewer.entities.getById(entityName);
so is there any way help me out.