Using the latest version of Google maps. How to add markers using longitude and latitude and automatically adjust the zoom level of the map to include all the markers using
The following did the trick for me
map.fitBounds(bounds);
// add a zoom to the map
var listener = google.maps.event.addListener(map, 'idle', function()
{
if(map.getZoom() > 16)
map.setZoom(17);
google.maps.event.removeListener(listener);
});
Set your desired zoom in the setZoom() method. The larger the value, the wider it shows location details, the smaller the value, it throttles and shrinks the location details