fromUrl

suspend fun fromUrl(url: Resource, options: Cesium3DTileset.ConstructorOptions? = definedExternally): Cesium3DTileset(source)

Creates a 3D Tiles tileset, used for streaming massive heterogeneous 3D geospatial datasets.

try {
const tileset = await Cesium3DTileset.fromUrl(
"http://localhost:8002/tilesets/Seattle/tileset.json"
);
scene.primitives.add(tileset);
} catch (error) {
console.error(`Error creating tileset: ${error}`);
}
// Common setting for the skipLevelOfDetail optimization
const tileset = await Cesium3DTileset.fromUrl(
"http://localhost:8002/tilesets/Seattle/tileset.json", {
skipLevelOfDetail: true,
baseScreenSpaceError: 1024,
skipScreenSpaceErrorFactor: 16,
skipLevels: 1,
immediatelyLoadDesiredLevelOfDetail: false,
loadSiblings: false,
cullWithChildrenBounds: true
});
scene.primitives.add(tileset);
// Common settings for the dynamicScreenSpaceError optimization
const tileset = await Cesium3DTileset.fromUrl(
"http://localhost:8002/tilesets/Seattle/tileset.json", {
dynamicScreenSpaceError: true,
dynamicScreenSpaceErrorDensity: 2.0e-4,
dynamicScreenSpaceErrorFactor: 24.0,
dynamicScreenSpaceErrorHeightFalloff: 0.25
});
scene.primitives.add(tileset);

Parameters

url

The url to a tileset JSON file.

options

An object describing initialization options

See also


suspend fun fromUrl(url: String, options: Cesium3DTileset.ConstructorOptions? = definedExternally): Cesium3DTileset(source)