• KmlBalloonStyle
  • class Esri::ArcGISRuntime::KmlBalloonStyle

    Specifies how the description balloon for a KmlNode is drawn. More...

    Header: #include <KmlBalloonStyle.h>
    Since: Esri::ArcGISRuntime 300.2
    Inherits: Esri::ArcGISRuntime::Object

    Public Functions

    KmlBalloonStyle(const QString &text, const QColor &backgroundColor, const QColor &textColor, bool visible, QObject *parent = nullptr)
    virtual ~KmlBalloonStyle() override
    QColor backgroundColor() const
    bool isVisible() const
    void setBackgroundColor(const QColor &backgroundColor)
    void setText(const QString &text)
    void setTextColor(const QColor &textColor)
    void setVisible(bool visible)
    QString text() const
    QColor textColor() const

    Detailed Description

    Controls the balloon's text, background color, text color, and visibility. Corresponds to a <BalloonStyle> in a KML document.

    Member Function Documentation

    KmlBalloonStyle::KmlBalloonStyle(const QString &text, const QColor &backgroundColor, const QColor &textColor, bool visible, QObject *parent = nullptr)

    Creates a KML balloon style with specified text, background color, text color, and visibility.

    • text The text template used to format balloon content.
    • backgroundColor The background color for the balloon. Default is white.
    • textColor The text color for the balloon. Default is black.
    • visible Specifies whether the balloon should be visible. Default is true.
    • parent The optional parent object.

    [override virtual noexcept] KmlBalloonStyle::~KmlBalloonStyle()

    Destructor.

    QColor KmlBalloonStyle::backgroundColor() const

    Returns the background color for the balloon. Default is white.

    See also setBackgroundColor().

    bool KmlBalloonStyle::isVisible() const

    Returns whether the balloon should be visible. Default is true.

    void KmlBalloonStyle::setBackgroundColor(const QColor &backgroundColor)

    Sets the balloon background color to backgroundColor.

    See also backgroundColor().

    void KmlBalloonStyle::setText(const QString &text)

    Sets the balloon text template to text.

    See also text().

    void KmlBalloonStyle::setTextColor(const QColor &textColor)

    Sets the balloon text color to textColor.

    See also textColor().

    void KmlBalloonStyle::setVisible(bool visible)

    Sets whether the balloon is visible.

    See also isVisible().

    QString KmlBalloonStyle::text() const

    Returns the text, with optional template placeholders, to display in the balloon.

    Balloon style text can be an explicit hardcoded string, or it can include placeholders to be substituted with values from the node. Valid placeholders include:

    Additionally, extended data display names and values from KmlNode::extendedSchemaData and KmlNode::extendedNonSchemaData can be substituted by using the following placeholders:

    • $[\<schemaName\>/\<fieldName\>/displayName]: The display name of a field in a schema.
    • $[\<schemaName\>/\<fieldName\>]: The value of a field in a schema.
    • $[\<fieldName\>/displayName]: The display name of a field not in a schema.
    • $[\<fieldName\>]: The value of a field not in a schema.

    If the text property is empty, KmlNode::balloonContent uses a default template of "<b>$[name]</b><br/>$[description]", while still honoring the specified colors and visibility. Text can also include raw HTML content enclosed in a CDATA section.

    See also setText().

    QColor KmlBalloonStyle::textColor() const

    Returns the text color for the balloon. Default is black.

    See also setTextColor().