Tracks Disappear as you zoom in using KML and CZML 3D cesium createWorldTerrain

I have been having problems with displaying KML files in Cesium ION using. createWorldTerrain… Placemark on the display . The Placemarks disappear as you zoom in and even when you are not zoomed in some of the placemarks disappear… parts etc… not all do however.

If you use regular 2D not using createWorldTerrain there is no problem.

Below is an example from Cesium sandcastle… You can try it for yourself.

Not rendering correctly with the World Terrain using .kml placement files.

var viewer = new Cesium.Viewer(“cesiumContainer”,
{terrainProvider : Cesium.createWorldTerrain(),

                           });

var options = {
camera: viewer.scene.camera,
canvas: viewer.scene.canvas,
};

Sandcastle.addToolbarMenu(
[
{
text: “KML - Global Science Facilities”,
onselect: function () {
viewer.camera.flyHome(0);
viewer.dataSources.add(
Cesium.KmlDataSource.load(
“…/SampleData/kml/facilities/facilities.kml”,
options
)
);
},
},
{
text: “KMZ with embedded data - GDP per capita”,
onselect: function () {
viewer.camera.flyHome(0);
viewer.dataSources.add(
Cesium.KmlDataSource.load(
“…/SampleData/kml/gdpPerCapita2008.kmz”,
options
)
);
},
},
{
text: “gx KML extensions - Bike Ride”,
onselect: function () {
viewer.dataSources
.add(
Cesium.KmlDataSource.load(
“…/SampleData/kml/bikeRide.kml”,
options
)
)
.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”
);

Sandcastle.reset = function () {
viewer.dataSources.removeAll();
viewer.clock.clockRange = Cesium.ClockRange.UNBOUNDED;
viewer.clock.clockStep = Cesium.ClockStep.SYSTEM_CLOCK;
};

Not only related to KML… but CZML Too

var viewer = new Cesium.Viewer(“cesiumContainer”,
{terrainProvider : Cesium.createWorldTerrain()});

Sandcastle.addDefaultToolbarButton(“Satellites”, function () {
viewer.dataSources.add(
Cesium.CzmlDataSource.load("…/SampleData/simple.czml")
);

viewer.camera.flyHome(0);
});

Sandcastle.addToolbarButton(“Vehicle”, function () {
viewer.dataSources.add(
Cesium.CzmlDataSource.load("…/SampleData/Vehicle.czml")
);

viewer.scene.camera.setView({
destination: Cesium.Cartesian3.fromDegrees(-116.52, 35.02, 95000),
orientation: {
heading: 6,
},
});
});

Sandcastle.reset = function () {
viewer.dataSources.removeAll();
};

Has anyone in the Cesium Development taken a look at this 3D issue with CZML and KML tracks ?

Here is the example

image

Here is the viewer change

var viewer = new Cesium.Viewer(“cesiumContainer”, {

shouldAnimate: true,

terrainProvider : Cesium.createWorldTerrain()

});

Zoom all the way in and out …

Hello,

Thanks for providing a Sandcastle. I took a look at it, but I’m having trouble reproducing the problem. Are you talking about the satellite paths, or is it the elements around Pennsylvania that are disappearing? Can you please tell me which web browser you are using?

Thanks,
Matt

Hi

Chrome,

Look at the icon in PA and the Lines around PA as you zoom In. I will send you another example in a second too.

Thanks,

This sandcastle as you zoom in many icons disappear.

Hi Matt,

I am assuming you were able to duplicate the issue ?

Thanks

Carlo

Hi Carlo,

Yes, I see it now. The KML labels are being partially occluded by the terrain, as you observed. A way to resolve this is to disable depthTestAgainstTerrain:

viewer.scene.globe.depthTestAgainstTerrain = false;

You can see that in this Sandcastle.

There is some additional discussion in this forum post and in this GitHub issue, if you are interested.

Thanks,
Matt

Hi Matt,

This works… Thanks …