LocationSimulatorOptions
public struct LocationSimulatorOptions : Hashable
Options to specify how the location simulator will behave.
-
A factor to scale the speed. Useful to speed up (or down) the simulation. By default, the speed factor is 1.0, which is equal to the speed that one normally drives along each route segment without taking into account any traffic-related constraints. The default speed may vary based on the road geometry, road condition and other statistical data. Values above 1.0 will increase the speed, values below 1.0 will reduce the speed. For example, a value of 2.0 will double the speed.
Declaration
Swift
public var speedFactor: Double -
Interval between notifications. Defaults to 1 second. Note that
TimeIntervalaccepts seconds as double, so 500 ms can be set as 0.5 s. Values less than 1 ms are not acceptable and the interval is raised to this minimum in object constructors.Note: This value does not affect
LocationSimulatorwhen created with aGPXTrack.Declaration
Swift
public var notificationInterval: TimeInterval -
When enabled, the default speed from
GPXOptionsis used for GPX track points that do not contain a speed value. When disabled, the speed remains unset (null).Declaration
Swift
public var useDefaultSpeedWhenMissing: Bool -
When enabled and bearing is not present in a GPX track point, it is calculated from the coordinates of adjacent track points. When disabled, the bearing remains unset (null). Note: Even when disabled, the last known bearing is preserved for stationary points to avoid null-bearing glitches in the map matcher.
Declaration
Swift
public var calculateBearingWhenMissing: Bool -
Creates a new instance of this class.
Parameters
- speedFactor: A factor to scale the speed. Useful to speed up (or down) the simulation. By default, the speed factor is 1.0, which is equal to the speed that one normally drives along each route segment without taking into account any traffic-related constraints. The default speed may vary based on the road geometry, road condition and other statistical data. Values above 1.0 will increase the speed, values below 1.0 will reduce the speed. For example, a value of 2.0 will double the speed.
- notificationInterval: Interval between notifications.
Defaults to 1 second.
Note that
TimeIntervalaccepts seconds as double, so 500 ms can be set as 0.5 s. Values less than 1 ms are not acceptable and the interval is raised to this minimum in object constructors.
Note: This value does not affect
LocationSimulatorwhen created with aGPXTrack.- useDefaultSpeedWhenMissing: When enabled, the default speed from
GPXOptionsis used for GPX track points that do not contain a speed value. When disabled, the speed remains unset (null). - calculateBearingWhenMissing: When enabled and bearing is not present in a GPX track point, it is calculated from the coordinates of adjacent track points. When disabled, the bearing remains unset (null). Note: Even when disabled, the last known bearing is preserved for stationary points to avoid null-bearing glitches in the map matcher.
Declaration
Swift
public init(speedFactor: Double = 1.0, notificationInterval: TimeInterval = 1000 * 0.001, useDefaultSpeedWhenMissing: Bool = false, calculateBearingWhenMissing: Bool = false)