Skip to Content
Hands-On GUI Programming with C++ and Qt5
book

Hands-On GUI Programming with C++ and Qt5

by Lee Zhi Eng
April 2018
Intermediate to advanced
404 pages
8h 27m
English
Packt Publishing
Content preview from Hands-On GUI Programming with C++ and Qt5

Geo Routing Request

There is another important feature called Geo Routing Request, which is a set of functions that help you plot out the route (often the shortest route) from point A to point B. This feature requires a service provider; in this case, we will be using Open Street Map (OSM) as it is completely free.

Do note that OSM is an online collaborative project, which means that if no one from your area contributed the route data to the OSM server, then you won't be able to get an accurate result. Optionally, you can also use paid services such as Mapbox or ESRI.

Let's see how we can implement Geo Routing Request in Qt! First, include the following headers to our mainwindow.h file:

#include <QGeoServiceProvider>#include <QGeoRoutingManager> ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C++ GUI Programming with Qt 4

C++ GUI Programming with Qt 4

Jasmin Blanchette, Mark Summerfield

Publisher Resources

ISBN: 9781788397827Supplemental Content