title: How fit all coordinates into the bounds of the map? fitBounds equivalent?
body: <p>I'm making a running app using the Mapbox API and I'm struggling on how set the bounds of MGLMapView to fit all of the polylines the user created by running. Mapbox has a version of this in JavaScript here: <a href="https://www.mapbox.com/mapbox-gl-js/example/zoomto-linestring/" rel="noreferrer">https://www.mapbox.com/mapbox-gl-js/example/zoomto-linestring/</a></p>
  
  <p>But I have no idea how to implement this using swift. I can't find a fitBounds equivalent. </p>
  
  <p>I'm storing each CLLocationCoordinate2D into a Array called pointsArray and passing that to the result view controller along with the mapView. </p>
  
  <p>I had method of finding the longest distance between two points in the array and set that as the bounds but since the algorithm is O(n^2) it takes way too long to calculate if I have too many points. There were also other cases where that wouldn't fit all points. </p>
  
  <p>If there's any particular code you want to see let me know. Not sure what to show since I have nothing to fit the bounds.</p>