getScreenCoordinate method

Future<ScreenCoordinate> getScreenCoordinate(
  1. LatLng latLng
)

Returns the ScreenCoordinate for a given viewport LatLng.

Implementation

Future<ScreenCoordinate> getScreenCoordinate(LatLng latLng) async {
  assert(_googleMap != null,
      'Cannot get the screen coordinates with a null map.');

  final gmaps.Point point =
      toScreenLocation(_googleMap!, _latLngToGmLatLng(latLng));

  return ScreenCoordinate(x: point.x!.toInt(), y: point.y!.toInt());
}