What is the right way to handle webgl context lost?

Hello,

I work on win10, and i dont know the reason but sometimes cesium crash because webgl lost the context.

I think maybe it happend because chrome use a lot of GPU, maybe…

Of course i can write event listener like this:

canvas.addEventListener('webglcontextlost', (event) => {
        window.location.reload();
      });

But this solution will reload the entire web page.

What is the right way to handle it?

Thanks in advance.

By the way, my solution above not working. Because right after the web page reloaded cesium crash with the known error:

Error constructing CesiumWidget
visit get.webgl.org to verify that your web browser and harware support WebGL. Etc... 

Help! What to do?

hello

Did you manage to find any solution to this ?
I am having the same issue.

Hi there, I might suggest destroying the Cesium Viewer or Widget and re-creating on a context lost.

We do have on open issue on handle lost contexts a bit more gracefully if anyone has any additional suggestions or comments.

Thanks!