Amey Jahagirdar
Amey Jahagirdar

Reputation: 485

Google maps in android should be zoomable but not scrollable

I have implemented a MapView in android. I need to achieve following things in maps

  1. Maps should not be scrollable (Achieved using setClickable() to false)
  2. Maps should not be scrollable (as setClickable is false, Map is not zoomable)

Upvotes: 0

Views: 476

Answers (2)

SanjeevMogaBishnoi
SanjeevMogaBishnoi

Reputation: 54

You can disable scroll in MapFragment using:

googleMap.getUiSettings().setScrollGesturesEnabled(false);

Upvotes: 1

antonio
antonio

Reputation: 18242

Enable the zoom gestures on your map object and disable the scroll gestures:

@Override
public void onMapReady(final GoogleMap googleMap) {
    googleMap.getUiSettings().setZoomGesturesEnabled(true);
    googleMap.getUiSettings().setScrollGesturesEnabled(false);
}

Upvotes: 1

Related Questions