From 68e032e505e23811aec1f6079995709b3d2b9700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Tue, 21 Mar 2017 14:41:08 +0100 Subject: [core] Remove private header includes from CLI utilities --- bin/offline.cpp | 1 - bin/render.cpp | 15 ++++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'bin') diff --git a/bin/offline.cpp b/bin/offline.cpp index 502561d0a1..ec2fb09096 100644 --- a/bin/offline.cpp +++ b/bin/offline.cpp @@ -1,7 +1,6 @@ #include #include #include -#include #include diff --git a/bin/render.cpp b/bin/render.cpp index d4090cfa9f..0af933475a 100644 --- a/bin/render.cpp +++ b/bin/render.cpp @@ -1,14 +1,12 @@ #include #include #include -#include #include #include #include #include #include -#include #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunknown-pragmas" @@ -21,6 +19,7 @@ namespace po = boost::program_options; #include #include +#include int main(int argc, char *argv[]) { std::string style_path; @@ -91,12 +90,12 @@ int main(int argc, char *argv[]) { ThreadPool threadPool(4); Map map(backend, mbgl::Size { width, height }, pixelRatio, fileSource, threadPool, MapMode::Still); - if (util::isURL(style_path)) { - map.setStyleURL(style_path); - } else { - map.setStyleJSON(mbgl::util::read_file(style_path)); + if (style_path.find("://") == std::string::npos) { + style_path = std::string("file://") + style_path; } + map.setStyleURL(style_path); + map.setClasses(classes); map.setLatLngZoom({ lat, lon }, zoom); @@ -117,7 +116,9 @@ int main(int argc, char *argv[]) { exit(1); } - util::write_file(output, encodePNG(view.readStillImage())); + std::ofstream out(output, std::ios::binary); + out << encodePNG(view.readStillImage()); + out.close(); loop.stop(); }); -- cgit v1.2.1