Yes. Basically, you need to call processPacketData for each property. This example also shows how to group properties together into subobjects. You can paste this into the CZML Sandcastle example to try it:
require([‘Cesium’], function(Cesium) {
“use strict”;
var viewer = new Cesium.Viewer(‘cesiumContainer’);
var czml = [{
“id” : “Vehicle”,
“availability” : “2012-08-04T16:00:00Z/2012-08-04T17:04:54.9962195740191Z”,
“properties” : {
“myPuppet” : “cat”,
“myName” : “test”
}
}];
var CustomProperties = function() {
this._definitionChanged = new Cesium.Event();
};
Object.defineProperties(CustomProperties.prototype, {
definitionChanged : {
get : function() {
return this._definitionChanged;
}
},
myPuppet : Cesium.createDynamicPropertyDescriptor(‘myPuppet’),
myName : Cesium.createDynamicPropertyDescriptor(‘myName’)
});
function processCustomProperties(dynamicObject, packet, dynamicObjectCollection, sourceUri) {
var propertiesData = packet.properties;
if (propertiesData === undefined) {
return;
}
var interval = propertiesData.interval;
if (interval !== undefined) {
interval = TimeInterval.fromIso8601(interval);
}
var properties = dynamicObject.properties;
if (properties === undefined) {
dynamicObject.addProperty(‘properties’);
dynamicObject.properties = properties = new CustomProperties();
}
Cesium.CzmlDataSource.processPacketData(String, properties, ‘myPuppet’, propertiesData.myPuppet, interval, sourceUri);
Cesium.CzmlDataSource.processPacketData(String, properties, ‘myName’, propertiesData.myName, interval, sourceUri);
}
Cesium.CzmlDataSource.updaters.push(processCustomProperties);
var czmlDataSource = new Cesium.CzmlDataSource();
czmlDataSource.load(czml);
viewer.dataSources.add(czmlDataSource);
var dynamicObject = czmlDataSource.dynamicObjects.getById(‘Vehicle’);
var lastValue;
viewer.clock.onTick.addEventListener(function(clock) {
var value = dynamicObject.properties.myName.getValue(clock.currentTime);
if (lastValue !== value) {
console.log(value);
lastValue = value;
}
});
Sandcastle.finishedLoading();
});