diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2014-08-08 18:25:45 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2014-08-08 18:25:45 +0200 |
commit | 4657e6e02314a0f3cfa545b37376a4cedb14484c (patch) | |
tree | 0b837eddef4a92fcd85c2e48df510c8a51e7b78f /linux/main.cpp | |
parent | a045d9c9d4e7040b699f1fbab88893440969ffe9 (diff) | |
download | qtlocation-mapboxgl-4657e6e02314a0f3cfa545b37376a4cedb14484c.tar.gz |
use a file source object to abstract loading of resources
Diffstat (limited to 'linux/main.cpp')
-rw-r--r-- | linux/main.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/linux/main.cpp b/linux/main.cpp index d51d2c8846..392b9fb666 100644 --- a/linux/main.cpp +++ b/linux/main.cpp @@ -45,15 +45,6 @@ int main(int argc, char *argv[]) { sigIntHandler.sa_flags = 0; sigaction(SIGINT, &sigIntHandler, NULL); - // read default stylesheet from disk - std::ifstream stylefile("./style.min.js"); - if (!stylefile.good()) { - fprintf(stderr, "Cannot read style file\n"); - return 1; - } - std::stringstream stylejson; - stylejson << stylefile.rdbuf(); - view = new GLFWView(); mbgl::Map map(*view); @@ -72,7 +63,10 @@ int main(int argc, char *argv[]) { } // Load style - map.setStyleJSON(stylejson.str()); + std::string style = "file://"; + style += uv::cwd(); + style += "/styles/bright/style.json"; + map.setStyleURL(style); int ret = view->run(); |