Class GraphicFenceParameters

java.lang.Object
com.esri.arcgisruntime.geotriggers.FenceParameters
com.esri.arcgisruntime.geotriggers.GraphicFenceParameters

public final class GraphicFenceParameters extends FenceParameters
Geotrigger fence parameters data created from graphics.

The graphics used to create a GraphicFenceParameters provide a set of geometries and attributes that define targets for a FenceGeotrigger condition. For example, if the condition is "notify me when my position comes within 50 meters of one of my target areas", the fence data is "my target areas".

A GraphicFenceParameters allows you to track a specific set of Graphic objects: these can be a selection of the graphics from a GraphicsOverlay or graphics that are not displayed on a GeoView. If you wish to track all of the graphics displayed in a GraphicsOverlay, use a GraphicsOverlayFenceParameters.

A GraphicFenceParameters is created using a list of Graphic objects. The graphics can have point, line, or polygon geometry. A FenceParameters.getBufferDistance() must be supplied for points or lines.

Since:
100.12.0
  • Constructor Details

    • GraphicFenceParameters

      public GraphicFenceParameters(Iterable<Graphic> graphics)
      Creates a GraphicFenceParameters that will apply a buffer distance to the supplied graphics.
      Parameters:
      graphics - a set of graphics that should be used as fences
      Throws:
      IllegalArgumentException - if graphics is null
      Since:
      100.12.0
    • GraphicFenceParameters

      public GraphicFenceParameters(Iterable<Graphic> graphics, double bufferDistance)
      Creates a GraphicFenceParameters that will apply a buffer distance to any graphics that are added to getGraphics().
      Parameters:
      graphics - a set of graphics that should be used as fences
      bufferDistance - a buffer distance in meters to apply to the graphics when checking if a Geotrigger condition is met
      Throws:
      IllegalArgumentException - if graphics is null
      Since:
      100.12.0
    • GraphicFenceParameters

      public GraphicFenceParameters(double bufferDistance)
      Creates a GraphicFenceParameters that will apply a buffer distance to any graphics that are added to getGraphics().
      Parameters:
      bufferDistance - a buffer distance in meters to apply to graphics when checking if a Geotrigger condition is met
      Since:
      100.12.0
  • Method Details

    • getGraphics

      public List<Graphic> getGraphics()
      Gets the graphics to use in the GraphicFenceParameters.

      This collection will be tracked when monitoring a Geotrigger such that any graphics that are added will be included and any that are removed will no longer be checked.

      The Geometry of each Graphic will be buffered by the buffer distance.

      Returns:
      the graphics to use in the GraphicFenceParameters
      Since:
      100.12.0