I have a MapView
with some overlays and a subclass of MyLocationOverlay
on top of them because I want the user current location to show above the other markers.
I'm handling the onTap
event for the markers to show a panel with info of the tapped marker and if tapped outside of a marker (even in the location marker) the panel should hide.
If I click on a marker or in an empty spot everything is fine, the panel shows or hides as expected, but if I click on the location marker nothing happens (if the location marker is over another marker the info doesn't show and if it's outside and the info is showing it doesn't hide).
In my MyLocationOverlay
I overrided dispatchTap()
function making it return false as stated in docs:
Returns: True if this tap was processed; false if it should be sent to the other overlays.
but still doesn't work, even I tried returning true just in case, but nothing...
Anybody knows how to propagate the onTap
event to the other overlays?
"Fixed since android 2.0, it was a known issue of some phones"
From - Propagate events in several layers android google maps
"If you are seeing the overlay items you put on your MapView, your onTap() will be triggered when you tap on any of the overlay items. onTap(GeoPoint point, MapView view) is always triggered regardless of where the user taps. Therefore, you can override it to see if it's triggered. onTap(int i) will run after it in the case where an overlay item is clicked."
From - https://stackoverflow.com/questions/6680387/ontap-event-on-map-is-not-fired
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With