summaryrefslogtreecommitdiff
path: root/src/plugins/geoservices/mapbox/qgeoroutereplymapbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/geoservices/mapbox/qgeoroutereplymapbox.cpp')
-rw-r--r--src/plugins/geoservices/mapbox/qgeoroutereplymapbox.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/geoservices/mapbox/qgeoroutereplymapbox.cpp b/src/plugins/geoservices/mapbox/qgeoroutereplymapbox.cpp
index 8fc3386a..3099657b 100644
--- a/src/plugins/geoservices/mapbox/qgeoroutereplymapbox.cpp
+++ b/src/plugins/geoservices/mapbox/qgeoroutereplymapbox.cpp
@@ -188,7 +188,7 @@ void QGeoRouteReplyMapbox::networkReplyFinished()
QList<QGeoRoute> list;
QJsonArray routes = object.value(QStringLiteral("routes")).toArray();
- for (int i = 0; i < routes.count(); i++) {
+ for (int i = 0; i < qMin(routes.count(), request().numberAlternativeRoutes() + 1); i++) {
QGeoRoute route = constructRoute(routes.at(i).toObject());
list.append(route);
}