1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-25 12:15:54 +01:00
GPXSee/src/map/tileloader.h

41 lines
848 B
C
Raw Normal View History

2018-02-20 23:37:19 +01:00
#ifndef TILELOADER_H
#define TILELOADER_H
#include <QObject>
2018-02-20 23:37:19 +01:00
#include <QString>
#include "common/downloader.h"
2018-02-20 23:37:19 +01:00
#include "tile.h"
class TileLoader : public QObject
2018-02-20 23:37:19 +01: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);
void setUrl(const QString &url) {_url = url;}
void setHeaders(const QList<HTTPHeader> &headers) {_headers = headers;}
2020-03-01 11:43:08 +01:00
void setScaledSize(int size);
2019-05-20 23:23:24 +02:00
void setQuadTiles(bool quadTiles) {_quadTiles = quadTiles;}
2018-02-20 23:37:19 +01:00
2022-07-06 14:58:41 +02:00
void loadTilesAsync(QVector<FetchTile> &list);
void loadTilesSync(QVector<FetchTile> &list);
2018-02-20 23:37:19 +01:00
void clearCache();
signals:
void finished();
2018-02-20 23:37:19 +01:00
private:
2022-07-06 14:58:41 +02:00
QUrl tileUrl(const FetchTile &tile) const;
QString tileFile(const FetchTile &tile) const;
2018-02-20 23:37:19 +01:00
Downloader *_downloader;
2018-02-20 23:37:19 +01:00
QString _url;
QString _dir;
QList<HTTPHeader> _headers;
2019-05-20 23:23:24 +02:00
int _scaledSize;
bool _quadTiles;
2018-02-20 23:37:19 +01:00
};
#endif // TILELOADER_H