Custom Properties for Polygons and Polylines?

Is there a way to create custom properties for Polygons or Polylines? I’ve done it for czmldataSource, which works like a beauty. I’ve tried changing it to fit with Polygons but it didn’t turn out well.

Here is the czmlDataSource one that I found on this form :

function processCustomProperty(dynamicObject, packet, dynamicObjectCollection, sourceUri) {

var CustomProperties = function () {

this._definitionChanged = new Cesium.Event();

};

var propertiesData = packet.customProperties;

if (propertiesData) {

var interval = propertiesData.interval;

if (interval) {

interval = TimeInterval.fromIso8601(interval);

}

var properties = dynamicObject.customProperties;

if (!properties) {

dynamicObject.addProperty(‘customProperties’);

dynamicObject.customProperties = properties = new CustomProperties();

}

// Adding properties [Add properties here!!]

Cesium.CzmlDataSource.processPacketData(Array, properties, ‘myArray’, propertiesData.myArray, interval, sourceUri);

Cesium.CzmlDataSource.processPacketData(String, properties, ‘myString’, propertiesData.myString, interval, sourceUri);

}

}

Any guidance would be great!

Katone

There’s no direct support for this, though eventually we hope to make it trivial and automatic (so that custom properties in any CZML are picked up without any client side code changes).

If you wanted to hack something together yourself, you would have to modify the processPolygon (for polygons) and processPolyline (for polylines) functions in CzmlDataSource.js

Thinking about it more, a cleaner option would be to remove the processPolyline function from the list of CzmlDataSource.updaters and then supply your own (by copying and pasted the one in in CzmlDataSource.js and modifying it with your additional properties.