2018-02-20 23:37:19 +01:00
|
|
|
#ifndef TILELOADER_H
|
|
|
|
#define TILELOADER_H
|
|
|
|
|
2018-04-27 19:31:27 +02:00
|
|
|
#include <QObject>
|
2018-02-20 23:37:19 +01:00
|
|
|
#include <QString>
|
|
|
|
#include "tile.h"
|
2018-04-01 20:01:25 +02:00
|
|
|
#include "downloader.h"
|
2018-02-20 23:37:19 +01:00
|
|
|
|
2018-04-27 19:31:27 +02:00
|
|
|
class TileLoader : public QObject
|
2018-02-20 23:37:19 +01:00
|
|
|
{
|
2018-04-27 19:31:27 +02:00
|
|
|
Q_OBJECT
|
|
|
|
|
2018-02-20 23:37:19 +01:00
|
|
|
public:
|
2018-09-24 22:49:10 +02:00
|
|
|
TileLoader(const QString &dir, QObject *parent = 0);
|
2018-04-27 19:31:27 +02:00
|
|
|
|
|
|
|
void setUrl(const QString &url) {_url = url;}
|
|
|
|
void setAuthorization(const Authorization &authorization)
|
|
|
|
{_authorization = authorization;}
|
2019-05-20 23:23:24 +02:00
|
|
|
void setScaledSize(int size) {_scaledSize = size;}
|
|
|
|
void setQuadTiles(bool quadTiles) {_quadTiles = quadTiles;}
|
2018-02-20 23:37:19 +01:00
|
|
|
|
2018-10-05 07:10:49 +02:00
|
|
|
void loadTilesAsync(QVector<Tile> &list);
|
|
|
|
void loadTilesSync(QVector<Tile> &list);
|
2018-02-20 23:37:19 +01:00
|
|
|
void clearCache();
|
|
|
|
|
2018-04-27 19:31:27 +02:00
|
|
|
signals:
|
|
|
|
void finished();
|
2018-02-20 23:37:19 +01:00
|
|
|
|
|
|
|
private:
|
2018-09-22 12:42:49 +02:00
|
|
|
QUrl tileUrl(const Tile &tile) const;
|
2018-02-20 23:37:19 +01:00
|
|
|
QString tileFile(const Tile &tile) const;
|
|
|
|
|
2018-04-27 19:31:27 +02:00
|
|
|
Downloader *_downloader;
|
2018-02-20 23:37:19 +01:00
|
|
|
QString _url;
|
|
|
|
QString _dir;
|
2018-04-01 20:01:25 +02:00
|
|
|
Authorization _authorization;
|
2019-05-20 23:23:24 +02:00
|
|
|
int _scaledSize;
|
|
|
|
bool _quadTiles;
|
2018-02-20 23:37:19 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TILELOADER_Honlinemap
|