Hello all,
I have been trying to find the solution for this problem for a long time, and I have searched for hours on the forum but could not find a neat and effective solution.
– I have a group of points and large number of polylines (thousands) and I want to remove them but not any other entities created such as spheres, ellipsoids or whatever.
– I tried to create parent entity, but when I remove the parent, children are not removed
eg.
viewer.entities.add({
parent : pts,
position : cartesian, //defined variable
point : {
pixelSize : 15,
color : Cesium.Color.RED
}
});
viewer.entities.add({
position : Cesium.Cartesian3.fromDegrees(-102.0, 45.0, 500000.0),
ellipsoid : {
radii : new Cesium.Cartesian3(45000.0, 45000.0, 90000.0),
material : Cesium.Color.fromRandom({alpha : 1.0})
}
});
var pts = viewer.entities.add(new Cesium.Entity());
viewer.entities.remove(pts);
``
This does not remove anything from the scene.
whereas,
var pts = viewer.entities.add(new Cesium.Entity());
viewer.entities.add({
parent : pts,
position : cartesian,
point : {
pixelSize : 15,
color : Cesium.Color.RED
}
});
viewer.entities.add({
position : Cesium.Cartesian3.fromDegrees(-102.0, 45.0, 500000.0),
ellipsoid : {
radii : new Cesium.Cartesian3(45000.0, 45000.0, 90000.0),
material : Cesium.Color.fromRandom({alpha : 1.0})
}
});
viewer.entites.removeAll();
This removes all the entities including the ellipsoid.
– Also, the documentation is also not very helpful.
So, if anyone could put this question to rest once and for all, it will be great.
Thanks,
Parthesh.