tileYToLatitude method

  1. @override
double tileYToLatitude(
  1. int tileY
)
override

Converts a tile Y number at a certain zoom level to a latitude coordinate.

@param tileY the tile Y number that should be converted. @param zoomLevel the zoom level at which the number should be converted. @return the latitude value of the tile Y number.

Implementation

@override
double tileYToLatitude(int tileY) {
  assert(tileY >= 0);
  assert(tileY <= scalefactor.scalefactor);
  const double pi2 = 2 * pi;
  const double pi360 = 360 / pi;
  double y = 0.5 - (tileY / _scalefactor.scalefactor);
  return 90 - pi360 * atan(exp(-y * pi2));
}