How to stop Cesium

Hey,

Do you know how can I stop Cesium programatically? Sometimes, there are errors in my JavaScript code that subsequently crash Cesium. However, sometimes Cesium keeps running. When there is an exception in my code but cesium keeps running, I noticed serious overheating and battery drain. I would like to catch errors and stop rendering / prevent Cesium from running on such occasions. What would be the best way to do that?

Many Thanks, Jakub

Hi Jakub,

Are you using the Viewer? Viewer.destroy() might be what you are looking for: https://cesiumjs.org/Cesium/Build/Documentation/Viewer.html#destroy

Thanks,
Gabby

Yeah destroy() does the job, thanks a lot for thre hint