title: How to Set Zoom of Map to cover all markers visible Markers?
body: <p>I have created a map with markers which are fetching latlongs data from mongodb collection.I have set the center as a particular location and zoom level to 5 but I want the map should zoom-in or zoom-out based on marker's location.So that I dont have to give any particular location in center.
  Please help.</p>
  
  <p>The Code is below - </p>
  
  <pre><code> &lt;div class="page-content"&gt;
              &lt;div id="tab-general"&gt;
                &lt;div id="map" style="height: 500px; width: 100%;"&gt;
  
                &lt;/div&gt; 
              &lt;/div&gt;
   &lt;/div&gt;
  
   &lt;script type="text/javascript"&gt;
  //LOAD DATA FROM MONGO
         data= &lt;%-JSON.stringify(data)%&gt;
  
   &lt;/script&gt;
   &lt;script type="text/javascript"&gt;
  
   var LatLngs = [];
    for (j=0;j&lt;data.length;j++){
  
       LatLngs[j] = [data[j].latitude, data[j].longitude, data[j].time, data[j].name];
  
    }
  
  var map = new google.maps.Map(document.getElementById('map'), {
    center: new google.maps.LatLng(23.2500, 77.4170),
    zoom: 5,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  });
  
  var infowindow = new google.maps.InfoWindow();
  
  var marker, i ,ext;
  
  
  for (i = 0; i &lt; LatLngs.length; i++) { 
    marker = new google.maps.Marker({
      position: new google.maps.LatLng(LatLngs[i][0], LatLngs[i][1]),
      map: map
    });
  
    google.maps.event.addListener(marker, 'click', (function(marker, i) {
      return function() {
        infowindow.setContent("Time - "+LatLngs[i][2]+"&lt;br&gt;User Name -"+LatLngs[i][3]);
        infowindow.open(map, marker);
      }
    })(marker, i));
  }
  </code></pre>
  
  <p></p>
  
  <p>Thanks,</p>
  
  <p>Dia</p>