Georgi Koemdzhiev Georgi Koemdzhiev - 1 month ago 12
Android Question

Disabling Zoom out on a GoogleMap object. [Android, Google Maps API]

I am trying to disable the zoom (or set a unchangable zoom level) on my GoogleMap object. I did try disabling the Zoom Controls to false but that did not work for some reason. [I am using the SupportMapFragment if it helps]

@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
mMap.getUiSettings().setZoomControlsEnabled(false);

....


Any ideas please? Thank you!

Answer

It was very simple,I was using the wrong method. Instead of that

mMap.getUiSettings().setZoomControlsEnabled(false);

I had to use this method:

mMap.getUiSettings(). setZoomGesturesEnabled(false);
Comments