Cannot add local 3D Tileset on CesiumJS 1.104

Hello,

I’m trying to add a local 3D tiles set and follow the docs.
It is loading the .json file with http status 304 and not loading the .b3dm and other files

My code:

async function load3DTiles() {
try {
const tileset = await Cesium.Cesium3DTileset.fromUrl(
‘Apps/SampleData/3DTileset/Aerometrex_Denver2020_20mm3D_Cesium/Cesium_20mm_MM_Sample.json’
);
viewer.scene.primitives.add(tileset);
console.log(“Loading initiated…”);
tileset.allTilesLoaded.addEventListener(function() {
console.log(‘All tiles are loaded’);
});
} catch (error) {
console.error(Error creating tileset: ${error});
}
}

However, the same tiles set is loading on Cesium JS version 1.92

The code for 1.92:

const add3DTilesSet = async () => {

const tileset = viewer.scene.primitives.add(
new Cesium.Cesium3DTileset({
url: “/3DTileset/Aerometrex_Denver2020_20mm3D_Cesium/Cesium_20mm_MM_Sample.json”,
})
);

(async () => {
try {
await tileset.readyPromise;
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);
}

})();
}

I’m not sure what I’m missing. The tiles set is valid it seems but it is not loading in the CesiumJS version 1.104. Any help is appreciated.

Thanks!

Hi there,

Hm, a 304 error sounds like there would be an issue with the server request rather than the CesiumJS code.

However, there was a fairly large re-architecture of 3D Tiles that was release in 1.97. Does the tileset work in 1.96, but not 1.97?

Hi Gabby,

The 304 is related to the caching at my end.
I tried again after clearing the cache and this time it is 200 but no b3dm files load after this call

Also, this time I tried downloading the new cesiumJS SDK 1.107.1
image

I’m not able to figure out why it is not loading the rest of the b3dm files after this.

Thanks

Would you be able to provide the .json file for testing?

Yes, here’s the link. This Denver sample was downloaded from Aeromatrix reference from the Cesium Ion.

Aeromatrix 3D Tileset

I should also let you know that the SDK 1.107.1 which I downloaded and started it on localhost:8080 gave me the inherent local Sandcastle which I opened and ran this code and this same tileset was rendered.

Now, when I use this in the CesiumViewer.js, it loads the .json only with 200 and loads nothing more.

Thanks

Can you clarify what you mean here? Are you extending Apps/CesiumViewer/CesiumViewer.js with code or something else?

Yes, I’ve been extending this file for the POC purpose. If that file has any limitation in terms of 3DTiles library references I can think of two things.

  1. Get the correct references in CesiumViewer.js for the 3D tiles to load the b3dm files from the sample, if at all this is the issue (which I’m feeling now).
  2. I can try another dev/build approach if you may advise.

Please suggest, thanks

Hello Gabby

I’ve been able to solve this.
I rebuild the App using the steps for building the CesiumJS based app available on your site.
Since it was a POC, I thought a quick thing would be to customize the CesiumViewer.js and move on.

The new app built, loads the .b3dm datasets after loading the initial .json tileset.
Whereas it is frustrating to load the same dataset in CesiumViewer.js since there is no error whatsoever and it doesn’t loads the .b3dm files after loading the .json tileset.

Thanks for your help.

Shadab