I tried two different ways to create tileset.
const assetId = 8564
let tileset: Cesium3DTileset
//------ code 1 -------
tileset = new Cesium3DTileset({
url: IonResource.fromAssetId(assetId )
})
//------ code 2 -------
const ionResource = IonResource.fromAssetId(modelData.assetId)
ionResource.then(
(resource) => {
tileset = new Cesium3DTileset({
url: resource.url
})
}
)
code 1
: Successfully loaded and displayed
code 2
: Failed to load, got 401 or 404
Why?