diff options
author | Jesse Bounds <jesse@rebounds.net> | 2016-11-11 14:40:04 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-11 14:40:04 -0800 |
commit | edf40bb6d9f0ee3731f39de597ce9a167571ea5b (patch) | |
tree | b0a310487d4c3f53dde0b554ff16f1b1cacee9fe /include/mbgl/map | |
parent | 39b0bc0a402248e29791f93aeab5a6234bf80862 (diff) | |
download | qtlocation-mapboxgl-edf40bb6d9f0ee3731f39de597ce9a167571ea5b.tar.gz |
[core] Return source and layer ownership (#7014)
When a source or layer is removed transfer ownership back to the
caller so it can (optionally) take it. Preserve the behavior that
removing a CustomLayer triggers deinitialization. Deinitialize all
custom layers when a style is destroyed in case those layers are not
explicitly removed.
Diffstat (limited to 'include/mbgl/map')
-rw-r--r-- | include/mbgl/map/map.hpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index 6656bccd51..aaec346731 100644 --- a/include/mbgl/map/map.hpp +++ b/include/mbgl/map/map.hpp @@ -159,12 +159,12 @@ public: // Sources style::Source* getSource(const std::string& sourceID); void addSource(std::unique_ptr<style::Source>); - void removeSource(const std::string& sourceID); + std::unique_ptr<style::Source> removeSource(const std::string& sourceID); // Layers 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); + std::unique_ptr<style::Layer> removeLayer(const std::string& layerID); // Add image, bound to the style void addImage(const std::string&, std::unique_ptr<const SpriteImage>); |