How can I make only some markers clickable in Google map for Android?

38 Views Asked by At

I am developing an Android app with a google map, which contain various markers. Some of these markers should be clickable, and it works nicely, using the setOnMarkerClickListener method on the GoogleMap-object. However, this does not allow me to select which markers are clickable. Of course, in the event handler, I can differentiate between the different markers, to see if the app should take any action or not. But if there are two markers partially overlapping each other in the map, the event handler will still only be called once for each click, alternating (it seems) between the two markers if I click several times.

Consequently, the user will sometimes have to click several times in order to interact with the marker, this makes the app feel very unresponsive.

Is there a way to either (a) tell the Google Maps API that a given marker (or set of markers) should not be clickable, or, maybe better, to (b) tell the API to fire the click event for EVERY marker clicked at once, rather than just one of them each time?

0

There are 0 best solutions below