#ifndef MBGL_STYLE_STYLE_PARSER #define MBGL_STYLE_STYLE_PARSER #include #include #include #include #include #include #include #include namespace mbgl { class StyleLayer; class Source; using JSVal = rapidjson::Value; class StyleParser { public: ~StyleParser(); void parse(const JSVal&); std::string spriteURL; std::string glyphURL; std::vector> sources; std::vector> layers; private: void parseSources(const JSVal&); void parseLayers(const JSVal&); void parseLayer(const std::string& id, const JSVal&, std::unique_ptr&); void parseVisibility(StyleLayer&, const JSVal& value); std::unordered_map sourcesMap; std::unordered_map>> layersMap; // Store a stack of layer IDs we're parsing right now. This is to prevent reference cycles. std::forward_list stack; }; } // namespace mbgl #endif