summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-01-21 16:51:55 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-01-22 18:42:53 -0800
commit27134df2e40efa14928859bface3de0bc2819072 (patch)
tree0f36876b04dde1f5f7488605fab9f8e276691b3c
parent73ddff60ad808e8cc010775eb53fcb9ef38e9a84 (diff)
downloadqtlocation-mapboxgl-27134df2e40efa14928859bface3de0bc2819072.tar.gz
[core] Use notModified to check for style change
-rw-r--r--src/mbgl/map/map_context.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mbgl/map/map_context.cpp b/src/mbgl/map/map_context.cpp
index 89c491facd..821741e87e 100644
--- a/src/mbgl/map/map_context.cpp
+++ b/src/mbgl/map/map_context.cpp
@@ -113,12 +113,14 @@ void MapContext::setStyleURL(const std::string& url) {
Log::Error(Event::Setup, "loading style failed: %s", res.error->message.c_str());
data.loading = false;
}
- } else {
- // We got a new stylesheet; only update when it's different from the previous one.
- if (styleJSON != *res.data) {
- loadStyleJSON(*res.data, base);
- }
+ return;
+ }
+
+ if (res.notModified) {
+ return;
}
+
+ loadStyleJSON(*res.data, base);
});
}