Getting error while reading entities from datasource

Hello Support,

Am getting an error while getting total entities in Geojson file.

My code is

var dataSource = Cesium.GeoJsonDataSource.load(‘data/electrical_ug_oh_ht_cable_geo.geojson’, {
‘stroke’: new Cesium.Color(1, 0, 0, 1.0),





When am printing the total enties in a datasource am getting below error. But I can see the geojson data on the globe.

“Unable to get property ‘values’ of undefined or null”.

Where is the mistake am doing in the above code?



Because GeoJsonDataSource is asynchronous, it returns a Promise that will resolve when the data is loaded. So you need to use .then before accessing any of the data.


  1. Your json is invalid
  2. Your data path is invalid.


Thank you scott. It is working now.

And I have one more question. Am loading geojson files dynamically. After loading all geojosn file am applying style for earch entity in the geojson datasource. Now my question is how to identify entity type like it is polyline entity or polygon entity?

Id there any way to indentity datasource is polygon or polyline type?