▾
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).

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.

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
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>- Create a simple renderer.
- Set a symbol color with a small alpha value, such as 0.01 to 0.1.
61 collapsed lines
<!doctype html><html> <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>
<link rel="stylesheet" href="https://js.arcgis.com/5.2/esri/themes/light/main.css" /> <!-- 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 center="-96.070373, 39.035811" zoom="3"> <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>
<script type="module"> const [Map, FeatureLayer, SimpleRenderer, SimpleFillSymbol] = await $arcgis.import([ "@arcgis/core/Map.js", "@arcgis/core/layers/FeatureLayer.js", "@arcgis/core/renderers/SimpleRenderer.js", "@arcgis/core/symbols/SimpleFillSymbol.js", ]);
const viewElement = document.querySelector("arcgis-map");
// flash flood warnings layer const layer = new FeatureLayer({ title: "Flash Flood Warnings (2002-2012)", portalItem: { id: "f9e348953b3848ec8b69964d5bceae02", }, });
layer.renderer = new SimpleRenderer({ symbol: new SimpleFillSymbol({ color: "rgba(0,76,115,0.04)", outline: null, }), });10 collapsed lines
const map = new Map({ basemap: "gray-vector", layers: [layer], });
viewElement.map = map; </script> </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.
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>- Create a simple renderer.
- Set a symbol color with a small alpha value, such as 0.01 to 0.1.
- Apply the same renderer to two or more related layers.
70 collapsed lines
<!doctype html><html> <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>
<link rel="stylesheet" href="https://js.arcgis.com/5.2/esri/themes/light/main.css" /> <!-- 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 center="-119.761946, 37.788559" rotation="0" scale="1155581"> <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>
<script type="module"> const [WebMap, FeatureLayer, SimpleRenderer, SimpleFillSymbol] = await $arcgis.import([ "@arcgis/core/WebMap.js", "@arcgis/core/layers/FeatureLayer.js", "@arcgis/core/renderers/SimpleRenderer.js", "@arcgis/core/symbols/SimpleFillSymbol.js", ]);
const viewElement = document.querySelector("arcgis-map");
const burnsLayer = new FeatureLayer({ title: "Burn areas", url: "https://services.arcgis.com/jIL9msH9OI208GCb/ArcGIS/rest/services/California_Fire_Perimeters_1878_2019/FeatureServer", layerId: 1, opacity: 1, blendMode: "multiply", });
const prescribedLayer = new FeatureLayer({ title: "Prescribed burns", url: "https://services.arcgis.com/jIL9msH9OI208GCb/ArcGIS/rest/services/California_Fire_Perimeters_1878_2019/FeatureServer", layerId: 2, opacity: 1, blendMode: "multiply", });
const renderer = new SimpleRenderer({ symbol: new SimpleFillSymbol({ color: "rgba(168, 0, 0, 0.17)", outline: null, }), }); burnsLayer.renderer = renderer; prescribedLayer.renderer = renderer;12 collapsed lines
const map = new WebMap({ portalItem: { id: "16bbd616637c4af29683d45eff023dfa", }, layers: [burnsLayer, prescribedLayer], });
viewElement.map = map; </script> </body></html>Density of multiple types
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>- Create a simple renderer for each warning type.
- Use distinct hues with the same small alpha value.
- Apply each renderer to its respective layer.
- Set
averageas the blend mode for the topmost layer.
63 collapsed lines
<!doctype html><html> <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>
<link rel="stylesheet" href="https://js.arcgis.com/5.2/esri/themes/light/main.css" /> <!-- 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 center="-97.139995, 38.788437" zoom="4"> <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>
<script type="module"> const [Map, FeatureLayer, GroupLayer, SimpleRenderer, SimpleFillSymbol] = await $arcgis.import([ "@arcgis/core/Map.js", "@arcgis/core/layers/FeatureLayer.js", "@arcgis/core/layers/GroupLayer.js", "@arcgis/core/renderers/SimpleRenderer.js", "@arcgis/core/symbols/SimpleFillSymbol.js", ]);
const viewElement = document.querySelector("arcgis-map");
// flash flood warnings layer const floods = new FeatureLayer({ title: "Flash flood warnings", portalItem: { id: "f9e348953b3848ec8b69964d5bceae02", }, renderer: new SimpleRenderer({ symbol: new SimpleFillSymbol({ color: "rgba(0,76,115,0.03)", outline: null, }), }), popupEnabled: false, blendMode: "average", });
const tornadoes = new FeatureLayer({ title: "Tornado warnings", portalItem: { id: "105fee001d244d33b90bf3ae5a243679", }, popupEnabled: false, blendMode: "average", renderer: new SimpleRenderer({ symbol: new SimpleFillSymbol({ color: "rgba(255, 128, 26,0.03)", outline: null, }), }), });15 collapsed lines
const map = new Map({ basemap: "gray-vector", layers: [ new GroupLayer({ title: "Severe weather warnings", layers: [floods, tornadoes], }), ], });
viewElement.map = map; </script> </body></html>Related samples and resources
API support
The following table describes the geometry and view types that are suited well for each visualization technique.
| 2D | 3D | Points | Lines | Polygons | Mesh | Client-side | Server-side | |
|---|---|---|---|---|---|---|---|---|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | ||||||
| | | | | | | | |
- Feature reduction selection not supported
- Only by feature reduction selection
- Only by scale-driven filter