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

src/ol/style/regularshapestyle.js, line 29
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

src/ol/style/regularshapestyle.js, line 144
Returns:
Anchor.

getAngle(){number} experimental

src/ol/style/regularshapestyle.js, line 153
Returns:
Shape's rotation in radians.

getFill(){ol.style.Fill} experimental

src/ol/style/regularshapestyle.js, line 162
Returns:
Fill style.

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

src/ol/style/regularshapestyle.js, line 179
Name Type Description
pixelRatio number

Pixel ratio.

Returns:
Image element.

getOpacity(){number} inherited experimental

src/ol/style/imagestyle.js, line 75
Returns:
Opacity.

getOrigin(){Array.<number>} experimental

src/ol/style/regularshapestyle.js, line 212
Returns:
Origin.

getPoints(){number} experimental

src/ol/style/regularshapestyle.js, line 221
Returns:
Number of points for stars and regular polygons.

getRadius(){number} experimental

src/ol/style/regularshapestyle.js, line 230
Returns:
Radius.

getRadius2(){number} experimental

src/ol/style/regularshapestyle.js, line 239
Returns:
Radius2.

getRotateWithView(){boolean} inherited experimental

src/ol/style/imagestyle.js, line 84
Returns:
Rotate with map.

getRotation(){number} inherited experimental

src/ol/style/imagestyle.js, line 93
Returns:
Rotation.

getScale(){number} inherited experimental

src/ol/style/imagestyle.js, line 102
Returns:
Scale.

getSize(){ol.Size} experimental

src/ol/style/regularshapestyle.js, line 248
Returns:
Size.

getSnapToPixel(){boolean} inherited experimental

src/ol/style/imagestyle.js, line 111
Returns:
Snap to pixel?

getStroke(){ol.style.Stroke} experimental

src/ol/style/regularshapestyle.js, line 257
Returns:
Stroke style.

setRotation(rotation) inherited experimental

src/ol/style/imagestyle.js, line 197

Set the rotation.

Name Type Description
rotation number

Rotation.

setScale(scale) inherited experimental

src/ol/style/imagestyle.js, line 208

Set the scale.

Name Type Description
scale number

Scale.