summaryrefslogtreecommitdiff
path: root/platform/qt/src/qmapboxgl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/qt/src/qmapboxgl.cpp')
-rw-r--r--platform/qt/src/qmapboxgl.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp
index 58158c1822..581a1c4111 100644
--- a/platform/qt/src/qmapboxgl.cpp
+++ b/platform/qt/src/qmapboxgl.cpp
@@ -1466,6 +1466,23 @@ void QMapboxGL::removeLayer(const QString& id)
}
/*!
+ List of all existing layer ids from the current style.
+*/
+QList<QString> QMapboxGL::layerIds() const
+{
+ const auto &layers = d_ptr->mapObj->getStyle().getLayers();
+
+ QList<QString> layerIds;
+ layerIds.reserve(layers.size());
+
+ for (const mbgl::style::Layer *layer : layers) {
+ layerIds.append(QString::fromStdString(layer->getID()));
+ }
+
+ return layerIds;
+}
+
+/*!
Adds the \a image with the identifier \a id that can be used
later by a symbol layer.