Question: I haven't found an answer in my search, there are a few answers on SO but they didn't work for me.

I have 2 markers on the map and I am using LatLngBounds builder in order to let the camera zoom to the right zoom level to include them both. Everything works as expected aside one thing, when the 2 markers are really close to each other, the map is very very zoomed and well, it doesn't make any sense to have this level of zooming.

```
LatLngBounds.Builder builder = new LatLngBounds.Builder();
builder.include(firstMarker.getPosition());
builder.include(secondMarker.getPosition());
LatLngBounds bounds = builder.build();

CameraUpdate cu = CameraUpdateFactory.newLatLngBounds(bounds, markerPadding);

```

Is there a way to force a certain level of zoom, after which the camera won't zoom ? This would avoid having the map too zoomed in/out. Basically I am using 15.0f as level of zoom. If the points are too far away I want the zoom to fit them both. If points are getting close I don't want the zoom level to go beyond 15.0f.

Answer: 
It is just simple:

```
LatLngBounds.Builder latlngBuilder = new LatLngBounds.Builder();

LatLng sydney1 = new LatLng(57.149651, -2.099075);

LatLng sydney2 = new LatLng(51.621441, -3.943646);

latlngBuilder.include(sydney1);
latlngBuilder.include(sydney2);

googlemap.animateCamera(CameraUpdateFactory.newLatLngBounds(latlngBuilder.build(), 100));

```
Following from the answers by user2808624 and dvdrlee, I wrote an extension in Kotlin:

```
fun LatLngBounds.Builder.createBoundsWithZoomMaintained(bounds: LatLngBounds) : LatLngBounds  {
    val HEADING_NORTH_EAST = 45.0   //NorthEast angle
    val HEADING_SOUTH_WEST = 215.0  //SouthWest angle
    val center = bounds.center
    val northEast = SphericalUtil.computeOffset(center, 709.0, HEADING_NORTH_EAST)  //1000 metres on the diagonal translates to 709 metres on either side.
    val southWest = SphericalUtil.computeOffset(center, 709.0, HEADING_SOUTH_WEST)
    this.include(northEast).include(southWest)
    return this.build()
}

```

This would typically be in your Utils or Extensions file, and then you can use it from anywhere simply like this:

```
var bounds = builder.build()  //To include all your existing points.
bounds = builder.createBoundsWithZoomMaintained(bounds)  //Updated bounds.
mMap.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 10)) 

```