setTerrain

Update the terrain providing surface geometry for the globe.

// Use Cesium World Terrain
scene.setTerrain(Terrain.fromWorldTerrain());
// 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}`);
});

Return

terrain The terrain provider async helper

Parameters

terrain

The terrain provider async helper

See also