diff options
author | Lauren Budorick <lauren@mapbox.com> | 2014-08-18 17:49:50 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2014-08-21 16:12:27 -0700 |
commit | 0168612ed311cf71802575aa3fb886edf2ca62fe (patch) | |
tree | 9aa6a9c9db002c67bdda1650610ae5106404607b /include/mbgl/style | |
parent | b9c7e1bdd99b4c6d37672ef34ffe178d4bc54ad3 (diff) | |
download | qtlocation-mapboxgl-0168612ed311cf71802575aa3fb886edf2ca62fe.tar.gz |
Load TileJSON; support inline TileJSON sources
Fixes #412
Refs https://github.com/mapbox/mapbox-gl-style-spec/pull/143
Diffstat (limited to 'include/mbgl/style')
-rw-r--r-- | include/mbgl/style/style_source.hpp | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/include/mbgl/style/style_source.hpp b/include/mbgl/style/style_source.hpp index fa5c8dfb34..b598550c65 100644 --- a/include/mbgl/style/style_source.hpp +++ b/include/mbgl/style/style_source.hpp @@ -4,6 +4,10 @@ #include <mbgl/style/types.hpp> #include <memory> +#include <vector> +#include <string> + +#include <rapidjson/document.h> namespace mbgl { @@ -11,27 +15,32 @@ class Source; class SourceInfo { public: - const SourceType type; - const std::string url; - const uint32_t tile_size; - const int32_t min_zoom; - const int32_t max_zoom; - - SourceInfo(SourceType type = SourceType::Vector, const std::string &url = "", - uint32_t tile_size = 512, int32_t min_zoom = 0, int32_t max_zoom = 22) - : type(type), url(url), tile_size(tile_size), min_zoom(min_zoom), max_zoom(max_zoom) {} + SourceType type = SourceType::Vector; + std::string url; + std::vector<std::string> tiles; + uint16_t tile_size = 512; + uint16_t min_zoom = 0; + uint16_t max_zoom = 22; + std::string attribution; + std::array<float, 3> center = {{0, 0, 0}}; + std::array<float, 4> bounds = {{-180, -90, 180, 90}}; + + void parseTileJSONProperties(const rapidjson::Value&); }; -class StyleSource { +class StyleSource : public std::enable_shared_from_this<StyleSource> { public: - const SourceInfo info; + SourceInfo info; bool enabled = false; std::shared_ptr<Source> source; - StyleSource(const SourceInfo &info) : info(info) {} + StyleSource(const SourceInfo &info) + : info(info) + {} }; + } #endif |