Android Google Maps: disable drag and drop in MapFragment

Is it possible to disable the drag and drop function when a user tries to drag a map with his fingers without disturbing the zoom in and out?

Anyone please suggest an idea to do this! Thanks for your precious help!

+54
android google-maps mapfragment drag
Jun 07 '13 at 8:30
source share
3 answers

I think here what you are looking for:

Inside Google Maps Android v2

Gestures of scrolling (panning)

The user can scroll (pan) on the map by dragging the map with the Finger. You can disable scrolling by calling UiSettings.setScrollGesturesEnabled (boolean).

+85
Jun 07 '13 at 9:08
source share

You can disable drag and drop in MapFragment using:

 googleMap.getUiSettings().setScrollGesturesEnabled(false); 
+100
Dec 23 '14 at 9:22
source share

to disable drag and drop in MapFragment this code:

 googleMap.getUiSettings().setScrollGesturesEnabled(false); 

works like @tomrozb. but it does not disable map scaling by touching the map. To do this, use this code next to the code above:

 googleMap.getUiSettings().setZoomGesturesEnabled(false); 
+9
Dec 04 '17 at 13:55 on
source share



All Articles