类名 ThemeStyle

# 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

是否填充,不需要填充则设置为 false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。

fillColor string

十六进制填充颜色。

fillOpacity number

填充不透明度。取值范围[0, 1]。

fontColor string

附加文本字体颜色。

fontFamily string

附加文本字体系列。fontFamily 值是字体族名称或/及类族名称的一个优先表,每个值逗号分割,浏览器会使用它可识别的第一个 可以使用具体的字体名称("times"、"courier"、"arial")或字体系列名称("serif"、"sans-serif"、"cursive"、"fantasy"、"monospace")。

fontSize number

附加文本字体大小,单位是像素。

fontStyle string

附加文本字体样式。可设值:"normal", "italic", "oblique"。

fontVariant string

附加文本字体变体。可设值:"normal", "small-caps"。

fontWeight string

附加文本字体粗细。可设值:"normal", "bold", "bolder", "lighter"。

label string

专题要素附加文本标签内容。

labelAlign string

附加文本水平对齐。可以是 'left', 'right', 'center'。

labelBaseline string

附加文本垂直对齐。 可以是 'top', 'bottom', 'middle'。

labelPosition string

附加文本位置, 可以是 'inside', 'left', 'right', 'top', 'bottom'。

labelRect boolean

是否显示文本标签矩形背景。

labelXOffset number

附加文本在 X 轴方向的偏移量。

labelYOffset number

附加文本在 Y 轴方向的偏移量。

pointRadius number

点半径。单位为像素。

shadowBlur number

阴影模糊度,(大于 0 有效)。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。

shadowColor string

阴影颜色。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。

shadowOffsetX number

阴影 X 方向偏移值。

shadowOffsetY number

Y 方向偏移值。

stroke boolean

是否描边,不需要描边则设置为false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。

strokeColor string

十六进制描边颜色。

strokeDashstyle string

虚线类型; strokeDashstyle 有八种类型 “dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted"; solid 表示实线。

strokeLinecap string

线帽样式;strokeLinecap 有三种类型 “butt", "round", "square" 。

strokeLineJoin string

线段连接样式;strokeLineJoin 有三种类型 “miter", "round", "bevel"。

strokeOpacity number

描边的不透明度。取值范围[0, 1]。

strokeWidth number

线宽度/描边宽度。

成员变量详情

boolean

# fill Optional

是否填充,不需要填充则设置为 false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。

Default Value:
  • true
string

# fillColor Optional

十六进制填充颜色。

Default Value:
  • "#000000"
number

# fillOpacity Optional

填充不透明度。取值范围[0, 1]。

Default Value:
  • 1
string

# fontColor Optional

附加文本字体颜色。

string

# fontFamily Optional

附加文本字体系列。fontFamily 值是字体族名称或/及类族名称的一个优先表,每个值逗号分割,浏览器会使用它可识别的第一个 可以使用具体的字体名称("times"、"courier"、"arial")或字体系列名称("serif"、"sans-serif"、"cursive"、"fantasy"、"monospace")。

Default Value:
  • "arial,sans-serif"
number

# fontSize Optional

附加文本字体大小,单位是像素。

Default Value:
  • 12
string

# fontStyle Optional

附加文本字体样式。可设值:"normal", "italic", "oblique"。

Default Value:
  • "normal"
string

# fontVariant Optional

附加文本字体变体。可设值:"normal", "small-caps"。

Default Value:
  • "normal"
string

# fontWeight Optional

附加文本字体粗细。可设值:"normal", "bold", "bolder", "lighter"。

Default Value:
  • "normal"
string

# label Optional

专题要素附加文本标签内容。

string

# labelAlign Optional

附加文本水平对齐。可以是 'left', 'right', 'center'。

Default Value:
  • 'center'
string

# labelBaseline Optional

附加文本垂直对齐。 可以是 'top', 'bottom', 'middle'。

Default Value:
  • 'middle'
string

# labelPosition Optional

附加文本位置, 可以是 'inside', 'left', 'right', 'top', 'bottom'。

Default Value:
  • 'top'
boolean

# labelRect Optional

是否显示文本标签矩形背景。

number

# labelXOffset Optional

附加文本在 X 轴方向的偏移量。

number

# labelYOffset Optional

附加文本在 Y 轴方向的偏移量。

number

# pointRadius Optional

点半径。单位为像素。

Default Value:
  • 6
number

# shadowBlur Optional

阴影模糊度,(大于 0 有效)。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。

string

# shadowColor Optional

阴影颜色。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。

Default Value:
  • '#000000'
number

# shadowOffsetX Optional

阴影 X 方向偏移值。

number

# shadowOffsetY

Y 方向偏移值。

boolean

# stroke Optional

是否描边,不需要描边则设置为false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。

string

# strokeColor Optional

十六进制描边颜色。

Default Value:
  • "#000000"
string

# strokeDashstyle Optional

虚线类型; strokeDashstyle 有八种类型 “dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted"; solid 表示实线。

Default Value:
  • "solid"
string

# strokeLinecap Optional

线帽样式;strokeLinecap 有三种类型 “butt", "round", "square" 。

Default Value:
  • "butt"
string

# strokeLineJoin Optional

线段连接样式;strokeLineJoin 有三种类型 “miter", "round", "bevel"。

Default Value:
  • "miter"
number

# strokeOpacity Optional

描边的不透明度。取值范围[0, 1]。

Default Value:
  • 1
number

# strokeWidth Optional

线宽度/描边宽度。

Default Value:
  • 1