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
, HTML
, 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.