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] 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< NMAGeoPosition * > *  positions

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

[readable, writable, assign] BOOL  stationary

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

Instance Method Summary

Table 2. Instance Methods
Instance Method Summary

-(nonnull instancetype) init

Initialize an NMALoggedPositionSource instance

-(nonnull instancetype) initWithLogFile:(nonnull NSURL *) logFile

Initialize 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 generates 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] NSURL * logFile

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

Attempts to change the log file after plyabck has started will be ignored. Playback is started when an NMALoggedPositionSource instance is set as the dataSource of NMAPositioningManager.

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< NMAGeoPosition * > * 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 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.

Instance Method Details

-(nonnull instancetype) init

Initialize an NMALoggedPositionSource instance.

-(nonnull instancetype) initWithLogFile:(nonnull NSURL *) logFile

Initialize 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.