Search code examples
javascriptreactjsgoogle-mapsgoogle-maps-api-3cesiumjs

Error while creating a polyline in Cesium


I am using the following code to create a polyline in my ReactJs app. I am getting "DeveloperError: Expected value to be greater than or equal to0.0125, the actual value was 0" error message. Can someone please explain to me why am I getting this error.

var viewer = new Cesium.Viewer("cesiumContainer");

var redLine = viewer.entities.add({
  name: "Red line on terrain",
  polyline: {
    positions: Cesium.Cartesian3.fromDegreesArray([180,90, 180, -90]),
    width: 5,
    material: Cesium.Color.RED,
    clampToGround: true,
  },
});

Solution

  • I suppose it's a bug for cesium.

    If you delete the code from lines 259 to 265 in the EllipsoidGeodesic-0f41968b.js file, You will find that your code will run normally.

    Screenshot of commented code in file

    I have encountered a lot of problem behaviors like this.

    I don’t know if I comment out the related anomaly detection, what will happen to the code system operation.

    I guess that under certain extreme conditions, it may affect the normal operation of the system.