Displaying a variety of buildings from multiple tilesets

Hello everyone,

I’m using CesiumJS to display tilesets I converted from CityGML data. I’m adding new data with the following command:

var tileset = new Cesium.Cesium3DTileset({
        url: "http://localhost:3000/.../tileset.json",
        dynamicScreenSpaceError: true,  
    });

However, I need to display a variety of buildings on which I only have single tile files. Is there an option to display more than one tileset at the same time?

Hi @felix_r

Is there an option to display more than one tileset at the same time?

Yes, you can add several Cesium3DTileset objects to the scene, like so:

// Create and add first tileset.
var tileset1 = new Cesium.Cesium3DTileset({
    url: "http://localhost:3000/.../tileset.json",
    dynamicScreenSpaceError: true,  
});
scene.primitives.add(tileset1);

// Create and add second tileset.
var tileset1 = new Cesium.Cesium3DTileset({
    url: "http://localhost:3001/.../tileset.json",
    dynamicScreenSpaceError: true,  
});
scene.primitives.add(tileset2);

I need to display a variety of buildings on which I only have single tile files.

Ideally, all these tiles would be merged into a single tileset.json (if they’re meant to be displayed together and are generated from a single source), but that is something you would have to do outside of CesiumJS. In the meantime, you can just add all the tilesets to the scene individually, as shown above.

Hope this helps,
Sam.