Description:
I’m developing an application that allows users to toggle between different terrain providers (e.g., createWorldTerrain
and EllipsoidTerrainProvider
). During the development process, I encountered an issue when switching the terrain provider after loading and unloading a KML file. The following sequence of actions leads to the error:
- Initialize the viewer with
createWorldTerrain
as the terrain provider. - Load a KML file into the viewer.
- Unload the KML file from the viewer.
- Change the terrain provider to
EllipsoidTerrainProvider
.
After performing these steps, the following error appears in the console:
cesium.js?v=c3a5bb9c:108503 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '_scene')
at Billboard._updateClamping (cesium.js?v=c3a5bb9c:108503:28)
at Billboard._updateClamping (cesium.js?v=c3a5bb9c:108499:13)
at Proxy.<anonymous> (cesium.js?v=c3a5bb9c:109376:27)
at Event.raiseEvent (cesium.js?v=c3a5bb9c:17660:20)
at Proxy.set (cesium.js?v=c3a5bb9c:192343:38)
at Reflect.set (<anonymous>)
at MutableReactiveHandler.set (vue.js?v=c3a5bb9c:1224:28)
at Proxy.set (cesium.js?v=c3a5bb9c:219440:36)
at Reflect.set (<anonymous>)
at MutableReactiveHandler.set (vue.js?v=c3a5bb9c:1224:28)
Additional Information:
- This error occurs consistently when following the steps above.
- The issue does not appear when testing similar code in Cesium Sandcastle, indicating that it might be specific to my local environment or setup.
You can view the code samples in the links below:
-
Sandbox Version: Cesium Sandcastle Demo
-
GitHub Repository: GitHub Repo
Request for Help::
If anyone has encountered a similar issue or has insights into what might be causing this behavior, I would greatly appreciate your assistance. It seems to be related to switching terrain providers after loading and unloading KML files, and I haven’t been able to replicate it in Cesium Sandcastle, so it may be specific to my setup. Any advice or suggestions would be really helpful. Thank you!