getTappedMarkers abstract method

List<Marker<T>> getTappedMarkers(
  1. TapEvent event
)

Returns markers that intersect with the given tap event area.

This method is used for hit testing to determine which markers were tapped by the user. The implementation should return all markers whose visual representation intersects with the tap area.

event The tap event containing position and area information Returns a list of markers that were hit by the tap

Implementation Guidelines:

  • Check marker bounds against the tap event area
  • Consider marker rendering size, not just position
  • Return markers in priority order (most important first)
  • Handle overlapping markers appropriately
  • Return empty list if no markers are hit

Performance Note: This method may be called frequently during user interaction, so implement efficient hit testing.

List<Marker<String>> tappedMarkers = datastore.getTappedMarkers(tapEvent);
if (tappedMarkers.isNotEmpty) {
  // Handle marker tap
  showMarkerDetails(tappedMarkers.first);
}

Implementation

List<Marker<T>> getTappedMarkers(TapEvent event);