diff --git a/platform/linux/scripts/after_script.sh b/platform/linux/scripts/after_script.sh index f8e4bc348..b5397f1df 100755 --- a/platform/linux/scripts/after_script.sh +++ b/platform/linux/scripts/after_script.sh @@ -10,6 +10,6 @@ if [ ! -z "${AWS_ACCESS_KEY_ID}" ] && [ ! -z "${AWS_SECRET_ACCESS_KEY}" ] ; then REPO_NAME=$(basename $TRAVIS_REPO_SLUG) - aws s3 cp --recursive --acl public-read test/fixtures/annotations \ - s3://mapbox/$REPO_NAME/render-tests/$TRAVIS_JOB_NUMBER/annotations + aws s3 cp --recursive --acl public-read --exclude "*" --include "*/actual.png" test/fixtures \ + s3://mapbox/$REPO_NAME/render-tests/$TRAVIS_JOB_NUMBER fi diff --git a/src/mbgl/map/map_context.cpp b/src/mbgl/map/map_context.cpp index 6f12e968b..eb17e20ae 100644 --- a/src/mbgl/map/map_context.cpp +++ b/src/mbgl/map/map_context.cpp @@ -105,12 +105,6 @@ void MapContext::setStyleURL(const std::string& url) { FileSource* fs = util::ThreadContext::getFileSource(); styleRequest = fs->request({ Resource::Kind::Style, styleURL }, [this, base](Response res) { - if (res.stale) { - // Only handle fresh responses. - return; - } - styleRequest = nullptr; - if (res.error) { if (res.error->reason == Response::Error::Reason::NotFound && util::mapbox::isMapboxURL(styleURL)) { @@ -120,9 +114,11 @@ void MapContext::setStyleURL(const std::string& url) { data.loading = false; } } else { - loadStyleJSON(*res.data, base); + // We got a new stylesheet; only update when it's different from the previous one. + if (styleJSON != *res.data) { + loadStyleJSON(*res.data, base); + } } - }); } @@ -132,7 +128,7 @@ void MapContext::setStyleJSON(const std::string& json, const std::string& base) } styleURL.clear(); - styleJSON = json; + styleJSON.clear(); style = std::make_unique