summaryrefslogtreecommitdiffstats
path: root/meta-agl-profile-graphical-qt5
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2020-03-10 23:03:47 +0200
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2020-03-11 21:48:39 +0000
commit220daa496a9030dc843c8b5fcc5b96568ea4a3b1 (patch)
treefd37635b9fa5e566beeb7f09fc25ec88c6368ebd /meta-agl-profile-graphical-qt5
parent919986e707f125da355e4b83c7d7635388e85a32 (diff)
qtlocation: add Mapbox patch to use new API
On June 1st the Mapbox Studio Classic API will be disabled, and thus the current QtLocation plugin needs to be updated to allow access to the new API Bug-AGL: SPEC-3264 Change-Id: I3799de4886b83d896d10b2ee97d15f604875b97e Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'meta-agl-profile-graphical-qt5')
-rw-r--r--meta-agl-profile-graphical-qt5/recipes-qt/qt5/qtlocation/0001-mapbox-update-API-url-to-match-new-schema.patch47
-rw-r--r--meta-agl-profile-graphical-qt5/recipes-qt/qt5/qtlocation_%.bbappend6
2 files changed, 53 insertions, 0 deletions
diff --git a/meta-agl-profile-graphical-qt5/recipes-qt/qt5/qtlocation/0001-mapbox-update-API-url-to-match-new-schema.patch b/meta-agl-profile-graphical-qt5/recipes-qt/qt5/qtlocation/0001-mapbox-update-API-url-to-match-new-schema.patch
new file mode 100644
index 000000000..350daaee6
--- /dev/null
+++ b/meta-agl-profile-graphical-qt5/recipes-qt/qt5/qtlocation/0001-mapbox-update-API-url-to-match-new-schema.patch
@@ -0,0 +1,47 @@
+From 58197439eade86e7efc6fe98116c0092ea429d29 Mon Sep 17 00:00:00 2001
+From: Matt Ranostay <matt.ranostay@konsulko.com>
+Date: Tue, 10 Mar 2020 13:59:58 -0700
+Subject: [PATCH] mapbox: update API url to match new schema
+
+---
+ src/plugins/geoservices/mapbox/qgeotilefetchermapbox.cpp | 7 ++++---
+ src/plugins/geoservices/mapbox/qmapboxcommon.h | 2 +-
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.cpp b/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.cpp
+index 0b128556..bd2be6b6 100644
+--- a/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.cpp
++++ b/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.cpp
+@@ -88,12 +88,13 @@ QGeoTiledMapReply *QGeoTileFetcherMapbox::getTileImage(const QGeoTileSpec &spec)
+ request.setRawHeader("User-Agent", m_userAgent);
+
+ request.setUrl(QUrl(mapboxTilesApiPath +
+- ((spec.mapId() >= m_mapIds.size()) ? QStringLiteral("mapbox.streets") : m_mapIds[spec.mapId() - 1]) + QLatin1Char('/') +
++ m_mapIds[m_mapIds.size() - 1] +
++ QStringLiteral("/tiles/") +
+ QString::number(spec.zoom()) + QLatin1Char('/') +
+ QString::number(spec.x()) + QLatin1Char('/') +
+ QString::number(spec.y()) +
+- ((m_scaleFactor > 1) ? (QLatin1Char('@') + QString::number(m_scaleFactor) + QLatin1String("x.")) : QLatin1String(".")) +
+- m_format + QLatin1Char('?') +
++ ((m_scaleFactor > 1) ? (QLatin1Char('@') + QString::number(m_scaleFactor) + QLatin1String("x")) : QLatin1String("")) +
++ QLatin1Char('?') +
+ QStringLiteral("access_token=") + m_accessToken));
+
+ QNetworkReply *reply = m_networkManager->get(request);
+diff --git a/src/plugins/geoservices/mapbox/qmapboxcommon.h b/src/plugins/geoservices/mapbox/qmapboxcommon.h
+index e60c4e83..4b2ea98d 100644
+--- a/src/plugins/geoservices/mapbox/qmapboxcommon.h
++++ b/src/plugins/geoservices/mapbox/qmapboxcommon.h
+@@ -46,7 +46,7 @@
+
+ QT_BEGIN_NAMESPACE
+
+-static const QString mapboxTilesApiPath = QStringLiteral("http://api.tiles.mapbox.com/v4/");
++static const QString mapboxTilesApiPath = QStringLiteral("https://api.mapbox.com/");
+
+ // https://www.mapbox.com/api-documentation/#geocoding
+ static const QString mapboxGeocodingApiPath = QStringLiteral("https://api.mapbox.com/geocoding/v5/mapbox.places/");
+--
+2.25.0
+
diff --git a/meta-agl-profile-graphical-qt5/recipes-qt/qt5/qtlocation_%.bbappend b/meta-agl-profile-graphical-qt5/recipes-qt/qt5/qtlocation_%.bbappend
index 115cea131..bcda6a1e5 100644
--- a/meta-agl-profile-graphical-qt5/recipes-qt/qt5/qtlocation_%.bbappend
+++ b/meta-agl-profile-graphical-qt5/recipes-qt/qt5/qtlocation_%.bbappend
@@ -1,3 +1,9 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "\
+ file://0001-mapbox-update-API-url-to-match-new-schema.patch \
+ "
+
# Need to explicitly enable the various plugins
PACKAGECONFIG += " \
geoservices_osm \