this.viewer.scene.primitives.removeAll() don't let the draw geometry again on the globe

Dear Team,

I’ve got a case while deleting all the geometries drawn on the globe for achieving that task I’m using given code:-
this.viewer.scene.primitives.removeAll();
It’s working fine. But problem is that after removing all geometries from the globe, the globe becomes inactive means I’m not able to draw any geometry like points, lines, ellipsoids, cubes, etc until I refresh it.
Kindly provide the appropriate solution ASAP.

-Shashi

@Shashi

I recommend only removing the primitives that you need to remove. In general, blindly removing all primitives from your scene can lead to unexpected issues. remove(primitive) is the best tool to use for this. Please read over our documentation for PrimitiveCollection

https://cesium.com/learn/cesiumjs/ref-doc/PrimitiveCollection.html

-Sam

1 Like

@sam.rothstein
Thanks, it’s working.
-Shashi

1 Like

@Shashi

Apologies for the delayed response - I was at GEOINT all of last week. I am happy to hear that my suggestion worked! Please reach out if you have any other questions. :grinning:

-Sam