kmldatasource with terrain

Hello!
I am trying to use kml with terrain

I add terrain data and kml ,but when zooming to kml elements they begin to move and change their position

viewer.dataSources.add(Cesium.KmlDataSource.load(‘http:/http://localhost:8080/Test.kml’));

viewer.terrainProvider = new Cesium.CesiumTerrainProvider({

url : ‘//assets.agi.com/stk-terrain/world

});

I try this in Sandcastle and get same result

I add my simple kml

Thanks in advance,

Kate

Test (2).kml (3.28 KB)

Hi. I had the same problem and as Matthew Amato said “What you are probably seeing is a parallax effect due to altitude of the
data. Cesium doesn’t support the various KML altitudeModes completely yet, but we are hoping to remedy that before the end of the year.”
About the terrainProvider, I used this one to avoid this effect:
var cesiumTerrainProviderMeshes = new Cesium.CesiumTerrainProvider({
url: ‘//assets.agi.com/stk-terrain/world’,
requestWaterMask: true,
requestVertexNormals: true
});
I hope this will help you

Thank you
but is it really helps?

I try this in Sandcastle and get the same effect

var viewer = new Cesium.Viewer(‘cesiumContainer’);

Sandcastle.addToolbarMenu([{

text : ‘KML - Global Science Facilities’,

onselect : function() {

viewer.homeButton.viewModel.command();

viewer.dataSources.add(Cesium.KmlDataSource.load(’…/…/SampleData/kml/facilities/facilities.kml’));

}

}, {

text : ‘KMZ with embedded data - GDP per capita’,

onselect : function() {

viewer.homeButton.viewModel.command();

viewer.dataSources.add(Cesium.KmlDataSource.load(’…/…/SampleData/kml/gdpPerCapita2008.kmz’));

}

}, {

text : ‘gx KML extensions - Bike Ride’,

onselect : function() {

viewer.dataSources.add(Cesium.KmlDataSource.load(’…/…/SampleData/kml/bikeRide.kml’)).then(function(dataSource){

viewer.clock.shouldAnimate = false;

var rider = dataSource.entities.getById(‘tour’);

viewer.flyTo(rider).then(function(){

viewer.trackedEntity = rider;

viewer.selectedEntity = viewer.trackedEntity;

viewer.clock.multiplier = 30;

viewer.clock.shouldAnimate = true;

});

});

}

}], ‘toolbar’);

var cesiumTerrainProviderMeshes = new Cesium.CesiumTerrainProvider({

url: ‘//assets.agi.com/stk-terrain/world’,

requestWaterMask: true,

requestVertexNormals: true

});

viewer.scene.terrainProvider = cesiumTerrainProviderMeshes;

Sandcastle.reset = function() {

viewer.dataSources.removeAll();

viewer.clock.clockRange = Cesium.ClockRange.UNBOUNDED;

viewer.clock.clockStep = Cesium.ClockStep.SYSTEM_CLOCK;

};

There’s no good solution for you right now, this is being actively worked and will hopefully be fixed in the next few releases.