# new ThemeStyle(options)
参数:
名称 | 类型 | 属性 | 默认值 | 描述 |
---|---|---|---|---|
options |
Object | 可选参数。 |
||
fill |
boolean |
<optional> |
true | 是否填充,不需要填充则设置为 false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。 |
fillColor |
string |
<optional> |
'#000000' | 十六进制填充颜色。 |
fillOpacity |
number |
<optional> |
1 | 填充不透明度。取值范围[0, 1]。 |
stroke |
boolean |
<optional> |
false | 是否描边,不需要描边则设置为false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。 |
strokeColor |
string |
<optional> |
'#000000' | 十六进制描边颜色。 |
strokeOpacity |
number |
<optional> |
1 | 描边的不透明度。取值范围[0, 1]。 |
strokeWidth |
number |
<optional> |
1 | 线宽度/描边宽度。 |
strokeLinecap |
string |
<optional> |
'butt' | 线帽样式。strokeLinecap 有三种类型 “butt", "round", "square"。 |
strokeLineJoin |
string |
<optional> |
'iter' | 线段连接样式。strokeLineJoin 有三种类型 “miter", "round", "bevel"。 |
strokeDashstyle |
string |
<optional> |
'solid' | 虚线类型。strokeDashstyle 有八种类型 “dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted"。solid 表示实线。 |
pointRadius |
number |
<optional> |
6 | 点半径,单位为像素。 |
shadowBlur |
number |
<optional> |
0 | 阴影模糊度,(大于 0 有效;)。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。 |
shadowColor |
string |
<optional> |
'#000000' | 阴影颜色。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。 |
shadowOffsetX |
number |
<optional> |
0 | 阴影 X 方向偏移值。 |
shadowOffsetY |
number |
<optional> |
0 | 阴影 Y 方向偏移值。 |
label |
string | 专题要素附加文本标签内容。 |
||
fontColor |
string |
<optional> |
附加文本字体颜色。 |
|
fontSize |
number |
<optional> |
12 | 附加文本字体大小,单位是像素。 |
fontStyle |
string |
<optional> |
'normal' | 附加文本字体样式。可设值:"normal", "italic", "oblique"。 |
fontVariant |
string |
<optional> |
'normal' | 附加文本字体变体。可设值:"normal", "small-caps"。 |
fontWeight |
string |
<optional> |
'normal' | 附加文本字体粗细。可设值:"normal", "bold", "bolder", "lighter"。 |
fontFamily |
string |
<optional> |
'arial,sans-serif' | 附加文本字体系列。fontFamily 值是字体族名称或/及类族名称的一个优先表,每个值逗号分割,浏览器会使用它可识别的第一个可以使用具体的字体名称("times"、"courier"、"arial")或字体系列名称"serif"、"sans-serif"、"cursive"、"fantasy"、"monospace")。 |
labelPosition |
string |
<optional> |
'top' | 附加文本位置, 可以是 'inside', 'left', 'right', 'top', 'bottom'。 |
labelAlign |
string |
<optional> |
'center' | 附加文本水平对齐。可以是 'left', 'right', 'center'。 |
labelBaseline |
string |
<optional> |
'middle' | 附加文本垂直对齐。 可以是 'top', 'bottom', 'middle' 。 |
labelXOffset |
number |
<optional> |
0 | 附加文本在x轴方向的偏移量。 |
labelYOffset |
number |
<optional> |
0 | 附加文本在y轴方向的偏移量。 |
成员变量
# fill Optional
是否填充,不需要填充则设置为 false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。
- Default Value:
- true
# fontFamily Optional
附加文本字体系列。fontFamily 值是字体族名称或/及类族名称的一个优先表,每个值逗号分割,浏览器会使用它可识别的第一个 可以使用具体的字体名称("times"、"courier"、"arial")或字体系列名称("serif"、"sans-serif"、"cursive"、"fantasy"、"monospace")。
- Default Value:
- "arial,sans-serif"
# fontWeight Optional
附加文本字体粗细。可设值:"normal", "bold", "bolder", "lighter"。
- Default Value:
- "normal"
# labelPosition Optional
附加文本位置, 可以是 'inside', 'left', 'right', 'top', 'bottom'。
- Default Value:
- 'top'
# shadowColor Optional
阴影颜色。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。
- Default Value:
- '#000000'
# strokeDashstyle Optional
虚线类型; strokeDashstyle 有八种类型 “dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted"; solid 表示实线。
- Default Value:
- "solid"
# strokeLinecap Optional
线帽样式;strokeLinecap 有三种类型 “butt", "round", "square" 。
- Default Value:
- "butt"
# strokeLineJoin Optional
线段连接样式;strokeLineJoin 有三种类型 “miter", "round", "bevel"。
- Default Value:
- "miter"