FeatureFenceParameters

Geotrigger fence data created from features. The features that create a FeatureFenceParameters provide a set of geometries (and attributes) that define targets for the Geotrigger. For example, if the condition is "notify me when my position comes within 50 meters of one of my target areas", the fence data are "my target areas" and each com.arcgismaps.data.Feature is one target area.

Create a FeatureFenceParameters using a com.arcgismaps.data.FeatureTable. The features can have point, line, or polygon geometry. For points and lines, you must also supply a FenceParameters.bufferDistance. Each feature in the table represents a single fence.

You can filter features using attributes or geometry by supplying a where clause. For example, you could further refine "my target areas" to be "my target areas that are open and are in California".

The number of features fetched by querying an online table is limited by the layer's com.arcgismaps.arcgisservices.ArcGISFeatureLayerInfo.maxRecordCount. Service feature tables that support pagination (com.arcgismaps.arcgisservices.ArcGISFeatureLayerInfo.supportsPagination) are not subject to the maximum feature count limit.

A FenceGeotrigger can also take into account floors within buildings. If the feature table used to create the FeatureFenceParameters is referenced by a com.arcgismaps.mapping.layers.FeatureLayer that is com.arcgismaps.mapping.floor.FloorAware, and the com.arcgismaps.location.LocationDataSource used to create the GeotriggerFeed includes com.arcgismaps.location.Location.SourceProperties.Keys.floor information, then fences will only be entered when they are intersected by a com.arcgismaps.location.Location on 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 com.arcgismaps.mapping.GeoModel that includes a valid com.arcgismaps.mapping.floor.GeoModelFloorDefinition. All layers and tables that are used by the floor definition are loaded when the GeotriggerMonitor is started.

A com.arcgismaps.location.Location can contain floor property as part of com.arcgismaps.location.Location.additionalSourceProperties. This is populated automatically by com.arcgismaps.location.IndoorsLocationDataSource, or can be supplied as part of your own implementation.

A GeotriggerMonitor accounts for changes to the FeatureFenceParameters.featureTable while the geotrigger is active. Added, removed, or updated fence features trigger a notification by the geotrigger monitor when the updated feature meets or no longer meets the geotrigger condition.

Updates to the FeatureFenceParameters.featureTable occur in the following situations:

  • An edit (add, update, or delete) is submitted to the local feature table.

  • User interactions, like performing a pan or zoom in a map or scene, request updates from an online feature table (com.arcgismaps.data.ServiceFeatureTable) for the new visible extent.

  • If com.arcgismaps.mapping.layers.FeatureLayer.refreshInterval is set on a layer associated with the FeatureFenceParameters.featureTable, feature fences are updated at the specified interval. For a com.arcgismaps.data.ServiceFeatureTable, fence features requested from the server include features within the buffered visible extent as well as features near the current device location. This allows the geotrigger monitor to check fences both inside and outside of the current visible area.

  • Online feature fences are explicitly requested using com.arcgismaps.data.ServiceFeatureTable.populateFromService. Use this method to control how and when feature fence updates are requested from a server. Setting the clearCache parameter of this method to true clears fence features from the local feature table before repopulating with updated features from the server. This ensures that deleted features are recognized and that the geotrigger monitor sends exit notifications.

Dynamic feature fence capabilities are enabled for com.arcgismaps.data.ServiceFeatureTable, com.arcgismaps.data.GeodatabaseFeatureTable, and com.arcgismaps.data.FeatureCollectionTable table types. They are disabled for all other table types and in the following circumstances:

Since

200.1.0

Constructors

Link copied to clipboard
constructor(featureTable: FeatureTable, bufferDistance: Double = 0.0)

Creates a FeatureFenceParameters using all of the features in the com.arcgismaps.data.FeatureTable.

Properties

Link copied to clipboard

The geometry that can be used to spatially filter fences. This needs to be either an com.arcgismaps.geometry.Envelope or com.arcgismaps.geometry.Polygon. Use this to define which features in the com.arcgismaps.data.FeatureTable are to be used as fences by defining an area of interest. If this property is null we will use the full extent of the feature table.

Link copied to clipboard

The com.arcgismaps.data.FeatureTable that contains the features to use in the FeatureFenceParameters. This table can be shared with a com.arcgismaps.mapping.layers.FeatureLayer.featureTable. This property will be null if the com.arcgismaps.mapping.layers.FeatureLayer within a web map could not be found.

Link copied to clipboard

A where clause that defines the features from the com.arcgismaps.data.FeatureTable to use as fences. The string that is used as the FeatureFenceParameters.whereClause should follow standard SQL syntax similar to what is discussed in the document SQL reference for query expressions used in ArcGIS.

Inherited properties

Link copied to clipboard

A buffer distance in meters to apply when checking if a FenceGeotrigger condition is met. For example, if the rule is "enters within 50 meters" you use a FenceGeotrigger.ruleType of FenceRuleType.Enter and set this property to 50.