Map API refactoring
[GPXSee.git] / src / map / mapsource.h
blob1be457eec370b801a82db166b8f118b5bd81bcc6
1 #ifndef MAPSOURCE_H
2 #define MAPSOURCE_H
4 #include <QList>
5 #include "common/range.h"
6 #include "common/rectc.h"
7 #include "common/kv.h"
8 #include "common/downloader.h"
9 #include "coordinatesystem.h"
11 class Map;
12 class QXmlStreamReader;
13 class Projection;
15 class MapSource
17 public:
18 static Map *create(const QString &path, bool *isDir);
20 private:
21 enum Type {
22 OSM,
23 WMTS,
24 WMS,
25 TMS,
26 QuadTiles
29 struct Config {
30 Type type;
31 QString name;
32 QString url;
33 Range zooms;
34 RectC bounds;
35 QString layer;
36 QString style;
37 QString set;
38 QString format;
39 QString crs;
40 CoordinateSystem coordinateSystem;
41 bool rest;
42 QList<KV<QString, QString> > dimensions;
43 Authorization authorization;
44 qreal tileRatio;
45 int tileSize;
46 bool scalable;
48 Config();
51 static RectC bounds(QXmlStreamReader &reader);
52 static Range zooms(QXmlStreamReader &reader);
53 static void map(QXmlStreamReader &reader, Config &config);
54 static void tile(QXmlStreamReader &reader, Config &config);
57 #endif // MAPSOURCE_H