diff --git a/platform/glfw/main.cpp b/platform/glfw/main.cpp index 003b019ff..eba3a2bca 100644 --- a/platform/glfw/main.cpp +++ b/platform/glfw/main.cpp @@ -7,6 +7,8 @@ #include #include #include +#include +#include #include #include #include @@ -49,6 +51,8 @@ int main(int argc, char* argv[]) { args::ValueFlag apikeyValue(argumentParser, "key", "API key", {'t', "apikey"}); args::ValueFlag styleValue(argumentParser, "URL", "Map stylesheet", {'s', "style"}); args::ValueFlag cacheDBValue(argumentParser, "file", "Cache database file name", {'c', "cache"}); + args::ValueFlag actionJournalDirValue( + argumentParser, "directory", "Action journal log directory", {"actionJournalDir"}); args::ValueFlag lonValue(argumentParser, "degrees", "Longitude", {'x', "lon"}); args::ValueFlag latValue(argumentParser, "degrees", "Latitude", {'y', "lat"}); args::ValueFlag zoomValue(argumentParser, "number", "Zoom level", {'z', "zoom"}); @@ -128,11 +132,20 @@ int main(int argc, char* argv[]) { GLFWRendererFrontend rendererFrontend{ std::make_unique(view->getRendererBackend(), view->getPixelRatio()), *view}; + // Configure action journal options if directory is specified + mbgl::util::ActionJournalOptions actionJournalOptions; + if (actionJournalDirValue) { + const std::string actionJournalDir = args::get(actionJournalDirValue); + actionJournalOptions.enable(true).withPath(actionJournalDir); + mbgl::Log::Info(mbgl::Event::General, "Action journal enabled. Logs will be written to: " + actionJournalDir); + } + mbgl::Map map(rendererFrontend, *view, mbgl::MapOptions().withSize(view->getSize()).withPixelRatio(view->getPixelRatio()), resourceOptions, - clientOptions); + clientOptions, + actionJournalOptions); backend.setMap(&map); @@ -208,9 +221,8 @@ int main(int argc, char* argv[]) { if (style.empty()) { const char* url = getenv("MLN_STYLE_URL"); if (url == nullptr) { - mbgl::util::DefaultStyle newStyle = orderedStyles[0]; - style = newStyle.getUrl(); - view->setWindowTitle(newStyle.getName()); + style = "https://tiles.openfreemap.org/styles/liberty"; + view->setWindowTitle("OpenFreeMap Liberty"); } else { style = url; view->setWindowTitle(url);