diff options
-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) { |