Check for v8
This commit is contained in:
committed by
John Firebaugh
parent
e42cfa239f
commit
58d6b84b2b
@@ -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"]);
|
||||
}
|
||||
|
||||
@@ -103,6 +103,8 @@ private:
|
||||
private:
|
||||
std::unordered_map<std::string, const rapidjson::Value *> constants;
|
||||
|
||||
std::uint8_t version;
|
||||
|
||||
std::vector<std::unique_ptr<Source>> sources;
|
||||
std::vector<util::ptr<StyleLayer>> layers;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user