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)
        Instantiates a Popup with the provided GeoElement and a PopupDefinition based off the attributes of the GeoElement.
        Parameters:
        geoElement - the GeoElement on which to base the Popup
        Throws:
        java.lang.IllegalArgumentException - if geoElement is null
        Since:
        100.0.0
      • Popup

        public Popup​(GeoElement geoElement,
                     PopupDefinition popupDefinition)
        Instantiates a Popup with the provided 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 on which to base the Popup
        popupDefinition - the PopupDefinition
        Throws:
        java.lang.IllegalArgumentException - if geoElement is null
        Since:
        100.0.0
    • Method Detail

      • getPopupDefinition

        public PopupDefinition getPopupDefinition()
        Gets the PopupDefinition.
        Returns:
        the PopupDefinition
        Since:
        100.0.0
      • getGeoElement

        public GeoElement getGeoElement()
        Gets the GeoElement of the Popup.
        Returns:
        the GeoElement
        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.

        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()
        Evaluates asynchronously all Arcade expressions including FeatureSet available at PopupDefinition.getExpressions().

        This method must be called before displaying the popup information in a UI so you can use synchronous method getFormattedValue(PopupField) to get the formatted string representation. Empty array is returned if there are no expressions defined in the Popup.

        Returns:
        a ListenableFuture for tracking when the operation is done and getting the result, which is an unmodifiable list of PopupExpressionEvaluation
        Since:
        100.8.0