replace Style object immediately

this makes sure that adding custom sprite imagery will add them to the new Style object rather than
the old one in case a user adds new custom sprites immediately after changing a stylesheet
This commit is contained in:
Konstantin Käfer
2015-07-02 18:39:06 +02:00
parent f9601ae685
commit b2a3314192
4 changed files with 18 additions and 11 deletions

View File

@@ -32,7 +32,8 @@ public:
transform_.setLatLngZoom({0, 0}, 16);
const std::string style = util::read_file("test/fixtures/resources/style.json");
style_ = std::make_unique<Style>(style, "", data_, util::RunLoop::getLoop());
style_ = std::make_unique<Style>(data_, util::RunLoop::getLoop());
style_->setJSON(style, "");
style_->setObserver(this);
}