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(Location). 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.
Constructors
Creates a simulated location data source.
Creates a simulated location data source with the specified locations.
Creates a simulated location data source which derives its collection of locations along an input polyline, optionally based on simulation parameters.
Functions
Creates a collection of locations using vertices from an input polyline. The generated locations are available from the SimulatedLocationDataSource.getLocations() property. These location properties are populated based on the inputs: Location.getTimestamp(), Location.getPosition(), Location.getSpeed(), The Location.getCourse() property is calculated based on the inputs. These location properties are not set: Location.getHorizontalAccuracy(), Location.getVerticalAccuracy(), Location.getLastKnown()
Creates a collection of locations along an input polyline based on simulation parameters. The generated locations are available from the SimulatedLocationDataSource.getLocations() property. Distance between each location on the polyline is determined by the value of SimulationParameters.getVelocity(). If velocity is 10 meters per second, for example, the distance between locations will be 10 meters. The Location.getTimestamp() values will always be 1 second apart. These location properties will be set based on the inputs: Location.getTimestamp(), Location.getPosition(), Location.getSpeed(), Location.getHorizontalAccuracy(), Location.getVerticalAccuracy() The Location.getCourse() property will be calculated based on the inputs and the Location.getLastKnown() property will not be set.
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.getLocations() collection represents the current location. You can also provide a new index to skip to a different location in the collection.
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.
The rate over which the SimulatedLocationDataSource.getLocations() 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(Location) 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.getTimestamp() property of the items in the SimulatedLocationDataSource.getLocations() (they are always 1 second apart).
LocationDataSource status.