内容表

上一话题

QGeoRoutingManagerEngine

下一话题

QGeoServiceProviderFactory

QGeoServiceProvider

QGeoServiceProvider class aggregates access to services which provide geographical information. 更多

Inheritance diagram of PySide2.QtLocation.QGeoServiceProvider

详细描述

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.

子类化的 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:

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.

class QGeoServiceProvider ( providerName [ , parameters=QVariantMap() [ , allowExperimental=false ] ] )
param providerName

unicode

param allowExperimental

bool

param parameters

构造 QGeoServiceProvider whose backend has the name providerName ,使用提供 参数 .

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

allowExperimental is true then plugins marked as experimental may be used. By default experimental plugins are not considered.

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

注意

Before the list of 参数 is passed on to the to-be-loaded provider plugin, the list is filtered to avoid the sharing of plugin specific parameters with unrelated provider plugins. Plugin specific parameter keys must be prefixed with the provider name (e.g. here.app_id ).

PySide2.QtLocation.QGeoServiceProvider. Error

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

常量

描述

QGeoServiceProvider.NoError

没有发生错误。

QGeoServiceProvider.NotSupportedError

The plugin does not support this functionality.

QGeoServiceProvider.UnknownParameterError

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

QGeoServiceProvider.MissingRequiredParameterError

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

QGeoServiceProvider.ConnectionError

The plugin could not connect to its backend service or database.

QGeoServiceProvider.LoaderError

The plugin failed to load.

PySide2.QtLocation.QGeoServiceProvider. RoutingFeature

Describes the routing features supported by the geo service provider.

常量

描述

QGeoServiceProvider.NoRoutingFeatures

No routing features are supported.

QGeoServiceProvider.OnlineRoutingFeature

Online routing is supported.

QGeoServiceProvider.OfflineRoutingFeature

Offline routing is supported.

QGeoServiceProvider.LocalizedRoutingFeature

Supports returning routes with localized addresses and instructions.

QGeoServiceProvider.RouteUpdatesFeature

Updating an existing route based on the current position is supported.

QGeoServiceProvider.AlternativeRoutesFeature

Supports returning alternative routes.

QGeoServiceProvider.ExcludeAreasRoutingFeature

Supports specifying a areas which the returned route must not cross.

QGeoServiceProvider.AnyRoutingFeatures

Matches a geo service provider that provides any routing features.

PySide2.QtLocation.QGeoServiceProvider. GeocodingFeature

Describes the geocoding features supported by the geo service provider.

常量

描述

QGeoServiceProvider.NoGeocodingFeatures

No geocoding features are supported.

QGeoServiceProvider.OnlineGeocodingFeature

Online geocoding is supported.

QGeoServiceProvider.OfflineGeocodingFeature

Offline geocoding is supported.

QGeoServiceProvider.ReverseGeocodingFeature

Reverse geocoding is supported.

QGeoServiceProvider.LocalizedGeocodingFeature

Supports returning geocoding results with localized addresses.

QGeoServiceProvider.AnyGeocodingFeatures

Matches a geo service provider that provides any geocoding features.

PySide2.QtLocation.QGeoServiceProvider. MappingFeature

Describes the mapping features supported by the geo service provider.

常量

描述

QGeoServiceProvider.NoMappingFeatures

No mapping features are supported.

QGeoServiceProvider.OnlineMappingFeature

Online mapping is supported.

QGeoServiceProvider.OfflineMappingFeature

Offline mapping is supported.

QGeoServiceProvider.LocalizedMappingFeature

Supports returning localized map data.

QGeoServiceProvider.AnyMappingFeatures

Matches a geo service provider that provides any mapping features.

PySide2.QtLocation.QGeoServiceProvider. PlacesFeature

Describes the places features supported by the geo service provider.

常量

描述

QGeoServiceProvider.NoPlacesFeatures

No places features are supported.

QGeoServiceProvider.OnlinePlacesFeature

Online places is supported.

QGeoServiceProvider.OfflinePlacesFeature

Offline places is supported.

QGeoServiceProvider.SavePlaceFeature

Saving places is supported.

QGeoServiceProvider.RemovePlaceFeature

Removing or deleting places is supported.

QGeoServiceProvider.SaveCategoryFeature

Saving categories is supported.

QGeoServiceProvider.RemoveCategoryFeature

Removing or deleting categories is supported.

QGeoServiceProvider.PlaceRecommendationsFeature

Searching for recommended places similar to another place is supported.

QGeoServiceProvider.SearchSuggestionsFeature

Search suggestions is supported.

QGeoServiceProvider.LocalizedPlacesFeature

Supports returning localized place data.

QGeoServiceProvider.NotificationsFeature

Notifications of place and category changes is supported.

QGeoServiceProvider.PlaceMatchingFeature

Supports matching places from two different geo service providers.

QGeoServiceProvider.AnyPlacesFeatures

Matches a geo service provider that provides any places features.

PySide2.QtLocation.QGeoServiceProvider. NavigationFeature

Describes the navigation features supported by the geo service provider.

常量

描述

QGeoServiceProvider.NoNavigationFeatures

No navigation features are supported.

QGeoServiceProvider.OnlineNavigationFeature

Online navigation is supported.

QGeoServiceProvider.OfflineNavigationFeature

Offline navigation is supported.

QGeoServiceProvider.AnyNavigationFeatures

Matches a geo service provider that provides any navigation features.

