Hi,
I have a trouble when i try to add GeoJson data source to my map. I add clamp to ground because of terrain but unfortuanetly GeoJson stands on my 3dTiles too… Is there a way to keep it on just terrain?
I added an image to down:
Hi,
I have a trouble when i try to add GeoJson data source to my map. I add clamp to ground because of terrain but unfortuanetly GeoJson stands on my 3dTiles too… Is there a way to keep it on just terrain?
I added an image to down:
Hi @nihat_kandal,
you have to set the option classificationType
for every entity of your geojson to Cesium.ClassificationType.TERRAIN
.
Look at this code snippet:
Cesium.GeoJsonDataSource.clampToGround = true;
let promise = Cesium.GeoJsonDataSource.load({URL_OF_GEOJSON});
promise.then(function (dataSource) {
viewer.dataSources.add(dataSource);
const entities = dataSource.entities.values;
for (let i = 0; i < entities.length; i++) {
const entity = entities[i];
entity.{TYPE_OF_GEOMETRY}.classificationType = Cesium.ClassificationType.TERRAIN;
}
}).catch(function (error) {
window.alert(error);
});
Best, Lennart