Custom popup content

This sample demonstrates how to work with custom content elements within the PopupTemplate's content. There are five types of popup elements: fields, media, text, attachments, and custom. The custom content elements is set via the creator property. This property passes in a function which returns either a: String, HTMLElement, Widget, or a promise.

This particular sample shows how to set two types of custom content in the PopupTemplate's content. The first contains a Search widget. The second is a promise resulting from a query.

Click on a state within the map to display the popup. Notice that these two elements display. It is possible to search for another state within the Search widget. It will zoom to the selected feature and update the existing popupTemplate with that state's information.

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