PolygonGraphics - Cesium Documentation

# PolygonGraphics

#### new PolygonGraphics(options)

  Describes a polygon defined by an hierarchy of linear rings which make up the outer shape and any nested holes. The polygon conforms to the curvature of the globe and can be placed on the surface or at altitude and can optionally be extruded into a volume.

  Name | Type | Description
  --- | --- | ---

  `options`

  Object

  optional Object with the following properties:

  Name | Type | Default | Description
  --- | --- | --- | ---
  `hierarchy` | Property |  | optional A Property specifying the `PolygonHierarchy`.
  `height` | Property | `0` | optional A numeric Property specifying the altitude of the polygon.
  `extrudedHeight` | Property |  | optional A numeric Property specifying the altitude of the polygon extrusion.
  `show` | Property | `true` | optional A boolean Property specifying the visibility of the polygon.
  `fill` | Property | `true` | optional A boolean Property specifying whether the polygon is filled with the provided material.
  `material` | MaterialProperty | `Color.WHITE` | optional A Property specifying the material used to fill the polygon.
  `outline` | Property | `false` | optional A boolean Property specifying whether the polygon is outlined.
  `outlineColor` | Property | `Color.BLACK` | optional A Property specifying the `Color` of the outline.
  `outlineWidth` | Property | `1.0` | optional A numeric Property specifying the width of the outline.
  `stRotation` | Property | `0.0` | optional A numeric property specifying the rotation of the polygon texture counter-clockwise from north.
  `granularity` | Property | `Cesium.Math.RADIANS_PER_DEGREE` | optional A numeric Property specifying the angular distance between each latitude and longitude point.
  `perPositionHeight` | Property | `false` | optional A boolean specifying whether or not the the height of each position is used.

  ##### Demo:

  - Cesium Sandcastle Polygon Demo

  ##### See:

  - Entity
  Source: DataSources/PolygonGraphics.js, line 45

### Members

#### readonlydefinitionChanged :Event

  Gets the event that is raised whenever a property or sub-property is changed or modified.
  Source: DataSources/PolygonGraphics.js, line 83

#### extrudedHeight :Property

  Gets or sets the numeric Property specifying the altitude of the polygon extrusion. If `PolygonGraphics#perPositionHeight` is false, the volume starts at `PolygonGraphics#height` and ends at this altitude. If `PolygonGraphics#perPositionHeight` is true, the volume starts at the height of each `PolygonGraphics#hierarchy` position and ends at this altitude.
  Source: DataSources/PolygonGraphics.js, line 127

#### fill :Property

  Gets or sets the boolean Property specifying whether the polygon is filled with the provided material.
  Default Value: `true`
  Source: DataSources/PolygonGraphics.js, line 151

#### granularity :Property

  Gets or sets the numeric Property specifying the angular distance between points on the polygon.
  Default Value: `{CesiumMath.RADIANS_PER_DEGREE}`
  Source: DataSources/PolygonGraphics.js, line 135

#### height :Property

  Gets or sets the numeric Property specifying the constant altitude of the polygon.
  Default Value: `0.0`
  Source: DataSources/PolygonGraphics.js, line 118

#### hierarchy :Property

  Gets or sets the Property specifying the `PolygonHierarchy`.
  Source: DataSources/PolygonGraphics.js, line 110

#### material :MaterialProperty

  Gets or sets the Property specifying the material used to fill the polygon.
  Default Value: `Color.WHITE`
  Source: DataSources/PolygonGraphics.js, line 103

#### outline :Property

  Gets or sets the Property specifying whether the polygon is outlined.
  Default Value: `false`
  Source: DataSources/PolygonGraphics.js, line 159

#### outlineColor :Property

  Gets or sets the Property specifying the `Color` of the outline.
  Default Value: `Color.BLACK`
  Source: DataSources/PolygonGraphics.js, line 167

#### outlineWidth :Property

  Gets or sets the numeric Property specifying the width of the outline.
  Default Value: `1.0`
  Source: DataSources/PolygonGraphics.js, line 175

#### perPositionHeight :Property

  Gets or sets the boolean specifying whether or not the the height of each position is used. If true, the shape will have non-uniform altitude defined by the height of each `PolygonGraphics#hierarchy` position. If false, the shape will have a constant altitude as specified by `PolygonGraphics#height`.
  Source: DataSources/PolygonGraphics.js, line 184

#### show :Property

  Gets or sets the boolean Property specifying the visibility of the polygon.
  Default Value: `true`
  Source: DataSources/PolygonGraphics.js, line 95

#### stRotation :Property

  Gets or sets the numeric property specifying the rotation of the polygon texture counter-clockwise from north.
  Default Value: `0`
  Source: DataSources/PolygonGraphics.js, line 143

### Methods

#### clone(result) → PolygonGraphics

  Duplicates this instance.

  Name | Type | Description
  --- | --- | ---
  `result` | PolygonGraphics | optional The object onto which to store the result.

  ##### Returns:

  The modified result parameter or a new instance if one was not provided.
  Source: DataSources/PolygonGraphics.js, line 193

#### merge(source)

  Assigns each unassigned property on this object to the value of the same property on the provided source object.

  Name | Type | Description
  --- | --- | ---
  `source` | PolygonGraphics | The object to be merged into this object.

  Source: DataSources/PolygonGraphics.js, line 218