Polygon

@Serializable
data class Polygon(val id: String? = null, val extrude: Boolean = false, val tessellate: Boolean = false, val altitudeMode: AltitudeMode = AltitudeMode.clampToGround, val outerBoundaryIs: OuterBoundaryIs? = null, val innerBoundaryIs: InnerBoundaryIs? = null) : Geometry

A Polygon is defined by an outer boundary and 0 or more inner boundaries. The boundaries, in turn, are defined by LinearRings. When a Polygon is extruded, its boundaries are connected to the ground to form additional polygons, which gives the appearance of a building or a box. Extruded Polygons use PolyStyle for their color, color mode, and fill.

The for polygons must be specified in counterclockwise order. Polygons follow the "right-hand rule," which states that if you place the fingers of your right hand in the direction in which the coordinates are specified, your thumb points in the general direction of the geometric normal for the polygon. (In 3D graphics, the geometric normal is used for lighting and points away from the front face of the polygon.) Since Google Earth fills only the front face of polygons, you will achieve the desired effect only when the coordinates are specified in the proper order. Otherwise, the polygon will be gray.

Constructors

Link copied to clipboard
constructor(id: String? = null, extrude: Boolean = false, tessellate: Boolean = false, altitudeMode: AltitudeMode = AltitudeMode.clampToGround, outerBoundaryIs: OuterBoundaryIs? = null, innerBoundaryIs: InnerBoundaryIs? = null)

Properties

Link copied to clipboard
@XmlElement
val altitudeMode: AltitudeMode

Specifies how altitude components in the element are interpreted.

Link copied to clipboard
@XmlElement
@Serializable(with = FlexibleBooleanSerializer::class)
val extrude: Boolean

Boolean value. Specifies whether to connect the Polygon to the ground. To extrude a Polygon, the altitude mode must be either AltitudeMode.relativeToGround, AltitudeMode.relativeToSeaFloor, or AltitudeMode.absolute. Only the vertices are extruded, not the geometry itself (for example, a rectangle turns into a box with five faces). The vertices of the Polygon are extruded toward the center of the Earth's sphere.

Link copied to clipboard
open override val id: String?
Link copied to clipboard

Contains a LinearRing element. A Polygon can contain multiple innerBoundaryIs elements, which create multiple cut-outs inside the Polygon.

Link copied to clipboard

Contains a LinearRing element.

Link copied to clipboard
@XmlElement
@Serializable(with = FlexibleBooleanSerializer::class)
val tessellate: Boolean

This field is not used by Polygon. To allow a Polygon to follow the terrain (that is, to enable tessellation) specify an altitude mode of AltitudeMode.clampToGround or AltitudeMode.clampToSeaFloor.