summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-08-08 18:25:45 +0200
committerKonstantin Käfer <mail@kkaefer.com>2014-08-08 18:25:45 +0200
commit4657e6e02314a0f3cfa545b37376a4cedb14484c (patch)
tree0b837eddef4a92fcd85c2e48df510c8a51e7b78f /linux
parenta045d9c9d4e7040b699f1fbab88893440969ffe9 (diff)
downloadqtlocation-mapboxgl-4657e6e02314a0f3cfa545b37376a4cedb14484c.tar.gz
use a file source object to abstract loading of resources
Diffstat (limited to 'linux')
-rw-r--r--linux/main.cpp14
-rw-r--r--linux/mapboxgl-app.gyp2
2 files changed, 5 insertions, 11 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();
diff --git a/linux/mapboxgl-app.gyp b/linux/mapboxgl-app.gyp
index 1d09b5444b..7b703ed75c 100644
--- a/linux/mapboxgl-app.gyp
+++ b/linux/mapboxgl-app.gyp
@@ -53,7 +53,7 @@
],
'dependencies': [
'../mapboxgl.gyp:mapboxgl',
- '../mapboxgl.gyp:copy_default_stylesheet',
+ '../mapboxgl.gyp:copy_styles',
'../mapboxgl.gyp:copy_certificate_bundle',
],
},