selectDestination method
- String name,
- RaliPosition position
//////////// ////////////
Implementation
// II.E - Route Management
///////////////
Future<void> selectDestination(String name, RaliPosition position) async {
if (_mapboxMap == null) return;
try {
_destinationPosition = position;
_destinationName = name;
notifyListeners();
await _createDestinationMarker();
if (_cameraController != null) {
await _cameraController!.flyToLocation(_destinationPosition!, zoom: 14.0);
}
// Fetch and display route to this destination
await fetchRoute();
} catch (e) {
print('Error selecting destination: $e');
_showError('Unable to select destination');
}
}