How to extend CZML with custom properties.

I figures out to extend the Czml writer library to extend czml with a custom property like this:

{
“id”:“Vehicle”,
“availability”:“2015-08-13T14:57:56Z/2015-08-13T15:48:45Z”,
“feed”:[
{
“interval”:“2015-08-13T14:56:49Z/2015-08-13T15:00:32Z”,
“name”:“VDO_0037.avi”
},
{
“interval”:“2015-08-13T15:00:32Z/2015-08-13T15:04:23Z”,
“name”:“VDO_0038.avi”
}, …
],
//rest of path,position properties ect.
}

``

In javascript I can load the czml like this:

        var czmlDataSource = new Cesium.CzmlDataSource();
        czmlDataSource.load(czml, 'Built-in CZML');
        console.log(czmlDataSource);
        var vehicle = czmlDataSource.entities.getById("Vehicle");

``

I tried he following:

        console.log(vehicle);
        console.log(vehicle["feed"]);
        console.log(vehicle.propertyNames);

``

but do not seem to be able to find my custom data.

I also found var feeds = new Cesium.TimeIntervalCollectionProperty(); and can add the interval properties myself, but then I would need to parse the czml again, so I am wondering if there are extension points to make the czmldatasource accept my custom data field.

I belive i have found the answer by https://cesiumjs.org/Cesium/Build/Documentation/CzmlDataSource.html?classFilter=czml and the property updaters. Will take a look into those atleast.

I figured out the solution for me:

Cesium.CzmlDataSource.updaters.push((entity, packet, entityCollection, sourceUri) => {
var feedData = packet.feed;
if (!defined(feedData)) {
return;
}

                var feed = entity.feed;
                if (!defined(feed)) {
                    entity.feed = feed = new Cesium.TimeIntervalCollectionProperty();
                }

                if (isArray(feedData)) {
                    for (var i = 0, ii = feedData.length; i < ii; ++i) {
                        var data = feedData[i];
                        feed.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
                            iso8601: data.interval,
                            isStartIncluded: true,
                            isStopIncluded: false,
                            data: data.name
                        }));
                    }
                }

           
                //composite
            });

``

my vechicle now has a feed property that change according to time.