This class was introduced in Esri::ArcGISRuntime 100.12.
|GeotriggerMonitor(Esri::ArcGISRuntime::Geotrigger *geotrigger, QObject *parent = nullptr)|
|Esri::ArcGISRuntime::Geotrigger *||geotrigger() const|
A Geotrigger defines a query that is evaluated against GIS data as it changes in real time. For example, "Notify me when my device location enters one of my areas of interest" or "Notify me when my device location is within 50 meters of my destination". The process of monitoring a Geotrigger is also known as "Geofencing".
Once a GeotriggerMonitor is created, you begin checking the condition by calling start. Once you are finished, call stop. When a Geotrigger evaluates to
true, a geotriggerNotification is sent. You can subscribe to the notification to receive details of where the Geotrigger was activated and the condition that was met.
Member Function Documentation
GeotriggerMonitor::GeotriggerMonitor(Esri::ArcGISRuntime::Geotrigger *geotrigger, QObject *parent = nullptr)
[signal] void GeotriggerMonitor::geotriggerNotification(Esri::ArcGISRuntime::GeotriggerNotificationInfo *geotriggerNotificationInfo)
Notification that the GeotriggerMonitor condition has been meet.
- geotriggerNotificationInfo - The GeotriggerNotificationInfo that is emitted.
See also Returned QObjects Parenting.
[signal] void GeotriggerMonitor::startCompleted(QUuid taskId)
Signal emitted when the start operation completes.
- taskId - The task ID of the asynchronous operation.
[signal] void GeotriggerMonitor::statusChanged(Esri::ArcGISRuntime::GeotriggerMonitorStatus status)
Notification that the status property has changed.
- status - The GeotriggerMonitorStatus of the geotrigger monitor.
[signal] void GeotriggerMonitor::warningChanged(Esri::ArcGISRuntime::Error warning)
Notification that the warning property has changed.
- warning - The Error of the geotrigger monitor.
Esri::ArcGISRuntime::Geotrigger *GeotriggerMonitor::geotrigger() const
Returns the Geotrigger that will be monitored.
Returns starts evaluating the GeotriggerMonitor.
Returns a string representing the task ID of the asynchronous task.
Esri::ArcGISRuntime::GeotriggerMonitorStatus GeotriggerMonitor::status() const
Returns the current monitoring status of the GeotriggerMonitor.
A GeotriggerMonitor begins with a monitoring status of GeotriggerMonitorStatus::Stopped and changes to GeotriggerMonitorStatus::Started when you call start. When you call stop, the monitoring status changes to GeotriggerMonitorStatus::Stopped.
Returns stops evaluating the GeotriggerMonitor.
Stopping the GeotriggerMonitor prevents the condition from being evaluated and notifications from being sent. If you are using a LocationGeotriggerFeed created from a AbstractLocationDataSource, the data source must also be stopped to turn off GPS receivers etc.
Esri::ArcGISRuntime::Error GeotriggerMonitor::warning() const
Returns an error that describes a problem encountered while monitoring the Geotrigger.
A warning can occur at various stages of monitoring a Geotrigger:
- when starting the GeotriggerMonitor
- when accessing the components of the Geotrigger such as the GeotriggerFeed
- when performing ongoing monitoring
If the problem is resolved, this property will be cleared.
Problems that occur when starting the GeotriggerMonitor result in a status of GeotriggerMonitorStatus::FailedToStart. These issues must be fixed and start called again before you will receive any notifications. For example, if the Geotrigger::messageExpression is an invalid ArcadeExpression, monitoring cannot be carried out.
Problems that occur when accessing the components of the Geotrigger will not prevent the GeotriggerMonitor from starting. However, until the problem is resolved, you will not receive any notifications. For example, if a LocationGeotriggerFeed uses a AbstractLocationDataSource that is not started, you will not receive any notifications. After the AbstractLocationDataSource is successfully started, monitoring will resume. If a FenceParameters has no valid data for a fence, you will not receive any notifications.
Problems that occur during ongoing monitoring relate to issues with individual objects, such as the graphics that make up the fences for a GraphicFenceParameters. These warnings do not prevent notifications from being sent for other valid fences. For example, a fence is considered invalid if it has: