1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-28 05:34:47 +01:00

Enable authorization for OSM type maps

This commit is contained in:
Martin Tůma 2018-04-27 21:13:10 +02:00
parent 2fb9a59bf0
commit f8c92cf036
3 changed files with 8 additions and 5 deletions

View File

@ -230,7 +230,8 @@ Map *MapSource::loadFile(const QString &path)
config.style, config.format, config.crs, config.coordinateSystem, config.style, config.format, config.crs, config.coordinateSystem,
config.dimensions, config.authorization)); config.dimensions, config.authorization));
else else
m = new OnlineMap(config.name, config.url, config.zooms, config.bounds); m = new OnlineMap(config.name, config.url, config.zooms, config.bounds,
config.authorization);
if (!m->isValid()) { if (!m->isValid()) {
_errorString = m->errorString(); _errorString = m->errorString();

View File

@ -42,9 +42,9 @@ static int scale2zoom(qreal scale)
OnlineMap::OnlineMap(const QString &name, const QString &url, OnlineMap::OnlineMap(const QString &name, const QString &url,
const Range &zooms, const RectC &bounds, QObject *parent) : const Range &zooms, const RectC &bounds, const Authorization &authorization,
Map(parent), _name(name), _zooms(zooms), _bounds(bounds), _block(false), QObject *parent) : Map(parent), _name(name), _zooms(zooms), _bounds(bounds),
_valid(false) _block(false), _valid(false)
{ {
QString dir(TILES_DIR + "/" + _name); QString dir(TILES_DIR + "/" + _name);
@ -53,6 +53,7 @@ OnlineMap::OnlineMap(const QString &name, const QString &url,
_tileLoader = new TileLoader(this); _tileLoader = new TileLoader(this);
_tileLoader->setUrl(url); _tileLoader->setUrl(url);
_tileLoader->setDir(dir); _tileLoader->setDir(dir);
_tileLoader->setAuthorization(authorization);
connect(_tileLoader, SIGNAL(finished()), this, SIGNAL(loaded())); connect(_tileLoader, SIGNAL(finished()), this, SIGNAL(loaded()));
if (!QDir().mkpath(dir)) { if (!QDir().mkpath(dir)) {

View File

@ -12,7 +12,8 @@ class OnlineMap : public Map
public: public:
OnlineMap(const QString &name, const QString &url, const Range &zooms, OnlineMap(const QString &name, const QString &url, const Range &zooms,
const RectC &bounds, QObject *parent = 0); const RectC &bounds, const Authorization &authorization,
QObject *parent = 0);
const QString &name() const {return _name;} const QString &name() const {return _name;}