title: How to count total distance covered in GMSMutablePath iOS
body: <p>I have one full route which walked by user and its Coordinate points.</p>
  
  <blockquote>
    <p>i have create path of it.</p>
  </blockquote>
  
  <pre><code>let path = GMSMutablePath()
  path.add(CLLocationCoordinate2D(latitude: latNew, longitude: longNew))
  </code></pre>
  
  <p>//Adding here multiple locations.</p>
  
  <blockquote>
    <p>Showing path to map.</p>
  </blockquote>
  
  <pre><code>let polyline = GMSPolyline(path: path)
  polyline.strokeWidth = 5.0;
  polyline.strokeColor = UIColor.blue
  let styles = [GMSStrokeStyle.solidColor(UIColor.black), GMSStrokeStyle.solidColor(UIColor.clear)]
  let lengths = [2, 2];
  polyline.spans = GMSStyleSpans(polyline.path!, styles, lengths as [NSNumber], kGMSLengthRhumb)
  polyline.geodesic = true
  polyline.map = self.viewGMap
  </code></pre>
  
  <p>Now i wants to calculate total distance covered in this route only. </p>
  
  <p>How to do it ?</p>