title: Leaflet - Fitbounds and keep center
body: <p>I'm using Leaflet with Mapbox and I'd like to set the view of the map so :</p>
  
  <ol>
  <li>all markers are visible</li>
  <li>the center is set to a specific point</li>
  </ol>
  
  <p>It's easy to do each points separately with setView and fitbounds but I don't know how to have both at the same time since setView changes the bounds and fitBounds changes the center. A solution could be to define a center and a zoom but how can I know which zoom will allow all my markers to be visible ?</p>
  
  <p>EDIT</p>
  
  <p>I implemented the solution suggested by IvanSanchez and it works as expected:</p>
  
  <pre><code>let ne=leafletBounds.getNorthEast();
  let sw=leafletBounds.getSouthWest();
  let neSymetric=[ne.lat + (center.lat - ne.lat)*2, ne.lng + (center.lng - ne.lng)*2];
  let swSymetric=[sw.lat +(center.lat - sw.lat)*2, sw.lng + (center.lng - sw.lng)*2];
  leafletBounds.extend(L.latLngBounds(swSymetric, neSymetric));
  </code></pre>