[core] Introduce Map::getLayer

This commit is contained in:
John Firebaugh
2016-06-08 17:18:28 -07:00
parent 039b05ebb4
commit 1529116ef6
2 changed files with 5 additions and 0 deletions

View File

@@ -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);

View File

@@ -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();