Class: RegularShape

ol.style.RegularShape

Set regular shape style for vector features. The resulting shape will be a regular polygon when radius is provided, or a star when radius1 and radius2 are provided.

new ol.style.RegularShape(options) experimental

Name Type Description
options

Options.

Name Type Description
fill ol.style.Fill | undefined experimental

Fill style.

points number experimental

Number of points for stars and regular polygons. In case of a polygon, the number of points is the number of sides.

radius number | undefined experimental

Radius of a regular polygon.

radius1 number | undefined experimental

Inner radius of a star.

radius2 number | undefined experimental

Outer radius of a star.

angle number | undefined experimental

Shape's angle in radians. A value of 0 will have one of the shape's point facing up. Default value is 0.

snapToPixel boolean | undefined experimental

If true integral numbers of pixels are used as the X and Y pixel coordinate when drawing the shape in the output canvas. If false fractional numbers may be used. Using true allows for "sharp" rendering (no blur), while using false allows for "accurate" rendering. Note that accuracy is important if the shape's position is animated. Without it, the shape may jitter noticeably. Default value is true.

stroke ol.style.Stroke | undefined experimental

Stroke style.

rotation number | undefined experimental

Rotation in radians (positive rotation clockwise). Default is 0.

Extends

Methods

getAnchor(){Array.<number>} experimental

Returns:
Anchor.

getAngle(){number} experimental

Returns:
Shape's rotation in radians.
Returns:
Fill style.

getImage(pixelRatio){HTMLCanvasElement|HTMLVideoElement|Image} experimental

Name Type Description
pixelRatio number

Pixel ratio.

Returns:
Image element.

getOpacity(){number} inherited experimental

Returns:
Opacity.

getOrigin(){Array.<number>} experimental

Returns:
Origin.

getPoints(){number} experimental

Returns:
Number of points for stars and regular polygons.

getRadius(){number} experimental

Returns:
Radius.

getRadius2(){number} experimental

Returns:
Radius2.

getRotateWithView(){boolean} inherited experimental

Returns:
Rotate with map.

getRotation(){number} inherited experimental

Returns:
Rotation.

getScale(){number} inherited experimental

Returns:
Scale.
Returns:
Size.

getSnapToPixel(){boolean} inherited experimental

Returns:
Snap to pixel?
Returns:
Stroke style.

setRotation(rotation) inherited experimental

Set the rotation.

Name Type Description
rotation number

Rotation.

setScale(scale) inherited experimental

Set the scale.

Name Type Description
scale number

Scale.