3DTiles are colorized by kml datasource

Hi everyone,
I am working on a project where I have used cesiumjs. I can render 3dtiles from cesium ion in the cesium viewer easily. But If I render the kml file from cesium ion, the 3dtiles and osm buildings are colorized by kml color.

Before rendering kml file

After rendering kml file

I have used clampToGround:true for kml file. But still, the issue exists.
Is it possible to render kml file under 3dtiles and osm buildings?

Can anyone help me?

Thanks in advance.

Hi there,

clampToGround: true is the default for KML. Have you tried clampToGround: false?

Thanks for your response.
Yes, I have also tried clampToGround: false. But It did not solve the issue.
Still, the 3dtiles and osm buildings are colorized by kml.

Thanks for checking.

What you’re looking for is to set the Classification type to TERRAIN so you are not colorizing any 3D tilesets.

I don’t think I see a top level KML option to change this, but you can iterate through the data source entities and set the classification types:

const dataSource = await Cesium.KmlDataSource.load(/*... */);
for (const entity of dataSource.entities.values) {
    if (Cesium.defined(entity.polygon)) {
        entity.polygon.classificationType = Cesium.ClassificationType.TERRAIN;

    // Any other entity geometries...

Classification type to
TERRAIN solved the issue.

Thank you @Gabby_Getz for your help.