I tried to create polygon as ground primitive:
var viewer = new Cesium.Viewer(‘cesiumContainer’);
var polygon = new Cesium.PolygonGeometry({
polygonHierarchy : new Cesium.PolygonHierarchy(
Cesium.Cartesian3.fromDegreesArray([
-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)?