QGeoServiceProvider Class
The QGeoServiceProvider class aggregates access to services which provide geographical information. More...
| Header: | #include <QGeoServiceProvider> |
| qmake: | QT += location |
| Since: | Qt 5.6 |
| Inherits: | QObject |
This class was introduced in Qt 5.6.
Public Types
| enum | Error { NoError, NotSupportedError, UnknownParameterError, MissingRequiredParameterError, ConnectionError, LoaderError } |
| enum | GeocodingFeature { NoGeocodingFeatures, OnlineGeocodingFeature, OfflineGeocodingFeature, ReverseGeocodingFeature, LocalizedGeocodingFeature, AnyGeocodingFeatures } |
| enum | MappingFeature { NoMappingFeatures, OnlineMappingFeature, OfflineMappingFeature, LocalizedMappingFeature, AnyMappingFeatures } |
| enum | NavigationFeature { NoNavigationFeatures, OnlineNavigationFeature, OfflineNavigationFeature, AnyNavigationFeatures } |
| enum | PlacesFeature { NoPlacesFeatures, OnlinePlacesFeature, OfflinePlacesFeature, SavePlaceFeature, RemovePlaceFeature, …, AnyPlacesFeatures } |
| enum | RoutingFeature { NoRoutingFeatures, OnlineRoutingFeature, OfflineRoutingFeature, LocalizedRoutingFeature, RouteUpdatesFeature, …, AnyRoutingFeatures } |
Detailed Description
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 incongruences between the services.
Subclasses of QGeoServiceProvider guarantee that the different services that they provide are interoperable.
At this point there are two GeoServices plugins packaged with Qt. They are accessible using their provider names:
- "mapbox" -> Mapbox service
- "here" -> HERE Services
- "osm" -> OpenStreetMap Services
- "esri" -> ESRI Services
Each service provider must follow a naming convention for their service specific parameter names/keys. They use the provider name as prefix for all their parameter names. For example, the HERE service provider requires the here.app_id parameter. When a provider is loaded only those parameters are passed on whose parameter names start with the provider name. This avoids the sharing sensitive parameters such as confidential token or app_id parameters with other plugins.
Please check the GeoServices plugin specific documentation to obtain a complete list of the available parameter names/keys and values.
Member Type Documentation
enum QGeoServiceProvider::Error
Describes an error related to the loading and setup of a service provider plugin.
| Constant | Value | Description |
|---|---|---|
QGeoServiceProvider::NoError | 0 | No error has occurred. |
QGeoServiceProvider::NotSupportedError | 1 | The plugin does not support this functionality. |
QGeoServiceProvider::UnknownParameterError | 2 | The plugin did not recognize one of the parameters it was given. |
QGeoServiceProvider::MissingRequiredParameterError | 3 | The plugin did not find one of the parameters it was expecting. |
QGeoServiceProvider::ConnectionError | 4 | The plugin could not connect to its backend service or database. |
QGeoServiceProvider::LoaderError | 5 | The plugin failed to load. |
enum QGeoServiceProvider::GeocodingFeature
Describes the geocoding features supported by the geo service provider.
| Constant | Value | Description |
|---|---|---|
QGeoServiceProvider::NoGeocodingFeatures | 0 | No geocoding features are supported. |
QGeoServiceProvider::OnlineGeocodingFeature | (1<<0) | Online geocoding is supported. |
QGeoServiceProvider::OfflineGeocodingFeature | (1<<1) | Offline geocoding is supported. |
QGeoServiceProvider::ReverseGeocodingFeature | (1<<2) | Reverse geocoding is supported. |
QGeoServiceProvider::LocalizedGeocodingFeature | (1<<3) | Supports returning geocoding results with localized addresses. |
QGeoServiceProvider::AnyGeocodingFeatures | ~(0) | Matches a geo service provider that provides any geocoding features. |
enum QGeoServiceProvider::MappingFeature
Describes the mapping features supported by the geo service provider.
| Constant | Value | Description |
|---|---|---|
QGeoServiceProvider::NoMappingFeatures | 0 | No mapping features are supported. |
QGeoServiceProvider::OnlineMappingFeature | (1<<0) | Online mapping is supported. |
QGeoServiceProvider::OfflineMappingFeature | (1<<1) | Offline mapping is supported. |
QGeoServiceProvider::LocalizedMappingFeature | (1<<2) | Supports returning localized map data. |
QGeoServiceProvider::AnyMappingFeatures | ~(0) | Matches a geo service provider that provides any mapping features. |
enum QGeoServiceProvider::NavigationFeature
Describes the navigation features supported by the geo service provider.
| Constant | Value | Description |
|---|---|---|
QGeoServiceProvider::NoNavigationFeatures | 0 | No navigation features are supported. |
QGeoServiceProvider::OnlineNavigationFeature | (1<<0) | Online navigation is supported. |
QGeoServiceProvider::OfflineNavigationFeature | (1<<1) | Offline navigation is supported. |
QGeoServiceProvider::AnyNavigationFeatures | ~(0) | Matches a geo service provider that provides any navigation features. |
enum QGeoServiceProvider::PlacesFeature
Describes the places features supported by the geo service provider.
| Constant | Value | Description |
|---|---|---|
QGeoServiceProvider::NoPlacesFeatures | 0 | No places features are supported. |
QGeoServiceProvider::OnlinePlacesFeature | (1<<0) | Online places is supported. |
QGeoServiceProvider::OfflinePlacesFeature | (1<<1) | Offline places is supported. |
QGeoServiceProvider::SavePlaceFeature | (1<<2) | Saving places is supported. |
QGeoServiceProvider::RemovePlaceFeature | (1<<3) | Removing or deleting places is supported. |
QGeoServiceProvider::SaveCategoryFeature | (1<<4) | Saving categories is supported. |
QGeoServiceProvider::RemoveCategoryFeature | (1<<5) | Removing or deleting categories is supported. |
QGeoServiceProvider::PlaceRecommendationsFeature | (1<<6) | Searching for recommended places similar to another place is supported. |
QGeoServiceProvider::SearchSuggestionsFeature | (1<<7) | Search suggestions is supported. |
QGeoServiceProvider::LocalizedPlacesFeature | (1<<8) | Supports returning localized place data. |
QGeoServiceProvider::NotificationsFeature | (1<<9) | Notifications of place and category changes is supported. |
QGeoServiceProvider::PlaceMatchingFeature | (1<<10) | Supports matching places from two different geo service providers. |
QGeoServiceProvider::AnyPlacesFeatures | ~(0) | Matches a geo service provider that provides any places features. |
enum QGeoServiceProvider::RoutingFeature
Describes the routing features supported by the geo service provider.
| Constant | Value | Description |
|---|---|---|
QGeoServiceProvider::NoRoutingFeatures | 0 | No routing features are supported. |
QGeoServiceProvider::OnlineRoutingFeature | (1<<0) | Online routing is supported. |
QGeoServiceProvider::OfflineRoutingFeature | (1<<1) | Offline routing is supported. |
QGeoServiceProvider::LocalizedRoutingFeature | (1<<2) | Supports returning routes with localized addresses and instructions. |
QGeoServiceProvider::RouteUpdatesFeature | (1<<3) | Updating an existing route based on the current position is supported. |
QGeoServiceProvider::AlternativeRoutesFeature | (1<<4) | Supports returning alternative routes. |
QGeoServiceProvider::ExcludeAreasRoutingFeature | (1<<5) | Supports specifying a areas which the returned route must not cross. |
QGeoServiceProvider::AnyRoutingFeatures | ~(0) | Matches a geo service provider that provides any routing features. |