The sample code below loads a KML polygon with altitude mode set to relativeToGround. The polygon renders properly without terrain, however with a terrain provider specified, the polygon appears as if drawn beneath the surface. I see similar behavior with altitude mode set to absolute. clampToGround (the default mode) works correctly.
Does Cesium support altitude modes with terrain? If not, are there any workarounds aside from perhaps sampling the terrain and updating all the polygon coordinates?
Thanks!
--Norm
var viewer = new Cesium.Viewer('cesiumContainer');
var cesiumTerrainProviderMeshes = new Cesium.CesiumTerrainProvider({
url : ‘https://assets.agi.com/stk-terrain/world’,
requestWaterMask : true,
requestVertexNormals : true
});
viewer.terrainProvider = cesiumTerrainProviderMeshes;
var options = {
camera : viewer.scene.camera,
canvas : viewer.scene.canvas
};
var kmlFile = "https://googlemaps.github.io/kml-samples/morekml/Polygons/Polygons.Relative.kml";
var kmlLoadPromise = Cesium.KmlDataSource.load(kmlFile, options);
Cesium.when(kmlLoadPromise, function(dataSource) {
viewer.dataSources.add(dataSource);
viewer.flyTo(dataSource);
});