toLatLng method

  1. @override
LatLng toLatLng(
  1. TileIndex tile
)
override

Converts a TileIndex to its corresponing LatLng.

Implementation

@override
LatLng toLatLng(TileIndex tile) {
  final x = tile.x;
  final y = tile.y;

  final xx = x - 0.5;
  final yy = 0.5 - y;

  final lat = 90.0 - 360.0 * atan(exp(-yy * 2.0 * pi)) / pi;
  final lng = 360.0 * xx;

  return LatLng(Angle.degree(lat), Angle.degree(lng));
}