From 1529116ef6a3e2ece63adfa12e02f57a18efff27 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Wed, 8 Jun 2016 17:18:28 -0700 Subject: [PATCH] [core] Introduce Map::getLayer --- include/mbgl/map/map.hpp | 1 + src/mbgl/map/map.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index d50aac1c0..749c45c4c 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, const optional& beforeLayerID = {}); void removeLayer(const std::string& layerID); diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp index 2b39b3e88..ae9330aba 100644 --- a/src/mbgl/map/map.cpp +++ b/src/mbgl/map/map.cpp @@ -736,6 +736,10 @@ std::vector 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, const optional& before) { impl->view.activate();