title: MapBox[IOS]: How to get MGLPolygon or MGLPolyline center coordinates
body: <p>How can I get the center coordinate of a <code>MGLPolygon</code> or any <code>MGLShape</code>?</p>
  
  <pre><code>var points = [
      CLLocationCoordinate2D(latitude: 40.718379593199494, longitude: -74.00519371032715),
      CLLocationCoordinate2D(latitude: 40.717273679029205, longitude: -74.00639533996582),
      CLLocationCoordinate2D(latitude: 40.713435363794270, longitude: -73.99841308593750),
      CLLocationCoordinate2D(latitude: 40.714150998671556, longitude: -73.99755477905273),
      CLLocationCoordinate2D(latitude: 40.716037635568070, longitude: -73.99643898010254),
      CLLocationCoordinate2D(latitude: 40.728201906826750, longitude: -73.99137496948242),
      CLLocationCoordinate2D(latitude: 40.743810548166270, longitude: -73.97961616516113)]
  
  let polygon = MGLPolygon(coordinates: &amp;points, count: UInt(points.count))
  map.addOverlay(polygon)
  </code></pre>
  
  <p>Using the above code I am creating shapes for <code>polygon</code> and <code>polyline</code>.</p>