-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overlapping markers - on marker click - marker in the back is getting selected instead of the frontmost. #61
Comments
same issue.Background marker get the click event not front one. |
I had the same issue, any solution?????????????? |
Someone please 🚨 |
I don't know if it's the best solution, but, my workaround is to set a high value in a variable as maxZIndex (the number of markers + 1 is fine), and then when I click on the marker: |
This issue has been automatically marked as stale because it has not had recent activity. Please comment here if it is still valid so that we can reprioritize. Thank you! |
Closing this. Please reopen if you believe it should be addressed. Thank you for your contribution. |
@epiphany27 Any solutions to this issue? |
I have several markers close to each other on map, so much so that they sort of partially/fully overlap each other. I haven't specified any z-Index explicitly while adding the markers on the map, hence z-Index for all markers is 0.0 by default.
The problem is that when I tap on one of the overlapping markers which is at the frontmost position, the marker at the backmost is getting selected. So if there are 3 overlapping markers (say marker-1, marker-2, marker-3) one behind the other, marker-1 being at the front, marker-3 at the back and marker-2 is the middle of marker-1 & 2, when I click on marker-1, marker-3 gets selected instead. When I click again (on the same click point), marker-2 gets selected next, click again the third time, marker-1 gets selected finally.
At first, I thought there is probably a bug on my end or in the Google Maps library itself. After enough research online, I finally landed on google maps docs which doesn't quite answer my question.
From google-map API docs:- https://developers.google.com/maps/documentation/android-api/marker#marker_click_events
(All marker's z-Indices are the same (0.0) in my case.)
On the other hand, when I checked on iOS (using iOS google maps library), I found the marker selection sequence to be correct (Marker-1 -> Marker-2 -> Marker-3) unlike Android which was the exact opposite.
Is this intended to be this way on Android? Or is it a Google Map library bug. Is there a way I could reverse the marker click sequence on Android like the way it's on iOS.
I know, one workaround could be to use marker clustering (ClusterManager etc) in such cases of overlapping markers, but I don't want to go that route for now.
Any comment will be highly appreciated.
Thanks.
The text was updated successfully, but these errors were encountered: