SimulatedLocationDataSource QML Type

A location data source that provides simulated device locations for testing. More...

Import Statement: import Esri.ArcGISRuntime 100.15
Since: Esri.ArcGISRuntime 100.8
Inherits:

AbstractLocationDataSource

Properties

Signals

Methods

Detailed Description

Use this data source to simulate location updates for a device. It uses a collection of Location objects 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.

Property Documentation

currentLocationIndex : int

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.


iterationRate : double

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).


locations : list<Location>

A collection of locations that are iterated sequentially.

As the collection is iterated, the AbstractLocationDataSource::locationChanged signal is emitted 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 to this property.


Signal Documentation

currentLocationIndexChanged()

Emitted when the currentLocationIndex property changes.

Note: The corresponding handler is onCurrentLocationIndexChanged.


iterationRateChanged()

Emitted when the iterationRate property changes.

Note: The corresponding handler is onIterationRateChanged.


locationsChanged()

Emitted when the locations property changes.

Note: The corresponding handler is onLocationsChanged.


Method Documentation

void setLocationsWithPolyline(Polyline polyline)

Creates a collection of locations using vertices from an input polyline.

The generated locations are available from the SimulatedLocationDataSource::locations property. The following location properties are populated based on the inputs:

The Location::course property is calculated based on the inputs.

These location properties are not set:


void setLocationsWithPolylineAndParameters(Polyline polyline, SimulationParameters simulationParameters)

Creates a collection of locations along an input polyline based on simulationParameters.

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.

The following properties will be set based on the inputs:

The Location::course property will be calculated based on the inputs. The Location::lastKnown property will not be set.


Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.