[Qt] Added QMapboxGL::layerExists

This commit is contained in:
Bruno de Oliveira Abinader
2017-02-02 17:26:02 +02:00
parent 343d161ac1
commit 8b9a511357
2 changed files with 10 additions and 1 deletions

View File

@@ -221,6 +221,7 @@ public:
void* context,
char* before = NULL);
void addLayer(const QVariantMap &params);
bool layerExists(const QString &id);
void removeLayer(const QString &id);
void setFilter(const QString &layer, const QVariant &filter);

View File

@@ -1390,7 +1390,15 @@ void QMapboxGL::addLayer(const QVariantMap &params)
}
/*!
Removes the layer \a id.
Returns true if the layer with given \a id exists, false otherwise.
*/
bool QMapboxGL::layerExists(const QString& id)
{
return !!d_ptr->mapObj->getLayer(id.toStdString());
}
/*!
Removes the layer with given \a id.
*/
void QMapboxGL::removeLayer(const QString& id)
{