[Qt] Allow setting the style via QML
This commit is contained in:
@@ -42,7 +42,6 @@ void QQuickMapboxGLRenderer::render()
|
||||
void QQuickMapboxGLRenderer::synchronize(QQuickFramebufferObject *item)
|
||||
{
|
||||
if (!m_initialized) {
|
||||
m_map->setStyleURL(QMapbox::defaultStyles()[0].first);
|
||||
QObject::connect(m_map.data(), SIGNAL(needsRendering()), item, SLOT(update()));
|
||||
m_initialized = true;
|
||||
}
|
||||
@@ -58,4 +57,8 @@ void QQuickMapboxGLRenderer::synchronize(QQuickFramebufferObject *item)
|
||||
const auto& center = quickMap->center();
|
||||
m_map->setCoordinate(QMapbox::Coordinate(center.latitude(), center.longitude()));
|
||||
}
|
||||
|
||||
if (syncStatus & QQuickMapboxGL::StyleNeedsSync) {
|
||||
m_map->setStyleURL(quickMap->style());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user