summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2018-05-04 15:48:15 +0300
committerBruno de Oliveira Abinader <brunoabinader@gmail.com>2018-05-16 13:29:16 +0000
commitc91bfe1d1d4fcb29a1f44d32235f82e4ec4a3ccd (patch)
tree945b9ca3dd09003d76d0694cac1f8d77ee40289c
parent4b05f361d32a355c34278656ab0eb473f787fb4c (diff)
downloadqtlocation-c91bfe1d1d4fcb29a1f44d32235f82e4ec4a3ccd.tar.gz
Support raster-dem source type in Mapbox GL Map QML plugin
Task-number: QTBUG-68121 Change-Id: Ica6bbd875777aa5689a683127937c594f4ff05f8 Reviewed-by: Thiago Marcos P. Santos <tmpsantos@gmail.com> 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.cpp5
2 files changed, 5 insertions, 2 deletions
diff --git a/src/location/doc/src/plugins/mapboxgl.qdoc b/src/location/doc/src/plugins/mapboxgl.qdoc
index 8ad6a9c2..51b49f93 100644
--- a/src/location/doc/src/plugins/mapboxgl.qdoc
+++ b/src/location/doc/src/plugins/mapboxgl.qdoc
@@ -176,6 +176,8 @@ 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.
+ \li Supported source types are: \b vector, \b raster, \b raster-dem and \b geojson.
+'geojson'.
\row
\li layer
\li Adds a new \l {https://www.mapbox.com/mapbox-gl-js/style-spec/#layers}{style layer} to the map. On a Mapbox GL map,
diff --git a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp
index f401707b..964f94f5 100644
--- a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp
+++ b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp
@@ -536,7 +536,7 @@ QSharedPointer<QMapboxGLStyleChange> QMapboxGLStyleAddSource::fromMapParameter(Q
Q_ASSERT(param->type() == "source");
static const QStringList acceptedSourceTypes = QStringList()
- << QStringLiteral("vector") << QStringLiteral("raster") << QStringLiteral("geojson");
+ << QStringLiteral("vector") << QStringLiteral("raster") << QStringLiteral("raster-dem") << QStringLiteral("geojson");
QString sourceType = param->property("sourceType").toString();
@@ -550,9 +550,10 @@ QSharedPointer<QMapboxGLStyleChange> QMapboxGLStyleAddSource::fromMapParameter(Q
break;
case 0: // vector
case 1: // raster
+ case 2: // raster-dem
source->m_params[QStringLiteral("url")] = param->property("url");
break;
- case 2: { // geojson
+ case 3: { // geojson
auto data = param->property("data").toString();
if (data.startsWith(':')) {
QFile geojson(data);