diff options
author | Thiago Marcos P. Santos <thiago@mapbox.com> | 2016-05-10 20:08:58 +0300 |
---|---|---|
committer | Thiago Marcos P. Santos <thiago@mapbox.com> | 2016-05-10 21:04:06 +0300 |
commit | e84b9a83fa821fa985aff698b5702521c541585b (patch) | |
tree | 3d44d90f54bf1a762b58a3103138f3b27e0ade92 /platform | |
parent | eb1e6c0f0c5bc3f427888e52ddf4729f8914b8da (diff) | |
download | qtlocation-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.cpp | 8 |
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) { |