Polygon is a collection of Geometry.LinearRings.
OpenLayers. Geometry. Polygon | Polygon is a collection of Geometry.LinearRings. |
Constructor | |
OpenLayers. Geometry. Polygon | Constructor for a Polygon geometry. |
Functions | |
getArea | Calculated by subtracting the areas of the internal holes from the area of the outer hole. |
intersects | Determine if the input geometry intersects this one. |
createRegularPolygon | Create a regular polygon around a radius. |
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.
components | {Array(OpenLayers.Geometry.LinearRing)} |
intersects: function( geometry )
Determine if the input geometry intersects this one.
geometry | {OpenLayers.Geometry} Any type of geometry. |
{Boolean} The input geometry intersects this one.
OpenLayers.Geometry.Polygon.createRegularPolygon = function( origin, radius, sides, rotation )
Create a regular polygon around a radius. Useful for creating circles and the like.
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. |
Calculated by subtracting the areas of the internal holes from the area of the outer hole.
getArea: function()
Determine if the input geometry intersects this one.
intersects: function( geometry )
Create a regular polygon around a radius.
OpenLayers.Geometry.Polygon.createRegularPolygon = function( origin, radius, sides, rotation )