Entry point for all methods related to the navigation visualization add-on.
A NavigationVisualization instance is used by first providing a RoutePlan with the displayRoutePlan method. After that, the routes contained in the RoutePlan are displayed on the map, and you can use selectRoute to select a route to be navigated on. You can access the list of route primitives displayed on the map using routes. The selected route and the alternative routes are styled with the properties contained in the StyleConfiguration provided to NavigationVisualizationFactory.create. After selecting the type of navigation guidance with selectGuidanceType, you can start the navigation session with NavigationController.start. Once the navigation session is started, the route that is selected becomes the active route. When you're done using NavigationVisualization, call NavigationController.stop. You can then call clear to remove all the primitives that have been added to the map by the add-on.
If a Route contained in the RoutePlan has traffic data available, traffic incidents are displayed on the map on top of that Route. You can access the list of traffic incidents that are on a route using getTrafficIncidents.
The navigation visualization add-on subscribes to certain listeners during its life cycle, so that it can react automatically to important events:
OnNavigationStartedListener - Notifies the add-on when a navigation session starts. The add-on reacts by removing the alternative routes from the map, setting the camera tracking mode to CameraTrackingMode.FOLLOW_ROUTE, and setting a default tilt angle.
OnProgressUpdateListener - Notifies the add-on as the driver progresses on the route. The add-on reacts by updating the visual cue of the progress on the route (i.e., the grayed-out region behind the vehicle).
OnRouteUpdatedListener - Notifies the add-on if the driver deviates from the current route. A new route is provided along with the notification. The add-on reacts by replacing the current route with the new one.
OnGuidanceUpdateListener - Notifies the add-on when new on-route instructions are available. The new instructions are provided along with the notification. The add-on reacts by updating the route with the new instructions.
OnDestinationReachedListener - Notifies the add-on when the driver reaches the destination. The add-on reacts by removing the route from the map, setting camera tracking mode to CameraTrackingMode.FOLLOW, and setting the default 2D view.
Important: This is a Public Preview API. It may be changed or removed at any time.