I have a MapView in an activity and it works fine, the map shows, and it responds to taps, and I can extract the location easily. However this handler is also responding to the pinch-zoom, so if a user tries to pinch-zoom, the app responds as if they tapped (and it's very confusing for them).
How can I respond to taps on a MapView and only pick up single-taps, specifically ignoring pinch-zoom and double-taps?
Do I need to use OnTouchEvent() instead of OnTap()? If so how do I distinguish between the different touch events, and how do I access the GeoPoint?
Here's the code from inside my MapActivity:
class MapOverlay extends com.google.android.maps.Overlay
{
@Override
public boolean onTap(GeoPoint p, MapView map)
{
if ( p!=null )
{
// Do stuff with the geopoint
return true; // We handled the tap
}
else
{
return false; // We didn't handle the tap
}
}
}