diff --git a/src/map/mapsource.cpp b/src/map/mapsource.cpp index 2c12f6d7..c204fe73 100644 --- a/src/map/mapsource.cpp +++ b/src/map/mapsource.cpp @@ -230,7 +230,8 @@ Map *MapSource::loadFile(const QString &path) config.style, config.format, config.crs, config.coordinateSystem, config.dimensions, config.authorization)); 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()) { _errorString = m->errorString(); diff --git a/src/map/onlinemap.cpp b/src/map/onlinemap.cpp index 8460c7c7..ddadee64 100644 --- a/src/map/onlinemap.cpp +++ b/src/map/onlinemap.cpp @@ -42,9 +42,9 @@ static int scale2zoom(qreal scale) OnlineMap::OnlineMap(const QString &name, const QString &url, - const Range &zooms, const RectC &bounds, QObject *parent) : - Map(parent), _name(name), _zooms(zooms), _bounds(bounds), _block(false), - _valid(false) + const Range &zooms, const RectC &bounds, const Authorization &authorization, + QObject *parent) : Map(parent), _name(name), _zooms(zooms), _bounds(bounds), + _block(false), _valid(false) { QString dir(TILES_DIR + "/" + _name); @@ -53,6 +53,7 @@ OnlineMap::OnlineMap(const QString &name, const QString &url, _tileLoader = new TileLoader(this); _tileLoader->setUrl(url); _tileLoader->setDir(dir); + _tileLoader->setAuthorization(authorization); connect(_tileLoader, SIGNAL(finished()), this, SIGNAL(loaded())); if (!QDir().mkpath(dir)) { diff --git a/src/map/onlinemap.h b/src/map/onlinemap.h index 20a40e7e..b489cdd2 100644 --- a/src/map/onlinemap.h +++ b/src/map/onlinemap.h @@ -12,7 +12,8 @@ class OnlineMap : public Map public: 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;}