A location data source that provides simulated device locations for testing. More...
This class was introduced in Esri::ArcGISRuntime 100.8.
|void||setLocations(const QList<Esri::ArcGISRuntime::Location> &locations)|
|void||setLocationsWithPolyline(const Esri::ArcGISRuntime::Polyline &polyline)|
|void||setLocationsWithPolyline(const Esri::ArcGISRuntime::Polyline &polyline, Esri::ArcGISRuntime::SimulationParameters *simulationParameters)|
Use this data source to simulate location updates for a device. It uses a collection of Location that are sequentially passed to AbstractLocationDataSource::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.
Member Function Documentation
Creates a simulated location data source with an optional parent.
Reacts to start requests by starting the simulation.
Note: You should not call this method directly - use start instead.
Reacts to stop requests by stopping the simulation.
Note: You should not call this method directly - use stop instead.
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.
See also setCurrentLocationIndex().
Returns 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 AbstractLocationDataSource::updateLocation once per 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).
See also setIterationRate().
QList<Esri::ArcGISRuntime::Location> SimulatedLocationDataSource::locations() const
Returns a list of location objects.
As the collection is iterated, the AbstractLocationDataSource::updateLocation is called for each location. The frequency at which AbstractLocationDataSource::updateLocation is called is determined by SimulatedLocationDataSource::iterationRate. Populate the collection by calling SimulatedLocationDataSource::setLocationsWithPolyline or by directly assigning a collection of Location objects in a list.
See also setLocations().
Sets the currentLocationIndex to currentLocationIndex.
See also currentLocationIndex.
Sets the iterationRate to iterationRate.
See also iterationRate.
void SimulatedLocationDataSource::setLocations(const QList<Esri::ArcGISRuntime::Location> &locations)
Sets the locations to locations.
See also locations.
void SimulatedLocationDataSource::setLocationsWithPolyline(const Esri::ArcGISRuntime::Polyline &polyline)
Creates a collection of locations using vertices from the input polyline.
These properties is calculated based on the inputs: Location::course
- polyline - A polyline that defines a simulated travel path.
void SimulatedLocationDataSource::setLocationsWithPolyline(const Esri::ArcGISRuntime::Polyline &polyline, Esri::ArcGISRuntime::SimulationParameters *simulationParameters)
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 following inputs: