summaryrefslogtreecommitdiff
path: root/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2018-10-30 14:56:44 +0200
committerPaolo Angelelli <paolo.angelelli@qt.io>2018-10-31 16:40:03 +0000
commitd64e59001884e942de087cdcd1bcef8b8e5f99e0 (patch)
treef712e7a80f401c8dcfb9e7befbbd015a27453eaa /src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp
parent563f6eb62fc614d435bf29337e182d82131b5b87 (diff)
downloadqtlocation-d64e59001884e942de087cdcd1bcef8b8e5f99e0.tar.gz
Mapbox GL: Add mapboxgl.china plugin parameter
Adds support for setting up Mapbox China API base URL + China government-approved styles. Change-Id: I66d9e15f336804466285e0996b0e326ef288be44 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
Diffstat (limited to 'src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp')
-rw-r--r--src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp
index 4614de89..ed36cd5f 100644
--- a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp
+++ b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp
@@ -378,7 +378,7 @@ QString QGeoMapMapboxGL::copyrightsStyleSheet() const
return QStringLiteral("* { vertical-align: middle; font-weight: normal }");
}
-void QGeoMapMapboxGL::setMapboxGLSettings(const QMapboxGLSettings& settings)
+void QGeoMapMapboxGL::setMapboxGLSettings(const QMapboxGLSettings& settings, bool useChinaEndpoint)
{
Q_D(QGeoMapMapboxGL);
@@ -386,8 +386,13 @@ void QGeoMapMapboxGL::setMapboxGLSettings(const QMapboxGLSettings& settings)
// If the access token is not set, use the development access token.
// This will only affect mapbox:// styles.
+ // Mapbox China requires a China-specific access token.
if (d->m_settings.accessToken().isEmpty()) {
- d->m_settings.setAccessToken(developmentToken);
+ if (useChinaEndpoint) {
+ qWarning("Mapbox China requires an access token: https://www.mapbox.com/contact/sales");
+ } else {
+ d->m_settings.setAccessToken(developmentToken);
+ }
}
}