GPXTrackWriter

public class GPXTrackWriter : LocationDelegate
extension GPXTrackWriter: NativeBase
extension GPXTrackWriter: Hashable

Writes GPX track points to GPXTrack. The instance of the class should be added as a listener to the LocationEngine for GPX track recording. Appends the new location to the back segment of the track whenever the listener is called. The following data (if provided) can be recorded and inserted into the resulting GPXTrack: latitude, longitude, altitude, time, bearingInDegrees, pitchInDegrees, speedInMetersPerSecond, horizontalAccuracyInMeters, verticalAccuracyInMeters, bearingAccuracyInDegrees, speedAccuracyInMetersPerSecond and locationTechnology.

Use case examples:

A user wants to create and save a new GPXDocument with one GPXTrack:

A user wants to modify and save GPXTrack in the existing GPXDocument:

The GPXDocument including all tracks is saved in the GPX file format. Hence, once saved, it can be easily shared with other applications that understand the GPX file format.

  • Creates a new instance of GPXTrackWriter with an empty track inside.

    Declaration

    Swift

    public init()
  • Creates a new instance of GPXTrackWriter with GPXTrack. Use this constructor to append locations to an existing track.

    Declaration

    Swift

    public init(track: GPXTrack)

    Parameters

    track

    GPX track.

  • GPX track into which GPX track points are written.

    Declaration

    Swift

    public var track: GPXTrack { get }
  • Called each time a new location is available. In a navigation context while using the Navigator or VisualNavigator, it’s required to set the Location.time parameter for each Location object so that the HERE SDK can map-match the locations properly. If the Location.time parameter is missing, the location will be ignored. For navigation, it is also recommended to provide the bearing and speed parameters for each Location object. Invoked on the main thread.

    Declaration

    Swift

    public func onLocationUpdated(_ location: Location)

    Parameters

    location

    Current location.