version 2.21.1
Map download API mapviewer download feature
This commit is contained in:
@@ -7,11 +7,8 @@
|
||||
OSMTileCache::OSMTileCache(MapView * p): QThread() {
|
||||
qRegisterMetaType<OSM::TileIndex>();
|
||||
qRegisterMetaType<OSM::TilePixmap>();
|
||||
parent = p;
|
||||
cache_root = QAD::userPath(QAD::ltCache, "map_osm") + "/";
|
||||
cache_dir.setPath(cache_root);
|
||||
qDebug() << "[OSMTileCache] save cache to" << cache_root;
|
||||
if (!cache_dir.exists()) cache_dir.mkpath(".");
|
||||
parent = p;
|
||||
setCacheRoot(QAD::userPath(QAD::ltCache, "map_osm") + "/");
|
||||
setAdditionalCacheSize(64);
|
||||
start();
|
||||
}
|
||||
@@ -57,6 +54,14 @@ OSM::TilePixmap OSMTileCache::getTile(OSM::TileIndex index, QRectF & rect_src) {
|
||||
}
|
||||
|
||||
|
||||
void OSMTileCache::setCacheRoot(const QString & p) {
|
||||
cache_root = p;
|
||||
cache_dir.setPath(cache_root);
|
||||
qDebug() << "[OSMTileCache] Cache dir" << cache_root;
|
||||
if (!cache_dir.exists()) cache_dir.mkpath(".");
|
||||
}
|
||||
|
||||
|
||||
OSM::TilePixmap OSMTileCache::getTileFromCache(OSM::TileIndex index) {
|
||||
OSM::TilePixmap ret;
|
||||
ret.index = index;
|
||||
|
||||
Reference in New Issue
Block a user