;

AbstractLocationDataSource Class

  • AbstractLocationDataSource
  • class Esri::ArcGISRuntime::AbstractLocationDataSource

    A location data source object. More...

    This class was introduced in Esri::ArcGISRuntime 100.8.

    Public Functions

    AbstractLocationDataSource(QObject *parent)
    virtual ~AbstractLocationDataSource() override
    bool isStarted() const
    void start()
    void stop()

    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 Esri::ArcGISRuntime::Location &location)

    Protected Slots

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

    Detailed Description

    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.

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

    Signal emitted when heading of the data source changes.

    • heading - The new heading in degrees.

    [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();

    [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();

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

    [override virtual] AbstractLocationDataSource::~AbstractLocationDataSource()

    Destructor.

    bool AbstractLocationDataSource::isStarted() const

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

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

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

    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 Esri::ArcGISRuntime::Location &location)

    Update the location position.

    • location - The Location, a location object.

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