summaryrefslogtreecommitdiffstats
path: root/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2017-09-01 19:07:29 +0300
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2017-09-05 10:24:30 +0000
commit8f80da7ea0165adb492c71255d0eea5f08c0af8e (patch)
tree7f5eca61363d41a32e2896aad08bc2fff975c794 /src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp
parent1903bfab5d5ceef6df247bbb19c7f7fac26f1edb (diff)
Fix Mapbox GL plugin not respecting MapItem visibility and opacity
Now opacity and visibility will be respected for the fill color as borders are not supported yet. Change-Id: I58f982dc9285537fde770e14238c5d6d903913e6 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
Diffstat (limited to 'src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp')
-rw-r--r--src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp
index f8bd9b4d..69bb6e4b 100644
--- a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp
+++ b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp
@@ -279,13 +279,20 @@ QList<QSharedPointer<QMapboxGLStyleChange>> QMapboxGLStyleSetLayoutProperty::fro
QList<QSharedPointer<QMapboxGLStyleChange>> QMapboxGLStyleSetLayoutProperty::fromMapItem(QDeclarativeGeoMapItemBase *item)
{
+ QList<QSharedPointer<QMapboxGLStyleChange>> changes;
+
switch (item->itemType()) {
case QGeoMap::MapPolyline:
- return fromMapItem(static_cast<QDeclarativePolylineMapItem *>(item));
+ changes = fromMapItem(static_cast<QDeclarativePolylineMapItem *>(item));
default:
- qWarning() << "Unsupported QGeoMap item type: " << item->itemType();
- return QList<QSharedPointer<QMapboxGLStyleChange>>();
+ break;
}
+
+ changes << QSharedPointer<QMapboxGLStyleChange>(
+ new QMapboxGLStyleSetLayoutProperty(getId(item), QStringLiteral("visibility"),
+ item->isVisible() ? QStringLiteral("visible") : QStringLiteral("none")));
+
+ return changes;
}
QList<QSharedPointer<QMapboxGLStyleChange>> QMapboxGLStyleSetLayoutProperty::fromMapItem(QDeclarativePolylineMapItem *item)