1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-27 21:24:47 +01:00

Added missing fallback elevation fetch

This commit is contained in:
Martin Tůma 2024-05-23 22:03:42 +02:00
parent 4d17dd5b92
commit 73fa197c25

View File

@ -269,9 +269,11 @@ void IMGMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
double IMGMap::elevation(const Coordinates &c) double IMGMap::elevation(const Coordinates &c)
{ {
MapData *d = _data.first();
if (d->hasDEM()) {
QList<MapData::Elevation> tiles; QList<MapData::Elevation> tiles;
DEM::DEMTRee tree; DEM::DEMTRee tree;
MapData *d = _data.first();
double ele = NAN; double ele = NAN;
d->elevations(RectC(Coordinates(c), Coordinates(c)), d->zooms().max(), d->elevations(RectC(Coordinates(c), Coordinates(c)), d->zooms().max(),
@ -281,6 +283,8 @@ double IMGMap::elevation(const Coordinates &c)
DEM::searchTree(tree, c, ele); DEM::searchTree(tree, c, ele);
return ele; return ele;
} else
return Map::elevation(c);
} }
Map* IMGMap::createIMG(const QString &path, const Projection &proj, bool *isDir) Map* IMGMap::createIMG(const QString &path, const Projection &proj, bool *isDir)