I wrote the code like this in Cesium 1.100 version.
the corresponding time and polygon are recognized, but the height is not recognized. how can i solve it?
let czml = "";
setInterval(function () {
$.ajax({
type: "GET",
url: "/data",
data: JSON, // Json
success: function (res) {
czml = res;
const dataSource = new CzmlDataSource();
function scaleProperty(property, scalingFactor) {
// returns a property that scales another property by a constant factor.
return new CallbackProperty(function (time, result) {
result = property.getValue(time, result);
result = result * scalingFactor;
return result;
}, property.isConstant);
}
function setExtrudedHeight(propertyName) {
const customPropertyObject = dataSource.entities.getById(
"water_extrudedheight"
);
const property = customPropertyObject.properties[propertyName];
const colorado = dataSource.entities.getById("colorado");
colorado.polygon.extrudedHeight = scaleProperty(property, 1);
}
// Custom properties can be used as the value of graphical properties:
dataSource.load(czml);
viewer.dataSources.add(dataSource);
console.log(czml);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert("not connection.");
},
});
}, 30000);