# new RegularShape(opts)
Initialization object
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
opts |
object
|
Options |
||
fill |
Fill
|
<optional> |
Fill style. |
|
points |
number
|
<optional> |
Number of points for stars and regular polygons. In case of a polygon, the number of points is the number of sides. |
|
radius |
number
|
<optional> |
Radius of a regular polygon. |
|
radius1 |
number
|
<optional> |
Outer radius of a star. |
|
radius2 |
number
|
<optional> |
Inner radius of a star. |
|
angle |
number
|
<optional> |
0 | Shape's angle in radians. A value of 0 will have one of the shape's point facing up. |
displacement |
Array.<number>
|
<optional> |
[0,0] | Displacement of the shape |
stroke |
stroke
|
<optional> |
Stroke style. |
|
rotation |
number
|
<optional> |
0 | Rotation in radians (positive rotation clockwise). |
rotateWithView |
boolean
|
<optional> |
false | Whether to rotate the shape with the view. |
scale |
number
|
<optional> |
1 | Scale. Unless two dimensional scaling is required a better
result may be obtained with appropriate settings for |
- Tutorials:
Classes
Methods
# getAnchor() → {Array.<number>}
Get the anchor point in pixels. The anchor determines the center point for the symbolizer.
Anchor.
Array.<number>
# getAngle() → {number}
Get the angle used in generating the shape.
Shape's rotation in radians.
number
# getDisplacement() → {Array.<number>}
Get the displacement of the shape
Shape's center displacement
Array.<number>
# getPoints() → {number}
Get the number of points for generating the shape.
Number of points for stars and regular polygons.
number
# getRadius2() → {number|undefined}
Get the secondary radius for the shape.
Radius2.
number
|
undefined
# getRotateWithView() → {boolean}
Determine whether the symbolizer rotates with the map.
Rotate with map.
boolean
# setRotateWithView(rotateWithView)
Set whether to rotate the style with the view.
Parameters:
Name | Type | Description |
---|---|---|
rotateWithView |
boolean
|
Rotate with map. |
# setRotation(rotation)
Set the rotation.
Parameters:
Name | Type | Description |
---|---|---|
rotation |
number
|
Rotation. |