getLatLng method

Future<LatLng> getLatLng(
  1. ScreenCoordinate screenCoordinate
)

Converts screen pixel coordinates to geographic coordinates.

This method returns the geographic location (LatLng) corresponding to a screen location. The screen location is specified in logical pixels (Flutter's coordinate system) relative to the top left of the map (not the top left of the whole screen).

The coordinates should be provided in Flutter's logical pixel system and do not require manual device pixel ratio conversion.

Implementation

Future<LatLng> getLatLng(ScreenCoordinate screenCoordinate) async {
  return GoogleMapsNavigationPlatform.instance.viewAPI.getLatLng(
    viewId: _viewId,
    screenCoordinate: screenCoordinate,
  );
}