summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <thiago@mapbox.com>2016-05-10 20:08:58 +0300
committerThiago Marcos P. Santos <thiago@mapbox.com>2016-05-10 21:04:06 +0300
commite84b9a83fa821fa985aff698b5702521c541585b (patch)
tree3d44d90f54bf1a762b58a3103138f3b27e0ade92 /platform
parenteb1e6c0f0c5bc3f427888e52ddf4729f8914b8da (diff)
downloadqtlocation-mapboxgl-e84b9a83fa821fa985aff698b5702521c541585b.tar.gz
[Qt] Always use setCoordinateZoom()
Because at low zoom levels setting a new coordinate won't correspond to the actual coordinate on the map.
Diffstat (limited to 'platform')
-rw-r--r--platform/qt/src/qquickmapboxglrenderer.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/platform/qt/src/qquickmapboxglrenderer.cpp b/platform/qt/src/qquickmapboxglrenderer.cpp
index 23ee440873..c76c98fb62 100644
--- a/platform/qt/src/qquickmapboxglrenderer.cpp
+++ b/platform/qt/src/qquickmapboxglrenderer.cpp
@@ -53,13 +53,9 @@ void QQuickMapboxGLRenderer::synchronize(QQuickFramebufferObject *item)
auto quickMap = static_cast<QQuickMapboxGL*>(item);
auto syncStatus = quickMap->swapSyncState();
- if (syncStatus & QQuickMapboxGL::ZoomNeedsSync) {
- m_map->setZoom(quickMap->zoomLevel());
- }
-
- if (syncStatus & QQuickMapboxGL::CenterNeedsSync) {
+ if (syncStatus & QQuickMapboxGL::CenterNeedsSync || syncStatus & QQuickMapboxGL::ZoomNeedsSync) {
const auto& center = quickMap->center();
- m_map->setCoordinate(QMapbox::Coordinate(center.latitude(), center.longitude()));
+ m_map->setCoordinateZoom({ center.latitude(), center.longitude() }, quickMap->zoomLevel());
}
if (syncStatus & QQuickMapboxGL::StyleNeedsSync) {