Classes
Methods
-
module:ol/geom/Polygon.circular(center, radius, opt_n, opt_sphereRadius){module:ol/geom/Polygon~Polygon}
geom/Polygon.js, line 348 -
Create an approximation of a circle on the surface of a sphere.
Name Type Description centermodule:ol/coordinate~Coordinate Center (
[lon, lat]in degrees).radiusnumber The great-circle distance from the center to the polygon vertices.
nnumber Optional number of vertices for the resulting polygon. Default is
32.sphereRadiusnumber Optional radius for the sphere (defaults to the Earth's mean radius using the WGS84 ellipsoid).
Returns:
The "circular" polygon.
-
module:ol/geom/Polygon.fromCircle(circle, opt_sides, opt_angle){module:ol/geom/Polygon~Polygon}
geom/Polygon.js, line 386 -
Create a regular polygon from a circle.
Name Type Description circlemodule:ol/geom/Circle~Circle Circle geometry.
sidesnumber Number of sides of the polygon. Default is 32.
anglenumber Start angle for the first vertex of the polygon in radians. Default is 0.
Returns:
Polygon geometry.
-
Create a polygon from an extent. The layout used is
XY.Name Type Description extentmodule:ol/extent~Extent The extent.
Returns:
The polygon.