summaryrefslogtreecommitdiff
path: root/platform/qt/src
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2017-02-08 20:17:51 +0200
committerBruno de Oliveira Abinader <bruno@mapbox.com>2017-02-09 12:31:32 +0200
commitb9af073e988c09ba01cf978c918edea7840825be (patch)
tree919a6c587bf88037e2fc59e348e05bc32cda02e9 /platform/qt/src
parentbcc9eda0124a9478de3a47ff561888187153c163 (diff)
downloadqtlocation-mapboxgl-b9af073e988c09ba01cf978c918edea7840825be.tar.gz
[Qt] Added QMapboxGL::sourceExists
Diffstat (limited to 'platform/qt/src')
-rw-r--r--platform/qt/src/qmapboxgl.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp
index eb908b6083..ca42f51ebd 100644
--- a/platform/qt/src/qmapboxgl.cpp
+++ b/platform/qt/src/qmapboxgl.cpp
@@ -1244,6 +1244,14 @@ void QMapboxGL::addSource(const QString &id, const QVariantMap &params)
}
/*!
+ Returns true if the layer with given \a id exists, false otherwise.
+*/
+bool QMapboxGL::sourceExists(const QString& sourceID)
+{
+ return !!d_ptr->mapObj->getSource(sourceID.toStdString());
+}
+
+/*!
Updates the source \a id with new \a params.
If the source does not exist, it will be added like in addSource(). Only