fromAssetId
suspend fun fromAssetId(assetId: Int, options: IonResource.Companion.FromAssetIdOptions? = definedExternally): IonResource(source)
Asynchronously creates an instance.
// Load a Cesium3DTileset with asset ID of 124624234
try {
const resource = await IonResource.fromAssetId(124624234);
const tileset = await Cesium3DTileset.fromUrl(resource);
scene.primitives.add(tileset);
} catch (error) {
console.error(`Error creating tileset: ${error}`);
}
Content copied to clipboard
//Load a CZML file with asset ID of 10890
IonResource.fromAssetId(10890)
.then(function (resource) {
viewer.dataSources.add(CzmlDataSource.load(resource));
});
Content copied to clipboard
Return
A Promise to am instance representing the Cesium ion Asset.
Parameters
assetId
The Cesium ion asset id.