summaryrefslogtreecommitdiff
path: root/include/mbgl/map
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-08-18 18:00:58 -0700
committerMinh Nguyễn <mxn@1ec5.org>2016-11-28 15:45:37 -0800
commit850b70ff91e582916829c5248afcafa195070a43 (patch)
tree3362e95001983e3029e006dbd99579a5bf68e97d /include/mbgl/map
parentf71dd14bb74be22fb27646b8732843d92cf72c62 (diff)
downloadqtlocation-mapboxgl-850b70ff91e582916829c5248afcafa195070a43.tar.gz
[core, ios, macos] Added layers and sources properties to MGLStyle
Added new layers and sources properties to MGLStyle that contain all the style’s layers and sources, respectively. These properties are KVC-compliant with all the mutable to-many methods. Layers are ordered from topmost to bottommost, for consistency with Cocoa APIs where front/first means top and back/last means bottom. Also added storage for mbgl::style::Source in MGLSource proper for wrapping AnnotationSource. Until the style finishes loading, its name property is set to nil. Fixes #6003.
Diffstat (limited to 'include/mbgl/map')
-rw-r--r--include/mbgl/map/map.hpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp
index 0c14600c75..10153c54e3 100644
--- a/include/mbgl/map/map.hpp
+++ b/include/mbgl/map/map.hpp
@@ -157,11 +157,13 @@ public:
void removeAnnotation(AnnotationID);
// Sources
+ std::vector<style::Source*> getSources();
style::Source* getSource(const std::string& sourceID);
void addSource(std::unique_ptr<style::Source>);
std::unique_ptr<style::Source> removeSource(const std::string& sourceID);
// Layers
+ std::vector<style::Layer*> getLayers();
style::Layer* getLayer(const std::string& layerID);
void addLayer(std::unique_ptr<style::Layer>, const optional<std::string>& beforeLayerID = {});
std::unique_ptr<style::Layer> removeLayer(const std::string& layerID);