summaryrefslogtreecommitdiff
path: root/src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@theqtcompany.com>2016-07-06 20:01:59 +0200
committerPaolo Angelelli <paolo.angelelli@theqtcompany.com>2016-07-19 12:16:31 +0000
commit10b708e419c672411507feceb4c7869a5024df1e (patch)
treef08b8290bc6d9e2487930a285b58a4ffc678358c /src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp
parent208c822225fe2a7a7e214dfb04acc48de5a7d001 (diff)
downloadqtlocation-10b708e419c672411507feceb4c7869a5024df1e.tar.gz
Differentiate cached tiles by dpi
This patch uses separate filenames for tiles downloaded at different resolutions/dpi. For the HERE plugin, the dpi is appeneded to the filename. For the mapbox plugin, @1x or @2x is used due to the different approach to High DPI tiles. Change-Id: I0dcda088dae84e98c0e73bdc24435d7e2a3f43f7 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp')
-rw-r--r--src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp b/src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp
index de7eb4cf..30e5179e 100644
--- a/src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp
+++ b/src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp
@@ -116,13 +116,14 @@ QGeoTiledMappingManagerEngineMapbox::QGeoTiledMappingManagerEngineMapbox(const Q
setSupportedMapTypes(mapTypes);
- bool doubleRes = true;
+ int scaleFactor = 2;
if (parameters.contains(QStringLiteral("mapbox.highdpi_tiles"))) {
const QString param = parameters.value(QStringLiteral("mapbox.highdpi_tiles")).toString().toLower();
if (param == "false")
- doubleRes = false;
+ scaleFactor = 1;
}
- QGeoTileFetcherMapbox *tileFetcher = new QGeoTileFetcherMapbox(this, doubleRes);
+
+ QGeoTileFetcherMapbox *tileFetcher = new QGeoTileFetcherMapbox(scaleFactor, this);
tileFetcher->setMapIds(mapIds);
if (parameters.contains(QStringLiteral("useragent"))) {
@@ -159,7 +160,7 @@ QGeoTiledMappingManagerEngineMapbox::QGeoTiledMappingManagerEngineMapbox(const Q
// It is illegal to violate Mapbox Terms of Service, setting a limit that exceeds
// what the plan the token belongs to allows.
- QAbstractGeoTileCache *tileCache = new QGeoFileTileCacheMapbox(mapTypes, m_cacheDirectory);
+ QGeoFileTileCache *tileCache = new QGeoFileTileCacheMapbox(mapTypes, scaleFactor, m_cacheDirectory);
if (parameters.contains(QStringLiteral("mapbox.cache.disk.size"))) {
bool ok = false;