// Grant CesiumJS access to your ion assets
Cesium.Ion.defaultAccessToken = "...";
const viewer = new Cesium.Viewer("cesiumContainer");
try {
const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(4492904, {
//This tileset doesn't have a location, so we're using a modelMatrix to place it at 0, 0 instead of drawing at the center of the earth
modelMatrix: Cesium.Transforms.eastNorthUpToFixedFrame(
Cesium.Cartesian3.fromDegrees(0, 0),
),
});
viewer.scene.primitives.add(tileset);
await viewer.zoomTo(tileset);
// Apply the default style if it exists
const extras = tileset.asset.extras;
if (
Cesium.defined(extras) &&
Cesium.defined(extras.ion) &&
Cesium.defined(extras.ion.defaultStyle)
) {
tileset.style = new Cesium.Cesium3DTileStyle(extras.ion.defaultStyle);
}
} catch (error) {
console.log(error);
}
Hey @daLeiStrive,
Just a quick heads up, if that access token gives access to all your assets and/or that asset should not be publicly available, it is probably a good idea to edit your post and remove your access token from the post or even better remove that token from your ION account and create a new one.
Moving on to your issue, can you share a screen capture/video of this behaviour? I have put your code in sandcastle to test and I can’t see any undesired behaviour. What version of cesiumJS are you using? Potentially updating to latest if you’re not currently using it could help.
As a separate note: you should be able to appropriately geolocate your model within cesium ion by going to My Assets, selecting the asset and clicking “Adjust Tileset Location” on the right pane.
Let us know how you go!