Item page
CodePen
Sandbox Download

Flash flood warnings from 2002 to 2012 are symbolized transparently to reveal areas of more frequent activity.

What is per feature opacity?

Layers with lots of overlapping features can be effectively visualized by setting a highly transparent symbol on all features (at least 90-99 percent transparency works best). This is particularly effective for showing areas where many polygons and polylines stack on top of one another.

For example, the following map shows areas that underwent a flash flood warning over a 10-year period. Each polygon represents one flash flood warning that lasted a time span of one to 12 hours. Each is assigned a blue fill symbol with an alpha level of 0.04 (96% transparency).

opacity 0.04

Figure A:

Flash flood warnings visualized as highly transparent polygons. Opaque areas experienced a high number of flash flood warnings. Transparent areas experienced fewer flash flood warnings.

Areas that experienced just one flash flood warning will have an opacity value of 0.04. Areas that experienced more than one will have a higher opacity value, making it more visible.

When opacity is not set on a per feature basis, you can only distinguish areas that experienced at least one flash flood warning.

opacity full

Figure B:

Flash flood warnings visualized as opaque polygons. There is no visual cue indicating areas that experienced more warnings than others.

This visualization technique works whether you have all your data stored in one layer, or separated in multiple layers. Each feature’s transparency multiplies with other overlapping features in either scenario, so you can easily see where a higher density of features exist compared to areas with sparse features.

How per feature opacity works

Opacity can only be set on a feature per feature basis via the color property of the symbol representing each feature. This allows the opacity at a given pixel to multiply across overlapping features.

Note the color value in the snippet below. Each parameter represents a color channel (i.e. rgba(red, green, blue, alpha)). The alpha (i.e. opacity) value must be a very small number. Depending on the density of features, a number between 0.01 and 0.1 usually works best.

Examples

Polygon density from one layer

Item page
CodePen
Sandbox Download
Transparent flash flood warning polygons reveal areas with more intense activity.
Opacity - flash flood warnings
31 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>Opacity - flash flood warnings</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;
}
#titleDiv {
background-color: white;
padding: 10px;
}
#titleText {
font-size: 20pt;
font-weight: 60;
padding-bottom: 10px;
}
</style>
</head>
<body>
<arcgis-map item-id="8882ff9197bb4d2ca7a9dbb712013ffc">
<arcgis-zoom slot="top-left"></arcgis-zoom>
<arcgis-expand slot="top-left">
<arcgis-legend></arcgis-legend>
</arcgis-expand>
<div id="titleDiv" slot="top-right">
<div id="titleText">Flash Floods by Season</div>
<div>Flash Flood Warnings (2002 - 2012)</div>
</div>
</arcgis-map>
2 collapsed lines
</body>
</html>

Polygon density from two layers

When comparing density across multiple layers, apply the same symbol to related layers so their overlapping features combine visually.

Item page
CodePen
Sandbox Download
California burn areas show where prescribed, natural, and accidental fires occurred from 1878 to 2020.
Opacity - California burn areas
31 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>Opacity - California burn areas</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;
}
#titleDiv {
background-color: white;
padding: 10px;
}
#titleText {
font-size: 20pt;
font-weight: 60;
padding-bottom: 10px;
}
</style>
</head>
<body>
<arcgis-map item-id="9950ee3ec168417aaabc732cd7b5384f">
<arcgis-zoom slot="top-left"></arcgis-zoom>
<arcgis-expand slot="top-left">
<arcgis-legend></arcgis-legend>
</arcgis-expand>
<div id="titleDiv" slot="top-right">
<div id="titleText">California fires</div>
<div>Burn areas (1878 - 2020)</div>
</div>
<arcgis-layer-list slot="top-right"></arcgis-layer-list>
</arcgis-map>
2 collapsed lines
</body>
</html>

Density of multiple types

Item page
CodePen
Sandbox Download
Flash flood and tornado warnings from 2002 to 2012 use transparent blue and orange symbols to reveal areas dominated by one warning type or both.
Opacity - severe weather warnings
25 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>Opacity - severe weather warnings</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;
}
#titleDiv {
background-color: white;
padding: 10px;
}
</style>
</head>
<body>
<arcgis-map item-id="ee871fa58c834473bf29cd6067d69695">
<arcgis-zoom slot="top-left"></arcgis-zoom>
<arcgis-expand slot="top-left">
<arcgis-legend></arcgis-legend>
</arcgis-expand>
<div id="titleDiv" slot="top-right">
<div>Flash Floods and tornadoes (2002 - 2012)</div>
</div>
<arcgis-layer-list slot="top-right"></arcgis-layer-list>
</arcgis-map>
2 collapsed lines
</body>
</html>

API support

The following table describes the geometry and view types that are suited well for each visualization technique.

  • Full support
  • Partial support
  • No support
2D3DPointsLinesPolygonsMeshClient-sideServer-side
  1. Feature reduction selection not supported
  2. Only by feature reduction selection
  3. Only by scale-driven filter