summaryrefslogtreecommitdiff
path: root/tests/auto/qgeotiledmap
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2016-12-02 18:18:23 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2017-01-16 16:18:23 +0000
commit45b1f2c23cf0e782c0b99f38e4d01a88da765753 (patch)
tree1bfe5d5706db94722b3956ac17b65897b2370d30 /tests/auto/qgeotiledmap
parent5504a4c00ec01fdbc95a862c9bc63a680095daee (diff)
downloadqtlocation-45b1f2c23cf0e782c0b99f38e4d01a88da765753.tar.gz
Make zoomLevel refer to a default 256^2 tile size
Currently the zoomLevel is the power of 2 reflecting how many tiles are in a map edge. This means that two plugins with two different tileSize will show a map of different size at the same zoomLevel. With this patch the zoomLevel is "normalized" upon a tileSize of 256, regardless of the tile size in use. In this way, the new 256 based zoom level can be a consistent parameter also for plugins that are not tile based. CameraCapabilities therefore now offers two new methods, m[in,ax]imumZoomLevelAt256, that return the respective value for the normalized 256^2 tilesize. It also gets a setTileSize, which is currently not used as all our plugins use a tile size of 256 (which is the camera capabilities default tilesize value). Change-Id: Ib12092fd14faf7fc85f8be5fb799dbd5496b760b Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'tests/auto/qgeotiledmap')
-rw-r--r--tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp b/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp
index e4ecfae9..22fb6589 100644
--- a/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp
+++ b/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp
@@ -101,7 +101,7 @@ void tst_QGeoTiledMap::initTestCase()
QStringLiteral("/../../../plugins"));
#endif
QVariantMap parameters;
- parameters["tileSize"] = 16;
+ parameters["tileSize"] = 256;
parameters["maxZoomLevel"] = 8;
parameters["finishRequestImmediately"] = true;
QGeoServiceProvider *provider = new QGeoServiceProvider("qmlgeo.test.plugin",parameters);
@@ -110,7 +110,7 @@ void tst_QGeoTiledMap::initTestCase()
QVERIFY2(provider->error() == QGeoServiceProvider::NoError, "Could not load plugin: " + provider->errorString().toLatin1());
m_map.reset(static_cast<QGeoTiledMapTest*>(mappingManager->createMap(this)));
QVERIFY(m_map);
- m_map->setViewportSize(QSize(16, 16));
+ m_map->setViewportSize(QSize(256, 256));
m_fetcher = static_cast<QGeoTileFetcherTest*>(m_map->m_engine->tileFetcher());
m_tilesCounter.reset(new FetchTileCounter());
connect(m_fetcher, SIGNAL(tileFetched(const QGeoTileSpec&)), m_tilesCounter.data(), SLOT(tileFetched(const QGeoTileSpec&)));