1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-25 04:05:53 +01:00
GPXSee/src/map/tileloader.h
2023-06-23 09:30:44 +02:00

46 lines
874 B
C++

#ifndef TILELOADER_H
#define TILELOADER_H
#include <QObject>
#include <QString>
#include "common/downloader.h"
#include "tile.h"
class TileLoader : public QObject
{
Q_OBJECT
public:
enum UrlType {
XYZ,
QuadTiles,
BoundingBox
};
TileLoader(const QString &dir, QObject *parent = 0);
void setUrl(const QString &url, UrlType type) {_url = url; _urlType = type;}
void setHeaders(const QList<HTTPHeader> &headers) {_headers = headers;}
void setScaledSize(int size);
void loadTilesAsync(QVector<FetchTile> &list);
void loadTilesSync(QVector<FetchTile> &list);
void clearCache();
signals:
void finished();
private:
QUrl tileUrl(const FetchTile &tile) const;
QString tileFile(const FetchTile &tile) const;
Downloader *_downloader;
QString _url;
UrlType _urlType;
QString _dir;
QList<HTTPHeader> _headers;
int _scaledSize;
};
#endif // TILELOADER_H