PIQt now provide PICout << operators for Qt types

MapView::setTileObsoleteTime() method. You can set maximum lifetime for tile, after that it will be redownloaded
This commit is contained in:
2024-09-28 09:15:25 +03:00
parent 2eacbfbfc1
commit dd4695780d
7 changed files with 128 additions and 6 deletions

View File

@@ -92,10 +92,18 @@ void MapView::setCachePath(const QString & p) {
}
void collectDownloadIndeces(OSMTileCache * cache, QQueue<OSM::TileIndex> & indeces, OSM::TileIndex index, int target_zoom_level, bool only_new) {
void MapView::setTileObsoleteTime(int secs) {
cache->setTileObsoleteTime(secs);
}
void collectDownloadIndeces(OSMTileCache * cache,
QQueue<OSM::TileIndex> & indeces,
OSM::TileIndex index,
int target_zoom_level,
bool only_new) {
if (only_new) {
if (!cache->isTileFileExists(index))
indeces << index;
if (!cache->isTileFileExists(index)) indeces << index;
} else
indeces << index;
if (index.z >= target_zoom_level) return;
@@ -205,7 +213,7 @@ void MapView::mouseMoveEvent(QMouseEvent * e) {
}
}
if (e->buttons() == Qt::RightButton) {
auto dp = e->pos() - press_point;
auto dp = e->pos() - press_point;
press_point = e->pos();
zoom(1. - dp.y() / 50., zoom_anchor);
}