Class Popup


  • public final class Popup
    extends java.lang.Object
    Represents the combination of a PopupDefinition and a GeoElement, which allows a visual representation of the GeoElement's attributes as well as the ability to edit them.
    Since:
    100.0.0
    • Constructor Detail

      • Popup

        public Popup​(GeoElement geoElement)
        Creates a new popup from a GeoElement. This method creates a default PopupDefinition with default properties and default popup elements based on the given GeoElement.
        Parameters:
        geoElement - the GeoElement for the popup, such as a Feature or Graphic
        Throws:
        java.lang.IllegalArgumentException - if geoElement is null
        Since:
        100.0.0
      • Popup

        public Popup​(GeoElement geoElement,
                     PopupDefinition popupDefinition)
        Creates a new popup from a GeoElement and PopupDefinition.

        If the PopupDefinition is null, a new one will be created based off the attributes of the GeoElement.

        Parameters:
        geoElement - the GeoElement for the popup, such as a Feature or Graphic
        popupDefinition - 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
      • 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 the PopupField may be using expressions with Arcade FeatureSets functions. Use evaluateExpressionsAsync() 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 is PopupExpression.ReturnType.NUMBER.

        If the field is part of a CodedValueDomain, the CodedValue.getName() is returned.

        Parameters:
        popupField - the popup field
        Returns:
        the formatted string representing the value of the popup field.
        Since:
        100.3.0
      • getEvaluatedElements

        public java.util.List<PopupElement> getEvaluatedElements()
        Gets an unmodifiable list of PopupElement objects evaluated asynchronously by evaluateExpressionsAsync(). During the evaluation, each ExpressionPopupElement is replaced by the PopupElement returned 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 by getFormattedValue(PopupField)}.

        The list is empty while evaluateExpressionsAsync() has not been executed, and is cleared if evaluateExpressionsAsync() is executed more than once. After evaluation, the order of the popup elements in the list matches the order elements present in PopupDefinition.getElements() and shown in the pop-up window. If an ExpressionPopupElement fails to be evaluated, then it will be skipped in the list. Use the array of PopupExpressionEvaluation returned from evaluateExpressionsAsync() to learn the cause of the error.

        Returns:
        an unmodifiable list of PopupElement evaluated asynchronously by evaluateExpressionsAsync(). During the evaluation, each ExpressionPopupElement is replaced by the PopupElement returned 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 by getFormattedValue(PopupField).
        Since:
        100.14.0
        See Also:
        PopupDefinition.getElements(), evaluateExpressionsAsync()