Hi All,
I'm trying to resolve an issue with streaming. I want to draw a path starting at the start of 'availability' time frame and finishing at the end.
This works fine for static czml (code 1). It also works for streaming data for the positions of a point (code 3). This does not work for a path (code 2), which draws path segments at the rate of 1 per second (setInterval value) and then stops when there are no more points. Everything else about how I stream code 2 and code 3 is the same, except for the czml.
What am I missing?
Thanks,
K.
// 1.
// non-streaming version.
// draws path over entire availability time frame
czml = [
{
"id" : "document",
"name" : Name + " CZML Point - Time Dynamic",
"version" : "1.0"
},
{
"id" : "point",
"availability" : dateTime_start + '/' + dateTime_end,
"position" : {
"epoch" : dateTime_start,
"cartographicDegrees" : position
},
"path" : {
"material" : {
"solidColor" : {
"color" : {
"rgba" : [231, 165, 57, 200]
}
}
},
"width" : 1,
"leadTime" : 10,
"trailTime" : diff,
"resolution" : 5
}
}
];
// 2.
// streaming version called from a setInterval function with time = 1000
// ignores availability time frame and draws path to one position per second
var entity = {
"id" : Name,
"availability" : dateTime_start + '/' + dateTime_end,
"position" : {
"interval" : coordinates[0] + "/" + position[0],
"epoch" : dateTime_start,
"cartographicDegrees" : [
coordinates[0], coordinates[1], coordinates[2], coordinates[3]
]
},
"path" : {
"material" : {
"solidColor" : {
"color" : {
"interval" : coordinates[0] + "/" + position[0],
"rgba" : [231, 165, 57, 200]
}
}
}
},
"width" : 2
};
// 3.
// streaming version called from a setInterval function with time = 1000
// animates point position over entire availabity time frame
var entity = {
"id" : "point",
"availability" : dateTime_start + '/' + dateTime_end,
"position" : {
"epoch" : dateTime_start,
"cartographicDegrees" : [
coordinates[0], coordinates[1], coordinates[2], coordinates[3]
]
},
"point" : {
"color" : {
"rgba" : [231, 165, 57, 255]
},
"pixelSize" : {
"number" : 10
}
}
};