fromPositions

A description of a polygon from an array of positions. Polygon geometry can be rendered with both Primitive and GroundPrimitive.

// create a polygon from points
const polygon = PolygonGeometry.fromPositions({
positions : Cartesian3.fromDegreesArray([
-72.0, 40.0,
-70.0, 35.0,
-75.0, 30.0,
-70.0, 30.0,
-68.0, 40.0
])
});
const geometry = PolygonGeometry.createGeometry(polygon);

See also