2018-01-29 00:19:57 +01:00
|
|
|
#ifndef MAPSOURCE_H
|
|
|
|
#define MAPSOURCE_H
|
2018-01-28 22:56:08 +01:00
|
|
|
|
|
|
|
#include <QList>
|
|
|
|
#include "common/range.h"
|
|
|
|
#include "common/rectc.h"
|
2018-04-01 20:01:25 +02:00
|
|
|
#include "downloader.h"
|
2018-04-05 21:13:48 +02:00
|
|
|
#include "coordinatesystem.h"
|
2018-01-28 22:56:08 +01:00
|
|
|
|
|
|
|
class Map;
|
|
|
|
class QXmlStreamReader;
|
|
|
|
|
2018-01-29 00:19:57 +01:00
|
|
|
class MapSource
|
2018-01-28 22:56:08 +01:00
|
|
|
{
|
|
|
|
public:
|
2018-02-20 23:37:19 +01:00
|
|
|
Map *loadFile(const QString &path);
|
2018-01-28 22:56:08 +01:00
|
|
|
const QString &errorString() const {return _errorString;}
|
|
|
|
|
|
|
|
private:
|
2018-02-27 01:02:22 +01:00
|
|
|
enum Type {
|
2018-04-08 17:48:13 +02:00
|
|
|
OSM,
|
2018-03-30 10:25:05 +02:00
|
|
|
WMTS,
|
|
|
|
WMS
|
2018-02-27 01:02:22 +01:00
|
|
|
};
|
|
|
|
|
2018-03-30 10:25:05 +02:00
|
|
|
struct Config {
|
|
|
|
Type type;
|
|
|
|
QString name;
|
|
|
|
QString url;
|
2018-02-27 01:02:22 +01:00
|
|
|
Range zooms;
|
|
|
|
RectC bounds;
|
|
|
|
QString layer;
|
|
|
|
QString style;
|
|
|
|
QString set;
|
|
|
|
QString format;
|
2018-03-30 10:25:05 +02:00
|
|
|
QString crs;
|
2018-04-07 18:42:25 +02:00
|
|
|
CoordinateSystem coordinateSystem;
|
2018-02-27 01:02:22 +01:00
|
|
|
bool rest;
|
2018-03-11 10:31:41 +01:00
|
|
|
QList<QPair<QString, QString> > dimensions;
|
2018-04-01 20:01:25 +02:00
|
|
|
Authorization authorization;
|
2018-02-27 01:02:22 +01:00
|
|
|
|
2018-03-30 10:25:05 +02:00
|
|
|
Config();
|
2018-02-27 01:02:22 +01:00
|
|
|
};
|
|
|
|
|
2018-02-27 21:50:29 +01:00
|
|
|
RectC bounds(QXmlStreamReader &reader);
|
|
|
|
Range zooms(QXmlStreamReader &reader);
|
2018-02-27 01:02:22 +01:00
|
|
|
void map(QXmlStreamReader &reader, Config &config);
|
2018-01-28 22:56:08 +01:00
|
|
|
|
|
|
|
QString _errorString;
|
|
|
|
};
|
|
|
|
|
2018-01-29 00:19:57 +01:00
|
|
|
#endif // MAPSOURCE_H
|