Class: CircleStyle

ol/style/Circle~CircleStyle


import CircleStyle from 'ol/style/Circle.js';

Set circle style for vector features.

new CircleStyle(options)

Name Type Description
fill Fill | undefined

Fill style.

radius number

Circle radius.

stroke Stroke | undefined

Stroke style.

displacement Array.<number> (defaults to [0,0])

displacement

scale number | Size (defaults to 1)

Scale. A two dimensional scale will produce an ellipse. Unless two dimensional scaling is required a better result may be obtained with an appropriate setting for radius.

rotation number (defaults to 0)

Rotation in radians (positive rotation clockwise, meaningful only when used in conjunction with a two dimensional scale).

rotateWithView boolean (defaults to false)

Whether to rotate the shape with the view (meaningful only when used in conjunction with a two dimensional scale).

declutterMode DeclutterMode | undefined

Declutter mode

Extends

Methods

Clones the style.

Returns:
The cloned style.

getAnchor(){Array.<number>} inherited

Get the anchor point in pixels. The anchor determines the center point for the symbolizer.

Returns:
Anchor.

Get the angle used in generating the shape.

Returns:
Shape's rotation in radians.

Get the declutter mode of the shape

Returns:
Shape's declutter mode

getDisplacement(){Array.<number>} inherited

Get the displacement of the shape

Returns:
Shape's center displacement

Get the fill style for the shape.

Returns:
Fill style.

getImage(pixelRatio){HTMLCanvasElement} inherited

Get the image icon.

Name Type Description
pixelRatio number

Pixel ratio.

Returns:
Image or Canvas element.

getOpacity(){number} inherited

Get the symbolizer opacity.

Returns:
Opacity.

getOrigin(){Array.<number>} inherited

Get the origin of the symbolizer.

Returns:
Origin.

Get the number of points for generating the shape.

Returns:
Number of points for stars and regular polygons.

Get the (primary) radius for the shape.

Returns:
Radius.

getRadius2(){number | undefined} inherited

Get the secondary radius for the shape.

Returns:
Radius2.

getRotateWithView(){boolean} inherited

Determine whether the symbolizer rotates with the map.

Returns:
Rotate with map.

getRotation(){number} inherited

Get the symoblizer rotation.

Returns:
Rotation.

getScale(){number | Size} inherited

Get the symbolizer scale.

Returns:
Scale.

Get the size of the symbolizer (in pixels).

Returns:
Size.

Get the stroke style for the shape.

Returns:
Stroke style.

setDisplacement(displacement) inherited

Set the displacement.

Name Type Description
displacement Array.<number>

Displacement.

Set the fill style.

Name Type Description
fill Fill | null

Fill style.

setOpacity(opacity) inherited

Set the opacity.

Name Type Description
opacity number

Opacity.

setRadius(radius)

Set the circle radius.

Name Type Description
radius number

Circle radius.

setRotateWithView(rotateWithView) inherited

Set whether to rotate the style with the view.

Name Type Description
rotateWithView boolean

Rotate with map.

setRotation(rotation) inherited

Set the rotation.

Name Type Description
rotation number

Rotation.

setScale(scale) inherited

Set the scale.

Name Type Description
scale number | Size

Scale.

Set the stroke style.

Name Type Description
stroke Stroke | null

Stroke style.