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