Can I get the EntityCollection from a GeoJsonDatasource without using promise?

Hi

I want to get the entity of geojsondata but failed.

This is my code:

var mydata = new Cesium.GeoJsonDataSource(‘mydata’); //is this line right?

mydata.load(‘mydataUrl’);

var entities=mydata.entities.values;

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

{

//do something

}

Chris

Hello,

I don’t believe there is a way to load the data synchronously. It is loaded asynchronously so it doesn’t delay other parts of the application from working.

Have you seen this demo? http://localhost:8080/Apps/Sandcastle/index.html?src=GeoJSON%20and%20TopoJSON.html&label=DataSources

If you look at the third example, it shows you how to manipulate the entities after they are loaded.

Best,

Hannah