Is polygon as ground primitive supported?

I tried to create polygon as ground primitive:

var viewer = new Cesium.Viewer(‘cesiumContainer’);

var polygon = new Cesium.PolygonGeometry({

polygonHierarchy : new Cesium.PolygonHierarchy(


 -72.0, 40.0,

 -70.0, 35.0,

 -75.0, 30.0,

 -70.0, 30.0,

 -68.0, 40.0




var geometry = Cesium.PolygonGeometry.createGeometry(polygon);

var polygonGeometryInstance = new Cesium.GeometryInstance({

geometry : geometry,

id : ‘polygon’,

attributes : {

color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5)



viewer.scene.primitives.add(new Cesium.GroundPrimitive({

geometryInstances : polygonGeometryInstance



but there is error: Not all of the geometry instances have GroundPrimitive support.

According documenation there is support for polygons. Am I doing something wrong or there is bug in 1.63.1 cesium version (I tested in current version in sandcastle)?

I figure it out . I can’t use Cesium.PolygonGeometry.createGeometry(polygon); because it creates Geometry not PolygonGeometry and when Cesium checks support for GroundPrimitive it is looking for specific property in constructor. This property doesn’t exist in Geometry object so it says it not supported. So I need to create polygon geometry via ‘new PolygonGeometry()’ instead. It seems that Geometry object is common interface but there isn’t any information for what purpose it exists. I had to debug cesium code to find that implications. Maybe those informations (including purpose of createGeometry method) should be in documentation.