Class: Label

SuperMap.Feature.ShapeParameters.Label

The label parameter object.

new SuperMap.Feature.ShapeParameters.Label()

Label.js, line 4

Members

textnumber

The text of the label

xnumber

x coordinate of the label

ynumber

y coordinate of the label

Methods

constructor(x, y, text){SuperMap.Feature.ShapeParameters.Label}

Label.js, line 14

Create a new object of label parameter.

Name Type Description
x number

x coordinate. Required.

y number

y coordinate. Required.

text string

Additional text in the shape. Required.

Returns:
Type Description
SuperMap.Feature.ShapeParameters.Label Label parameter object.

destroy()

Label.js, line 46

Destroy objects.

Type Definitions

SuperMap.Feature.ShapeParameters.Label.styleObject

Properties:
Name Type Description
fill boolean

Whether or not to fill, if you don't need to fill it, set it to false, the default value is true. If fill and stroke are false at the same time, the layers will be rendered by the default values of fill and stroke.

fillColor string

Sixteen decimal fill color. The default value is"#000000".

fillOpacity number

fill opacity. The range is [0, 1], and the default value is 1.

stroke boolean

Whether stroke, if you don't need to stroke it, set it to false, the default value is false. If fill and stroke are false at the same time, the layers will be rendered by the default values of fill and stroke.

strokeColor string

Sixteen decimal stroke color. The default value is "#000000".

strokeOpacity number

stroke opacity. The range is [0, 1], and the default value is 1.

strokeWidth number

width of the line/width of the stroke, the default value is 1.

maxWidth number

Maximum width limit. Default: null.

fontSize number

Additional text font size. The default value is 12, and the unit is the pixel.

fontStyle string

Additional text font style. Set value: "normal", "italic", "oblique";The default value is "normal".

fontVariant string

Additional text font variant. Set value: "normal", "small-caps"; The default value is "normal"." 。

fontWeight string

Additional text font weight. Set value: "normal", "bold", "bolder", "lighter"; The default value is "normal".

fontFamily string

Additional text font family. Value of the fontFamily is fontFamily's name or a priority table for family name, each value is separated by a comma. The browser will use the first type of font name it can identify ("times"、"courier"、"arial") or font family name.

labelBaseline string

Additional text baseline alignment. Set value: 'top', 'bottom', 'middle'; The default value is 'middle'.

labelAlign string

Additional text level alignment. Set value: 'left', 'right', 'center'; The default value is 'center'.

shadowBlur number

Shadow blur, (more than 0 is valid; default value is 0).

shadowColor number

Shadow color; The default value is '#000000'.

shadowOffsetX number

Shadow X direction offset value; The default value is 0.

shadowOffsetY number

Shadow Y direction offset value; The default value is 0.