FRAMES | NO FRAMES
Renderer Objects

Overview

This document discusses the JSON renderer objects as returned by the REST API.

The following renderers are discussed here:

Simple Renderer

A renderer that uses one symbol only. The type property for simple renderers is simple.

JSON Syntax

{
  "type" : "simple",
  "symbol" :  <symbol>,
  "label" : "<label>",
  "description" : "<description>"
}

JSON Example

{  
   "type": "simple",
   "symbol": 
   {
	"type": "esriSMS",
    "style": "esriSMSCircle",
    "color": [255,0,0,255],
    "size": 5,
    "angle": 0,
    "xoffset": 0,
    "yoffset": 0,
    "outline": 
	{
     "color": [0,0,0,255],
     "width": 1
    }
   },
   "label": "",
   "description": ""
}

Unique Value Renderer

A unique value renderer symbolizes groups of features that have matching field values. The type property for unique value renderers is uniqueValue.

JSON Syntax

{
  "type" : "uniqueValue",
  "field1" : "<field1>",
  "field2" : "<field2>",
  "field3" : "<field3>",
  "fieldDelimiter" : "<fieldDelimiter>",
  "defaultSymbol" :  <symbol>,
  "defaultLabel" : "<defaultLabel>",
  "uniqueValueInfos" : [
    {
      "value" : "<value1>",
      "label" : "<label1>",
      "description" : "<description1>",
      "symbol" :  <symbol1>
    },
    {
      "value" : "<value2>",
      "label" : "<label2>",
      "description" : "<description2>",
      "symbol" :  <symbol2>
    }
  ]
}

JSON Example

{
      "type" : "uniqueValue", 
      "field1" : "SubtypeCD", 
      "field2" : null, 
      "field3" : null, 
      "fieldDelimiter" : ", ", 
      "defaultSymbol" : 
      {
        "type" : "esriSLS", 
        "style" : "esriSLSSolid", 
        
        "color" : [130,130,130,255], 
        "width" : 1
      }, 
      "defaultLabel" : "\u003Other values\u003e", 
      "uniqueValueInfos" : [
        {
          "value" : "1", 
          "label" : "Duct Bank", 
          "description" : "Duct Bank description", 
          "symbol" : 
          {
            "type" : "esriSLS", 
            "style" : "esriSLSDash", 
            
            "color" : [76,0,163,255], 
            "width" : 1
          }
        }, 
        {
          "value" : "2", 
          "label" : "Trench", 
          "description" : "Trench description", 
          "symbol" : 
          {
            "type" : "esriSLS", 
            "style" : "esriSLSDot", 
            
            "color" : [115,76,0,255], 
            "width" : 1
          }
        }
      ]
}

Class Breaks Renderer

A class breaks renderer symbolizes each feature based on the value of some numeric field. The type property for class breaks renderers is classBreaks.

JSON Syntax

{
  "type" : "classBreaks",
  "field" : "<field>",
  "minValue" : <minValue>,
  "classBreakInfos" : [
    {
      "classMaxValue" : <classMaxValue1>,
      "label" : "<label1>",
      "description" : "<description1>",
      "symbol" :  <symbol1>
    },
    {
      "classMaxValue" : <classMaxValue2>,
      "label" : "<label2>",
      "description" : "<description2>",
      "symbol" :  <symbol2>
    }
  ]
}

JSON Example

{ 	
      "type" : "classBreaks", 
      "field" : "Shape.area", 
      "minValue" : 10.3906320193541, 
      "classBreakInfos" : [
        {
          "classMaxValue" : 1000, 
          "label" : "10.0 - 1000.000000", 
          "description" : "10 to 1000", 
          "symbol" : 
          {
            "type" : "esriSFS", 
            "style" : "esriSFSSolid", 
            
            "color" : [236,252,204,255], 
            "outline" : 
            {
              "type" : "esriSLS", 
              "style" : "esriSLSSolid", 
              
              "color" : [110,110,110,255], 
              "width" : 0.4
            }
          }
        }, 
        {
          "classMaxValue" : 5000, 
          "label" : "1000.000001 - 5000.000000", 
          "description" : "1000 to 5000", 
          "symbol" : 
          {
            "type" : "esriSFS", 
            "style" : "esriSFSSolid", 
            
            "color" : [218,240,158,255], 
            "outline" : 
            {
              "type" : "esriSLS", 
              "style" : "esriSLSSolid", 
              
              "color" : [110,110,110,255], 
              "width" : 0.4
            }
          }
        }
      ]
}