1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-07-27 08:54:23 +02:00

Do not depend on the file extension when loading the maps

This commit is contained in:
2022-04-29 23:16:10 +02:00
parent 40febb8c0e
commit 93aadb7e74
34 changed files with 225 additions and 99 deletions

View File

@ -23,8 +23,10 @@ MapsforgeMap::MapsforgeMap(const QString &fileName, QObject *parent)
: Map(fileName, parent), _data(fileName), _zoom(0),
_projection(PCS::pcs(3857)), _tileRatio(1.0)
{
_zoom = _data.zooms().min();
updateTransform();
if (_data.isValid()) {
_zoom = _data.zooms().min();
updateTransform();
}
}
void MapsforgeMap::load()
@ -233,3 +235,11 @@ void MapsforgeMap::setOutputProjection(const Projection &projection)
updateTransform();
QPixmapCache::clear();
}
Map *MapsforgeMap::create(const QString &path, const Projection &, bool *isMap)
{
if (isMap)
*isMap = false;
return new MapsforgeMap(path);
}