I apologize in advance for my ignorance. I am a seasoned SW developer but new to Android. I am developing my first Android application (MapActivity) for a friend of mine and have managed to fight my way through a myriad of problems handling gestures, not the least of which was onTap(GeoPoint p, MapView mapView) used to capture a non marker tap in the ItemizedOverlay intercepting every gesture available. I settled on using OnSingleTapConfirmed from DoubleTapListener and handling the marker/non-marker tap logic from there. I have still one issue remaining I cannot seem to solve. OnSingleTapConfirmed apparently is handled before
the built in Zoom Controls, so when I tap in the space where the zoom controls are hidden, I get the non-marker tap behavior in addition to the zoom control becoming visible which is not what I want. I'd like to only see the zoom controls become visible in that case.
I figured I could simply do a hit test on the zoom control rectangle and if I get a hit, simply bail out of OnSingleTapConfirmed with a FALSE return value and let the built in logic take it from there. I am able to get the rectangle for the zoom controls using the MapView's getZoomButtonsController() and then calling getZoomControls() from there. I then call getHitRect to get the target touch area. The problem
I am having is determining where the Zoom Control's starting x,y position isrelative to the MapView. Once I can determine that, I can apply the offset to my hit rectangle and simply do a contains check.
It may be very simple and likely is and I can't see it (I've been looking at this too long and think I can't see the forest for the trees), but I'm spinning my wheels at this point.
Does anyone know how to find the built in zoom control's starting x,y position relative to the MapView? If there is a simpler solution to ensuring the ZoomControls will still function properly when handling tap
gestures, I am open to suggestions. I appreciate any advice anyone would be willing to offer.
Thanks in advance.
UPDATE: I have managed to get this working, but it still has a "hacky" feel to me since it is completely reliant on the placement of the zoom controls forever being at the bottom of the screen. I am open to any suggestions on
how to handle this more appropriately. For anyone interested, the code snippet placed into OnSingleTapUpConfirmed follows: