-4

How can I set maximum zoomin level in google maps, so that user cannot pinch zoom further in map?? I searched it for about half an hour but didn't find any suitable solution

Vivek Mishra
  • 5,669
  • 9
  • 46
  • 84
  • 3
    duplicate with http://stackoverflow.com/questions/15700808/setting-max-zoom-level-in-google-maps-android-api-v2 – karvoynistas Nov 16 '15 at 13:09
  • maximum zoom level is 19f –  Nov 16 '15 at 13:11
  • check this answer on stackoverflow [here](http://stackoverflow.com/questions/19227378/android-gmaps-v2-bounds-and-max-zoom-level) – Nils Nov 16 '15 at 13:13

2 Answers2

1

We can not restrict map zoomin feature directly, but we can try to get same feature like this.

add map.setOnCameraChangeListener

final float maxZoom = 10.0f;

@Override
public void onCameraChange(CameraPosition position) {

    if (position.zoom > maxZoom)
        map.animateCamera(CameraUpdateFactory.zoomTo(maxZoom));
}
R_K
  • 803
  • 1
  • 7
  • 18
0

use this

 googleMap.animateCamera(CameraUpdateFactory.zoomTo(1), 2000, null);
Kastriot Dreshaj
  • 1,121
  • 6
  • 16