popups

This bundle provides support for displaying custom contents (feature information and title) and custom actions based on the clicked feature in map popups.

It provides also a way to configure the behavior of the popup, like docking.

It also provides the mechanism for adding a default popup. Without the need of manual configuration,
layers that do not initially have a popup configured, will get the default popup type assigned.

Implementors of custom content only need to comply with the interfaces defined by this bundle to get their content into a popup,
while app creators can easily link layers of their map configuration to custom content by type IDs.
See this bundle's API docs for details.

Usage

You can control the popup behaviour like docking by setting various options as described in the Configuration Reference.

Default Popups

If the defaultPopupEnabled property is true the defaultPopupType is added to any map image and feature layer which do not declare a popup template.

A special case are WMS Layer, in this case the defaultPopupEnabled will automatically set the popupEnabled to true in all sublayers of a WMS.
You can prevent this behavior by setting the flag popupEnabled to false on a WMSLayer.

You will require to add the popups-default bundle to your app to get the default popups working in your app.
The PopupDefinitionFactory implementation for the defaultPopupType value default is located there.
See popups-default for further configuration capabilities.

Custom Popups

This bundle provides the api to integrate custom popup content.
To make use of custom popups you need following:

Display actions dependant on the selected feature

You can provide the method isVisibleForFeature(feature) in your custom action implementation that should return true if you want your action to be displayed for that feature and false if it should be hidden.

If you do not provide that method, actions are visible for every feature (of a layer the action is configured for) by default.

Using the provided default popup only for specific layers

In some cases, you might not want to use the provided default popup from the popups-default bundle in all of your layers (without a configured popup template), but only in some specific layers.
You have two options to do this:

Leave the popup bundle configuration as is and for the layers you want to exclude, in your layer's configuration set popupEnabled to false (as described in the ESRI JS API).

The other option is, to disable the default popup mechanism entirely by setting defaultPopupEnabled of this bundle to false. Then add the popups-default bundle to your app and set the popupType to default only for those layers, you want the popup for.

Using your own popup implementation as a default

As mentioned above, it is possible to configure another popup type to be used as a default popup.
To do this, just set the defaultPopupType property to the type that your own custom popup definition factory provides.
For example, if you wanted to use the popup from the sample above, set defaultPopupType to tweetable and ensure, that the bundle containing your factory is used in your app.