0

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);

enter image description here

1 Answer 1

0

I didn’t include the “loadedPromise” function, and I didn’t create a function that executes “setExtrudedHeight”.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.