SKPositionerService Class Reference

Inherits from NSObject
Declared in SKPositionerService.h

Overview

SKPositionerService is used for managing GPS position related operations.

  delegate

The delegate that must conform to SKPositionerServiceDelegate protocol, used for receiving different GPS location updates.

@property (nonatomic, weak) id<SKPositionerServiceDelegate> delegate

Discussion

The delegate that must conform to SKPositionerServiceDelegate protocol, used for receiving different GPS location updates.

Declared In

SKPositionerService.h

  positionerMode

The positioner mode. The positioner can use real positions or simulated positions using reportGPSPosition method. The default value is SKPositionerModeRealPositions.

@property (nonatomic, assign) SKPositionerMode positionerMode

Discussion

The positioner mode. The positioner can use real positions or simulated positions using reportGPSPosition method. The default value is SKPositionerModeRealPositions.

Declared In

SKPositionerService.h

  activityType

The activity type of the location positioner.

@property (nonatomic, assign) CLActivityType activityType

Discussion

The activity type of the location positioner.

Declared In

SKPositionerService.h

  worksInBackground

Indicates whether the positioner will still work when the client application is in background. Default value is NO. If the client still requires positions when the app is in backgorund, set to YES.

@property (nonatomic, assign) BOOL worksInBackground

Discussion

Indicates whether the positioner will still work when the client application is in background. Default value is NO. If the client still requires positions when the app is in backgorund, set to YES.

Declared In

SKPositionerService.h

  automaticLocationUpdatePause

Allow or forbid location update pause when movement is not detected. This is useful for optimizing battery life. Default is YES. If this property is YES, battery life can be prolonged but if the app is in background it may be completely suspended after a while, thus it may be undesirable for background navigation. If the property is NO, the battery life may suffer but your app will receive location updates even if the device is stationary. In a real life situation it is recommended that this property is YES because if the the app is in background it will be resumed periodically, whenever the location is updated.

@property (nonatomic, assign) BOOL automaticLocationUpdatePause

Discussion

Allow or forbid location update pause when movement is not detected. This is useful for optimizing battery life. Default is YES. If this property is YES, battery life can be prolonged but if the app is in background it may be completely suspended after a while, thus it may be undesirable for background navigation. If the property is NO, the battery life may suffer but your app will receive location updates even if the device is stationary. In a real life situation it is recommended that this property is YES because if the the app is in background it will be resumed periodically, whenever the location is updated.

Declared In

SKPositionerService.h

  gpsAccuracyLevel

The overall accuracy of the latest received GPS positions.

@property (nonatomic, readonly, assign) SKGPSAccuracyLevel gpsAccuracyLevel

Discussion

The overall accuracy of the latest received GPS positions.

Declared In

SKPositionerService.h

  currentCoordinate

Last GPS coordinate reported by the device.

@property (nonatomic, readonly, assign) CLLocationCoordinate2D currentCoordinate

Discussion

Last GPS coordinate reported by the device.

Declared In

SKPositionerService.h

  currentMatchedPosition

The current position stored by the library, matched on a road segment, in the SKPosition format.

@property (nonatomic, readonly, assign) SKPosition currentMatchedPosition

Discussion

The current position stored by the library, matched on a road segment, in the SKPosition format.

Declared In

SKPositionerService.h

  currentHeading

Last heading information reported by the location manager.

@property (nonatomic, readonly, assign) CLLocationDirection currentHeading

Discussion

Last heading information reported by the location manager.

Declared In

SKPositionerService.h

  currentSpeed

Current speed information reported by the location manager.

@property (nonatomic, readonly, assign) double currentSpeed

Discussion

Current speed information reported by the location manager.

Declared In

SKPositionerService.h

  positionsLogFilePath

Path to the log file to be used for simulating a navigation.

@property (nonatomic, strong) NSString *positionsLogFilePath

Discussion

Path to the log file to be used for simulating a navigation.

Declared In

SKPositionerService.h

  movementThreshold

The value for triggering movement events. Use this to set the minimum update distance.

@property (nonatomic, assign) CLLocationDistance movementThreshold

Discussion

The value for triggering movement events. Use this to set the minimum update distance.

Declared In

SKPositionerService.h

+ sharedInstance

Returns the singleton instance of the SKPositionerService class.

+ (instancetype)sharedInstance

Discussion

Returns the singleton instance of the SKPositionerService class.

Declared In

SKPositionerService.h

– startLocationUpdate

Starts updating GPS locations. In order to receive GPS locations, the following key must be added in the project’s plist file: NSLocationWhenInUseUsageDescription. The value of the key will be displayed to the user when he accepts/declines location updates for the application. If the key and the value are not added to the plist file, the user will not be asked for permission and the current position will not be available in the SDK.

