NSDK_GPSManager

@interface NSDK_GPSManager : NSObject

This class is the key to reception of GPS data in the PTV Navigation SDK. The class is able to process real or simulated GPS data - depending on the particular usage.

For real GPS data please verify that you have a set the key ‘Privacy - Location Always Usage Description’ or ‘Privacy - Location When In Use Usage Description’ in your Info.plist file

This class has to be used as a singleton. So use the sharedInstance method to obtain the object

  • get the singleton instance

    Declaration

    Objective-C

    + (instancetype)sharedInstance;

    Swift

    class func sharedInstance() -> Self!

    Return Value

    the instance

  • Opens a simulated GPS-Device

    Declaration

    Objective-C

    - (void)openSimulatedGPSDevice:(BOOL)shortTimeExtrapolator
                           simFile:(NSString *)simFile
                             error:(NSError **)error;

    Swift

    func openSimulatedGPSDevice(_ shortTimeExtrapolator: Bool, simFile: String!, error: NSErrorPointer)

    Parameters

    shortTimeExtrapolator

    Enable short time extrapolator for getting extrapolated gps results within one second when not getting any gps data

    simFile

    Name of simulation file. The file has to be created before by the [NSDK_Navigation createGPSSimulationWithPath:]` call

  • Opens a real GPS-Device

    Declaration

    Objective-C

    - (void)openGPSDevice:(BOOL)shortTimeExtrapolator error:(NSError **)error;

    Swift

    func openGPSDevice(_ shortTimeExtrapolator: Bool, error: NSErrorPointer)

    Parameters

    shortTimeExtrapolator

    Enable short time extrapolator for getting extrapolated gps results within one second when not getting any gps data real GPS receiver is used.

    error

    contains error information, if an error occured.

  • Closes the GPS-Device.

    Declaration

    Objective-C

    - (void)closeGPSDevice:(NSError **)error;

    Swift

    func closeGPSDevice(_ error: NSErrorPointer)

    Parameters

    error

    contains error information, if an error occured.

  • pushes a GPS Location into the SDK. This method should be called everytime when the OS signalizes a new location

    Declaration

    Objective-C

    - (BOOL)pushLocation:(CLLocation *)loc error:(NSError **)error;

    Swift

    func push(_ loc: CLLocation!) throws

    Parameters

    loc

    the new GPS Location

    error

    contains error information, if an error occured.

  • Retrieves the current GPS-Information.

    Declaration

    Objective-C

    - (NSDK_GPSData *)getCurrentPosition:(NSError **)error;

    Swift

    func getCurrentPosition() throws -> NSDK_GPSData

    Parameters

    error

    contains error information, if an error occured.

    Return Value

    the current GPS-Information.