title: fitBounds to zoom to include all markers
body: <p>My JavaScript for the Leaflet map is below, near the bottom you will see my <code>fitBounds()</code> definition.</p>
  
  <p>The problem is I do not understand how to use it exactly, or where to put it in this code to make it work (i.e. to zoom to include all Markers, instead of hard coding the coordinates).</p>
  
  <p>It seems nothing I try makes it work correctly.</p>
  
  <pre class="lang-js prettyprint-override"><code>var map = L.map('map').setView([39.202903, -94.602907], 20);
  L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
    maxZoom: 18,
    attribution: 'Map data &amp;copy; &lt;a href="https://www.openstreetmap.org/"&gt;OpenStreetMap&lt;/a&gt; contributors, ' +
      '&lt;a href="https://creativecommons.org/licenses/by-sa/2.0/"&gt;CC-BY-SA&lt;/a&gt;, ' +
      'Imagery © &lt;a href="https://www.mapbox.com/"&gt;Mapbox&lt;/a&gt;',
    id: 'mapbox.streets'
  }).addTo(map);
  
  function onLocationFound(e) {
    var radius = e.accuracy / 2;
  
    L.circle(e.latlng, radius).addTo(map);
  
    marker1 = L.marker([39.199178, -94.643435]).addTo(map);
    marker1.bindPopup("1&lt;br&gt;&lt;b&gt;#050&lt;/b&gt;&lt;br&gt;KC0YT&lt;br&gt;Charlotte Hoverder&lt;br&gt;Platte Co., MODist:A&lt;br&gt;39.199178, -94.643435&lt;br&gt;EM29qe").openPopup();
  
    marker2 = L.marker([39.2859182, -94.667236]).addTo(map);
    marker2.bindPopup("2&lt;br&gt;&lt;b&gt;#007&lt;/b&gt;&lt;br&gt;KD0YEX&lt;br&gt;Karen Mcmackin&lt;br&gt;Platte  Co., MODist:A&lt;br&gt;39.2859182, -94.667236&lt;br&gt;EM29pg98").openPopup();
  
    marker3 = L.marker([39.233982, -94.666035]).addTo(map);
    marker3.bindPopup("3&lt;br&gt;&lt;b&gt;#048&lt;/b&gt;&lt;br&gt;N0RL&lt;br&gt;David Copeland&lt;br&gt;Clay  Co., MODist:A&lt;br&gt;39.233982, -94.666035&lt;br&gt;EM29ri").openPopup();
  
    marker4 = L.marker([39.33353, -94.76145]).addTo(map);
    marker4.bindPopup("4&lt;br&gt;&lt;b&gt;#052&lt;/b&gt;&lt;br&gt;W0JSH&lt;br&gt;John Heavener&lt;br&gt;Platte  Co., MODist:A&lt;br&gt;39.33353, -94.76145&lt;br&gt;EM29oi").openPopup();
  }
  
  function onLocationError(e) {
    alert(e.message);
  }
  
  map.on('locationfound', onLocationFound);
  map.on('locationerror', onLocationError);
  
  map.fitBounds([
    [39.199178, -94.643435],
    [39.2859182, -94.667236],
    [39.233982, -94.666035],
    [39.33353, -94.76145],
  ]);
  
  map.locate({
    setView: true,
    maxZoom: 10,
  });
  </code></pre>