QGeoServiceProvider

Since: 1.1

#include <QtLocationSubset/QGeoServiceProvider>

The QGeoServiceProvider class aggregates access to services which provide geographical information.

The Maps and Navigation API allows people to access various kinds of geographical information, including functionality to perform geocoding, routing and the display of maps. The QGeoServiceProvider aggregates the access to a set of these services that are provided by a single vendor.

It is possible to mix and match service providers for the various domains, so that a geocoding manager from one service provider can be used with a geographic routing manager from another service provider.

This is not recommended unless the client is able to verify that the data provided by the different services are compatible, as differences in the underlying data sets could cause serious incongruencies between the services.

Subclasses of QGeoServiceProvider guarantee that the different services that they provide are interoperable.

Note that BB10 provides a single service provider, and this provider only supports the geocoding functionality. Maps are supported by the MapView API.


Overview

Public Functions Index

QGeoServiceProvider (const QString &providerName, const QMap< QString, QVariant > &parameters=(QMap< QString, QVariant >()))
~QGeoServiceProvider ()
Errorerror () const
QStringerrorString () const
QGeoMappingManager *mappingManager () const
QGeoRoutingManager *routingManager () const
QGeoSearchManager *searchManager () const

Static Public Functions Index

Public Types

Error

Describes an error related to the loading and setup of a service provider plugin.

NoError No error has occurred.

NotSupportedError The plugin does not support this functionality.

UnknownParameterError The plugin did not recognise one of the parameters it was given.

MissingRequiredParameterError The plugin did not find one of the parameters it was expecting.

NoError
NotSupportedError
UnknownParameterError
MissingRequiredParameterError

Public Functions

QGeoServiceProvider (

Constructs a QGeoServiceProvider whose backend has the name providerName, using the provided parameters.

If multiple plugins have the same providerName, the plugin with the highest reported providerVersion() will be used.

If no plugin matching providerName was able to be loaded then error() and errorString() will provide details about why this is the case.

Note that BB10 has only one service provider, with provider name "BbGeoServices".

~QGeoServiceProvider ()

Destructor.

Error error ()

Returns an error code describing the error which occurred during the last operation that was performed by this class.

QString errorString ()

Returns a string describing the error which occurred during the last operation that was performed by this class.

QGeoMappingManager * mappingManager ()

Returns the QGeoMappingManager made available by the service provider.

This function will return 0 if the service provider does not provide any mapping services.

This function will attempt to construct a QGeoMappingManager instance when it is called for the first time. If the attempt is successful the QGeoMappingManager will be cached, otherwise each call of this function will attempt to construct a QGeoMappingManager instance until the construction is successful.

After this function has been called, error() and errorString() will report any errors which occurred during the construction of the QGeoMappingManager.

Note that the BB10 service provider does not support mapping and always returns 0.

QGeoRoutingManager * routingManager ()

Returns the QGeoRoutingManager made available by the service provider.

This function will return 0 if the service provider does not provide any geographic routing services.

This function will attempt to construct a QGeoRoutingManager instance when it is called for the first time. If the attempt is successful the QGeoRoutingManager will be cached, otherwise each call of this function will attempt to construct a QGeoRoutingManager instance until the construction is successful.

After this function has been called, error() and errorString() will report any errors which occurred during the construction of the QGeoRoutingManager.

Note that the BB10 service provider does not support routing and always returns 0.

QGeoSearchManager * searchManager ()

Returns the QGeoSearchManager made available by the service provider.

This function will return 0 if the service provider does not provide any geocoding services.

This function will attempt to construct a QGeoSearchManager instance when it is called for the first time. If the attempt is successful the QGeoSearchManager will be cached, otherwise each call of this function will attempt to construct a QGeoSearchManager instance until the construction is successful.

After this function has been called, error() and errorString() will report any errors which occurred during the construction of the QGeoSearchManager.

Static Public Functions

QStringList availableServiceProviders ()

Returns a list of names of the available service providers, for use with the QGeoServiceProvider constructors.

Note that BB10 has only one service provider, with provider name "BbGeoServices".

Last modified: 2014-09-30



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus