-
Name Type Description options
Options.
Name Type Description color
module:ol/color~Color | module:ol/colorlike~ColorLike | undefined A color, gradient or pattern. See
module:ol/color~Color
andmodule:ol/colorlike~ColorLike
for possible formats. Default null; if null, the Canvas/renderer default black will be used.lineCap
CanvasLineCap (defaults to 'round') Line cap style:
butt
,round
, orsquare
.lineJoin
CanvasLineJoin (defaults to 'round') Line join style:
bevel
,round
, ormiter
.lineDash
Array.<number> | undefined Line dash pattern. Default is
null
(no dash). Please note that Internet Explorer 10 and lower do not support thesetLineDash
method on theCanvasRenderingContext2D
and therefore this option will have no visual effect in these browsers.lineDashOffset
number (defaults to 0) Line dash offset.
miterLimit
number (defaults to 10) Miter limit.
width
number | undefined Width.
Methods
-
Clones the style.
Returns:
The cloned style.
-
Get the stroke color.
Returns:
Color.
-
Get the line cap type for the stroke.
Returns:
Line cap.
-
Get the line dash style for the stroke.
Returns:
Line dash.
-
Get the line dash offset for the stroke.
Returns:
Line dash offset.
-
Get the line join type for the stroke.
Returns:
Line join.
-
Get the miter limit for the stroke.
Returns:
Miter limit.
-
Get the stroke width.
Returns:
Width.
-
Set the color.
Name Type Description color
module:ol/color~Color | module:ol/colorlike~ColorLike Color.
-
Set the line cap.
Name Type Description lineCap
CanvasLineCap | undefined Line cap.
-
Set the line dash.
Please note that Internet Explorer 10 and lower do not support the
setLineDash
method on theCanvasRenderingContext2D
and therefore this property will have no visual effect in these browsers.Name Type Description lineDash
Array.<number> Line dash.
-
Set the line dash offset.
Name Type Description lineDashOffset
number | undefined Line dash offset.
-
Set the line join.
Name Type Description lineJoin
CanvasLineJoin | undefined Line join.
-
Set the miter limit.
Name Type Description miterLimit
number | undefined Miter limit.
-
Set the width.
Name Type Description width
number | undefined Width.