I have a MapView that has an ItemizedOverlay on it which displays markers. This overlay also overrides onTap to perform an action when the marker is tapped.
My map also includes a normal Overlay that overrides onTouchEvent to perform an action when anywhere else on the map is touched.
However, when the user taps on the marker, the onTouchEvent from the normal Overlay is called as well as the onTap from the ItemizedOverlay.
So my question is: is there any way to have the onTouchEvent not called (or ignored) when the marker is tapped?
Thanks.
Yes, there’s an extremely simple solution to this. The answer stems from the way Java inheritance works. Basically, ItemizedOverlay extends Overlay, so all you need to do is to not call the super.onTap() method in your itemizedOverlay override of onTap(). That should do it as far as I know. Do let me know if it doesn’t work and I’ll provide you with an alternative solution.