Text Symbol (esriTS)

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

Referenced by: labelingInfo, symbol

Properties

Property Details
angle 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 Background 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.
borderLineColor Borderline 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.
borderLineSize Numeric value indicating the the size of the border line in points.
color 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 An object specifying the font used for the text symbol.
haloColor Color of the halo around the text.
haloSize Numeric value indicating the point size of a halo around the text symbol.
horizontalAlignment One of the following string values representing the horizontal alignment of the text.
Valid values:
  • center
  • justify
  • left
  • right
kerning Boolean value indicating whether to adjust the spacing between characters in the text string.
rightToLeft Boolean value, set to true if using Hebrew or Arabic fonts.
rotated Boolean value indicating whether every character in the text string is rotated.
text A string value used for text graphics in map notes layers.
type Specifies the type of symbol used.
Valid value of this property esriTS
verticalAlignment One of the following string values representing the vertical alignment of the text.
Valid values:
  • baseline
  • bottom
  • middle
  • top
xoffset Numeric value indicating the offset on the x-axis in points.
yoffset Numeric value indicating the offset on the y-axis in points.

Text Symbol Example

{
  "type": "esriTS",
  "color": [
    78,
    78,
    78,
    255
  ],
  "backgroundColor": [
    0,
    0,
    0,
    0
  ],
  "borderLineSize": 2,
  "borderLineColor": [
    255,
    0,
    255,
    255
  ],
  "haloSize": 2,
  "haloColor": [
    0,
    255,
    0,
    255
  ],
  "verticalAlignment": "bottom",
  "horizontalAlignment": "left",
  "rightToLeft": false,
  "angle": 0,
  "xoffset": 0,
  "yoffset": 0,
  "kerning": true,
  "font": {
    "family": "Arial",
    "size": 12,
    "style": "normal",
    "weight": "bold",
    "decoration": "none"
  }
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.