Skip to content

Simulate Navigation

Calculate a route and simulate navigating on it.

Simulate Navigation

Use case

Calculate a route between two given pairs of coordinates then simulate navigation on it.

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 Windows

When you open the sample, you’ll be viewing the scene from above. When the route calculation is completed a simulation will start.

How it works

  1. Create a MapViewListener, OpenGLContext and MapView.

  2. Create a RouteList, a LandmarkList with two Landmarks in it and a RoutePreferences object.

  3. Call the RoutingService using RouteList, LandmarkList, RoutePreferences and the progress listener.

  4. Once the route calculation operation completes, add the first calculated route to the MapViewPreferences routes collection.

  5. Create a ``ProgressListener`` and a NavigationListener. Instruct the NavigationService to start a simulation using the first route and the newly created listeners.

  6. Instruct the MapView to start following the position.

C++ Examples

Maps SDK for C++ Examples can be downloaded or cloned with Git