Skip to content

Commit

Permalink
Remove the zoom offset hack
Browse files Browse the repository at this point in the history
Now that we are back to the map data defined tile size, it makes no sense any
more. Additionaly it crashes with world maps as zoom 0 becomes -1...
  • Loading branch information
tumic0 committed Apr 18, 2024
1 parent 089ccfd commit 31cd65f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/map/mapsforge/rastertile.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,13 @@ namespace Mapsforge {
class RasterTile
{
public:
/* Most Mapsforge themes expect the zoom levels to be offset by one from
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, bool hillShading)
: _proj(proj), _transform(transform), _style(style), _data(data),
_zoom(zoom - 1), _rect(rect), _ratio(ratio), _hillShading(hillShading) {}
_zoom(zoom), _rect(rect), _ratio(ratio), _hillShading(hillShading) {}

int zoom() const {return _zoom + 1;}
int zoom() const {return _zoom;}
QPoint xy() const {return _rect.topLeft();}
const QPixmap &pixmap() const {return _pixmap;}

Expand Down

0 comments on commit 31cd65f

Please sign in to comment.