teja2495
12/9/2018 - 7:35 PM

Zoom in to selected Places in Maps

LatLngBounds.Builder latLngBuilder = new LatLngBounds.Builder();
for (int i = 0; i < pointsList.size(); i++) {
    latLngBuilder.include(pointsList.get(i));
}
LatLngBounds LatLngBuilder = latLngBuilder.build();
final CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngBounds(LatLngBuilder, 100);

this.mMap.setOnMapLoadedCallback(new GoogleMap.OnMapLoadedCallback() {
    @Override
    public void onMapLoaded() {
        mMap.animateCamera(cameraUpdate);
    }
});