UniqueValue Renderer

This renderer symbolizes features based on one or more matching string attributes.

Referenced by: renderer

Properties

Property Details
authoringInfo An object containing metadata about the authoring process for creating a renderer object. This allows the authoring clients to save specific settings so that next time it is accessed via the UI, their selections are remembered. Non-authoring clients can ignore it.
backgroundFillSymbol A symbol used for polygon features as a background if the renderer uses point symbols, e.g. for bivariate types & size rendering. Only applicable to polygon layers. PictureFillSymbols can also be used outside of the Map Viewer for Size and Predominance and Size renderers.
defaultLabel Default label for the default symbol used to draw unspecified values.
defaultSymbol Symbol used when a value cannot be matched.
drawInClassOrder Indicates whether the order of the classes in the renderer definition should be used for the feature drawing order of the layer. If orderBy is set in the layerDefinition, then that will take precedence over this property.
field1 Attribute field renderer uses to match values.
field2 If needed, specify an additional attribute field the renderer uses to match values.
field3 If needed, specify an additional attribute field the renderer uses to match values.
fieldDelimiter String inserted between the values if multiple attribute fields are specified.
legendOptions Allows the user to override the layer title with a more descriptive title of the renderer.
See legendOptions properties table.
rotationExpression A constant value or an expression that derives the angle of rotation based on a feature attribute value. When an attribute name is specified, it's enclosed in square brackets. Rotation is set using a visual variable of type rotationInfo with a specified field or valueExpression property.
rotationType String property which controls the origin and direction of rotation. If the rotationType is defined as arithmetic the symbol is rotated from East in a counter-clockwise direction where East is the 0 degree axis. If the rotationType is defined as geographic, the symbol is rotated from North in a clockwise direction where North is the 0 degree axis.
Valid values:
  • arithmetic
  • geographic
type Specifies the type of renderer used.
Valid value of this property uniqueValue
uniqueValueGroups[] An array of uniqueValueGroup objects. If present, then uniqueValueGroups should be used in favor of uniqueValueInfos.
uniqueValueInfos[] An array of uniqueValueInfo objects. If uniqueValueGroups is present, then this property should be ignored during webmap reading. In the future, this property will be deprecated and eventually removed.
valueExpression An Arcade expression evaluating to either a string or a number.
valueExpressionTitle The title identifying and describing the associated Arcade expression as defined in the valueExpression property.
visualVariables[] An array of objects used to set rendering properties.

legendOptions properties

Property Details
title The title of the legend.

temporal Example

Live sample web maps showing uniqueValue renderer

{
  "type": "uniqueValue",
  "field1": "COUNTRY",
  "uniqueValueInfos": [
    {
      "value": "US",
      "symbol": {
        "color": [
          253,
          127,
          111,
          255
        ],
        "size": 12.75,
        "angle": 0,
        "xoffset": 0,
        "yoffset": 0,
        "type": "esriSMS",
        "style": "esriSMSCircle",
        "outline": {
          "color": [
            26,
            26,
            26,
            255
          ],
          "width": 0.75,
          "type": "esriSLS",
          "style": "esriSLSSolid"
        }
      },
      "label": "US"
    },
    {
      "value": "Canada",
      "symbol": {
        "color": [
          126,
          176,
          213,
          255
        ],
        "size": 12.75,
        "angle": 0,
        "xoffset": 0,
        "yoffset": 0,
        "type": "esriSMS",
        "style": "esriSMSCircle",
        "outline": {
          "color": [
            26,
            26,
            26,
            255
          ],
          "width": 0.75,
          "type": "esriSLS",
          "style": "esriSLSSolid"
        }
      },
      "label": "Canada"
    },
    {
      "value": "Brazil",
      "symbol": {
        "color": [
          178,
          224,
          97,
          255
        ],
        "size": 12.75,
        "angle": 0,
        "xoffset": 0,
        "yoffset": 0,
        "type": "esriSMS",
        "style": "esriSMSCircle",
        "outline": {
          "color": [
            26,
            26,
            26,
            255
          ],
          "width": 0.75,
          "type": "esriSLS",
          "style": "esriSLSSolid"
        }
      },
      "label": "Brazil"
    },
    {
      "value": "Mexico",
      "symbol": {
        "color": [
          189,
          126,
          190,
          255
        ],
        "size": 12.75,
        "angle": 0,
        "xoffset": 0,
        "yoffset": 0,
        "type": "esriSMS",
        "style": "esriSMSCircle",
        "outline": {
          "color": [
            26,
            26,
            26,
            255
          ],
          "width": 0.75,
          "type": "esriSLS",
          "style": "esriSLSSolid"
        }
      },
      "label": "Mexico"
    }
  ]
}

Unique value renderer with grouped symbols, but no headings Example

A Unique Value Renderer where multiple unique value info objects combine into classes, and represented with the same symbol. This just handles multiple entries without legend headings.

