summaryrefslogtreecommitdiff
path: root/bin/render.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'bin/render.cpp')
-rw-r--r--bin/render.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/bin/render.cpp b/bin/render.cpp
index 87a1e670b9..a805953693 100644
--- a/bin/render.cpp
+++ b/bin/render.cpp
@@ -6,10 +6,9 @@
#include <mbgl/gl/headless_frontend.hpp>
#include <mbgl/util/default_thread_pool.hpp>
-#include <mbgl/storage/default_file_source.hpp>
#include <mbgl/style/style.hpp>
-#include <args/args.hxx>
+#include <args.hxx>
#include <cstdlib>
#include <iostream>
@@ -76,17 +75,12 @@ int main(int argc, char *argv[]) {
using namespace mbgl;
util::RunLoop loop;
- DefaultFileSource fileSource(cache_file, asset_root);
-
- // Set access token if present
- if (token.size()) {
- fileSource.setAccessToken(std::string(token));
- }
ThreadPool threadPool(4);
HeadlessFrontend frontend({ width, height }, pixelRatio, threadPool);
- Map map(frontend, MapObserver::nullObserver(), frontend.getSize(), pixelRatio,
- fileSource, threadPool, MapOptions().withMapMode(MapMode::Static));
+ Map map(frontend, MapObserver::nullObserver(), threadPool,
+ MapOptions().withMapMode(MapMode::Static).withSize(frontend.getSize()).withPixelRatio(pixelRatio),
+ ResourceOptions().withCachePath(cache_file).withAssetPath(asset_root).withAccessToken(std::string(token)));
if (style.find("://") == std::string::npos) {
style = std::string("file://") + style;