identifyGraphicsOverlays method

Future<List<IdentifyGraphicsOverlayResult>> identifyGraphicsOverlays({
  1. required Offset screenPoint,
  2. required double tolerance,
  3. int? maximumResultsPerOverlay = 1,
})

Identifies a limited number of graphics in all graphics overlays, at the given screen point.

As locations from user gestures are not always accurate to the exact pixel, you can define a tolerance for the identify operation. The tolerance parameter sets the radius of a circle, centered at the specified coordinates, in device-independent pixels (DIP). If the tolerance value is 0, identify performs the test at the specified coordinates. If it is greater than 0, identify tests inside the circle. For touch displays a value of 22 is recommended to cover an average finger tap. The maximum allowed value is 100 DIPs.

The returnPopupsOnly parameter controls which properties are populated in the IdentifyGraphicsOverlayResult instance. If true, only IdentifyGraphicsOverlayResult.popups is populated. If the overlay does not have popups an error is returned. If false, IdentifyGraphicsOverlayResult.geoElements, IdentifyGraphicsOverlayResult.graphics, and IdentifyGraphicsOverlayResult.popups are populated, if the overlay has popups.

Results are returned in a top-to-bottom order.

Parameters:

  • screenPoint — The screen coordinates to identify the graphics.
  • tolerance — A radius in device-independent pixels (DIP) that specifies how precise the identify operation should be.
  • maximumResultsPerOverlay — The maximum number of graphics and/or popups returned in the IdentifyGraphicsOverlayResult per graphics overlay. A value of 1 means that only the top-most graphic or popup will be identified. A value of null means that the number of results will not be limited.

Return Value: A Future of List of IdentifyGraphicsOverlayResult containing one entry for each overlay in the view. Each entry holds a GraphicsOverlay, a List of GeoElement, and a List of Graphic.

Implementation

Future<List<IdentifyGraphicsOverlayResult>> identifyGraphicsOverlays({
  required Offset screenPoint,
  required double tolerance,
  int? maximumResultsPerOverlay = 1,
}) {
  final coreScreenPoint = screenPoint.toArcGIS();
  final taskHandle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore
        .RT_GeoView_identifyGraphicsOverlaysWithMaxResultsNullable(
      _handle,
      coreScreenPoint.ref,
      tolerance,
      maximumResultsPerOverlay,
      errorHandler,
    );
  });
  return taskHandle.toFuture(
    (element) => element.getValueAsList()!,
  );
}