tileYToLatitude method
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);
// allow one more so that we can find the end of the tile from the top
assert(tileY <= _maxTileCount, "$tileY > ${_maxTileCount} of zoomlevel ${scalefactor.zoomlevel}");
const double pi2 = 2 * pi;
const double pi360 = 360 / pi;
double y = 0.5 - (tileY / _scalefactor.scalefactor);
return 90 - pi360 * atan(exp(-y * pi2));
}