Polygon in 3d not working


I drew a polygon. So far this works fine.
But if I have also defined a height to display the polygon as 3D, I get the general error.


   polygon: {
           hierarchy: new Cesium.PolygonHierarchy(esium.Cartesian3({x,y,z})),
           material: Cesium.Color.BLUE.withAlpha(0.6),
           extrudedHeight: 100,
           height: geoData.altitude! ?? 0,
           heightReference: Cesium.HeightReference.CLAMP_TO_GROUND

The value for the “hierarchy” is passed by mouse position. So I’ve abbreviated it a bit here.

Can someone tell me what I’m doing wrong here?
Why can’t I use the height etc. here?
Please help!

Thanks in advance.

PolygonHeirarchy must be an array. And it would be easy for us to understand your issue with the help of a basic sandcastle example.

“height” property will be ignored if you are using heightReference Clamp to ground.
Check this basic example.

  • Regards