Skip to content

KBE3D / KBCore / Cesium / createWorldTerrainAsync

函数: createWorldTerrainAsync()

createWorldTerrainAsync(options?: { requestVertexNormals?: boolean; requestWaterMask?: boolean; }): Promise<CesiumTerrainProvider>

Creates a CesiumTerrainProvider instance for the Cesium World Terrain

.

参数

options?

Object with the following properties:

requestVertexNormals?

boolean

Flag that indicates if the client should request additional lighting information from the server if available.

requestWaterMask?

boolean

Flag that indicates if the client should request per tile water masks from the server if available.

返回

Promise<CesiumTerrainProvider>

A promise that resolves to the created CesiumTerrainProvider

Examples

ts
// Create Cesium World Terrain with default settings
try {
  const viewer = new Cesium.Viewer("cesiumContainer", {
    terrainProvider: await Cesium.createWorldTerrainAsync();
  });
} catch (error) {
  console.log(error);
}
ts
// Create Cesium World Terrain with water and normals.
try {
  const viewer1 = new Cesium.Viewer("cesiumContainer", {
    terrainProvider: await Cesium.createWorldTerrainAsync({
      requestWaterMask: true,
      requestVertexNormals: true
    });
  });
} catch (error) {
  console.log(error);
}

KBE3D @3.0.0 Copyright © 2024-present KBE3D