summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2017-08-22 14:53:19 +0300
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2017-08-22 12:51:19 +0000
commit47e2c461d517a6bb2fe663f752f3c7dd72c63357 (patch)
treec050fa727cba927e72f0f1b91bbbd3585e14e789
parentcb2d9854615405ebe3b78a5ad4ba477d2f87ecaa (diff)
downloadqtlocation-47e2c461d517a6bb2fe663f752f3c7dd72c63357.tar.gz
Bump Mapbox GL to v1.1.0
mapbox-gl-native @ bd15e273dce767458d335aeb1f50aa081390d593 Task-number: QTBUG-62454 Change-Id: I241ae47d8590a5de7da95f39ae056abeab9c172b Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
m---------src/3rdparty/mapbox-gl-native0
-rw-r--r--src/plugins/geoservices/geoservices.pro2
-rw-r--r--src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp34
-rw-r--r--src/plugins/geoservices/mapboxgl/qmapboxglstylechange_p.h1
-rw-r--r--src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp1
5 files changed, 26 insertions, 12 deletions
diff --git a/src/3rdparty/mapbox-gl-native b/src/3rdparty/mapbox-gl-native
-Subproject 9ecbe3642fb4a53b558598239b59bf1d0224c25
+Subproject 1c633072fcea7ad153ab6f8ec40dd72d83541ea
diff --git a/src/plugins/geoservices/geoservices.pro b/src/plugins/geoservices/geoservices.pro
index 459897a8..07c34798 100644
--- a/src/plugins/geoservices/geoservices.pro
+++ b/src/plugins/geoservices/geoservices.pro
@@ -7,7 +7,7 @@ qtConfig(concurrent) {
}
qtConfig(opengl):qtConfig(c++14):!win32|mingw:!qnx {
- !exists(../../3rdparty/mapbox-gl-native/CMakeLists.txt) {
+ !exists(../../3rdparty/mapbox-gl-native/mapbox-gl-native.pro) {
warning("Submodule mapbox-gl-native does not exist. Run 'git submodule update --init' on qtlocation.")
} else {
SUBDIRS += mapboxgl ../../3rdparty/mapbox-gl-native
diff --git a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp
index c6972b07..f79f0a38 100644
--- a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp
+++ b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp
@@ -54,7 +54,7 @@ QString formatPropertyName(QString *name)
bool isImmutableProperty(const QString &name)
{
- return name == QStringLiteral("type") || name == QStringLiteral("layer") || name == QStringLiteral("class");
+ return name == QStringLiteral("type") || name == QStringLiteral("layer");
}
QString getId(QDeclarativeGeoMapItemBase *mapItem)
@@ -288,7 +288,7 @@ QMapboxGLStyleSetPaintProperty::QMapboxGLStyleSetPaintProperty(const QString& la
void QMapboxGLStyleSetPaintProperty::apply(QMapboxGL *map)
{
- map->setPaintProperty(m_layer, m_property, m_value, m_class);
+ map->setPaintProperty(m_layer, m_property, m_value);
}
QList<QSharedPointer<QMapboxGLStyleChange>> QMapboxGLStyleSetPaintProperty::fromMapParameter(QGeoMapParameter *param)
@@ -313,7 +313,6 @@ QList<QSharedPointer<QMapboxGLStyleChange>> QMapboxGLStyleSetPaintProperty::from
paint->m_layer = param->property("layer").toString();
paint->m_property = formatPropertyName(&name);
- paint->m_class = param->property("class").toString();
changes << QSharedPointer<QMapboxGLStyleChange>(paint);
}
@@ -399,15 +398,30 @@ QSharedPointer<QMapboxGLStyleChange> QMapboxGLStyleAddLayer::fromMapParameter(QG
Q_ASSERT(param->type() == "layer");
auto layer = new QMapboxGLStyleAddLayer();
- layer->m_params[QStringLiteral("id")] = param->property("name");
- layer->m_params[QStringLiteral("source")] = param->property("source");
- layer->m_params[QStringLiteral("type")] = param->property("layerType");
- if (param->property("sourceLayer").isValid()) {
- layer->m_params[QStringLiteral("source-layer")] = param->property("sourceLayer");
- }
+ static const QStringList layerProperties = QStringList()
+ << QStringLiteral("name") << QStringLiteral("layerType") << QStringLiteral("before");
- layer->m_before = param->property("before").toString();
+ // Offset objectName and type properties.
+ for (int i = 2; i < param->metaObject()->propertyCount(); ++i) {
+ QString name = param->metaObject()->property(i).name();
+ QVariant value = param->property(name.toLatin1());
+
+ switch (layerProperties.indexOf(name)) {
+ case -1:
+ layer->m_params[formatPropertyName(&name)] = value;
+ break;
+ case 0: // name
+ layer->m_params[QStringLiteral("id")] = value;
+ break;
+ case 1: // layerType
+ layer->m_params[QStringLiteral("type")] = value;
+ break;
+ case 2: // before
+ layer->m_before = value.toString();
+ break;
+ }
+ }
return QSharedPointer<QMapboxGLStyleChange>(layer);
}
diff --git a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange_p.h b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange_p.h
index 9164591a..aa81d89f 100644
--- a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange_p.h
+++ b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange_p.h
@@ -102,7 +102,6 @@ private:
QString m_layer;
QString m_property;
QVariant m_value;
- QString m_class;
};
class QMapboxGLStyleAddLayer : public QMapboxGLStyleChange
diff --git a/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp b/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp
index d338a51a..3f31997c 100644
--- a/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp
+++ b/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp
@@ -65,6 +65,7 @@ void QSGMapboxGLTextureNode::resize(const QSize &size, qreal pixelRatio)
m_map->resize(minSize, fbSize);
m_fbo.reset(new QOpenGLFramebufferObject(fbSize, QOpenGLFramebufferObject::CombinedDepthStencil));
+ m_map->setFramebufferObject(m_fbo->handle());
QSGPlainTexture *fboTexture = static_cast<QSGPlainTexture *>(texture());
if (!fboTexture)