summaryrefslogtreecommitdiff
path: root/src/plugins/geoservices/mapboxgl
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/geoservices/mapboxgl')
-rw-r--r--src/plugins/geoservices/mapboxgl/mapboxgl.pro11
-rw-r--r--src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp13
-rw-r--r--src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp9
3 files changed, 17 insertions, 16 deletions
diff --git a/src/plugins/geoservices/mapboxgl/mapboxgl.pro b/src/plugins/geoservices/mapboxgl/mapboxgl.pro
index f35f26dc..17b6f53a 100644
--- a/src/plugins/geoservices/mapboxgl/mapboxgl.pro
+++ b/src/plugins/geoservices/mapboxgl/mapboxgl.pro
@@ -35,16 +35,7 @@ load(qt_build_paths)
LIBS_PRIVATE += -L$$MODULE_BASE_OUTDIR/lib -lqmapboxgl$$qtPlatformTargetSuffix()
qtConfig(icu) {
- include(../../../3rdparty/icu_dependency.pri)
-}
-
-# When building for Windows with dynamic OpenGL, this plugin
-# can only run with ANGLE because Mapbox GL requires at least
-# OpenGL ES and does not use QOpenGLFunctions for resolving
-# the OpenGL symbols. -lopengl32 only gives OpenGL 1.1.
-win32:qtConfig(dynamicgl) {
- qtConfig(combined-angle-lib): LIBS_PRIVATE += -l$${LIBQTANGLE_NAME}
- else: LIBS_PRIVATE += -l$${LIBEGL_NAME} -l$${LIBGLESV2_NAME}
+ QMAKE_USE_PRIVATE += icu
}
PLUGIN_TYPE = geoservices
diff --git a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp
index 69bb6e4b..f39bfae3 100644
--- a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp
+++ b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp
@@ -124,7 +124,10 @@ QMapbox::Feature featureFromMapPolygon(QDeclarativePolygonMapItem *mapItem)
coordinates << QMapbox::Coordinate { coordinate.latitude(), coordinate.longitude() };
}
}
- coordinates.append(coordinates.first());
+
+ if (!coordinates.empty())
+ coordinates.append(coordinates.first()); // closing the path
+
QMapbox::CoordinatesCollections geometry { { coordinates } };
return QMapbox::Feature(QMapbox::Feature::PolygonType, geometry, {}, getId(mapItem));
@@ -381,7 +384,7 @@ QList<QSharedPointer<QMapboxGLStyleChange>> QMapboxGLStyleSetPaintProperty::from
const QString id = getId(item);
changes << QSharedPointer<QMapboxGLStyleChange>(
- new QMapboxGLStyleSetPaintProperty(id, QStringLiteral("fill-opacity"), item->mapItemOpacity()));
+ new QMapboxGLStyleSetPaintProperty(id, QStringLiteral("fill-opacity"), item->color().alphaF() * item->mapItemOpacity()));
changes << QSharedPointer<QMapboxGLStyleChange>(
new QMapboxGLStyleSetPaintProperty(id, QStringLiteral("fill-color"), item->color()));
changes << QSharedPointer<QMapboxGLStyleChange>(
@@ -398,7 +401,7 @@ QList<QSharedPointer<QMapboxGLStyleChange>> QMapboxGLStyleSetPaintProperty::from
const QString id = getId(item);
changes << QSharedPointer<QMapboxGLStyleChange>(
- new QMapboxGLStyleSetPaintProperty(id, QStringLiteral("fill-opacity"), item->mapItemOpacity()));
+ new QMapboxGLStyleSetPaintProperty(id, QStringLiteral("fill-opacity"), item->color().alphaF() * item->mapItemOpacity()));
changes << QSharedPointer<QMapboxGLStyleChange>(
new QMapboxGLStyleSetPaintProperty(id, QStringLiteral("fill-color"), item->color()));
changes << QSharedPointer<QMapboxGLStyleChange>(
@@ -415,7 +418,7 @@ QList<QSharedPointer<QMapboxGLStyleChange>> QMapboxGLStyleSetPaintProperty::from
const QString id = getId(item);
changes << QSharedPointer<QMapboxGLStyleChange>(
- new QMapboxGLStyleSetPaintProperty(id, QStringLiteral("fill-opacity"), item->mapItemOpacity()));
+ new QMapboxGLStyleSetPaintProperty(id, QStringLiteral("fill-opacity"), item->color().alphaF() * item->mapItemOpacity()));
changes << QSharedPointer<QMapboxGLStyleChange>(
new QMapboxGLStyleSetPaintProperty(id, QStringLiteral("fill-color"), item->color()));
changes << QSharedPointer<QMapboxGLStyleChange>(
@@ -432,7 +435,7 @@ QList<QSharedPointer<QMapboxGLStyleChange>> QMapboxGLStyleSetPaintProperty::from
const QString id = getId(item);
changes << QSharedPointer<QMapboxGLStyleChange>(
- new QMapboxGLStyleSetPaintProperty(id, QStringLiteral("line-opacity"), item->mapItemOpacity()));
+ new QMapboxGLStyleSetPaintProperty(id, QStringLiteral("line-opacity"), item->line()->color().alphaF() * item->mapItemOpacity()));
changes << QSharedPointer<QMapboxGLStyleChange>(
new QMapboxGLStyleSetPaintProperty(id, QStringLiteral("line-color"), item->line()->color()));
changes << QSharedPointer<QMapboxGLStyleChange>(
diff --git a/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp b/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp
index 82aa868f..7721fe61 100644
--- a/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp
+++ b/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp
@@ -68,8 +68,10 @@ void QSGMapboxGLTextureNode::resize(const QSize &size, qreal pixelRatio)
m_map->setFramebufferObject(m_fbo->handle());
QSGPlainTexture *fboTexture = static_cast<QSGPlainTexture *>(texture());
- if (!fboTexture)
+ if (!fboTexture) {
fboTexture = new QSGPlainTexture;
+ fboTexture->setHasAlphaChannel(true);
+ }
fboTexture->setTextureId(m_fbo->texture());
fboTexture->setTextureSize(fbSize);
@@ -92,6 +94,11 @@ void QSGMapboxGLTextureNode::render(QQuickWindow *window)
f->glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment);
m_fbo->bind();
+
+ f->glClearColor(0.f, 0.f, 0.f, 0.f);
+ f->glColorMask(true, true, true, true);
+ f->glClear(GL_COLOR_BUFFER_BIT);
+
m_map->render();
m_fbo->release();