mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-03-15 03:17:44 +01:00
Only fetch data when the rect is valid
This commit is contained in:
parent
cf81a90865
commit
81e967f20d
@ -497,6 +497,9 @@ int MapData::level(int zoom) const
|
|||||||
|
|
||||||
void MapData::points(const RectC &rect, int zoom, QList<Point> *list)
|
void MapData::points(const RectC &rect, int zoom, QList<Point> *list)
|
||||||
{
|
{
|
||||||
|
if (!rect.isValid())
|
||||||
|
return;
|
||||||
|
|
||||||
int l(level(zoom));
|
int l(level(zoom));
|
||||||
PointCTX ctx(this, rect, zoom, list);
|
PointCTX ctx(this, rect, zoom, list);
|
||||||
double min[2], max[2];
|
double min[2], max[2];
|
||||||
@ -528,6 +531,9 @@ void MapData::points(const VectorTile *tile, const RectC &rect, int zoom,
|
|||||||
|
|
||||||
void MapData::paths(const RectC &rect, int zoom, QList<Path> *list)
|
void MapData::paths(const RectC &rect, int zoom, QList<Path> *list)
|
||||||
{
|
{
|
||||||
|
if (!rect.isValid())
|
||||||
|
return;
|
||||||
|
|
||||||
int l(level(zoom));
|
int l(level(zoom));
|
||||||
PathCTX ctx(this, rect, zoom, list);
|
PathCTX ctx(this, rect, zoom, list);
|
||||||
double min[2], max[2];
|
double min[2], max[2];
|
||||||
|
@ -211,9 +211,10 @@ void MapsforgeMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
|
|||||||
_data.points(pointRectD.toRectC(_projection, 20), _zoom,
|
_data.points(pointRectD.toRectC(_projection, 20), _zoom,
|
||||||
&points);
|
&points);
|
||||||
|
|
||||||
tiles.append(RasterTile(_projection, _transform, &_style, _zoom,
|
if (paths.size() || points.size())
|
||||||
QRect(ttl, QSize(_data.tileSize(), _data.tileSize())),
|
tiles.append(RasterTile(_projection, _transform, &_style,
|
||||||
_tileRatio, paths, points));
|
_zoom, QRect(ttl, QSize(_data.tileSize(), _data.tileSize())),
|
||||||
|
_tileRatio, paths, points));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user