QtLocation.location-maps-cpp

Maps and Navigation provides C++ utilities for geocoding (finding a geographic coordinate from a street address) and navigation (including driving and walking directions).

Currently it is not possible to interact with maps via C++. Mapping applications must use the Maps and Navigation (QML) API.

Geocoding

In C++, an address-to-coordinate query is performed using the geocode() method of the QGeoCodingManager class. For coordinate-to-address queries, the reverseGeocode() method is available on the same class. Instances of QGeoCodingManager are available via QGeoServiceProvider.

Key Classes

QGeoServiceProviderProvides a QGeoCodingManager instance ready for use.
QGeoCodingManagerAccepts queries and produces QGeoCodeReply objects.
QGeoCodeReplyContains the results of a geocoding query.

In C++, a route query is performed using the calculate() method of the QGeoRoutingManager class. The returned route reply can contain multiple routes to the same destination.

Key Classes

QGeoServiceProviderProvides a QGeoCodingManager instance ready for use.
QGeoRoutingManagerAccepts queries and produces QGeoRouteReply objects.
QGeoRouteReplyContains the results of a routing query.
QGeoRouteContains information about a route.