summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTadej Novak <tadej@tano.si>2019-10-19 10:38:44 +0200
committerTadej Novak <tadej@tano.si>2019-11-09 12:00:25 +0200
commit664a83674b2bf8313763870c9eca7c4c558a14bc (patch)
tree72797ebd7a34d0b5c0e7a387d5cc36cc66276a99
parent56849a2b9c605cbbeed5d7eff24ece1808d07748 (diff)
downloadqtlocation-664a83674b2bf8313763870c9eca7c4c558a14bc.tar.gz
Add image source support to Mapbox GL plugin
[ChangeLog][QtLocation][MapboxGL] Added support for image sources Change-Id: I5334f36e033d26824300d90ad8d9aacf3ac75ac3 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
-rw-r--r--src/location/doc/src/plugins/mapboxgl.qdoc2
-rw-r--r--src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp6
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<QMapboxGLStyleChange> 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<QMapboxGLStyleChange> 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<QMapboxGLStyleChange>(source);