diff --git a/include/mbgl/storage/response.hpp b/include/mbgl/storage/response.hpp index 6c79f5e18..4dc3f3668 100644 --- a/include/mbgl/storage/response.hpp +++ b/include/mbgl/storage/response.hpp @@ -32,6 +32,10 @@ public: optional modified; optional expires; optional etag; + + bool isFresh() const { + return !expires || *expires > util::now(); + } }; class Response::Error { diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp index 15f7779f8..2e7dc06e8 100644 --- a/src/mbgl/map/map.cpp +++ b/src/mbgl/map/map.cpp @@ -67,6 +67,7 @@ public: std::string styleURL; std::string styleJSON; + bool styleMutated = false; std::unique_ptr styleRequest; @@ -293,10 +294,21 @@ void Map::setStyleURL(const std::string& url) { impl->styleRequest = nullptr; impl->styleURL = url; impl->styleJSON.clear(); + impl->styleMutated = false; impl->style = std::make_unique