diff options
author | Young Hahn <young@mapbox.com> | 2014-06-01 13:50:32 -0400 |
---|---|---|
committer | Young Hahn <young@mapbox.com> | 2014-06-01 13:50:32 -0400 |
commit | 04610023deab950a2bbca9d5f04129d981c5d6b2 (patch) | |
tree | 0497b52f8ccd0704bbd6537a0cf5bd9cb031be94 /linux | |
parent | 705ddf68a5957a84c0e96beaf5a6e25b1166dc74 (diff) | |
download | qtlocation-mapboxgl-04610023deab950a2bbca9d5f04129d981c5d6b2.tar.gz |
Load stylesheet from disk.
Diffstat (limited to 'linux')
-rw-r--r-- | linux/main.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/linux/main.cpp b/linux/main.cpp index 2c7440c876..f796a23515 100644 --- a/linux/main.cpp +++ b/linux/main.cpp @@ -3,6 +3,8 @@ #include <signal.h> #include <getopt.h> +#include <fstream> +#include <sstream> #include "../common/settings_json.hpp" #include "../common/glfw_view.hpp" @@ -40,6 +42,11 @@ int main(int argc, char *argv[]) { sigIntHandler.sa_flags = 0; sigaction(SIGINT, &sigIntHandler, NULL); + // read default stylesheet from disk + std::ifstream stylefile("./build/Release/style.min.js"); + std::stringstream stylejson; + stylejson << stylefile.rdbuf(); + view = new GLFWView(); llmr::Map map(*view); @@ -49,6 +56,9 @@ int main(int argc, char *argv[]) { map.setAngle(settings.angle); map.setDebug(settings.debug); + // Load style + map.setStyleJSON(stylejson.str()); + int ret = view->run(); // Save settings |