Skip to content Skip to sidebar Skip to footer

Catch Double Tap Events On New Google Maps Android Api V2

I have an app with a ViewSwitcher that has a MapView (v1) and another View and using a GestureDetector I can detect double taps and switch between the 2 views. Now I'm trying to sw

Solution 1:

Okay, I found a way now. I have to create a sub class of MapView (which is actually a ViewGroup) and implement interceptTouchEvent() there to detect and catch double taps.

How this is implemented in detail is explained here: Double Tap -> Zoom on Android MapView?

Solution 2:

As far as I know (and according to: http://developer.android.com/reference/com/google/android/gms/maps/GoogleMap.html), you can set to the GoogleMap object (and also to the MapView) click and long click listener. So I think you can't set a double click listener.

But you can try this:

GoogleMap map=mapView.getMap();
map.getUiSettings().setZoomGesturesEnabled(false);

And maybe it will react to your GestureDetector.

Post a Comment for "Catch Double Tap Events On New Google Maps Android Api V2"