diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2015-01-29 18:30:46 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2015-02-04 10:49:09 +0100 |
commit | 29baacf3a5bb773d94d08d16b81c3cda45a44eb6 (patch) | |
tree | 1dc3ca456151138ee5e8b7cf88b3afcecc3df1db /bin/render.cpp | |
parent | 3d51e116a84ee168975bcee8377e9156f77e2731 (diff) | |
download | qtlocation-mapboxgl-29baacf3a5bb773d94d08d16b81c3cda45a44eb6.tar.gz |
refactor makefile
Diffstat (limited to 'bin/render.cpp')
-rw-r--r-- | bin/render.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/bin/render.cpp b/bin/render.cpp index ba17498c88..827f247d6c 100644 --- a/bin/render.cpp +++ b/bin/render.cpp @@ -9,7 +9,8 @@ #include <mbgl/platform/default/headless_view.hpp> #include <mbgl/platform/default/headless_display.hpp> -#include <mbgl/storage/caching_http_file_source.hpp> +#include <mbgl/storage/default_file_source.hpp> +#include <mbgl/storage/default/sqlite_cache.hpp> #if __APPLE__ #include <mbgl/platform/darwin/log_nslog.hpp> @@ -35,7 +36,7 @@ int main(int argc, char *argv[]) { int height = 256; double pixelRatio = 1.0; std::string output = "out.png"; - std::string cache = "cache.sqlite"; + std::string cache_file = "cache.sqlite"; std::vector<std::string> classes; std::string token; @@ -51,7 +52,7 @@ int main(int argc, char *argv[]) { ("class,c", po::value(&classes)->value_name("name"), "Class name") ("token,t", po::value(&token)->value_name("key")->default_value(token), "Mapbox access token") ("output,o", po::value(&output)->value_name("file")->default_value(output), "Output file name") - ("cache,d", po::value(&cache)->value_name("file")->default_value(cache), "Cache database file name") + ("cache,d", po::value(&cache_file)->value_name("file")->default_value(cache_file), "Cache database file name") ; try { @@ -74,7 +75,8 @@ int main(int argc, char *argv[]) { Log::Set<StderrLogBackend>(); #endif - CachingHTTPFileSource fileSource(cache); + mbgl::SQLiteCache cache(cache_file); + mbgl::DefaultFileSource fileSource(&cache); // Try to load the token from the environment. if (!token.size()) { @@ -84,14 +86,15 @@ int main(int argc, char *argv[]) { } } - // Set access token if present - if (token.size()) { - fileSource.setAccessToken(std::string(token)); - } HeadlessView view; Map map(view, fileSource); + // Set access token if present + if (token.size()) { + map.setAccessToken(std::string(token)); + } + map.setStyleJSON(style, "."); map.setClasses(classes); |