Class: ServerStyle

SuperMap.ServerStyle

The ServerStyle class.

new SuperMap.ServerStyle(options)

ServerStyle.js, line 5

This class is used to define the styles of point symbols, line symbols, fill symbols, and their related properties.

Name Type Description
options Object

The parameters.

Name Type Default Description
fillGradientMode SuperMap.FillGradientMode

The FillGradientMode.

fillBackColor SuperMap.ServerColor [255,255,255] optional

The fill background color.

fillBackOpaque boolean false optional

Whether the background is opacity.

fillForeColor SuperMap.ServerColor [255,0,0] optional

The fill color.

fillGradientAngle number 0 optional

The rotation angle of the gradient fill.

fillGradientOffsetRatioX number 0 optional

The percentage of the gradient center to the fill center in the horizontal direction.

fillGradientOffsetRatioY number 0 optional

The percentage of the gradient center to the fill center in the vertical direction.

fillOpaqueRate number 100 optional

The fill opacity.

fillSymbolID number 0 optional

The code of the fill symbol.

lineColor SuperMap.ServerColor optional

The border color of the features. It's default new ServerColor(0, 0, 0).

lineSymbolID number 0 optional

The code of the line symbol.

lineWidth number 1 optional

The width of the line.

markerAngle number 0 optional

The rotation angle of a point symbol.

markerSize number 1 optional

The size of a point symbol.

markerSymbolID number -1 optional

The code of the marker symbol.

Members

fillBackColorSuperMap.ServerColor

The background fill color. When the fill mode is the gradient fill, the color is the end fill color. The default is white.

fillBackOpaqueboolean

The opacity of the background. false represents opacity.

fillForeColorSuperMap.ServerColor

The fill color. When the fill mode is the gradient fill, the color is the start fill color. The default is red.

fillGradientAnglenumber

The rotation of gradient fill, in degrees. It is accurate to 0.1 degree, and the counterclockwise direction is positive.

fillGradientModeSuperMap.FillGradientMode

The FillGradientMode.

fillGradientOffsetRatioXnumber

The percentage of the gradient center to the fill center in the horizontal direction. Their relations are shown as follows: Suppose that the coordinates of the center of fill area is (x0, y0), the coordinates of fill center is (x, y), the width of fill area is a and the percentage of horizontal offset is dx, then x=x0 + a*dx/100.

fillGradientOffsetRatioYnumber

The percentage of the gradient center to the fill center in the vertical direction. Their relations are shown as follows:
Suppose that the coordinates of the center of fill area is (x0, y0), the coordinates of fill center is (x, y), the height of fill area is b and the percentage of vertical offset is dy, then x=y0 + b*dx/100.

fillOpaqueRatenumber

The fill opacity, ranging from 0 to 100, with 100 meaning full opacity and 0 meaning transparent. If the assigned value is less than 0, it is treated as 0; if the assigned value is greater than 100, it is treated as 100.

Default Value:
100

fillSymbolIDnumber

The style of the fill symbol whose ID has been stored in resources library. Each fill symbol has a unique ID. For the symbol style and the corresponding ID number, please find in the SuperMap desktop software.

The border color of the features.

lineSymbolIDnumber

The style of the line symbol whose ID has been stored in resources library. Each line symbol has a unique ID. For the symbol style and the corresponding ID number, please find in the SuperMap desktop software.

lineWidthnumber

The width of line symbol in millimeters. It is accurate to 0.1mm. The default is 1.0.

Default Value:
1.0

markerAnglenumber

The rotation of the marker, in degrees. It is accurate to 0.1 degree, and the counterclockwise direction is positive.

markerSizenumber

The size of marker symbol in millimeters. It is accurate to 0.1mm. When the property is set to 0, the size of the symbol is 1.0. When the property setting is invalid, the server will make default treatment.

Default Value:
1.0

markerSymbolIDnumber

The coding of marker symbols. Each marker symbol has a unique ID. For the line symbol styles and the corresponding ID number, please find in the SuperMap desktop software.

Default Value:
-1

Methods

SuperMap.ServerStyle.fromJson(jsonObject){SuperMap.ServerStyle}

ServerStyle.js, line 178

Transform the JSON object to the SuperMap.ServerStyle object.

Name Type Description
jsonObject Object

JSON object to be turned.

Returns:
Type Description
SuperMap.ServerStyle The SuperMap.ServerStyle object.

destroy()

ServerStyle.js, line 133

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

toServerJSONObject(){Object}

ServerStyle.js, line 166

Transform to the JSON object.

Returns:
Type Description
Object The JSON object.