{
  "type": "uniqueValue",
  "field1": "CLASS",
  "legendOptions": {
    "title": "Highway type"
  },
  "defaultLabel": "Other Highway",
  "defaultSymbol": {
    "type": "esriSLS",
    "color": [
      128,
      128,
      128,
      255
    ],
    "width": 0.375,
    "style": "esriSLSSolid"
  },
  "uniqueValueGroups": [
    {
      "classes": [
        {
          "label": "Freeway",
          "symbol": {
            "type": "esriSLS",
            "color": [
              48,
              255,
              234,
              255
            ],
            "width": 0.375,
            "style": "esriSLSSolid"
          },
          "values": [
            [
              "Interstate"
            ]
          ]
        },
        {
          "label": "U.S. Highway",
          "symbol": {
            "type": "esriSLS",
            "color": [
              255,
              98,
              7,
              255
            ],
            "width": 0.375,
            "style": "esriSLSSolid"
          },
          "values": [
            [
              "Major highway"
            ],
            [
              "Minor highway"
            ]
          ]
        },
        {
          "label": "Local Highway",
          "symbol": {
            "type": "esriSLS",
            "color": [
              239,
              55,
              172,
              255
            ],
            "width": 0.375,
            "style": "esriSLSSolid"
          },
          "values": [
            [
              "State hwy"
            ],
            [
              "State hwy - toll"
            ]
          ]
        }
      ]
    }
  ],
  "uniqueValueInfos": [
    {
      "label": "Interstate",
      "symbol": {
        "type": "esriSLS",
        "color": [
          48,
          255,
          234,
          255
        ],
        "width": 0.375,
        "style": "esriSLSSolid"
      },
      "value": "Interstate"
    },
    {
      "label": "Expressway",
      "symbol": {
        "type": "esriSLS",
        "color": [
          255,
          255,
          0,
          255
        ],
        "width": 0.375,
        "style": "esriSLSSolid"
      },
      "value": "Expressway"
    },
    {
      "label": "Major Highway",
      "symbol": {
        "type": "esriSLS",
        "color": [
          255,
          98,
          7,
          255
        ],
        "width": 0.375,
        "style": "esriSLSSolid"
      },
      "value": "Major highway"
    },
    {
      "label": "Minor Highway",
      "symbol": {
        "type": "esriSLS",
        "color": [
          255,
          0,
          0,
          255
        ],
        "width": 0.375,
        "style": "esriSLSSolid"
      },
      "value": "Minor highway"
    },
    {
      "label": "State Highway",
      "symbol": {
        "type": "esriSLS",
        "color": [
          239,
          55,
          172,
          255
        ],
        "width": 0.375,
        "style": "esriSLSSolid"
      },
      "value": "State hwy"
    },
    {
      "label": "Toll Road",
      "symbol": {
        "type": "esriSLS",
        "color": [
          0,
          0,
          255,
          255
        ],
        "width": 0.375,
        "style": "esriSLSSolid"
      },
      "value": "State hwy - toll"
    }
  ]
}

Unique value renderer with headings, but no grouped symbols Example

A Unique Value Renderer where all unique value info objects map belong to distinct classes, and are grouped together under legend headings.

{
  "type": "uniqueValue",
  "field1": "CLASS",
  "legendOptions": {
    "title": "Highway type"
  },
  "defaultLabel": "Other Highway",
  "defaultSymbol": {
    "type": "esriSLS",
    "color": [
      128,
      128,
      128,
      255
    ],
    "width": 0.375,
    "style": "esriSLSSolid"
  },
  "uniqueValueGroups": [
    {
      "heading": "Freeways",
      "classes": [
        {
          "label": "Interstate",
          "symbol": {
            "type": "esriSLS",
            "color": [
              48,
              255,
              234,
              255
            ],
            "width": 0.375,
            "style": "esriSLSSolid"
          },
          "values": [
            [
              "Interstate"
            ]
          ]
        },
        {
          "label": "Expressway",
          "symbol": {
            "type": "esriSLS",
            "color": [
              255,
              255,
              0,
              255
            ],
            "width": 0.375,
            "style": "esriSLSSolid"
          },
          "values": [
            [
              "Expressway"
            ]
          ]
        }
      ]
    },
    {
      "heading": "Highways",
      "classes": [
        {
          "label": "Major Highway",
          "symbol": {
            "type": "esriSLS",
            "color": [
              255,
              98,
              7,
              255
            ],
            "width": 0.375,
            "style": "esriSLSSolid"
          },
          "values": [
            [
              "Major highway"
            ]
          ]
        },
        {
          "label": "Minor Highway",
          "symbol": {
            "type": "esriSLS",
            "color": [
              255,
              0,
              0,
              255
            ],
            "width": 0.375,
            "style": "esriSLSSolid"
          },
          "values": [
            [
              "Minor highway"
            ]
          ]
        },
        {
          "label": "State Highway",
          "symbol": {
            "type": "esriSLS",
            "color": [
              239,
              55,
              172,
              255
            ],
            "width": 0.375,
            "style": "esriSLSSolid"
          },
          "values": [
            [
              "State hwy"
            ]
          ]
        },
        {
          "label": "Toll Road",
          "symbol": {
            "type": "esriSLS",
            "color": [
              0,
              0,
              255,
              255
            ],
            "width": 0.375,
            "style": "esriSLSSolid"
          },
          "values": [
            [
              "State hwy - toll"
            ]
          ]
        }
      ]
    }
  ],
  "uniqueValueInfos": [
    {
      "label": "Interstate",
      "symbol": {
        "type": "esriSLS",
        "color": [
          48,
          255,
          234,
          255
        ],
        "width": 0.375,
        "style": "esriSLSSolid"
      },
      "value": "Interstate"
    },
    {
      "label": "Expressway",
      "symbol": {
        "type": "esriSLS",
        "color": [
          255,
          255,
          0,
          255
        ],
        "width": 0.375,
        "style": "esriSLSSolid"
      },
      "value": "Expressway"
    },
    {
      "label": "Major Highway",
      "symbol": {
        "type": "esriSLS",
        "color": [
          255,
          98,
          7,
          255
        ],
        "width": 0.375,
        "style": "esriSLSSolid"
      },
      "value": "Major highway"
    },
    {
      "label": "Minor Highway",
      "symbol": {
        "type": "esriSLS",
        "color": [
          255,
          0,
          0,
          255
        ],
        "width": 0.375,
        "style": "esriSLSSolid"
      },
      "value": "Minor highway"
    },
    {
      "label": "State Highway",
      "symbol": {
        "type": "esriSLS",
        "color": [
          239,
          55,
          172,
          255
        ],
        "width": 0.375,
        "style": "esriSLSSolid"
      },
      "value": "State hwy"
    },
    {
      "label": "Toll Road",
      "symbol": {
        "type": "esriSLS",
        "color": [
          0,
          0,
          255,
          255
        ],
        "width": 0.375,
        "style": "esriSLSSolid"
      },
      "value": "State hwy - toll"
    }
  ]
}

