1 From 58197439eade86e7efc6fe98116c0092ea429d29 Mon Sep 17 00:00:00 2001
2 From: Matt Ranostay <matt.ranostay@konsulko.com>
3 Date: Tue, 10 Mar 2020 13:59:58 -0700
4 Subject: [PATCH] mapbox: update API url to match new schema
7 src/plugins/geoservices/mapbox/qgeotilefetchermapbox.cpp | 7 ++++---
8 src/plugins/geoservices/mapbox/qmapboxcommon.h | 2 +-
9 2 files changed, 5 insertions(+), 4 deletions(-)
11 diff --git a/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.cpp b/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.cpp
12 index 0b128556..bd2be6b6 100644
13 --- a/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.cpp
14 +++ b/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.cpp
15 @@ -88,12 +88,13 @@ QGeoTiledMapReply *QGeoTileFetcherMapbox::getTileImage(const QGeoTileSpec &spec)
16 request.setRawHeader("User-Agent", m_userAgent);
18 request.setUrl(QUrl(mapboxTilesApiPath +
19 - ((spec.mapId() >= m_mapIds.size()) ? QStringLiteral("mapbox.streets") : m_mapIds[spec.mapId() - 1]) + QLatin1Char('/') +
20 + m_mapIds[m_mapIds.size() - 1] +
21 + QStringLiteral("/tiles/256/") +
22 QString::number(spec.zoom()) + QLatin1Char('/') +
23 QString::number(spec.x()) + QLatin1Char('/') +
24 QString::number(spec.y()) +
25 - ((m_scaleFactor > 1) ? (QLatin1Char('@') + QString::number(m_scaleFactor) + QLatin1String("x.")) : QLatin1String(".")) +
26 - m_format + QLatin1Char('?') +
27 + ((m_scaleFactor > 1) ? (QLatin1Char('@') + QString::number(m_scaleFactor) + QLatin1String("x")) : QLatin1String("")) +
29 QStringLiteral("access_token=") + m_accessToken));
31 QNetworkReply *reply = m_networkManager->get(request);
32 diff --git a/src/plugins/geoservices/mapbox/qmapboxcommon.h b/src/plugins/geoservices/mapbox/qmapboxcommon.h
33 index e60c4e83..4b2ea98d 100644
34 --- a/src/plugins/geoservices/mapbox/qmapboxcommon.h
35 +++ b/src/plugins/geoservices/mapbox/qmapboxcommon.h
40 -static const QString mapboxTilesApiPath = QStringLiteral("http://api.tiles.mapbox.com/v4/");
41 +static const QString mapboxTilesApiPath = QStringLiteral("https://api.mapbox.com/");
43 // https://www.mapbox.com/api-documentation/#geocoding
44 static const QString mapboxGeocodingApiPath = QStringLiteral("https://api.mapbox.com/geocoding/v5/mapbox.places/");