1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-28 05:34:47 +01:00

Removed the zoom level offset hack

In the Mapsforge library the offset is dependent on the tile size which is
in turn dependent on whether the tiles are hidpi or not. In other words
the Mapsforge library is broken and inconsistent between hidpi/non-hdpi
displays. GPXSee is consistent here and we have thus tochoose one zoom level
mapping (i.e. what zoom level corresponds to what resolution). Lets choose
"no offset" = more details on a given zoom level/resolution.
This commit is contained in:
Martin Tůma 2023-08-09 01:12:42 +02:00
parent 092c56468c
commit 97b61451b1

View File

@ -14,16 +14,13 @@ namespace Mapsforge {
class RasterTile class RasterTile
{ {
public: public:
/* Mapsforge maps zoom levels are offset by one against the standard OSM
zoom levels! We decrease the zoom level internaly here when initializing
_zoom and return the propper/increased value back in zoom() */
RasterTile(const Projection &proj, const Transform &transform, RasterTile(const Projection &proj, const Transform &transform,
const Style *style, MapData *data, int zoom, const QRect &rect, const Style *style, MapData *data, int zoom, const QRect &rect,
qreal ratio) : _proj(proj), _transform(transform), _style(style), qreal ratio) : _proj(proj), _transform(transform), _style(style),
_data(data), _zoom(zoom - 1), _rect(rect), _ratio(ratio), _data(data), _zoom(zoom), _rect(rect), _ratio(ratio),
_pixmap(rect.width() * ratio, rect.height() * ratio), _valid(false) {} _pixmap(rect.width() * ratio, rect.height() * ratio), _valid(false) {}
int zoom() const {return _zoom + 1;} int zoom() const {return _zoom;}
QPoint xy() const {return _rect.topLeft();} QPoint xy() const {return _rect.topLeft();}
const QPixmap &pixmap() const {return _pixmap;} const QPixmap &pixmap() const {return _pixmap;}
bool isValid() const {return _valid;} bool isValid() const {return _valid;}