Unique value renderer with headings and grouped symbols Example

A Unique Value Renderer with multiple values assigned to unique value classes and grouped together under legend headings.

{
  "type": "uniqueValue",
  "field1": "CLASS",
  "legendOptions": {
    "title": "Highway type"
  },
  "defaultLabel": "Other Highway",
  "defaultSymbol": {
    "type": "esriSLS",
    "color": [
      128,
      128,
      128,
      255
    ],
    "width": 0.375,
    "style": "esriSLSSolid"
  },
  "uniqueValueGroups": [
    {
      "heading": "Highways",
      "classes": [
        {
          "label": "U.S. Highway",
          "symbol": {
            "type": "esriSLS",
            "color": [
              255,
              98,
              7,
              255
            ],
            "width": 0.375,
            "style": "esriSLSSolid"
          },
          "values": [
            [
              "Major highway"
            ],
            [
              "Minor highway"
            ]
          ]
        },
        {
          "label": "Local Highway",
          "symbol": {
            "type": "esriSLS",
            "color": [
              239,
              55,
              172,
              255
            ],
            "width": 0.375,
            "style": "esriSLSSolid"
          },
          "values": [
            [
              "State hwy"
            ],
            [
              "State hwy - toll"
            ]
          ]
        }
      ]
    },
    {
      "classes": [
        {
          "label": "Freeway",
          "symbol": {
            "type": "esriSLS",
            "color": [
              48,
              255,
              234,
              255
            ],
            "width": 0.375,
            "style": "esriSLSSolid"
          },
          "values": [
            [
              "Interstate"
            ],
            [
              "Expressway"
            ]
          ]
        }
      ]
    }
  ],
  "uniqueValueInfos": [
    {
      "label": "Freeway",
      "symbol": {
        "type": "esriSLS",
        "color": [
          48,
          255,
          234,
          255
        ],
        "width": 0.375,
        "style": "esriSLSSolid"
      },
      "value": "Interstate"
    },
    {
      "label": "Freeway",
      "symbol": {
        "type": "esriSLS",
        "color": [
          48,
          255,
          234,
          255
        ],
        "width": 0.375,
        "style": "esriSLSSolid"
      },
      "value": "Expressway"
    },
    {
      "label": "U.S. Highway",
      "symbol": {
        "type": "esriSLS",
        "color": [
          255,
          98,
          7,
          255
        ],
        "width": 0.375,
        "style": "esriSLSSolid"
      },
      "value": "Major highway"
    },
    {
      "label": "U.S. Highway",
      "symbol": {
        "type": "esriSLS",
        "color": [
          255,
          98,
          7,
          255
        ],
        "width": 0.375,
        "style": "esriSLSSolid"
      },
      "value": "Minor highway"
    },
    {
      "label": "Local Highway",
      "symbol": {
        "type": "esriSLS",
        "color": [
          239,
          55,
          172,
          255
        ],
        "width": 0.375,
        "style": "esriSLSSolid"
      },
      "value": "State hwy"
    },
    {
      "label": "Local Highway",
      "symbol": {
        "type": "esriSLS",
        "color": [
          239,
          55,
          172,
          255
        ],
        "width": 0.375,
        "style": "esriSLSSolid"
      },
      "value": "State hwy - toll"
    }
  ]
}

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