GPXTrackSegment

extension GPXTrackSegment

This extension adds some methods to work with MapKit

  • Returns a MapKit polyline with the points of the segment. This polyline can be directly plotted on the map as an overlay

    Declaration

    Swift

    public var overlay: MKPolyline { get }
  • Helper method to create the polyline. Returns the array of coordinates of the points that belong to this segment

    Declaration

    Swift

    func trackPointsToCoordinates() -> [CLLocationCoordinate2D]
  • Calculates length in meters of the segment

    Declaration

    Swift

    func length() -> CLLocationDistance