I am using cesium to visualize my transportation problem, I find working with CZML is much easier for me. But I found so many good methods and properties such as VelocityOrientationProperty
or SampledPositionProperty
which seems are not applicable in CZML, Am I right? Is there any good way that I can use such these methods?
The SampledPositionProperty
is the main one that Entities use when specifying a position that changes over time. I've included a CZML snippet below that shows a truck driving over a bridge using only a 2-point SampledPositionProperty.
The VelocityOrientationProperty
is much newer (introduced in March), and is not yet wired into CZML. Currently the only way in CZML is to have the server pre-calculate the orientation over time, and send down a list of quaternions. This is probably on a roadmap to fix at some future point, you can try asking on the mailing list. In the past I've also seen clients get the CZML from the server, and then loop over the entities that need VelocityOrientationProperty
and add it in manually there.
The position
property at the very bottom of this CZML example has options that line up with the SampledPositionProperty
class, and that class will be used here.
[{
"id" : "document",
"version" : "1.0",
"clock" : {
"interval" : "2012-08-04T16:00:00Z/2012-08-04T16:02:00Z",
"currentTime" : "2012-08-04T16:00:00Z",
"multiplier" : 1,
"range" : "LOOP_STOP",
"step" : "SYSTEM_CLOCK_MULTIPLIER"
}
}, {
"id" : "Vehicle",
"availability" : "2012-08-04T16:00:00Z/2012-08-04T16:02:00Z",
"billboard" : {
"eyeOffset" : {
"cartesian" : [0.0, 0.0, 0.0]
},
"horizontalOrigin" : "CENTER",
"image" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEISURBVEhLvVXBDYQwDOuojHKj8LhBbpTbpBCEkZsmIVTXq1RVQGrHiWlLmTTqPiZBlyLgy/KSZQ5JSHDQ/mCYCsC8106kDU0AdwRnvYZArWRcAl0dcYJq1hWCb3hBrumbDAVMwAC82WoRvgMnVMDBnB0nYZFTbE6BBvdUGqVqCbjBIk3PyFFR/NU7EKzru+qZsau3ryPwwCRLKYOzutZuCL6fUmWeJGzNzL/RxAMrUmASSCkkAayk2IxPlwhAAYGpsiHQjbLccfdOY5gKkCXAMi7SscAwbQpAnKyctWyUZ6z8ja3OGMepwD8asz+9FnSvbhU8uVOHFIwQsI3/p0CfhuqCSQuxLqsN6mu8SS+N42MAAAAASUVORK5CYII=",
"pixelOffset" : {
"cartesian2" : [0.0, 0.0]
},
"scale" : 0.8,
"show" : true,
"verticalOrigin" : "BOTTOM"
},
"path" : {
"material" : {
"solidColor" : {
"color" : {
"rgba" : [255, 255, 0, 255]
}
}
},
"width" : 5.0,
"show" : true
},
"position" : {
"interpolationAlgorithm" : "LAGRANGE",
"interpolationDegree" : 1,
"epoch" : "2012-08-04T16:00:00Z",
"cartesian" : [0.0, 1254962.0093268978, -4732330.528380746, 4074172.505865612,
120.0, 1256995.7322857284, -4732095.2154790815, 4073821.2249589274]
}
}]