×
Calculate Route Multi View | Maps SDK for C++ | General Magic Calculate Route Multi View — Maps & Navigation SDKs documentation
Skip to content

Calculate Route Multi View

Calculate two routes and add them in two separate views.

Calculate Route Multi View

Use case

Calculate routes and display them in separate views.

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. The screen will be split into two identical views. From each view a fly will be performed to a different calculated route.

How it works

  1. Create two MapViewListener objects, one OpenGLContext, one Screen and two MapView objects.

  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. Perform steps 2 and 3 for the 2nd MapView.

  5. Once the route calculation operations complete, add the first calculated route of each collection to their correspoding view MapViewPreferences routes collection.

  6. Instruct both the MapView objects to center on the first route.

C++ Examples

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