;

Geotrigger Class

  • Geotrigger
  • class Esri::ArcGISRuntime::Geotrigger

    A condition monitored by a GeotriggerMonitor. More...

    Header: #include <Geotrigger>
    Since: Esri::ArcGISRuntime 100.12
    Inherits: Esri::ArcGISRuntime::Object
    Inherited By:

    Esri::ArcGISRuntime::FenceGeotrigger

    This class was introduced in Esri::ArcGISRuntime 100.12.

    Public Functions

    virtual ~Geotrigger() override
    Esri::ArcGISRuntime::GeotriggerFeed *feed() const
    Esri::ArcGISRuntime::GeotriggerType geotriggerType() const
    Esri::ArcGISRuntime::ArcadeExpression *messageExpression() const
    QString name() const
    void setMessageExpression(Esri::ArcGISRuntime::ArcadeExpression *messageExpression)
    void setName(const QString &name)

    Detailed Description

    A Geotrigger defines a condition that can be continually monitored in real-time. Once the condition is met, the Geotrigger defines how a GeotriggerNotificationInfo can be used to inform the user.

    A GeotriggerMonitor, created with the Geotrigger, handles monitoring and notification.

    You can create a FenceGeotrigger describing areas of interest, covered by spatial rules such as enter or exit. This type of spatial monitoring is also known as "Geofencing".

    Member Function Documentation

    [override virtual] Geotrigger::~Geotrigger()

    Destructor.

    Esri::ArcGISRuntime::GeotriggerFeed *Geotrigger::feed() const

    Returns the GeotriggerFeed that is monitored for changes.

    You can construct a LocationGeotriggerFeed from any AbstractLocationDataSource. Typically, this shows the device location based on GPS.

    Esri::ArcGISRuntime::GeotriggerType Geotrigger::geotriggerType() const

    Returns the type of geotrigger.

    The type for a specific Geotrigger object.

    Esri::ArcGISRuntime::ArcadeExpression *Geotrigger::messageExpression() const

    Returns an ArcadeExpression that controls the message when a Geotrigger is met.

    The expression uses the Arcade language to form an output message that can be:

    • A string literal that is the same for all notifications relating to this Geotrigger
    • A message that is specific to the attributes of objects that met the Geotrigger

    The expression is evaluated, whenever the Geotrigger condition is met in order to populate the GeotriggerNotificationInfo::message property. This message can be displayed to alert the user that the Geotrigger condition has been met. Note that the expression cannot be changed when the GeotriggerMonitor is running.

    For example, with a FenceGeotrigger, setting the messageExpression property to:

    "You have " + $fencenotificationtype + ' ' + $fencefeature.name

    would return the GeotriggerNotificationInfo::message "You have entered Area A", where "area_name" is an attribute field on the FenceGeotriggerNotificationInfo::fenceGeoElement.

    Optionally, the expression can return extra properties in addition to the message. For example, it could produce another string, suitable for logging to a database. To supply additional properties, write an arcade expression that evaluates to a dictionary of key value pairs. A value with the key "message" will be used to populate the GeotriggerNotificationInfo::message property and additional key value pairs will be returned in the GeotriggerNotificationInfo::messageProperties dictionary.

    The ArcadeExpression must evaluate to either a string or a dictionary - see ArcadeExpression::returnType.

    For more information on the available globals and functions for creating the messageExpression see the "Geotrigger Notification" profile at https://developers.arcgis.com/arcade/guide/profiles/.

    See also setMessageExpression().

    QString Geotrigger::name() const

    Returns the name of the Geotrigger.

    See also setName().

    void Geotrigger::setMessageExpression(Esri::ArcGISRuntime::ArcadeExpression *messageExpression)

    Sets the messageExpression to messageExpression.

    See also messageExpression.

    void Geotrigger::setName(const QString &name)

    Sets the name to name.

    See also name.

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.