screenPointToPosition method

Future<RaliPosition?> screenPointToPosition(
  1. ScreenCoordinate screenPoint
)

//////////// //////////// Converts a screen point to a geographical position

Implementation

// I.H - Position Conversion Utilities
///////////////
/// Converts a screen point to a geographical position
Future<RaliPosition?> screenPointToPosition(mapbox.ScreenCoordinate screenPoint) async {
  try {
    final mapboxPoint = await mapboxMap.coordinateForPixel(screenPoint);
    // Use the PositionConverter utility to convert the mapbox Point to RaliPosition
    return PositionConverter.pointToRaliPosition(mapboxPoint);
  } catch (e) {
    print('Error converting screen point to position: $e');
    return null;
  }
}