#ifndef MBGL_STYLE_STYLE_PARSER #define MBGL_STYLE_STYLE_PARSER #include #include #include #include #include #include #include #include namespace mbgl { class StyleLayer; class Source; class StyleParser { public: ~StyleParser(); void parse(const std::string&); std::string spriteURL; std::string glyphURL; std::vector> sources; std::vector> layers; static std::unique_ptr parseTileJSON(const std::string& json, const std::string& sourceURL, SourceType); static std::unique_ptr parseTileJSON(const JSValue&); static std::unique_ptr parseGeoJSON(const JSValue&); private: void parseSources(const JSValue&); void parseLayers(const JSValue&); void parseLayer(const std::string& id, const JSValue&, std::unique_ptr&); void parseVisibility(StyleLayer&, const JSValue& 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