Class Popup
- java.lang.Object
-
- com.esri.arcgisruntime.mapping.popup.Popup
-
public final class Popup extends java.lang.ObjectRepresents the combination of aPopupDefinitionand aGeoElement, which allows a visual representation of the GeoElement's attributes as well as the ability to edit them.- Since:
- 100.0.0
-
-
Constructor Summary
Constructors Constructor Description Popup(GeoElement geoElement)Creates a new popup from aGeoElement.Popup(GeoElement geoElement, PopupDefinition popupDefinition)Creates a new popup from aGeoElementandPopupDefinition.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ListenableFuture<java.util.List<PopupExpressionEvaluation>>evaluateExpressionsAsync()Asynchronously evaluates all expressions available atPopupDefinition.getExpressions()or atExpressionPopupElement.getPopupExpression().java.lang.StringgetDescription()Gets the description of the Popup.java.util.List<PopupElement>getEvaluatedElements()Gets an unmodifiable list ofPopupElementobjects evaluated asynchronously byevaluateExpressionsAsync().java.lang.StringgetFormattedValue(PopupField popupField)Gets the formatted value of the popup field.GeoElementgetGeoElement()Gets theGeoElementof the pop-up.PopupDefinitiongetPopupDefinition()Gets the popup definition associated with the popup.SymbolgetSymbol()Gets the symbol of the Popup.java.lang.StringgetTitle()Gets the title of the Popup.
-
-
-
Constructor Detail
-
Popup
public Popup(GeoElement geoElement)
Creates a new popup from aGeoElement. This method creates a defaultPopupDefinitionwith default properties and default popup elements based on the givenGeoElement.- Parameters:
geoElement- theGeoElementfor the popup, such as aFeatureorGraphic- Throws:
java.lang.IllegalArgumentException- if geoElement is null- Since:
- 100.0.0
-
Popup
public Popup(GeoElement geoElement, PopupDefinition popupDefinition)
Creates a new popup from aGeoElementandPopupDefinition.If the
PopupDefinitionis null, a new one will be created based off the attributes of theGeoElement.- Parameters:
geoElement- theGeoElementfor the popup, such as aFeatureorGraphicpopupDefinition- the PopupDefinition- Throws:
java.lang.IllegalArgumentException- if geoElement is null- Since:
- 100.0.0
-
-
Method Detail
-
getPopupDefinition
public PopupDefinition getPopupDefinition()
Gets the popup definition associated with the popup.- Returns:
- the popup definition associated with the popup
- Since:
- 100.0.0
-
getGeoElement
public GeoElement getGeoElement()
Gets theGeoElementof the pop-up.- Returns:
- the
GeoElementof the pop-up - Since:
- 100.0.0
-
getTitle
public java.lang.String getTitle()
Gets the title of the Popup.- Returns:
- the title of the Popup
- Since:
- 100.0.0
-
getDescription
public java.lang.String getDescription()
Gets the description of the Popup.- Returns:
- the description of the Popup
- Since:
- 100.0.0
-
getSymbol
public Symbol getSymbol()
Gets the symbol of the Popup.- Returns:
- the symbol of the Popup
- Since:
- 100.0.0
-
getFormattedValue
public java.lang.String getFormattedValue(PopupField popupField)
Gets the formatted value of the popup field.Dates/times are returned in the local timezone. If
PopupDefinition.getExpressions()is not empty, then it is possible that thePopupFieldmay be using expressions with Arcade FeatureSets functions. UseevaluateExpressionsAsync()to evaluate the Arcade expressions before trying to get the formatted String representation of the popup field's value; otherwise it may return an empty string or "0.00" if the return type isPopupExpression.ReturnType.NUMBER.If the field is part of a
CodedValueDomain, theCodedValue.getName()is returned.- Parameters:
popupField- the popup field- Returns:
- the formatted string representing the value of the popup field.
- Since:
- 100.3.0
-
evaluateExpressionsAsync
public ListenableFuture<java.util.List<PopupExpressionEvaluation>> evaluateExpressionsAsync()
Asynchronously evaluates all expressions available atPopupDefinition.getExpressions()or atExpressionPopupElement.getPopupExpression(). The expression can include Arcade FeatureSet functions, which need to be evaluated asynchronously.Also populates the
getEvaluatedElements()from thePopupDefinition.getElements(). During the evaluation, eachExpressionPopupElementis replaced by thePopupElementreturned by the Arcade expression and each placeholder is replaced by its value.This method must be called before displaying the popup information in a UI so you can use synchronous methods
getFormattedValue(PopupField)andsubstitute(String)to get the formattedStringrepresentation. If there are noPopupDefinition.getExpressions()and no popup elements of typeExpressionPopupElementthen the result array will be empty.The
PopupExpressionmay be used in thePopupDefinition.getFields(),PopupDefinition.getMedia(),PopupDefinition.getTitle()andPopupDefinition.getDescription().- Returns:
- a
ListenableFuturethat contains an array ofPopupExpressionEvaluation - Since:
- 100.8.0
-
getEvaluatedElements
public java.util.List<PopupElement> getEvaluatedElements()
Gets an unmodifiable list ofPopupElementobjects evaluated asynchronously byevaluateExpressionsAsync(). During the evaluation, eachExpressionPopupElementis replaced by thePopupElementreturned by the Arcade expression and each placeholder is replaced by its value. If the Arcade expression returns a list of attributes to be used by the popup element, these attributes will be used bygetFormattedValue(PopupField)}.The list is empty while
evaluateExpressionsAsync()has not been executed, and is cleared ifevaluateExpressionsAsync()is executed more than once. After evaluation, the order of the popup elements in the list matches the order elements present inPopupDefinition.getElements()and shown in the pop-up window. If anExpressionPopupElementfails to be evaluated, then it will be skipped in the list. Use the array ofPopupExpressionEvaluationreturned fromevaluateExpressionsAsync()to learn the cause of the error.- Returns:
- an unmodifiable list of
PopupElementevaluated asynchronously byevaluateExpressionsAsync(). During the evaluation, eachExpressionPopupElementis replaced by thePopupElementreturned by the Arcade expression and each placeholder is replaced by its value. If the Arcade expression returns a list of attributes to be used by the popup element, these attributes will be used bygetFormattedValue(PopupField). - Since:
- 100.14.0
- See Also:
PopupDefinition.getElements(),evaluateExpressionsAsync()
-
-