Hiding/Showing CesiumWidget

Hi gurus,

Using \("\#cesiumContainer"\)\.hide\(\) hides the widget without issues\. Using ("#cesiumContainer").show() redraws everything except the globe.

Is there a workaround for getting the globe redrawn after it's been hidden?

Thank you in advance for any feedback.

I ended up including the Cesium.jsp (which contains the CesiumWidget), in an iFrame.
Hiding and showing the iFrame doesn't adversely affect the CesiumWidget.

Would be interested to know if there is a more elegant solution to this.

Reason for my need to hide/show the widget is the fact that the widget is contained within a tab using the dojo framework.
On dojo, when a user selects between abs, the contents of the previous tab is hidden.

The iFrame was too much of a baboonTune to my liking.

I descovered that you have to do the following:
1) set viewer.useDefaultRenderLoop = false
2) \("\#cesiumContainer"\)\.hide\(\) 3\) ("#cesiumContainer").show()
4) viewer.useDefaultRenderLoop = true

This will hide and show the widget witout any issues.

Glad you figured this out. I was going to highly recommend against using an iFrame unless you really had to. The only use case I’ve run into where an iFrame solution was necessary is when using Cesium in a packaged Chrome App. Which using the WebView (aka iframe) was the only way to access external imagery providers.

This sounds like a manifestation of issue #2662, which will be fixed in Cesium 1.9 by pull #2668.