If a rendered object is selected, the infobox displays its name. (as usual)
1) Executing the following command:
,to remove all objects (including the currently selected one), results in an error:
->"This object was destroyed, i.e., destroy() was called"
2) Closing the the infobox manually, and thus unselecting the current primitive seems to work.
3) Closing the infobox using this command doesn't seem to work:
How do I remove all primitives, including the currently selected one?
OK, if anyone wants to remove all primitives (including the one that might be selected by the user) without any errors, this is how you do it:
In general, you shouldn’t remove primitives you yourself haven’t created and your code will still cause problems in many situations. Since it looks like you are using entities, you are better off calling viewer.entities.removeAll() or view.dataSoures.removeAll() (if you are using data sources). This thread should have lots of details on the problem: https://groups.google.com/d/msg/cesium-dev/qEqVH1j9k_k/4HFodvLcztUJ There’s actually a bug in Cesium that I’ve been meaning to look into.