I am using a PolygonGeometry and trying to create GroundPrimitives with it. Currently I get the follwoing error if I try and add it to scene.primitives “DeveloperError: Not all of the geometry instances have GroundPrimitive support” The docs here https://cesium.com/docs/cesiumjs-ref-doc/GroundPrimitive.html state that GroundPrimitives should work with PolygonGeometries.
The code looks like this:
let polygon = new Cesium.PolygonGeometry({
polygonHierarchy: new Cesium.PolygonHierarchy(
Cesium.Cartesian3.fromDegreesArray(bounds)),
});
let instance = new Cesium.GeometryInstance({
geometry: Cesium.PolygonGeometry.createGeometry(polygon),
id: cell,
attributes: {
color: new Cesium.Color(rgb[0], rgb[1], rgb[2], 0.5),
},
})
scene.primitives.add(new Cesium.GroundPrimitive({
geometryInstances: instance,
}));