Item page
CodePen
Sandbox Download

USA freeways styled with a unique value renderer displaying freeway types.

What is a unique types style?

A unique types style assigns distinct symbols to unique data values returned from a field or expression in a layer. You can use this style to visualize what something represents, such as:

  • Show points of interest on a map (e.g. schools, parks, places of worship)
  • Represent categories of data (e.g. regions, types)
  • Visualize ordinal data (e.g. high, medium, and low)

How a unique types style works

This style is configured with a Unique Value Renderer. This renderer requires the following:

  1. A reference to a data value either from a field name, or an Arcade expression.
  2. A list of unique value infos or unique value groups that match a unique symbol with an expected value returned from the field or expression.

Examples

Categorical data

Item page
CodePen
Sandbox Download
USA freeways are classified as interstates, state highways, U.S. highways, and other road types by a unique value renderer.
Unique types - categorical data
21 collapsed lines
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>Unique types - categorical data</title>
<!-- Load the ArcGIS Maps SDK for JavaScript from CDN -->
<script type="module" src="https://js.arcgis.com/5.2/"></script>
<style>
html,
body {
color-scheme: dark;
height: 100%;
margin: 0;
}
</style>
</head>
<body>
<arcgis-map item-id="55a6f89e8e25433da23a34bd6ba08630">
<arcgis-zoom slot="top-left"></arcgis-zoom>
<arcgis-expand slot="bottom-left" expanded>
<arcgis-legend></arcgis-legend>
</arcgis-expand>
</arcgis-map>
2 collapsed lines
</body>
</html>

Points of interest (3D)

Item page
CodePen
Sandbox Download
Points of interest in a Lyon city scene are represented by unique 3D symbols; picture marker symbols and web styles can create similar visualizations.
Unique types - points of interest (3D)
20 collapsed lines
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>Unique types - points of interest (3D)</title>
<!-- Load the ArcGIS Maps SDK for JavaScript from CDN -->
<script type="module" src="https://js.arcgis.com/5.2/"></script>
<style>
html,
body {
height: 100%;
margin: 0;
}
</style>
</head>
<body>
<arcgis-scene item-id="c6914a1571cd4e209a35019dffe4ba77">
<arcgis-zoom slot="top-left"></arcgis-zoom>
<arcgis-navigation-toggle slot="top-left"></arcgis-navigation-toggle>
<arcgis-expand slot="top-right" expanded>
<arcgis-legend></arcgis-legend>
</arcgis-expand>
</arcgis-scene>
2 collapsed lines
</body>
</html>

Ordinal data

Arcade expression classifying the numeric data
var traffic = $feature.AADT;
When(
traffic > 80000, "High",
traffic > 20000, "Medium",
"Low"
);
Item page
CodePen
Sandbox Download
Florida highways are categorized as low, medium, or high traffic with an Arcade expression.
Unique types - ordinal data
20 collapsed lines
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>Unique types - ordinal data</title>
<!-- Load the ArcGIS Maps SDK for JavaScript from CDN -->
<script type="module" src="https://js.arcgis.com/5.2/"></script>
<style>
html,
body {
height: 100%;
margin: 0;
}
</style>
</head>
<body>
<arcgis-map item-id="1e2cab3452c143698680bd075b2cbb29">
<arcgis-zoom slot="top-left"></arcgis-zoom>
<arcgis-expand slot="top-right" expanded>
<arcgis-legend></arcgis-legend>
</arcgis-expand>
</arcgis-map>
2 collapsed lines
</body>
</html>

Categorical data (3D)

Item page
CodePen
Sandbox Download
San Francisco buildings are colored by their land-use category as residential, commercial, or mixed use.
Unique types - categorical data (3D)
20 collapsed lines
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>Unique types - categorical data (3D)</title>
<!-- Load the ArcGIS Maps SDK for JavaScript from CDN -->
<script type="module" src="https://js.arcgis.com/5.2/"></script>
<style>
html,
body {
height: 100%;
margin: 0;
}
</style>
</head>
<body>
<arcgis-scene item-id="3cdd4a63acc84e64a0b911ca607366a4">
<arcgis-zoom slot="top-left"></arcgis-zoom>
<arcgis-navigation-toggle slot="top-left"></arcgis-navigation-toggle>
<arcgis-expand slot="top-right" expanded>
<arcgis-legend></arcgis-legend>
</arcgis-expand>
</arcgis-scene>
2 collapsed lines
</body>
</html>

API support

  1. Color only
  2. Size variable creators only supported for points
  3. Size variable creators not supported in 3D