Reading in Custom Data from a Czml file

If I have a czml file read in using:
    viewer.dataSources.add(Cesium.CzmlDataSource.load("http://path/to/file.czml"));

If the czml file contains data such as:
    {
        "id":"Polyline_1",
        "name":"Polyline 1",
        "polyline": {
            "width":3,
            "material": {
                "solidColor": {
                     "color": {
                         "rgba": [255,255,255,255]
                    }
                }
            },
            "positions": {
                "cartographicDegrees": [long1, lat1, height1, long2, lat2, height2]
            }
        },
        "myData":[8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7]
    }

How can I then read in this new custom data "myData"?

Hello,

Custom properties probably aren’t processed by the CZMLDataSource when the CZML is loaded. You should be able to get it in by making it part of the id. Try doing something like:

id: {

“myData”: [1,2,3,4]

}

Best,

Hannah

If I put the following in sandcastle everything runs smoothly:
var viewer = new Cesium.Viewer('cesiumContainer');
var scene = viewer.scene;

var myCzmlData = [
    {
        "id" : "document",
        "name" : "CZML Sample",
        "version" : "1.0"
    },
    {
        "id": "Unique_Polyline_1",
        "name":"Polyline 1",
        "polyline": {
            "width":3,
            "material": {
                "solidColor": {
                    "color": {
                        "rgba": [255,255,255,255]
                    }
                }
            },
            "positions": {
                "cartographicDegrees": [-120.0, 40.0,0,
                                        -80.0, 40.0,0]
            }
        }
    }
];

viewer.dataSources.add(Cesium.CzmlDataSource.load(myCzmlData));
var ds = viewer.dataSources.get(0);
console.log("# of ds loaded: " + ds.entities.values.length);
console.log("ds id: " + ds.entities.values[0].id);
console.log("ds name: " + ds.entities.values[0].name);
console.log("ds polyline pos: " + ds.entities.values[0].polyline.positions.getValue(new Date()));

I tried to edit myCzmlData as you suggested but it is not read in properly and produces an error. Any other suggestions?

var myCzmlData = [
    {
        "id" : "document",
        "name" : "CZML Sample",
        "version" : "1.0"
    },
    {
        "id": {
            "myData": [1, 2, 3]
        },
        "name":"Polyline 1",
        "polyline": {
            "width":3,
            "material": {
                "solidColor": {
                    "color": {
                        "rgba": [255,255,255,255]
                    }
                }
            },
            "positions": {
                "cartographicDegrees": [-120.0, 40.0,0,
                                        -80.0, 40.0,0]
            }
        }
    }
];

Currently Cesium does not load custom CZML properties automatically. To load the data yourself you can hook up a function to process your particular custom CZML properties. I recently posted some sample code here that shows how to do that:

https://gist.github.com/shunter/0fb273feed2ed7b507fe

Thanks!