OpenLayers. Geometry. Polygon

Polygon is a collection of Geometry.LinearRings.

Inherits from

Summary
Polygon is a collection of Geometry.LinearRings.
Constructor for a Polygon geometry.
Calculated by subtracting the areas of the internal holes from the area of the outer hole.
Create a regular polygon around a radius.

Constructor

OpenLayers. Geometry. Polygon

Constructor for a Polygon geometry.  The first ring (this.component[0])is the outer bounds of the polygon and all subsequent rings (this.component[1-n]) are internal holes.

Parameters

componentsArray({OpenLayers.Geometry.LinearRing})

Functions

getArea

getArea: function()

Calculated by subtracting the areas of the internal holes from the area of the outer hole.

Returns

{float} The area of the geometry

createRegularPolygon

OpenLayers.Geometry.Polygon.createRegularPolygon = function(origin,
radius,
sides,
rotation)

Create a regular polygon around a radius.  Useful for creating circles and the like.

Parameters

origin{OpenLayers.Geometry.Point} center of polygon.
radius{Float} distance to vertex, in map units.
sides{Integer} Number of sides.  20 approximates a circle.
rotation{Float} original angle of rotation, in degrees.
getArea: function()
Calculated by subtracting the areas of the internal holes from the area of the outer hole.
OpenLayers.Geometry.Polygon.createRegularPolygon = function(origin,
radius,
sides,
rotation)
Create a regular polygon around a radius.
A Collection is exactly what it sounds like: A collection of different Geometries.
A Geometry is a description of a geographic object.
A Linear Ring is a special LineString which is closed.
Point geometry class.