summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2016-09-14 16:34:01 +0300
committerBruno de Oliveira Abinader <bruno@mapbox.com>2016-09-22 15:23:43 +0300
commitd5679b07be3125f00be8a6bd6a91edc0f5cb7930 (patch)
tree5cd6079fc976a830eb2eefdbd644522bb44d9d0e
parente84b4042dea7e977f722934e4a948ea7824745fe (diff)
downloadqtlocation-mapboxgl-d5679b07be3125f00be8a6bd6a91edc0f5cb7930.tar.gz
[qt] Initial style from MAPBOX_STYLE_URL if set
-rw-r--r--platform/qt/app/mapwindow.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/platform/qt/app/mapwindow.cpp b/platform/qt/app/mapwindow.cpp
index 2a6e55cb2f..e8319365b7 100644
--- a/platform/qt/app/mapwindow.cpp
+++ b/platform/qt/app/mapwindow.cpp
@@ -21,7 +21,13 @@ MapWindow::MapWindow(const QMapboxGLSettings &settings)
// Set default location to Helsinki.
m_map.setCoordinateZoom(QMapbox::Coordinate(60.170448, 24.942046), 14);
- changeStyle();
+ QString styleUrl = qgetenv("MAPBOX_STYLE_URL");
+ if (styleUrl.isEmpty()) {
+ changeStyle();
+ } else {
+ m_map.setStyleUrl(styleUrl);
+ setWindowTitle(QString("Mapbox GL: ") + styleUrl);
+ }
connect(&m_zoomAnimation, SIGNAL(finished()), this, SLOT(animationFinished()));
connect(&m_zoomAnimation, SIGNAL(valueChanged(const QVariant&)), this, SLOT(animationValueChanged()));