From 97b61451b1a9f8d1f88207bf277d9bcca198c3bb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20T=C5=AFma?= Date: Wed, 9 Aug 2023 01:12:42 +0200 Subject: [PATCH] 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. --- src/map/mapsforge/rastertile.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/map/mapsforge/rastertile.h b/src/map/mapsforge/rastertile.h index 39ff086a..1f912418 100644 --- a/src/map/mapsforge/rastertile.h +++ b/src/map/mapsforge/rastertile.h @@ -14,16 +14,13 @@ namespace Mapsforge { class RasterTile { 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, const Style *style, MapData *data, int zoom, const QRect &rect, 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) {} - int zoom() const {return _zoom + 1;} + int zoom() const {return _zoom;} QPoint xy() const {return _rect.topLeft();} const QPixmap &pixmap() const {return _pixmap;} bool isValid() const {return _valid;} -- 2.11.4.GIT