summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/mbgl/map/map.hpp1
-rw-r--r--src/mbgl/map/map.cpp4
2 files changed, 5 insertions, 0 deletions
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp
index d50aac1c09..749c45c4c2 100644
--- a/include/mbgl/map/map.hpp
+++ b/include/mbgl/map/map.hpp
@@ -149,6 +149,7 @@ public:
AnnotationIDs getPointAnnotationsInBounds(const LatLngBounds&);
+ style::Layer* getLayer(const std::string& layerID);
void addLayer(std::unique_ptr<style::Layer>, const optional<std::string>& beforeLayerID = {});
void removeLayer(const std::string& layerID);
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp
index 2b39b3e884..ae9330abae 100644
--- a/src/mbgl/map/map.cpp
+++ b/src/mbgl/map/map.cpp
@@ -736,6 +736,10 @@ std::vector<Feature> Map::queryRenderedFeatures(const ScreenBox& box, const opti
#pragma mark - Style API
+style::Layer* Map::getLayer(const std::string& layerID) {
+ return impl->style ? impl->style->getLayer(layerID) : nullptr;
+}
+
void Map::addLayer(std::unique_ptr<Layer> layer, const optional<std::string>& before) {
impl->view.activate();