Legend widget

This sample demonstrates how to add a Legend fora WebMap Layer to a 2D MapView. The map shows predominant educational attainment with darker colors indicating a stronger predominance.

The Legend widget can also be added to a 3D SceneView. You can use DefaultUI.add() method to add Legend to the UI. The widget renders inside its own DOM node nested within the view node. Legend must reference its respective View through the view property of the widget constructor object.

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

The developer dashboard has moved

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close