Text symbols are used to add text to a feature (labeling).

See https://developers.arcgis.com/web-map-specification/objects/esriTS_symbol/.

interface TextSymbolJson {
    angle?: number;
    backgroundColor?: ColorJson;
    borderLineColor?: ColorJson;
    borderLineSize?: number;
    color?: ColorJson;
    font?: FontJson;
    haloColor?: ColorJson;
    haloSize?: number;
    horizontalAlignment?:
        | "center"
        | "left"
        | "right"
        | "justify";
    kerning?: boolean;
    rightToLeft?: boolean;
    rotated?: boolean;
    text?: string;
    type: "esriTS";
    verticalAlignment?:
        | "baseline"
        | "top"
        | "middle"
        | "bottom";
    xoffset?: number;
    yoffset?: number;
}

Hierarchy (view full)

Properties

angle?: number

A numeric value that defines the number of degrees (0 to 360) that a text symbol is rotated. The rotation is from East in a counter-clockwise direction where East is the 0° axis.

backgroundColor?: ColorJson

Background color of the text.

borderLineColor?: ColorJson

Value indicating the the color of the border line.

borderLineSize?: number

Numeric value indicating the the size of the border line in points.

color?: ColorJson

Color is represented as a four-element array. The four elements represent values for red, green, blue, and alpha in that order. Values range from 0 through 255. If color is undefined for a symbol, the color value is null.

font?: FontJson

Font used for text symbols.

haloColor?: ColorJson

Color of the halo around the text.

haloSize?: number

Numeric value indicating the point size of a halo around the text symbol.

horizontalAlignment?:
    | "center"
    | "left"
    | "right"
    | "justify"

The horizontal alignment of the text.

kerning?: boolean

Boolean value indicating whether to adjust the spacing between characters in the text string.

rightToLeft?: boolean

Boolean value, set to true if using Hebrew or Arabic fonts.

rotated?: boolean

Boolean value indicating whether every character in the text string is rotated.

text?: string

Only applicable when specified as a client-side graphic.

type

The type of symbol. See SymbolJsonType.

verticalAlignment?:
    | "baseline"
    | "top"
    | "middle"
    | "bottom"

The vertical alignment of the text.

xoffset?: number

Numeric value indicating the offset on the x-axis in pixels.

yoffset?: number

Numeric value indicating the offset on the y-axis in pixels.