Calculate Route¶
Calculate a route and show it on map.

Use case¶
Calculate a route between two given pairs of coordinates then display it on map.
How to use the sample¶
First, get an API key token, see the Getting Started guide.
Download the Maps & Navigation SDK for C++ archive file for Linux or WindowsWhen you open the sample, you’ll be viewing the scene from above. A fly will be performed to the calculated route.
How it works¶
Create a
MapViewListener
,OpenGLContext
andMapView
.Create a
RouteList
, aLandmarkList
with twoLandmarks
in it and aRoutePreferences
object.Call the
RoutingService
usingRouteList
,LandmarkList
,RoutePreferences
and the progress listener.Once the route calculation operation completes, add the first calculated route to the
MapViewPreferences
routes collection.Instruct the
MapView
to center on the first route.