From 4e04a107e85a2118df12415cc661b8edb1fa36f4 Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Thu, 21 Apr 2016 20:15:18 +0300 Subject: [PATCH] Revert "[core] Do not clear custom layers upon style switch" This reverts commit 8ec875b87c387713d7e4df5c90e6cac7669ed38b. --- src/mbgl/style/style.cpp | 4 +--- test/api/custom_layer.cpp | 4 ---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp index b239ac20d..010f0aeaf 100644 --- a/src/mbgl/style/style.cpp +++ b/src/mbgl/style/style.cpp @@ -70,9 +70,7 @@ Style::Style(FileSource& fileSource_, float pixelRatio) void Style::setJSON(const std::string& json, const std::string&) { sources.clear(); - layers.erase(std::remove_if(layers.begin(), layers.end(), [](const auto& layer) { - return !layer->template is(); - }), layers.end()); + layers.clear(); classes.clear(); StyleParser parser; diff --git a/test/api/custom_layer.cpp b/test/api/custom_layer.cpp index beffa749d..4ad25bbfd 100644 --- a/test/api/custom_layer.cpp +++ b/test/api/custom_layer.cpp @@ -90,8 +90,4 @@ TEST(CustomLayer, Basic) { }, new TestLayer()); test::checkImage("test/fixtures/custom_layer/basic", test::render(map)); - - // Custom layer should be preserved when switching styles - map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"), ""); - test::checkImage("test/fixtures/custom_layer/basic", test::render(map)); }