1

I have implemented a Google Map Api v2 in my Android App with zoom control.

map.getUiSettings().setZoomControlsEnabled(true);

I'd like to zoom out to view the entire world but it seems the min zoom level is set to 2 or higher. Is there any way to achieve this behavior ? Thanks in advance!!!

sat70
  • 51
  • 1
  • 5

1 Answers1

3

Yes, you can work around this by listening to camera change and reset zoom when needed.

    map.setOnCameraChangeListener(this);

    @Override
    public void onCameraChange(CameraPosition position) {
      float maxZoom = 17.0f;
      float minZoom = 2.0f;

      if (position.zoom > maxZoom) {
        map.animateCamera(CameraUpdateFactory.zoomTo(maxZoom));
      } else if (position.zoom < minZoom) {
      map.animateCamera(CameraUpdateFactory.zoomTo(minZoom));
     }
   }
Nima
  • 6,383
  • 7
  • 46
  • 68