Symbol Objects

Overview

This topic discusses the JSON representation of statistics objects. The following objects are discussed here:

  • Color
  • Simple Marker Symbol
  • Simple Line Symbol
  • Simple Fill Symbol
  • Picture Marker Symbol
  • Picture Fill Symbol
  • Text Symbol

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.

Use dark colors for code blocksCopy
1
[ <red>, <green>, <blue>, <alpha> ]

Simple Marker Symbol

Simple marker symbols can be used to symbolize point geometries. The type property for simple marker symbols is esriSMS. The angle property defines the number of degrees (0 to 360) that a marker symbol is rotated. The rotation is from East in a counter-clockwise direction where East is the 0° axis.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
{
  "type": "esriSMS",
  "style": "< esriSMSCircle | esriSMSCross | esriSMSDiamond | esriSMSSquare | esriSMSX | esriSMSTriangle >",
  "color": <color>,
  "size": <size>,
  "angle": <angle>,
  "xoffset": <xoffset>,
  "yoffset": <yoffset>,
  "outline": { //if outline has been specified
    "color": <color>,
    "width": <width>
  }
}

Simple Line Symbol

Simple line symbols can be used to symbolize polyline geometries or outlines for polygon fills. The type property for simple line symbols is esriSLS.

Use dark colors for code blocksCopy
1
2
3
4
5
6
{
  "type": "esriSLS",
  "style": "< esriSLSDash | esriSLSDashDot | esriSLSDashDotDot | esriSLSDot | esriSLSNull | esriSLSSolid >",
  "color": <color>,
  "width": <width>
}

Simple Fill Symbol

Simple fill symbols can be used to symbolize polygon geometries. The type property for simple fill symbols is esriSFS.

Use dark colors for code blocksCopy
1
2
3
4
5
6
{
  "type": "esriSFS",
  "style": "<esriSFSBackwardDiagonal | esriSFSCross | esriSFSDiagonalCross | esriSFSForwardDiagonal | esriSFSHorizontal | esriSFSNull | esriSFSSolid | esriSFSVertical>",
  "color": <color>,
  "outline": <simpleLineSymbol> //if outline has been specified
}

Picture Marker Symbol

Picture marker symbols can be used to symbolize point geometries. The type property for picture marker symbols is esriPMS.

Keep the following in mind when using this object:

  • These symbols include the base64 encoded imageData as well as a url that could be used to retrieve an image from the server. This is a relative URL for static layers and a full URL for dynamic layers in a map aervice.
  • To resize the symbol specify only the height in points. For an image to be displayed in its original size, height and width can be skipped.
  • The angle property defines the number of degrees (0 to 360) that a marker symbol is rotated. The rotation is from East in a counter-clockwise direction where East is the 0° axis.
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
{
  "type": "esriPMS",
  "url": "<imageUrl>", //Relative URL for static layers and full URL for dynamic layers. Access relative URL using http://<mapservice-url>/<layerId1>/images/<imageUrl11>
  "imageData": "<base64EncodedImageData>",
  "contentType": "<imageContentType>",
  "width": <width>,
  "height": <height>,
  "angle": <angle>,
  "xoffset": <xoffset>,
  "yoffset": <yoffset>
}

Picture Fill Symbol

Picture fill symbols can be used to symbolize polygon geometries. The type property for picture fill symbols is esriPFS.

Keep the following in mind while working with this object:

  • These symbols include the base64 encoded imageData as well as a url that could be used to retrieve an image from the server. This is a relative URL for static layers and a full URL for dynamic layers in a map service.
  • To resize the symbol specify only the height in points. For an image to be displayed in its original size, height and width can be skipped.
  • The angle property defines the number of degrees (0 to 360) that a marker symbol is rotated. The rotation is from East in a counter-clockwise direction where East is the 0° axis.
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
  "type": "esriPFS",
  "url": "<imageUrl>", //Relative URL for static layers and full URL for dynamic layers. Access relative URL using http://<mapservice-url>/<layerId1>/images/<imageUrl11>
  "imageData": "<base64EncodedImageData>",
  "contentType": "<imageContentType>",
  "outline": <simpleLineSymbol>, //if outline has been specified
  "width": <width>,
  "height": <height>,
  "angle": <angle>,
  "xoffset": <xoffset>,
  "yoffset": <yoffset>,
  "xscale": <xscale>,
  "yscale": <yscale>
}

Text Symbol

Text symbols are used to add text to a feature (labeling). The type property for text symbols is esriTS.

Keep the following in mind when working with this object:

  • The borderlineSize, haloSize, and size properties are specified in points.
  • When used in a dynamic layer to specify a labeling object, as part of drawingInfo, the angle property is ignored. Also, the labeling engine can override verticalAlignment and horizontalAlignment values for proper label placement.
  • When used in an Export Web Map Task as part of specifying a client-side graphic, use text to specify the text that appears on the graphic. The text symbol used in export web map task supports angle, horizontalAlignment, and verticalAlignment properties. It does not support transparency (alpha) used in color. The angle property 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.
  • Support for the style and weight properties are dependent on the specified font. Not all fonts support all the values. In most cases bold and bolder are the same.
  • The rightToLeft property only affects Hebrew and Arabic fonts.
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{
  "type": "esriTS",
  "color": <color>,
  "backgroundColor": <color>,
  "borderLineSize": <size>,
  "borderLineColor": <color>,
  "haloSize": <size>,
  "haloColor": <color>,
  "verticalAlignment": "<baseline | top | middle | bottom>",
  "horizontalAlignment": "<left | right | center | justify>",
  "rightToLeft": <true | false>,
  "angle": <angle>,
  "xoffset": <xoffset>,
  "yoffset": <yoffset>,
  "kerning": <true | false>,
  "font": {
    "family": "<fontFamily>",
    "size": <fontSize>,
    "style": "<italic | normal | oblique>",
    "weight": "<bold | bolder | lighter | normal>",
    "decoration": "<line-through | underline | none>"
  },
  "text": "<client-side graphic text>" //only applicable when specified as a client-side graphic.
}

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