Skip to content

Route Rendering

Info

Document is still in progress

Route Rendering

This document describes how Telenav's MapView interacts with routes, including:

  • Route visualization: such as route/destination planning, POI details, turn arrows and other active guidance visualations.
  • Route Interaction: such as selection with visual impact.

Adding and Showing Routes to mapview is very simple:

1
2
3
4
5
6
// Add pre-generated routes to mapview  @routes is List<Route>
List<String> routeIds = mapView.routesController().add(routes);
// Calculate the Region which encompass the List of RouteIds.
Camera.Region region = mapView.routesController().region(routeIds)
// Show the routes within the Region
mapView.cameraController().showRegion(region)
1
2
3
4
5
6
// Add pre-generated routes to mapview  @routes is List<Route>
routeIds = mapView.routesController().add(routes)
// Calculate the Region which encompass the List of RouteIds.
val region = mapView.routesController().region(routeIds)
// Show the routes within the Region
mapView.cameraController().showRegion(region)

After add Routes to MapView, mapview will return a RouteId (String) for future interaction. such as clearing the Route:

1
2
// Remove Route from mapView
mapView.routesController().remove(routeId);
1
2
// Remove Route from mapView
mapView.routesController().remove(routeId)

Also you can change the selected route by highlights:

1
2
// Highlight Route 
mapView.routesController().highlight(routeId);
1
2
// Highlight Route 
mapView.routesController().highlight(routeId)