1

I am using MapFragment to place googlemap in myapplication.I need a solution to get double tap event on map.

@Override
public void onMapReady(GoogleMap map) {
    if(googleMap == null){ 
        googleMap = map; 
        googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
        googleMap.setOnMyLocationButtonClickListener(this);
        googleMap.animateCamera(CameraUpdateFactory.zoomBy(12.0f));
        googleMap.setOnMarkerClickListener(this);

        // Here i need to set a listener for double tapping

    } 
}
SachinS
  • 2,223
  • 1
  • 15
  • 25

1 Answers1

0

You have to extend your class with MapActivity and you have to override the DoubleTap event.

For more info follow the link http://publicstaticdroidmain.com/2012/03/double-tap-zoom-android-mapactivity-mapview/

If you need to handle the double tap event to zoom the google maps,there is no need to handle double tap event explicitly.You can adjust that in settings for user interface of the map in the following way

 @Override
    public void onMapReady(GoogleMap map) {
        UiSettings settings=map.getUiSettings();
        settings.setZoomGesturesEnabled(true);

    }
bhanu.cs
  • 1,345
  • 1
  • 11
  • 25
  • I currently using Fragment to display map (Google Maps API V2) inside it. – SachinS Dec 15 '15 at 10:05
  • May I know what do you want to do exactly on double tap of google maps? – bhanu.cs Dec 15 '15 at 10:10
  • i need to change visibility of a layout that displayed over google map.I already override OnMapClickListener to use this functionality.But double tapping changes zoom level of map .I need to override double tapping event to use same functionality – SachinS Dec 15 '15 at 10:40