- (void)startLocationUpdate

Discussion

Starts updating GPS locations. In order to receive GPS locations, the following key must be added in the project’s plist file: NSLocationWhenInUseUsageDescription. The value of the key will be displayed to the user when he accepts/declines location updates for the application. If the key and the value are not added to the plist file, the user will not be asked for permission and the current position will not be available in the SDK.

Declared In

SKPositionerService.h

– cancelLocationUpdate

Stops updating GPS locations.

- (void)cancelLocationUpdate

Discussion

Stops updating GPS locations.

Declared In

SKPositionerService.h

– startSignificantLocationUpdate

Starts updating only significant GPS locations.

- (void)startSignificantLocationUpdate

Discussion

Starts updating only significant GPS locations.

Declared In

SKPositionerService.h

– cancelSignificantLocationUpdate

Stops updating only significant GPS locations.

- (void)cancelSignificantLocationUpdate

Discussion

Stops updating only significant GPS locations.

Declared In

SKPositionerService.h

– reportGPSLocation:

Reports GPS locations in order to simulate the current position. The positionerMode property needs to previously be set to SKPositionerModePositionSimulation.

- (void)reportGPSLocation:(CLLocation *)location

Parameters

location

The location that will be used as current position. In order to set a custom heading, use the reportDeviceHeading method.

Discussion

Reports GPS locations in order to simulate the current position. The positionerMode property needs to previously be set to SKPositionerModePositionSimulation.

Declared In

SKPositionerService.h

– reportDeviceHeading:

Reports device heading in order to simulate the current heading. The positionerMode property needs to be previously set to SKPositionerModePositionSimulation. We recommend using the trueHeading property of a CLHeading object. The course property of a CLLocation object can also be used as input.

- (void)reportDeviceHeading:(CLLocationDirection)heading

Parameters

heading

The heading that will be used as current device heading.

Discussion

Reports device heading in order to simulate the current heading. The positionerMode property needs to be previously set to SKPositionerModePositionSimulation. We recommend using the trueHeading property of a CLHeading object. The course property of a CLLocation object can also be used as input.

Declared In

SKPositionerService.h

– startPositionReplayFromLog:

Starts replaying a log file that was previously recorded. Positions saved there will be used instead of those received from the GPS hardware.

- (BOOL)startPositionReplayFromLog:(NSString *)logFileNameWithPath

Parameters

logFileNameWithPath

The path to the log file.

Return Value

Success/Failure of the operation.

Discussion

Starts replaying a log file that was previously recorded. Positions saved there will be used instead of those received from the GPS hardware.

Declared In

SKPositionerService.h

– stopPositionReplay

Stops the replaying of GPS positions.

- (BOOL)stopPositionReplay

Return Value

Success/Failure of the operation.

Discussion

Stops the replaying of GPS positions.

Declared In

SKPositionerService.h

– setPositionReplayRate:

Sets the position replaying rate. The time interval between the replay of positions is shortened directly proportional to the rate.

- (BOOL)setPositionReplayRate:(double)rate

Parameters

rate

The rate of replaying.

Return Value

Success/Failure of the operation.

Discussion

Sets the position replaying rate. The time interval between the replay of positions is shortened directly proportional to the rate.

Declared In

SKPositionerService.h

– increaseRouteSimulationSpeed:

Increases the current speed of the user during a navigation simulation with the given value in m/s.

- (BOOL)increaseRouteSimulationSpeed:(NSInteger)withValue

Parameters

withValue

The value to increase the current speed in m/s.

Return Value

Success/Failure of the operation.

Discussion

Increases the current speed of the user during a navigation simulation with the given value in m/s.

Declared In

SKPositionerService.h

– decreaseRouteSimulationSpeed:

Decreases the current speed of the user during a navigation simulation with the given value in m/s.

- (BOOL)decreaseRouteSimulationSpeed:(double)withValue

Parameters

withValue

The value to increase the current speed in m/s.

Return Value

Success/Failure of the operation.

Discussion

Decreases the current speed of the user during a navigation simulation with the given value in m/s.

Declared In

SKPositionerService.h

– requestElevationAtCoordinate:

Returns the elevation in meters at the given location. Returns 0 if the tiles for that location are not yet loaded.

- (void)requestElevationAtCoordinate:(CLLocationCoordinate2D)coordinate

Parameters

coordinate

Coordinate where the elevation is returned.

Discussion

Returns the elevation in meters at the given location. Returns 0 if the tiles for that location are not yet loaded.

Declared In

SKPositionerService.h