Class LocationGeotriggerFeed
- java.lang.Object
-
- com.esri.arcgisruntime.geotriggers.GeotriggerFeed
-
- com.esri.arcgisruntime.geotriggers.LocationGeotriggerFeed
-
public final class LocationGeotriggerFeed extends GeotriggerFeed
Feed data for aGeotriggercreated from aLocationDataSource.The
GeotriggerFeedis the dynamic component of aGeotrigger. Typically, it is the data that moves around and triggers the condition. For example, if the condition is "notify me when my position comes within 50 meters of one of my target areas", the feed data is "my position".To receive location updates, the
LocationDataSourcemust beLocationDataSource.isStarted(). If you callGeotriggerMonitor.stop(), the underlyingLocationDataSourcewill not be stopped for you. For example, it may continue to receive GPS readings.If the LocationGeotriggerFeed is from a
Geotriggerdefined in aGeotriggersInfo, you must supply aLocationDataSourceto provide the device location. Set thegetLocationDataSource()to yourLocationDataSource- for example, using theLocationDisplay.setLocationDataSource(LocationDataSource).A
FenceGeotriggercan also take into account floors within buildings. If the feature table used to create theFeatureFenceParametersis referenced by aFeatureLayerthat isFloorAware, and theLocationDataSourceused to create theGeotriggerFeedincludesLocationDataSource.Location.KEY_FLOORinformation, then fences will only be entered when they are intersected by aLocationDataSource.Locationon the correct floor. If the fence or location data does not include valid floor information, the floor is ignored and the fence is entered when it is intersected by the location.A floor aware feature layer or table must be part of a
GeoModelthat includes a validGeoModelFloorDefinition. All layers and tables that are used by the floor definition are loaded when theGeotriggerMonitoris started.A
Locationcan contain floor property as part ofLocationDataSource.Location.getAdditionalSourceProperties(). This can be supplied as part of your own implementation.- Since:
- 100.12.0
-
-
Constructor Summary
Constructors Constructor Description LocationGeotriggerFeed()Constructs an empty LocationGeotriggerFeed.LocationGeotriggerFeed(LocationDataSource locationDataSource)Constructs a LocationGeotriggerFeed with aLocationDataSource.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArcadeExpressiongetFilter()Gets anArcadeExpressionthat controls whether an update from the LocationGeotriggerFeed is sent to aGeotriggerMonitor.LocationDataSourcegetLocationDataSource()Gets the location data source that provides updates for the device location.voidsetFilter(ArcadeExpression filter)Sets anArcadeExpressionthat controls whether an update from the LocationGeotriggerFeed is sent to aGeotriggerMonitor.voidsetLocationDataSource(LocationDataSource locationDataSource)Sets the location data source that provides updates for the device location.
-
-
-
Constructor Detail
-
LocationGeotriggerFeed
public LocationGeotriggerFeed()
Constructs an empty LocationGeotriggerFeed.- Since:
- 100.12.0
-
LocationGeotriggerFeed
public LocationGeotriggerFeed(LocationDataSource locationDataSource)
Constructs a LocationGeotriggerFeed with aLocationDataSource.- Parameters:
locationDataSource- a location data source that provides updates for the device location- Throws:
java.lang.IllegalArgumentException- if locationDataSource is null- Since:
- 100.12.0
-
-
Method Detail
-
getFilter
public ArcadeExpression getFilter()
Gets anArcadeExpressionthat controls whether an update from the LocationGeotriggerFeed is sent to aGeotriggerMonitor.The expression uses the Arcade language to determine whether feed entity updates are suitable for monitoring. The
ArcadeExpressionmust evaluate to a boolean where:- True indicates that the update will be used.
- False indicates that the update will not be used.
GeotriggerMonitor. For example, you could filter out GPS updates where the horizontal accuracy is poor, to avoid false enter and exit notifications.With a LocationGeotriggerFeed, the expression inspects a new
LocationDataSource.Locationobject and returns true if it is suitable and false if not. Typically, your expression excludesLocationobjects where theLocationDataSource.Location.getHorizontalAccuracy()does not meet your criteria - but it could also consider other properties such asLocationDataSource.Location.getVelocity()andLocationDataSource.Location.getCourse().Arcade gives you access to the properties of the feed entity with the
$locationupdateprofile variable. This represents a newLocationreceived from your device GPS. For example, anArcadeExpressionwith the following string rejectsLocationupdates with a horizontal accuracy greater than 10 meters:return $locationupdate.horizontalaccuracy <= 10;.- Returns:
- an
ArcadeExpressionthat controls whether an update from the LocationGeotriggerFeed is sent to aGeotriggerMonitor, or null if none - Since:
- 100.13.0
- See Also:
setFilter(ArcadeExpression)
-
setFilter
public void setFilter(ArcadeExpression filter)
Sets anArcadeExpressionthat controls whether an update from the LocationGeotriggerFeed is sent to aGeotriggerMonitor.The expression uses the Arcade language to determine whether feed entity updates are suitable for monitoring. The
ArcadeExpressionmust evaluate to a boolean where:- True indicates that the update will be used.
- False indicates that the update will not be used.
GeotriggerMonitor. For example, you could filter out GPS updates where the horizontal accuracy is poor, to avoid false enter and exit notifications.With a LocationGeotriggerFeed, the expression inspects a new
LocationDataSource.Locationobject and returns true if it is suitable and false if not. Typically, your expression excludesLocationobjects where theLocationDataSource.Location.getHorizontalAccuracy()does not meet your criteria — but it could also consider other properties such asLocationDataSource.Location.getVelocity()andLocationDataSource.Location.getCourse().Arcade gives you access to the properties of the feed entity with the
$locationupdateprofile variable. This represents a newLocationreceived from your device GPS. For example, anArcadeExpressionwith the following string rejectsLocationupdates with a horizontal accuracy greater than 10 meters:return $locationupdate.horizontalaccuracy <= 10;.- Parameters:
filter- anArcadeExpressionthat controls whether an update from the LocationGeotriggerFeed is sent to aGeotriggerMonitor- Since:
- 100.13.0
- See Also:
getFilter()
-
getLocationDataSource
public LocationDataSource getLocationDataSource()
Gets the location data source that provides updates for the device location.To receive location updates, the
LocationDataSourcemust beLocationDataSource.isStarted(). If you callGeotriggerMonitor.stop(), the underlyingLocationDataSourceis not stopped for you. In other words, it may continue to receive GPS readings.- Returns:
- the location data source that provides updates for the device location, or null if none
- Since:
- 100.12.0
-
setLocationDataSource
public void setLocationDataSource(LocationDataSource locationDataSource)
Sets the location data source that provides updates for the device location.To receive location updates, the
LocationDataSourcemust beLocationDataSource.isStarted(). If you callGeotriggerMonitor.stop(), the underlyingLocationDataSourceis not stopped for you. In other words, it may continue to receive GPS readings.- Parameters:
locationDataSource- the location data source that provides updates for the device location- Since:
- 100.12.0
-
-