[Qt] Added QMapboxGL::sourceExists
This commit is contained in:
@@ -208,6 +208,7 @@ public:
|
||||
QMargins margins() const;
|
||||
|
||||
void addSource(const QString &sourceID, const QVariantMap& params);
|
||||
bool sourceExists(const QString &sourceID);
|
||||
void updateSource(const QString &sourceID, const QVariantMap& params);
|
||||
void removeSource(const QString &sourceID);
|
||||
|
||||
|
||||
@@ -1243,6 +1243,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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user