HERE iOS SDK Developer's Guide

NMALoggedPositionSource

Class Summary

class NMALoggedPositionSource

Derived from: NSObject, NMAPositionDataSource

A position data source which generates updates from a GPS data log file.

Include: NMAKit.framework/headers/NMALoggedPositionSource.h

Inheritance Diagrams

Figure 1. Public inheritance diagram for NMALoggedPositionSource

[For complete information, see the section Class Details]

Public Property Summary

Table 1. Public Properties
Public Properties

[readable, assign] NSUInteger  currentPositionIndex

[readable, assign] BOOL  finished

Indicates whether the position source has reached the end of its log file

[readable, writable, assign] float  horizontalAccuracy

The default horizontal accuracy value in meters, used when a log data point does not specify an accuracy

[readable, writable, assign] NSURL *  logFile

The URL of the log file from which position updates are being generated

[readable, writable, assign] BOOL  positionLost

Indicates whether the position source returns valid positions

[readable, assign] NSArray *  positions

The array of NMAGeoPositions loaded from the current logFile, or nil if no file is set

[readable, writable, assign] BOOL  runsInBackground

Indicates whether the position source attempts to keep the application running in the background in order to provide position updates

[readable, writable, assign] BOOL  stationary

Indicates whether or not the simulated positions are moving through the log

[readable, writable, assign] NSTimeInterval  updateInterval

The time interval between successive position updates, in seconds

[readable, writable, assign] NMALoggedPositionUpdateStyle   updateStyle

The update style of the data source; the style controls update frequency

[readable, writable, assign] BOOL  usesOriginalTimestamps

Controls whether or not the log file time stamps are used in position updates.

[readable, writable, assign] float  verticalAccuracy

The default vertical accuracy value in meters, used when a log data point does not specify an accuracy

Instance Method Summary

Table 2. Instance Methods
Instance Method Summary

-(id) initWithLogFile:(NSURL *) logFile

Creats a logged position source with the specified log file as input

-(void) reset

Erases all progress through the log

Class Details

A position data source which generates updates from a GPS data log file.

The input source of the position updates is specified using the logFile property. The update frequency can be controlled using the updateStyle and updateInterval properties.

Note:

By default this class attempts to generate position updates in the background. See the runsInBackground property.

Public Property Details

[readable, assign] NSUInteger currentPositionIndex

The index of the current position within positions

[readable, assign] BOOL finished

Indicates whether the position source has reached the end of its log file.

Note:

Returns NO if the source has not yet been started.

[readable, writable, assign] float horizontalAccuracy

The default horizontal accuracy value in meters, used when a log data point does not specify an accuracy.

Note:

The default value is 5.0 meters.

[readable, writable, assign] NSURL * logFile

The URL of the log file from which position updates are being generated.

Note:

Currently, only the GPX file format is supported. GPX files may be generated using NMAPositioningManager and NMADevicePositionSource

[readable, writable, assign] BOOL positionLost

Indicates whether the position source returns valid positions.

Setting positionLost to YES can be used to simulate position loss. Position updates will still be generated by the position source, but the currentPosition property will always return nil.

Note:

Progress through the log will continue regardless of the value of this property.

Note:

The default value is NO.

[readable, assign] NSArray * positions

The array of NMAGeoPositions loaded from the current logFile, or nil if no file is set.

Note:

These objects are not exactly the same as objects returned by currentPosition as the currentPosition may have a different timestamp depending upon the values of usesOriginalTimestamps and updateStyle

[readable, writable, assign] BOOL runsInBackground

Indicates whether the position source attempts to keep the application running in the background in order to provide position updates.

Defaults to YES.

Note:

UIApplication background tasks are used to keep the app running in the background to generate position updates. The amount of time it can run in the background is therefore decided by Apple and could only be a couple of minutes. To guarantee background position updates beyond this you will need use other means to keep your app running in the background.

[readable, writable, assign] BOOL stationary

Indicates whether or not the simulated positions are moving through the log.

If stationary is YES, the currentPosition will remain fixed at the last calculated position, or the beginning of the log file if no progress has been made.

Note:

The default value is NO.

[readable, writable, assign] NSTimeInterval updateInterval

The time interval between successive position updates, in seconds.

If the position update style is interval-based, this property controls the time between updates. If the update style is NMALoggedPositionUpdateStyleActual, this property has no effect.

The minimum value of the property is 0.1 seconds, the default value is 1.0 seconds.

[readable, writable, assign] NMALoggedPositionUpdateStyle  updateStyle

The update style of the data source; the style controls update frequency.

Note:

The default value is NMALoggedPositionUpdateStyleActual.

See also:

NMALoggedPositionUpdateStyle

[readable, writable, assign] BOOL usesOriginalTimestamps

Controls whether or not the log file time stamps are used in position updates.

If this property is set to YES, position values will be created with the time stamp of their corresponding data point in the log file. If this property is NO, the time stamps of the position updates will be calculated relative to the time when position updating was started. The time offset of each data point will be equal to the time difference between that point's timestamp and the timestamp of the first data point in the log file.

Note:

The default value is NO.

[readable, writable, assign] float verticalAccuracy

The default vertical accuracy value in meters, used when a log data point does not specify an accuracy.

Note:

The default value is 5.0 meters.

Instance Method Details

-(id) initWithLogFile:(NSURL *) logFile

Creats a logged position source with the specified log file as input.

-(void) reset

Erases all progress through the log.

Note:

This method will not affect any properties, including the current log file.

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.