summaryrefslogtreecommitdiff
path: root/src/location/maps/qgeotiledmap.cpp
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@theqtcompany.com>2016-09-15 23:12:42 +0200
committerPaolo Angelelli <paolo.angelelli@qt.io>2016-10-05 11:30:12 +0000
commit218e208bbf1c3112d2ea5781debc605fc76db80a (patch)
tree34812fb7c66e401bc288d4916ec6fed58d443022 /src/location/maps/qgeotiledmap.cpp
parenta65d9b7acf62fdafd670b40c01425cedff61106c (diff)
downloadqtlocation-218e208bbf1c3112d2ea5781debc605fc76db80a.tar.gz
Fix cache mixing with high-dpi and low-dpi osm providers
This cache fixes the cache mixing problem that has been introduced with the osm high dpi tiles support. high dpi providers fall back to low dpi ones and ultimately to hardcoded providers (also low dpi), and can also be enabled/disabled via plugin parameter, thus leaving the cache for a given map id dirty for the next run. With this patch high dpi tiles are named differently from low dpi ones. If high-dpi providers are selected, but become not available, the cache can also change the tileset to load at runtime Change-Id: I229692da07c1fc61c58fb0b6fae6ec5af16e43a7 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
Diffstat (limited to 'src/location/maps/qgeotiledmap.cpp')
-rw-r--r--src/location/maps/qgeotiledmap.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/location/maps/qgeotiledmap.cpp b/src/location/maps/qgeotiledmap.cpp
index f59417f7..fedaecbc 100644
--- a/src/location/maps/qgeotiledmap.cpp
+++ b/src/location/maps/qgeotiledmap.cpp
@@ -116,6 +116,13 @@ void QGeoTiledMap::clearData()
d->m_mapScene->clearTexturedTiles();
}
+void QGeoTiledMap::clearScene(int mapId)
+{
+ Q_D(QGeoTiledMap);
+ if (activeMapType().mapId() == mapId)
+ d->clearScene();
+}
+
void QGeoTiledMap::handleTileVersionChanged()
{
Q_D(QGeoTiledMap);
@@ -293,6 +300,11 @@ void QGeoTiledMapPrivate::prefetchTiles()
}
}
+QGeoMapType QGeoTiledMapPrivate::activeMapType()
+{
+ return m_visibleTiles->activeMapType();
+}
+
void QGeoTiledMapPrivate::changeCameraData(const QGeoCameraData &cameraData)
{
Q_Q(QGeoTiledMap);
@@ -356,6 +368,13 @@ void QGeoTiledMapPrivate::changeTileVersion(int version)
updateScene();
}
+void QGeoTiledMapPrivate::clearScene()
+{
+ m_mapScene->clearTexturedTiles();
+ m_mapScene->setVisibleTiles(QSet<QGeoTileSpec>());
+ updateScene();
+}
+
void QGeoTiledMapPrivate::changeMapSize(const QSize& size)
{
Q_Q(QGeoTiledMap);