Skip To Content ArcGIS for Developers Sign In Dashboard

AbstractLocationDataSource Class

(Esri::ArcGISRuntime::AbstractLocationDataSource)

A location data source object. More...

Header: #include <AbstractLocationDataSource>
Since: Esri::ArcGISRuntime 100.8
Inherits: Object
Inherited By:

Esri::ArcGISRuntime::DefaultLocationDataSource and Esri::ArcGISRuntime::SimulatedLocationDataSource

Public Functions

AbstractLocationDataSource(QObject *parent)
~AbstractLocationDataSource()
bool isStarted() const
void start()
void stop()
  • 31 public functions inherited from QObject

Signals

void headingChanged(double heading)
void locationChanged(const Esri::ArcGISRuntime::Location &location)
void statusChanged(bool started)

Protected Functions

void onStartCompleted(const QString &error = QString())
void onStopCompleted()
void updateHeading(double heading)
void updateLocation(const Location &location)
  • 9 protected functions inherited from QObject

Protected Slots

virtual void onStart() = 0
virtual void onStop() = 0

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 public variable inherited from QObject
  • 10 static public members inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

A location data source object.

This type provides an interface for updating a location - for example, used by the LocationDisplay.

AbstractLocationDataSource is an abstract base class which can be customized to provide your own data source.

The DefaultLocationDataSource provides a default implementation designed to work with the Qt types:

Member Function Documentation

AbstractLocationDataSource::AbstractLocationDataSource(QObject *parent)

Create a location data source object with an optional parent.

AbstractLocationDataSource::~AbstractLocationDataSource()

Destructor.

[signal] void AbstractLocationDataSource::headingChanged(double heading)

Signal emitted when heading of the data source changes.

  • heading - The new heading in degrees.

bool AbstractLocationDataSource::isStarted() const

Returns true if the data source has been started, false otherwise.

[signal] void AbstractLocationDataSource::locationChanged(const Esri::ArcGISRuntime::Location &location)

Signal emitted when location of the data source changes.

[pure virtual protected slot] void AbstractLocationDataSource::onStart()

Reacts to start requests - must be implemented by all AbstractLocationDataSource types.

This slot allows the type to react to requests to start the data source. At the end of the implementation, call onStartCompleted with an optional error message.

For example, an implementation using QGeoPositionInfoSource and QCompass would call:

m_geoPositionInfoSource->startUpdates();
m_compass->start();

onStartCompleted();

[protected] void AbstractLocationDataSource::onStartCompleted(const QString &error = QString())

Completes the implementation of the start operation of the AbstractLocationDataSource.

If you are implementing your own AbstractLocationDataSource, this method must be called at the end of your onStart method.

  • error - If the data source could not be started, this QString supplies an error message.

[pure virtual protected slot] void AbstractLocationDataSource::onStop()

Reacts to stop requests - must be implemented by all AbstractLocationDataSource types.

This slot allows the type to react to requests to stop the data source. At the end of the implementation, call onStopCompleted.

For example, an implementation using QGeoPositionInfoSource and QCompass would call:

m_geoPositionInfoSource->stopUpdates();
m_compass->stop();

onStopCompleted();

[protected] void AbstractLocationDataSource::onStopCompleted()

Completes the implementation of the stop operation of the AbstractLocationDataSource.

If you are implementing your own AbstractLocationDataSource, this method must be called at the end of your onStart method.

void AbstractLocationDataSource::start()

Starts the location data source.

[signal] void AbstractLocationDataSource::statusChanged(bool started)

Signal emitted when heading of the data source changes.

  • started - Whether the data source is not started or stopped.

void AbstractLocationDataSource::stop()

Stops the location data source.

[protected] void AbstractLocationDataSource::updateHeading(double heading)

Updates the heading.

  • heading - a heading in degrees, clockwise from North.

[protected] void AbstractLocationDataSource::updateLocation(const Location &location)

Update the location position.

  • location - The Location, a location object.

Feedback on this topic?