Skip to content

Commit

Permalink
Limit the overzoom to max 3 levels
Browse files Browse the repository at this point in the history
  • Loading branch information
tumic0 committed Dec 10, 2023
1 parent 58cd2a8 commit 6f1f5fd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/map/mbtilesmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "osm.h"
#include "mbtilesmap.h"


#define MAX_OVERZOOM 3
#define META_TYPE(type) static_cast<QMetaType::Type>(type)

static RectC str2bounds(const QString &str)
Expand Down Expand Up @@ -88,8 +88,12 @@ bool MBTilesMap::getZooms()
}

if (_scalable) {
for (int i = _zooms.last().base + 1; i <= OSM::ZOOMS.max(); i++)
for (int i = _zooms.last().base + 1; i <= OSM::ZOOMS.max(); i++) {
Zoom z(i, _zooms.last().base);
if (z.z - z.base > MAX_OVERZOOM)
break;
_zooms.append(Zoom(i, _zooms.last().base));
}
}

_zi = _zooms.size() - 1;
Expand Down

0 comments on commit 6f1f5fd

Please sign in to comment.