static PySide2.QtLocation.QGeoServiceProvider. availableServiceProviders ( )
返回类型

字符串列表

Returns a list of names of the available service providers, for use with the QGeoServiceProvider 构造函数。

PySide2.QtLocation.QGeoServiceProvider. error ( )
返回类型

Error

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

PySide2.QtLocation.QGeoServiceProvider. errorString ( )
返回类型

unicode

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

PySide2.QtLocation.QGeoServiceProvider. geocodingError ( )
返回类型

Error

Returns an error code describing the error which occurred during the last attempt to create a geocoding manager.

PySide2.QtLocation.QGeoServiceProvider. geocodingErrorString ( )
返回类型

unicode

Returns a string describing the error which occurred during the last attempt to create a geocoding manager.

PySide2.QtLocation.QGeoServiceProvider. geocodingFeatures ( )
返回类型

GeocodingFeatures

Returns the geocoding features supported by the geo service provider.

PySide2.QtLocation.QGeoServiceProvider. geocodingManager ( )
返回类型

QGeoCodingManager

返回 QGeoCodingManager 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 QGeoCodingManager instance when it is called for the first time. If the attempt is successful the QGeoCodingManager will be cached, otherwise each call of this function will attempt to construct a QGeoCodingManager instance until the construction is successful.

QGeoCodingManager is owned by this QGeoServiceProvider and should not be deleted separately. Users should assume that deleting the QGeoServiceProvider renders the pointer returned by this method invalid.

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

PySide2.QtLocation.QGeoServiceProvider. mappingError ( )
返回类型

Error

Returns an error code describing the error which occurred during the last attempt to create a mapping manager.

PySide2.QtLocation.QGeoServiceProvider. mappingErrorString ( )
返回类型

unicode

Returns a string describing the error which occurred during the last attempt to create a mapping manager.

PySide2.QtLocation.QGeoServiceProvider. mappingFeatures ( )
返回类型

MappingFeatures

Returns the mapping features supported by the geo service provider.

PySide2.QtLocation.QGeoServiceProvider. navigationError ( )
返回类型

Error

Returns an error code describing the error which occurred during the last attempt to create a navigation manager.

PySide2.QtLocation.QGeoServiceProvider. navigationErrorString ( )
返回类型

unicode

Returns a string describing the error which occurred during the last attempt to create a navigation manager.

PySide2.QtLocation.QGeoServiceProvider. navigationFeatures ( )
返回类型

NavigationFeatures

Returns the navigation features supported by the geo service provider.

PySide2.QtLocation.QGeoServiceProvider. placeManager ( )
返回类型

QPlaceManager

返回 QPlaceManager made available by the service provider.

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

The QGeoPlaceManager is owned by this QGeoServiceProvider and should not be deleted separately. Users should assume that deleting the QGeoServiceProvider renders the pointer returned by this method invalid.

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

PySide2.QtLocation.QGeoServiceProvider. placesError ( )
返回类型

Error

Returns an error code describing the error which occurred during the last attempt to create a places manager.

PySide2.QtLocation.QGeoServiceProvider. placesErrorString ( )
返回类型

unicode

Returns a string describing the error which occurred during the last attempt to create a places manager.

PySide2.QtLocation.QGeoServiceProvider. placesFeatures ( )
返回类型

PlacesFeatures

Returns the places features supported by the geo service provider.

PySide2.QtLocation.QGeoServiceProvider. routingError ( )
返回类型

Error

Returns an error code describing the error which occurred during the last attempt to create a routing manager.

PySide2.QtLocation.QGeoServiceProvider. routingErrorString ( )
返回类型

unicode

Returns a string describing the error which occurred during the last attempt to create a routing manager.

PySide2.QtLocation.QGeoServiceProvider. routingFeatures ( )
返回类型

RoutingFeatures

Returns the routing features supported by the geo service provider.

PySide2.QtLocation.QGeoServiceProvider. routingManager ( )
返回类型

QGeoRoutingManager

返回 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.

QGeoRoutingManager is owned by this QGeoServiceProvider and should not be deleted separately. Users should assume that deleting the QGeoServiceProvider renders the pointer returned by this method invalid.

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

PySide2.QtLocation.QGeoServiceProvider. setAllowExperimental ( allow )
参数

allow bool

Sets whether experimental plugins are considered when locating the correct plugin library for this service provider to allow .

Important: this will destroy any existing managers held by this service provider instance. You should be sure not to attempt to use any pointers that you have previously retrieved after calling this method.

PySide2.QtLocation.QGeoServiceProvider. setLocale ( locale )
参数

locale QLocale

Sets the locale used by this service provider to locale . If the relevant features (see LocalizedMappingFeature etc), this will change the languages, units and other locale-specific attributes of the provider’s data.

PySide2.QtLocation.QGeoServiceProvider. setParameters ( 参数 )
参数

参数

Sets the parameters used to construct individual manager classes for this service provider to 参数 .

Before the list of 参数 is passed on to the to-be-loaded service provider, the list is filtered to avoid the sharing of provider specific parameters with unrelated service providers. Provider specific parameter keys must be prefixed with the provider name (e.g. here.app_id ).

Important: this will destroy any existing managers held by this service provider instance. You should be sure not to attempt to use any pointers that you have previously retrieved after calling this method.

PySide2.QtLocation.QGeoServiceProvider. setQmlEngine ( engine )
参数

engine QQmlEngine