summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2016-09-14 16:33:40 +0300
committerBruno de Oliveira Abinader <bruno@mapbox.com>2016-09-22 15:23:43 +0300
commite84b4042dea7e977f722934e4a948ea7824745fe (patch)
treeeebe82a0d3e7a0453d311765d5b81bed943e0268 /bin
parent8efe31b7e3a9f1c2e05e41dc2381be420e5f3c02 (diff)
downloadqtlocation-mapboxgl-e84b4042dea7e977f722934e4a948ea7824745fe.tar.gz
[glfw] Initial style from MAPBOX_STYLE_URL if set
Diffstat (limited to 'bin')
-rw-r--r--bin/glfw.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/bin/glfw.cpp b/bin/glfw.cpp
index 98fb32075e..142095f8a2 100644
--- a/bin/glfw.cpp
+++ b/bin/glfw.cpp
@@ -148,9 +148,15 @@ int main(int argc, char *argv[]) {
// Load style
if (style.empty()) {
- mbgl::util::default_styles::DefaultStyle newStyle = mbgl::util::default_styles::orderedStyles[0];
- style = newStyle.url;
- view->setWindowTitle(newStyle.name);
+ const char *url = getenv("MAPBOX_STYLE_URL");
+ if (url == nullptr) {
+ mbgl::util::default_styles::DefaultStyle newStyle = mbgl::util::default_styles::orderedStyles[0];
+ style = newStyle.url;
+ view->setWindowTitle(newStyle.name);
+ } else {
+ style = url;
+ view->setWindowTitle(url);
+ }
}
map.setStyleURL(style);