Callback Property in CZML

Can Callback Property be used in CZML concept of cesium ??

If yes, then please refer me some code.

Thank you in advance.Please help me out with this

Regards,
Shubham

Hi there,

The CZML Guide will have the reference information you need.

You can’t use callback properties, but you could use a sampled property depending on what you are trying to accomplish,

Thanks,

Gabby

Hi Gabby,

Basically, I need to draw a pyramid with polygon base which may move with aircraft…

So, i am drawing pyramid using CZML polygon. Here, for continuous movement of pyramid, callback property may be useful,

but said by you that CZML cannot be used by callbackproperty.

What can be done to draw a pyramid with polygon base with dynamic changes in position as that of aircraft??

Regards,

Shubham

While you can’t use a callback property in the CZML itself, after you load the CAML, you can set the positions with a callback property, something like:

Cesium.CzmlDataSource.load(czml).then(function (dataSource) {

var entity = dataSource.entities.values;

var initialPositions = entity.polygon.positions.getValue(viewer.clock.currentTime);

entity.polygon.positions = new Cesium.CallbackProperty(function(time, result) {

var offset = aircraft.model.position.getValue(viewer.clock.currentTime);

for (var i = 0; i < intialPositions.length; ++i) {

positions.push(Cesium.Cartesian3.add(intialPositions[i], offset, result[i]));

}

return result;

}, isConstant)

});

``