1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-06-25 10:48:04 +02:00

Code cleanup

This commit is contained in:
2018-10-07 13:07:04 +02:00
parent 140e975524
commit 2f9751672e
3 changed files with 37 additions and 39 deletions

View File

@ -1,3 +1,4 @@
#include <QtCore>
#include "common/wgs84.h"
#include "osm.h"
@ -16,8 +17,8 @@ Coordinates OSM::m2ll(const QPointF &p)
QPoint OSM::mercator2tile(const QPointF &m, int zoom)
{
return QPoint((int)(floor((m.x() + 180.0) / 360.0 * (1<<zoom))),
(int)(floor((1.0 - (m.y() / 180.0)) / 2.0 * (1<<zoom))));
return QPoint(qFloor((m.x() + 180.0) / 360.0 * (1<<zoom)),
qFloor((1.0 - (m.y() / 180.0)) / 2.0 * (1<<zoom)));
}
qreal OSM::zoom2scale(int zoom, int tileSize)