Simulated Location Data Source
A location data source that provides simulated device locations for testing. Use this data source to simulate location updates for a device. It uses a collection of Location that are sequentially passed to LocationDataSource.updateLocation. The location collection can be derived from vertices in a provided polyline, generated evenly along a polyline based on a travel velocity, or assigned to the collection directly.
Since
200.1.0
Constructors
Properties
The index of the item in the location collection that provides the current location. You can get this value to find which item in the SimulatedLocationDataSource.locations collection represents the current location. You can also provide a new index to skip to a different location in the collection.
The rate over which the SimulatedLocationDataSource.locations collection is iterated. This controls the frequency of location updates for the simulated location data source. The default value is 1.0, resulting in calls to LocationDataSource.updateLocation every second. To increase the frequency, provide a higher value. A value of 2.0, for example, doubles the frequency of location updates. To slow down updates, provide a lower value. A value of 0.5, for example, decreases location updates by a factor of two. The iteration rate does not affect the Location.timestamp property of the items in the SimulatedLocationDataSource.locations (they are always 1 second apart).
A collection of locations that are iterated sequentially. As the collection is iterated, the LocationDataSource.updateLocation is fired for each location. The frequency at which LocationDataSource.updateLocation is called is determined by SimulatedLocationDataSource.iterationRate. Populate the collection by calling SimulatedLocationDataSource.setLocationsWithPolyline or by directly assigning a collection of Location to this property.
Inherited properties
An error that describes a problem encountered while starting or running the LocationDataSource. This property is used to notify the user about errors that occur in LocationDataSource. Such errors are critical for LocationDataSource and will cause it stop. If LocationDataSource cannot be started, or it stopped after a successful start, this property will store information related to what caused LocationDataSource to stop.
A SharedFlow that emits heading changes.
A SharedFlow that emits location changes.
The current status of the location data source. The status indicates if the location data source is starting, started, stopping, stopped, and has failed to start.
Functions
Creates a collection of locations using vertices from an input polyline. The generated locations are available from the SimulatedLocationDataSource.locations property. These location properties are populated based on the inputs: Location.timestamp, Location.position, Location.speed, The Location.course property is calculated based on the inputs. These location properties are not set: Location.horizontalAccuracy, Location.verticalAccuracy, Location.lastKnown
Creates a collection of locations along an input polyline based on simulation parameters. The generated locations are available from the SimulatedLocationDataSource.locations property. Distance between each location on the polyline is determined by the value of SimulationParameters.velocity. If velocity is 10 meters per second, for example, the distance between locations will be 10 meters. The Location.timestamp values will always be 1 second apart. These location properties will be set based on the inputs: Location.timestamp, Location.position, Location.speed, Location.horizontalAccuracy, Location.verticalAccuracy The Location.course property will be calculated based on the inputs and the Location.lastKnown property will not be set.