setTerrain
Update the terrain providing surface geometry for the globe.
// Use Cesium World Terrain
scene.setTerrain(Terrain.fromWorldTerrain());
Content copied to clipboard
// Use a custom terrain provider
const terrain = new Terrain(CesiumTerrainProvider.fromUrl("https://myTestTerrain.com"));
scene.setTerrain(terrain);
terrain.errorEvent.addEventListener(error => {
alert(`Encountered an error while creating terrain! ${error}`);
});
Content copied to clipboard
Return
terrain The terrain provider async helper
Parameters
terrain
The terrain provider async helper