HERE iOS SDK Developer's Guide

NMARoutePositionSource

Class Summary

class NMARoutePositionSource

Derived from: NSObject, NMAPositionDataSource

A position data source which generates updates by simulating traversal of a route.

Include: NMAKit.framework/headers/NMARoutePositionSource.h

Inheritance Diagrams

Figure 1. Public inheritance diagram for NMARoutePositionSource

[For complete information, see the section Class Details]

Public Property Summary

Table 1. Public Properties
Public Properties

[readable, writable, assign] float  accuracy

The accuracy used in generated position updates, in meters

[readable, writable, assign] float  movementSpeed

The simulated speed at which to traverse the route, in meters per second

[readable, writable, assign] BOOL  positionLost

Indicates whether the position source returns valid positions

[readable, writable, assign] NMARoute route

The route from which to generate position updates

[readable, writable, assign] BOOL  stationary

Indicates whether or not the simulated positions are moving along the route

[readable, writable, assign] NSTimeInterval  updateInterval

The time period between successive position updates, in seconds

Instance Method Summary

Table 2. Instance Methods
Instance Method Summary

-(nonnull instancetype) init

Initialize an NMARoutePositionSource instance

-(nonnull instancetype) initWithRoute:(nonnull NMARoute *) route

Initializes an NMARoutePositionSource with a given route

-(void) reset

Erases all progress along the route

Class Details

A position data source which generates updates by simulating traversal of a route.

Note:

If background updates are enabled (see backgroundUpdatesEnabled from NMAPositionDataSource) CLLocationManager is used to keep the app running in the background but the positions generated come from route simulation traversal.

Public Property Details

[readable, writable, assign] float accuracy

The accuracy used in generated position updates, in meters.

Note:

The default value is 5.0m.

[readable, writable, assign] float movementSpeed

The simulated speed at which to traverse the route, in meters per second.

Note:

The default value is 20m/s (72km/h)

[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 along the route will continue regardless of the value of this property.

Note:

The default value is NO.

[readable, writable, assign] NMARouteroute

The route from which to generate position updates.

Note:

The route can't be changed while position generation is active.

[readable, writable, assign] BOOL stationary

Indicates whether or not the simulated positions are moving along the route.

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

Note:

The default value is NO.

[readable, writable, assign] NSTimeInterval updateInterval

The time period between successive position updates, in seconds.

Note:

The default value is 1.0s.

Instance Method Details

-(nonnull instancetype) init

Initialize an NMARoutePositionSource instance.

-(nonnull instancetype) initWithRoute:(nonnull NMARoute *) route

Initializes an NMARoutePositionSource with a given route.

-(void) reset

Erases all progress along the route.

Note:

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