From d0181dc2b72a5cfe473ee1eec4ce5a8ba9e3ac19 Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Wed, 8 Feb 2017 20:17:51 +0200 Subject: [Qt] Added QMapboxGL::sourceExists --- platform/qt/src/qmapboxgl.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'platform/qt/src/qmapboxgl.cpp') diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp index e23f97f679..e94a0e1bc6 100644 --- a/platform/qt/src/qmapboxgl.cpp +++ b/platform/qt/src/qmapboxgl.cpp @@ -1246,6 +1246,14 @@ void QMapboxGL::addSource(const QString &id, const QVariantMap ¶ms) d_ptr->mapObj->addSource(std::move(*source)); } +/*! + 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. -- cgit v1.2.1