Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

MarkerView deselect events with OnMarkerViewClickListener #8996

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -670,12 +670,15 @@ boolean onTap(PointF tapPoint, float screenDensity) {
for (Marker nearbyMarker : nearbyMarkers) {
for (Marker selectedMarker : selectedMarkers) {
if (nearbyMarker.equals(selectedMarker)) {
if (onMarkerClickListener != null) {
// end developer has provided a custom click listener
if (nearbyMarker instanceof MarkerView) {
handledDefaultClick = markerViewManager.onClickMarkerView((MarkerView) nearbyMarker);
} else if (onMarkerClickListener != null) {
handledDefaultClick = onMarkerClickListener.onMarkerClick(nearbyMarker);
if (!handledDefaultClick) {
deselectMarker(nearbyMarker);
}
}

if (!handledDefaultClick) {
// only deselect marker if user didn't handle the click event themselves
deselectMarker(nearbyMarker);
}
return true;
}
Expand Down