summaryrefslogtreecommitdiff
path: root/src/mbgl/map/map.cpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-06-14 16:21:02 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-06-22 08:04:39 -0700
commitbe7e9bbb8d54c775127f53d793c117c4bf5e2764 (patch)
tree2621c4aa950956af9e48205bda13960ac2ce8584 /src/mbgl/map/map.cpp
parente4201e207c3a6b33da64fdc2f9a00ec08586dc09 (diff)
downloadqtlocation-mapboxgl-be7e9bbb8d54c775127f53d793c117c4bf5e2764.tar.gz
[core] Refactor CustomLayer internals
Move the responsibility for initialization/deinitialization/rendering to RenderCustomLayer. This eliminates special case code from Map and Style.
Diffstat (limited to 'src/mbgl/map/map.cpp')
-rw-r--r--src/mbgl/map/map.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp
index 0df9f11112..73a540a16a 100644
--- a/src/mbgl/map/map.cpp
+++ b/src/mbgl/map/map.cpp
@@ -904,20 +904,14 @@ Layer* Map::getLayer(const std::string& layerID) {
void Map::addLayer(std::unique_ptr<Layer> layer, const optional<std::string>& before) {
impl->styleMutated = true;
- BackendScope guard(impl->backend);
-
impl->style->addLayer(std::move(layer), before);
impl->onUpdate(Update::Repaint);
}
std::unique_ptr<Layer> Map::removeLayer(const std::string& id) {
impl->styleMutated = true;
- BackendScope guard(impl->backend);
-
- auto removedLayer = impl->style->removeLayer(id);
impl->onUpdate(Update::Repaint);
-
- return removedLayer;
+ return impl->style->removeLayer(id);
}
void Map::addImage(std::unique_ptr<style::Image> image) {