createWorldTerrain
suspend external fun createWorldTerrain(options: CreateWorldTerrainAsyncOptions? = definedExternally): CesiumTerrainProvider(source)
Creates a CesiumTerrainProvider instance for the Cesium World Terrain.
// Create Cesium World Terrain with default settings
try {
const viewer = new Viewer("cesiumContainer", {
terrainProvider: await createWorldTerrainAsync();
});
} catch (error) {
console.log(error);
}
Content copied to clipboard
// Create Cesium World Terrain with water and normals.
try {
const viewer1 = new Viewer("cesiumContainer", {
terrainProvider: await createWorldTerrainAsync({
requestWaterMask: true,
requestVertexNormals: true
});
});
} catch (error) {
console.log(error);
}
Content copied to clipboard
Return
A promise that resolves to the created CesiumTerrainProvider