clearRoute method

Future<void> clearRoute(
  1. MapboxMap map
)

//////////// //////////// Clears all route layers from the map

Implementation

// II.F - Utility Methods
///////////////
/// Clears all route layers from the map
Future<void> clearRoute(mapbox.MapboxMap map) async {
  try {
    await map.style.removeStyleLayer("route-layer");
    await map.style.removeStyleSource("route-source");
  } catch (e) {
    // Ignore errors if layers don't exist
  }
}