GPXSession
class GPXSession
Handles the actual logging of waypoints and trackpoints.
Addition of waypoints, trackpoints, and the handling of adding trackpoints to tracksegments and tracks all happens here. Exporting the data as a GPX string is also done here as well.
Should not be used directly on iOS, as code origins from GPXMapView
.
-
List of waypoints currently displayed on the map.
Declaration
Swift
var waypoints: [GPXWaypoint]
-
List of tracks currently displayed on the map.
Declaration
Swift
var tracks: [GPXTrack]
-
Current track segments
Declaration
Swift
var trackSegments: [GPXTrackSegment]
-
Segment in which device locations are added.
Declaration
Swift
var currentSegment: GPXTrackSegment
-
Total tracked distance in meters
Declaration
Swift
var totalTrackedDistance: Double
-
Distance in meters of current track (track in which new user positions are being added)
Declaration
Swift
var currentTrackDistance: Double
-
Current segment distance in meters
Declaration
Swift
var currentSegmentDistance: Double
-
Adds a waypoint to the map.
Declaration
Swift
func addWaypoint(_ waypoint: GPXWaypoint)
-
Removes a Waypoint from current session
Declaration
Swift
func removeWaypoint(_ waypoint: GPXWaypoint)
-
Adds a new point to current segment.
Declaration
Swift
func addPointToCurrentTrackSegmentAtLocation(_ location: CLLocation)
Parameters
location
Typically a location provided by CLLocation
-
Appends currentSegment to trackSegments and initializes currentSegment to a new one.
Declaration
Swift
func startNewTrackSegment()
-
Clears all data held in this object.
Declaration
Swift
func reset()
-
Converts current sessionn into a GPX String
Declaration
Swift
func exportToGPXString() -> String
-
Declaration
Swift
func continueFromGPXRoot(_ gpx: GPXRoot)