From 8b0694bc16c0a565c99691283df48b333aef5837 Mon Sep 17 00:00:00 2001 From: Ivo van Dongen Date: Tue, 20 Sep 2016 12:37:34 +0200 Subject: [PATCH] [core] MapChangeDidFinishLoadingStyle - Ensure style is loaded (#6392) --- src/mbgl/style/style.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp index 1c0d7f53958..4cb267a261e 100644 --- a/src/mbgl/style/style.cpp +++ b/src/mbgl/style/style.cpp @@ -103,10 +103,7 @@ void Style::setJSON(const std::string& json) { Log::Error(Event::ParseStyle, "Failed to parse style: %s", util::toString(error).c_str()); observer->onStyleError(); observer->onResourceError(error); - return; - } else { - observer->onStyleLoaded(); } for (auto& source : parser.sources) { @@ -127,6 +124,8 @@ void Style::setJSON(const std::string& json) { spriteAtlas->load(parser.spriteURL, fileSource); loaded = true; + + observer->onStyleLoaded(); } void Style::addSource(std::unique_ptr source) {