displayRoute method
- MapboxMap map,
- RouteDetails routeData, {
- bool showAlternatives = false,
- RouteEmphasis emphasis = RouteEmphasis.balanced,
//////////// //////////// Displays the route on the provided MapboxMap
Implementation
// II.D - Route Display Methods
///////////////
/// Displays the route on the provided MapboxMap
Future<void> displayRoute(
mapbox.MapboxMap map,
RouteDetails routeData, {
bool showAlternatives = false,
RouteEmphasis emphasis = RouteEmphasis.balanced,
}) async {
try {
// Clear existing routes
await clearRoute(map);
// Add main route
await _addRouteToMap(map, routeData, emphasis);
// Optionally add alternative routes
if (showAlternatives && routeData.points.isNotEmpty) {
// Future implementation for alternative routes
}
} catch (e) {
print('Error displaying route: $e');
rethrow;
}
}