KML - access polygon

1. A concise explanation of the problem you’re experiencing.

After loading KML using KmlDataSource then looping round the entities there is no polygon. The name and id is accessible ok.

2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.

kmlOverlay1.load(‘test.kml’, options).then(function () {

var entities = kmlOverlay1.entities.values;

for (var i = 0; i < entities.length; i++)


var entity = entities[i];

console.log (i + " " +;

entity.polygon.material = Cesium.Color.WHITE;



3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

Change the color of the polygons.

4. The Cesium version you’re using, your operating system and browser.


Converting the kml file to geojson works, we need to support loading of kml files.

Are you saying the for loop causes the polygons to disappear? But they appear normally without it?

Do you get any console errors? Are you able to produce a Sandcastle example ( of this issue I can look at?