diff --git a/src/mbgl/style/style_parser.cpp b/src/mbgl/style/style_parser.cpp index 4767bdafa..fb834c02b 100644 --- a/src/mbgl/style/style_parser.cpp +++ b/src/mbgl/style/style_parser.cpp @@ -27,6 +27,13 @@ StyleParser::StyleParser(MapData& data_) } void StyleParser::parse(JSVal document) { + if (document.HasMember("version")) { + version = document["version"].GetInt(); + if (version != 8) { + Log::Warning(Event::ParseStyle, "current renderer implementation only supports style spec version 8; using an outdated style will cause rendering errors"); + } + } + if (document.HasMember("constants")) { parseConstants(document["constants"]); } diff --git a/src/mbgl/style/style_parser.hpp b/src/mbgl/style/style_parser.hpp index 5f0c509eb..508db5bd3 100644 --- a/src/mbgl/style/style_parser.hpp +++ b/src/mbgl/style/style_parser.hpp @@ -103,6 +103,8 @@ private: private: std::unordered_map constants; + std::uint8_t version; + std::vector> sources; std::vector> layers;