AbstractLocationDataSource Class

  • AbstractLocationDataSource
  • class Esri::ArcGISRuntime::AbstractLocationDataSource

    A location data source object. More...

    Public Functions

    AbstractLocationDataSource(QObject *parent)
    virtual ~AbstractLocationDataSource() override
    Esri::ArcGISRuntime::Error error() const
    Esri::ArcGISRuntime::LocationDataSourceStatus locationDataSourceStatus() const
    void start()
    void stop()

    Signals

    void errorChanged(const Esri::ArcGISRuntime::Error &error)
    void headingChanged(double heading)
    void locationChanged(const Esri::ArcGISRuntime::Location &location)
    void locationDataSourceStatusChanged(Esri::ArcGISRuntime::LocationDataSourceStatus locationDataSourceStatus)

    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

    [explicit] AbstractLocationDataSource::AbstractLocationDataSource(QObject *parent)

    Create a location data source object with an optional parent.

    [override virtual] AbstractLocationDataSource::~AbstractLocationDataSource()

    Destructor.

    [since Esri::ArcGISRuntime 100.14] Esri::ArcGISRuntime::Error AbstractLocationDataSource::error() const

    Returns an error that describes a problem encountered while starting or running the AbstractLocationDataSource.

    This property is used to notify the user about errors that occur in AbstractLocationDataSource. Such errors are critical for AbstractLocationDataSource and will cause it stop. If AbstractLocationDataSource cannot be started, or it stopped after a successful start, this property will store information related to what caused AbstractLocationDataSource to stop.

    This function was introduced in Esri::ArcGISRuntime 100.14.

    [signal, since Esri::ArcGISRuntime 100.14] void AbstractLocationDataSource::errorChanged(const Esri::ArcGISRuntime::Error &error)

    Signal emitted when the error property changed.

    This signal differs from Object::errorOccurred in the sense that it will emit both when there is an error and when a previous error condition was cleared.

    • error - the new error, or an empty error if a previous error was cleared and is no longer applicable.

    This function was introduced in Esri::ArcGISRuntime 100.14.

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

    [since Esri::ArcGISRuntime 100.14] Esri::ArcGISRuntime::LocationDataSourceStatus AbstractLocationDataSource::locationDataSourceStatus() const

    Returns AbstractLocationDataSource status.

    This function was introduced in Esri::ArcGISRuntime 100.14.

    [signal, since Esri::ArcGISRuntime 100.14] void AbstractLocationDataSource::locationDataSourceStatusChanged(Esri::ArcGISRuntime::LocationDataSourceStatus locationDataSourceStatus)

    Signal emitted when the locationDataSourceStatus property changed.

    • locationDataSourceStatus - the new status.

    This function was introduced in Esri::ArcGISRuntime 100.14.

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

    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.