[Qt] Added QQuickMapboxGLStyle

A QQuickMapboxGLStyleProperty being a child of QQuickMapboxGLStyle
assures that only properties associated with that particular style will
reflect on the map - and that happens only when the style is the current
set via style property.
This commit is contained in:
Bruno de Oliveira Abinader
2016-08-05 16:32:31 +03:00
parent 45da1abbe1
commit 8843bebee2
9 changed files with 161 additions and 32 deletions

View File

@@ -2,6 +2,7 @@
#include <QMapboxGL>
#include <QQuickMapboxGL>
#include <QQuickMapboxGLStyle>
#include <QSize>
#include <QOpenGLFramebufferObject>
@@ -83,8 +84,8 @@ void QQuickMapboxGLRenderer::synchronize(QQuickFramebufferObject *item)
m_map->setCoordinateZoom({ center.latitude(), center.longitude() }, quickMap->zoomLevel());
}
if (syncStatus & QQuickMapboxGL::StyleNeedsSync) {
m_map->setStyleURL(quickMap->style());
if (syncStatus & QQuickMapboxGL::StyleNeedsSync && quickMap->style()) {
m_map->setStyleURL(quickMap->style()->url());
m_styleLoaded = false;
}