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:
parent
2fb9a59bf0
commit
f8c92cf036
@ -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();
|
||||
|
@ -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)) {
|
||||
|
@ -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;}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user