version 2.21.1

Map download API
mapviewer download feature
This commit is contained in:
2023-11-11 23:01:21 +03:00
parent 9f3a54bbb9
commit d200dbdab5
14 changed files with 373 additions and 77 deletions

View File

@@ -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;