From 6be56ff9c25a8b5c6710f2be51f9cf96f2a38974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Tue, 6 Dec 2016 14:45:34 +0100 Subject: [render] allow passing URLs to mbgl-render --- bin/render.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/render.cpp b/bin/render.cpp index 12ad1626ce..d275b445d2 100644 --- a/bin/render.cpp +++ b/bin/render.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunknown-pragmas" @@ -65,8 +66,6 @@ int main(int argc, char *argv[]) { exit(1); } - std::string style = mbgl::util::read_file(style_path); - using namespace mbgl; util::RunLoop loop; @@ -90,7 +89,12 @@ int main(int argc, char *argv[]) { ThreadPool threadPool(4); Map map(backend, mbgl::Size { width, height }, pixelRatio, fileSource, threadPool, MapMode::Still); - map.setStyleJSON(style); + if (util::isURL(style_path)) { + map.setStyleURL(style_path); + } else { + map.setStyleJSON(mbgl::util::read_file(style_path)); + } + map.setClasses(classes); map.setLatLngZoom({ lat, lon }, zoom); -- cgit v1.2.1