Class: ServerTextStyle

SuperMap.ServerTextStyle

The ServerTextStyle class,

new SuperMap.ServerTextStyle(options)

ServerTextStyle.js, line 6

The ServerTextStyle class is used to define the relevance properties of text style.

Name Type Description
options Object

The parameters.

Name Type Default Description
align SuperMap.TextAlignment SuperMap.TextAlignment.BASELINECENTER optional

he text alignment.

backColor SuperMap.ServerColor optional

The background color of the text. It's default new ServerColor(255, 255, 255);

foreColor SuperMap.ServerColor optional

The foreground color of the text. It's default new ServerColor(0, 0, 0).

backOpaque boolean false optional

Whether the text background is opacity.

sizeFixed boolean true optional

Whether to fix the size of the image.

fontHeight number 6 optional

The height of the text font.

fontWidth number 0 optional

The width of the text font.

fontWeight number 400 optional

The weight of the text font.

fontName string 'Times New Roman' optional

The name of the text font.

bold boolean false optional

Whether the text is in bold.

italic boolean false optional

Whether the text is in italic.

italicAngle number 0 optional

The tilt angle of the font.

shadow boolean false optional

Determines whether this text has shadow.

strikeout boolean false optional

Whether to add the strikeout to the text font.

outline boolean false optional

Whether to use outline to display text background.

opaqueRate number 0 optional

The opacity of the annotation text.

underline boolean false optional

Whether to add the underline to the text font.

rotation number 0.0 optional

Text rotation,

Members

he text alignment.

Default Value:
SuperMap.TextAlignment.BASELINECENTER

The background color of the text.

Default Value:
(255, 255, 255)

backOpaqueboolean

Whether the text background is opacity, true means that the text background is opacity.

boldboolean

Whether the text is in bold, true means it’s in bold.

fontHeightnumber

The unit is related to sizeFixed. When setting sizeFixed as False, namely, using map coordinates in unfixed text size. For example, if the unit is degree in geographic coordinate system; When sizeFixed is set to True, the unit is mm.

Default Value:
6

fontNamestring

The name of the font.

Default Value:
"Times New Roman"

fontWeightnumber

The pound of the text font, indicating the specific value of the bold. The range of the value is a full hundred from 0 to 900. The default value is 400.

Default Value:
400

fontWidthnumber

The width of the text font. The default value is 0 in map unit The standard of the width of the font is the English characters, then a Chinese character is equivalent to two English characters.

The foreground color of the text.

Default Value:
(0, 0, 0)

italicboolean

Whether the text is in italic, true means in italic.

italicAnglenumber

The tilt angle of the font, between positive and negative degree in degree unit, and it is accurate to 0.1 degree. The positive and negative degree refers to the vertical axis as the starting zero line, the left of the vertical axis is positive, and right negative. The maximum angle allowed is 60, and the minimum is -60. If the assigned value is less than 60, it is treated as 60; if the assigned value is greater than -60, it is treated as -60. It’s effective for the label map currently.

opaqueRatenumber

The opacity of the annotation text. The opacity ranges from 0 to 100. .

outlineboolean

Whether to use outline to display text background. true means to use outline to display text background. false means not to use outline to display text background.

rotationnumber

Text rotation, in degree. It is accurate to 0.1 degree, and the counterclockwise direction is positive.

Default Value:
0.0

shadowboolean

Determines whether this text has shadow. true means to add shadow to the text.

sizeFixedboolean

Whether the text size is fixed. If true, representing the image is in fixed pixel . Please refer to fontHeight. When it is set to false, image will be zoomed with the map.

Default Value:
true

strikeoutboolean

Whether to add the strikeout to the text font. true means to add the strikeout.

underlineboolean

Gets or sets whether to use underline to display text. true represents to use underline.

Methods

SuperMap.ServerTextStyle.fromObj(obj){SuperMap.ServerTextStyle}

ServerTextStyle.js, line 186

Getting the server-side text style class from the incoming object.

Name Type Description
obj Object

the incoming object.

Returns:
Type Description
SuperMap.ServerTextStyle The ServerTextStyle.

destroy()

ServerTextStyle.js, line 154

Disposes the resource. The property that references resource is set to null.