Code cleanup
[GPXSee.git] / src / map / mapsource.h
blob7bed218be9e14a60e7d4f1946dcfa43e75518829
1 #ifndef MAPSOURCE_H
2 #define MAPSOURCE_H
4 #include <QList>
5 #include "common/range.h"
6 #include "common/rectc.h"
7 #include "downloader.h"
8 #include "coordinatesystem.h"
10 class Map;
11 class QXmlStreamReader;
13 class MapSource
15 public:
16 static Map *loadMap(const QString &path, QString &errorString);
18 private:
19 enum Type {
20 OSM,
21 WMTS,
22 WMS,
23 TMS
26 struct Config {
27 Type type;
28 QString name;
29 QString url;
30 Range zooms;
31 RectC bounds;
32 QString layer;
33 QString style;
34 QString set;
35 QString format;
36 QString crs;
37 CoordinateSystem coordinateSystem;
38 bool rest;
39 QList<QPair<QString, QString> > dimensions;
40 Authorization authorization;
41 qreal tileRatio;
43 Config();
46 static RectC bounds(QXmlStreamReader &reader);
47 static Range zooms(QXmlStreamReader &reader);
48 static void map(QXmlStreamReader &reader, Config &config);
51 #endif // MAPSOURCE_H