Cesium Ion - Code snippet for terrain

Hi, I migrated my code to the latest CesiumJS version (1.109). I noticed that setting a custom terrain model leads to an error message when using the code snippet from Cesium Ion:


TypeError: Cannot read properties of undefined (reading ‘addEventListener’)

This works:

viewer.scene.setTerrain(new Cesium.Terrain(Cesium.CesiumTerrainProvider.fromIonAssetId(id)));

Can you confirm this?

Thanks for bringing this issue to Cesium’s attention sraimund. I can confirm this is a bug in the code snippet displayed. The Cesium ion team is working to correct this issue.

This issue has been fixed. Thanks again for reporting it.