processMaterialPacket

Now I want to know the syntax of such function like this:

Cesium.CzmlDataSource.processMaterialPacketData(object, propertyName, packetData, interval, sourceUri, entityCollection)

Cesium.CzmlDataSource.processPacketData(type, object, propertyName, packetData, interval, sourceUri, entityCollection)

Cesium.CzmlDataSource.processPacketData(type, object, propertyName, packetData, interval, sourceUri, entityCollection)

I want to know how to call this function.Can I write like this directly, if I want to update the material.solidColor of the first packet?

Or these functions just mean to make some custom properties, not to update the packet? I am very confused.

Thanks if you can give an answer.

var czml = [

{

“id” : “document”,

“name” : “CZML Geometries: Polygon”,

“version” : “1.0”

}, {

“id” : “redPolygon”,

“name” : “Red polygon on surface”,

“polygon” : {

“positions” : {

“cartographicDegrees” : [

-115.0, 37.0, 0,

-115.0, 32.0, 0,

-107.0, 33.0, 0,

-102.0, 31.0, 0,

-102.0, 35.0, 0

]

},

“material” : {

“solidColor” : {

“color” : {

“rgba” : [255, 0, 0, 255]

}

}

}

}

}, {

“id” : “greenPolygon”,

“name” : “Green extruded polygon”,

“polygon” : {

“positions” : {

“cartographicDegrees” : [

-108.0, 42.0, 0,

-100.0, 42.0, 0,

-104.0, 40.0, 0

]

},

“material” : {

“solidColor” : {

“color” : {

“rgba” : [0, 255, 0, 255]

}

}

},

“extrudedHeight” : 500000.0

}

}, {

“id” : “orangePolygon”,

“name” : “Orange polygon with per-position heights and outline”,

“polygon” : {

“positions” : {

“cartographicDegrees” : [

-108.0, 25.0, 100000,

-100.0, 25.0, 100000,

-100.0, 30.0, 100000,

-108.0, 30.0, 300000

]

},

“material” : {

“solidColor” : {

“color” : {

“rgba” : [255, 100, 0, 100]

}

}

},

“extrudedHeight” : 0,

“perPositionHeight” : true,

“outline” : true,

“outlineColor” : {

“rgba” : [0, 0, 0, 255]

}

}

}

];

var viewer = new Cesium.Viewer(‘cesiumContainer’);

var czmlDataSource = new Cesium.CzmlDataSource();

czmlDataSource.load(czml);

viewer.dataSources.add(czmlDataSource);

var object = czmlDataSource.entities.values[0];

var packetData=object.color;

var propertyName=‘color’;

var interval=object.interval;

var entityCollection=czmlDataSource.entities;

Cesium.CzmlDataSource.processMaterialPacketData(object, propertyName, packetData, interval,undefined, entityCollection)

{ //I want to update the firdt packet’s solidcolor into BROWN

object.solidColor=Cesium.Color.BLUE ;

}

viewer.zoomTo(czmlDataSource);