There are two ways to add a Rectangle to cesium:
one:
var greenRectangle = viewer.entities.add({
rectangle : {
coordinates :rectangle,
material : Cesium.Color.GREEN.withAlpha(0.5),
height : 300,
}
});
There is no problem with this method;
two:
But the following way there is a problem:
var RectangleGeometry = new Cesium.RectangleGeometry({
rectangle: rectangle,
height:300
});
console.log("++++++++++++++++++++++");
console.log(RectangleGeometry)
console.log(RectangleGeometry instanceof Cesium.RectangleGeometry);
var GeometryInstance = new Cesium.GeometryInstance({
geometry:RectangleGeometry,
attributes:{
color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 0.0, 0.5)
}
});
var primity = viewer.scene.primitives.add(new Cesium.GroundPrimitive({
geometryInstances : [GeometryInstance]
}));
in RectangleGeometry = new Cesium.RectangleGeometry({
rectangle: rectangle,
height:300
});
Here, when set high, the height of the Earth's surface in the Rectangle does not change
I want to know where I am wrong, or that he really is a bug