From 664a83674b2bf8313763870c9eca7c4c558a14bc Mon Sep 17 00:00:00 2001 From: Tadej Novak Date: Sat, 19 Oct 2019 10:38:44 +0200 Subject: Add image source support to Mapbox GL plugin [ChangeLog][QtLocation][MapboxGL] Added support for image sources Change-Id: I5334f36e033d26824300d90ad8d9aacf3ac75ac3 Reviewed-by: Paolo Angelelli --- src/location/doc/src/plugins/mapboxgl.qdoc | 2 +- src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/location/doc/src/plugins/mapboxgl.qdoc b/src/location/doc/src/plugins/mapboxgl.qdoc index c5e02810..119868d1 100644 --- a/src/location/doc/src/plugins/mapboxgl.qdoc +++ b/src/location/doc/src/plugins/mapboxgl.qdoc @@ -181,7 +181,7 @@ replacing the dash with camel case for technical reasons (i.e. \b line-cap will \li A style data \l {https://www.mapbox.com/mapbox-gl-js/style-spec/#sources}{source}. When using a source of \b sourceType \l {https://www.mapbox.com/mapbox-gl-js/style-spec/#sources-geojson}{geojson}, the \b data property can be both inlined or sourced from qrc. Supported source types are: \b vector, \b raster, - \b raster-dem and \b geojson. + \b raster-dem, \b image and \b geojson. 'geojson'. \row \li layer diff --git a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp index b45fdef1..cb8dc2be 100644 --- a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp +++ b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp @@ -552,7 +552,7 @@ QSharedPointer QMapboxGLStyleAddSource::fromMapParameter(Q Q_ASSERT(param->type() == "source"); static const QStringList acceptedSourceTypes = QStringList() - << QStringLiteral("vector") << QStringLiteral("raster") << QStringLiteral("raster-dem") << QStringLiteral("geojson"); + << QStringLiteral("vector") << QStringLiteral("raster") << QStringLiteral("raster-dem") << QStringLiteral("geojson") << QStringLiteral("image"); QString sourceType = param->property("sourceType").toString(); @@ -579,6 +579,10 @@ QSharedPointer QMapboxGLStyleAddSource::fromMapParameter(Q source->m_params[QStringLiteral("data")] = data.toUtf8(); } } break; + case 4: { // image + source->m_params[QStringLiteral("url")] = param->property("url"); + source->m_params[QStringLiteral("coordinates")] = param->property("coordinates"); + } break; } return QSharedPointer(source); -- cgit v1.2.1