hitTest method

List<MarkerMatch> hitTest(
  1. Coordinates coordinates, {
  2. Marker? ignoreMarker,
})

Perform a hit test against all markers in this collection.

Returns matches (see MarkerMatch) describing markers that intersect the provided geographic coordinates. An optional ignoreMarker may be supplied to exclude a specific marker from the test.

Parameters

  • coordinates: Location used for the hit test.
  • ignoreMarker: Optional marker to ignore during hit testing.

Returns

Implementation

List<MarkerMatch> hitTest(Coordinates coordinates, {Marker? ignoreMarker}) {
  final OperationResult resultString = objectMethod(
    pointerId,
    'MarkerCollection',
    'hitTest',
    args: <String, Object>{
      'coords': coordinates,
      if (ignoreMarker != null) 'ignoreMarker': ignoreMarker.pointerId,
    },
  );
  return MarkerMatchList.init(resultString['result']).toList();
}