diff --git a/gpxsee.pro b/gpxsee.pro index 7bbda49e..9ea34971 100644 --- a/gpxsee.pro +++ b/gpxsee.pro @@ -87,7 +87,8 @@ HEADERS += src/config.h \ src/atlas.h \ src/projection.h \ src/mercator.h \ - src/transversemercator.h + src/transversemercator.h \ + src/latlon.h SOURCES += src/main.cpp \ src/gui.cpp \ src/poi.cpp \ diff --git a/src/latlon.h b/src/latlon.h new file mode 100644 index 00000000..28202854 --- /dev/null +++ b/src/latlon.h @@ -0,0 +1,15 @@ +#ifndef LATLON_H +#define LATLON_H + +#include "projection.h" + +class LatLon : public Projection +{ +public: + virtual QPointF ll2xy(const Coordinates &c) const + {return c.toPointF();} + virtual Coordinates xy2ll(const QPointF &p) const + {return Coordinates(p);} +}; + +#endif // LATLON_H diff --git a/src/offlinemap.cpp b/src/offlinemap.cpp index b14f3fa2..09f4d9c6 100644 --- a/src/offlinemap.cpp +++ b/src/offlinemap.cpp @@ -12,6 +12,7 @@ #include "wgs84.h" #include "coordinates.h" #include "matrix.h" +#include "latlon.h" #include "mercator.h" #include "transversemercator.h" #include "offlinemap.h" @@ -31,7 +32,7 @@ int OfflineMap::parseMapFile(QIODevice &device, QList &points, QByteArray line = device.readLine(); if (ln == 1) { - if (line.trimmed() != "OziExplorer Map Data File Version 2.2") + if (!line.trimmed().startsWith("OziExplorer Map Data File")) return ln; } else if (ln == 3) _imgPath = line.trimmed(); @@ -101,6 +102,9 @@ bool OfflineMap::createProjection(const QString &projection, double params[8]) _projection = new TransverseMercator(params[1], params[2], params[3], params[4]); return true; + } else if (projection == "Latitude/Longitude") { + _projection = new LatLon(); + return true; } qWarning("%s: %s: unsupported map projection", qPrintable(_name),