[ { "id":"document", "name":"test_document", "version":"1.0" }, { "id":"1", "name":"Entity-1", "description":"some info", "point":{ "color":{ "rgbaf":[ 1,0,1,1 ] }, "outlineColor":{ "rgbaf":[ 0,0,0,1 ] }, "outlineWidth":2, "pixelSize":4, "show":true }, "path":{ "width":1, "trailTime":7969, "leadTime":0, "show":false }, "position":{ "referenceFrame":"INERTIAL", "epoch":"2016-06-30T00:00:00Z", "cartesian":[ thousands of positions.... ] } },
{
// for entity 2
},
{
// for entity 50
}
]
var promise = new Cesium.CzmlDataSource.load('data.czml');
var _dataSource;
promise.then(function(dataSource) {
_dataSource = dataSource;
viewer.dataSources.add(dataSource);
//Get the array of entities
var entities = _dataSource.entities.values;
for (let i = 0; i < entities.length; i++) {
let entity = entities[i];
entity.point.pixelSize = new Cesium.CallbackProperty(function(time,result){
updatePointSize(entity.name, function(size){
sizes[entity.name] = size;
});
return sizes[entity.name];
}, false);
}
});