diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2016-09-14 16:33:40 +0300 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2016-09-22 15:23:43 +0300 |
commit | e84b4042dea7e977f722934e4a948ea7824745fe (patch) | |
tree | eebe82a0d3e7a0453d311765d5b81bed943e0268 /bin | |
parent | 8efe31b7e3a9f1c2e05e41dc2381be420e5f3c02 (diff) | |
download | qtlocation-mapboxgl-e84b4042dea7e977f722934e4a948ea7824745fe.tar.gz |
[glfw] Initial style from MAPBOX_STYLE_URL if set
Diffstat (limited to 'bin')
-rw-r--r-- | bin/glfw.cpp | 12 |
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); |