mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 03:35:53 +01:00
Explicitly marking the basemaps is not required
This commit is contained in:
parent
959d08ba94
commit
208e31c6de
@ -10,6 +10,11 @@ public:
|
|||||||
Range() {_min = 0; _max = 0;}
|
Range() {_min = 0; _max = 0;}
|
||||||
Range(int min, int max) : _min(min), _max(max) {}
|
Range(int min, int max) : _min(min), _max(max) {}
|
||||||
|
|
||||||
|
bool operator==(const Range &other) const
|
||||||
|
{return _min == other._min && _max == other._max;}
|
||||||
|
bool operator!=(const Range &other) const
|
||||||
|
{return _min != other._min || _max != other._max;}
|
||||||
|
|
||||||
int min() const {return _min;}
|
int min() const {return _min;}
|
||||||
int max() const {return _max;}
|
int max() const {return _max;}
|
||||||
int size() const {return (_max - _min);}
|
int size() const {return (_max - _min);}
|
||||||
|
@ -94,10 +94,6 @@ bool GMAPData::loadTile(const QDir &dir, bool baseMap)
|
|||||||
delete tile;
|
delete tile;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (baseMap) {
|
|
||||||
tile->markAsBasemap();
|
|
||||||
_baseMap = tile->zooms();
|
|
||||||
}
|
|
||||||
|
|
||||||
double min[2], max[2];
|
double min[2], max[2];
|
||||||
min[0] = tile->bounds().left();
|
min[0] = tile->bounds().left();
|
||||||
@ -110,6 +106,9 @@ bool GMAPData::loadTile(const QDir &dir, bool baseMap)
|
|||||||
if (tile->zooms().min() < _zooms.min())
|
if (tile->zooms().min() < _zooms.min())
|
||||||
_zooms.setMin(tile->zooms().min());
|
_zooms.setMin(tile->zooms().min());
|
||||||
|
|
||||||
|
if (baseMap)
|
||||||
|
_baseMap = tile->zooms();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,11 +175,9 @@ bool IMGData::createTileTree(const TileMap &tileMap)
|
|||||||
for (_tileTree.GetFirst(it); !_tileTree.IsNull(it);
|
for (_tileTree.GetFirst(it); !_tileTree.IsNull(it);
|
||||||
_tileTree.GetNext(it)) {
|
_tileTree.GetNext(it)) {
|
||||||
VectorTile *tile = _tileTree.GetAt(it);
|
VectorTile *tile = _tileTree.GetAt(it);
|
||||||
if (tile->zooms().min() == _zooms.min()) {
|
if (tile->zooms().min() == _zooms.min())
|
||||||
tile->markAsBasemap();
|
|
||||||
_baseMap = tile->zooms();
|
_baseMap = tile->zooms();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
/* Allow some extra zoom out on maps without basemaps, but not too much
|
/* Allow some extra zoom out on maps without basemaps, but not too much
|
||||||
as this would kill the rendering performance. */
|
as this would kill the rendering performance. */
|
||||||
|
@ -122,8 +122,6 @@ bool TREFile::init()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_isBaseMap = false;
|
|
||||||
|
|
||||||
return (_firstLevel >= 0);
|
return (_firstLevel >= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -287,9 +285,9 @@ void TREFile::clear()
|
|||||||
int TREFile::level(int bits, const Range &baseMap)
|
int TREFile::level(int bits, const Range &baseMap)
|
||||||
{
|
{
|
||||||
if (!baseMap.isNull()) {
|
if (!baseMap.isNull()) {
|
||||||
if (!_isBaseMap && bits <= baseMap.max())
|
if (zooms() != baseMap && bits <= baseMap.max())
|
||||||
return -1;
|
return -1;
|
||||||
if (_isBaseMap && bits > baseMap.max())
|
if (zooms() == baseMap && bits > baseMap.max())
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,6 @@ public:
|
|||||||
~TREFile();
|
~TREFile();
|
||||||
|
|
||||||
bool init();
|
bool init();
|
||||||
void markAsBasemap() {_isBaseMap = true;}
|
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
const RectC &bounds() const {return _bounds;}
|
const RectC &bounds() const {return _bounds;}
|
||||||
@ -56,7 +55,6 @@ private:
|
|||||||
quint32 _flags;
|
quint32 _flags;
|
||||||
quint16 _extItemSize;
|
quint16 _extItemSize;
|
||||||
int _firstLevel;
|
int _firstLevel;
|
||||||
bool _isBaseMap;
|
|
||||||
|
|
||||||
QMap<int, SubDivTree*> _subdivs;
|
QMap<int, SubDivTree*> _subdivs;
|
||||||
};
|
};
|
||||||
|
@ -20,7 +20,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool init();
|
bool init();
|
||||||
void markAsBasemap() {_tre->markAsBasemap();}
|
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
const RectC &bounds() const {return _tre->bounds();}
|
const RectC &bounds() const {return _tre->bounds();}
|
||||||
|
Loading…
Reference in New Issue
Block a user