summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);