Exemple #1
0
static QPointF tile2mercator(const QPoint &tile, int z)
{
	Coordinates m;

	m.setLon(tile.x() / pow(2.0, z) * 360.0 - 180);
	qreal n = M_PI - 2.0 * M_PI * tile.y() / pow(2.0, z);
	m.setLat(rad2deg(atan(0.5 * (exp(n) - exp(-n)))));

	return m.toMercator();
}