androidandroid-mapviewgoogle-maps-android-api-2

Google Maps Android MapView v2: disable zooming


Is there a way to disable the zooming (pinch and double tap) in the MapView but keep the scrolling?

This means setting clickable to false would not work.

I have also tried setting an onTouch listener in the activity but it will not trigger using:

mapView.setOnTouchListener(this);

Solution

  • You can assign those properties using the XML file:

       map:uiRotateGestures="true"
       map:uiScrollGestures="true"
       map:uiTiltGestures="true"
       map:uiZoomGestures="true"
    

    So use:

       map:uiZoomGestures="false"
    

    On the MapFragment object.