diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-08-18 21:51:49 +0200 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-08-27 14:37:42 +0000 |
commit | a011969f842d662b593e6b33c09dedd90c82de9c (patch) | |
tree | b01b95240e34f58d06d5e3f47a56a107389d399f /src | |
parent | 0a6315b7a2a00d56a101c4a2ea165242d356e024 (diff) | |
download | qtlocation-a011969f842d662b593e6b33c09dedd90c82de9c.tar.gz |
Set the request into QGeoRoute results in osm, mapbox plugins
Change-Id: Iec8d1cb9ad369fe765e34bdcff2512e2726797ad
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/geoservices/mapbox/qgeoroutereplymapbox.cpp | 7 | ||||
-rw-r--r-- | src/plugins/geoservices/osm/qgeoroutereplyosm.cpp | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/geoservices/mapbox/qgeoroutereplymapbox.cpp b/src/plugins/geoservices/mapbox/qgeoroutereplymapbox.cpp index c5f9d38c..8b0772ad 100644 --- a/src/plugins/geoservices/mapbox/qgeoroutereplymapbox.cpp +++ b/src/plugins/geoservices/mapbox/qgeoroutereplymapbox.cpp @@ -127,6 +127,13 @@ void QGeoRouteReplyMapbox::networkReplyFinished() QByteArray routeReply = reply->readAll(); QGeoRouteReply::Error error = parser->parseReply(routes, errorString, routeReply); + // Setting the request into the result + for (QGeoRoute &route : routes) { + route.setRequest(request()); + for (QGeoRoute &leg: route.routeLegs()) { + leg.setRequest(request()); + } + } QVariantMap metadata; metadata["osrm.reply-json"] = routeReply; diff --git a/src/plugins/geoservices/osm/qgeoroutereplyosm.cpp b/src/plugins/geoservices/osm/qgeoroutereplyosm.cpp index 732e8d72..af2a03b1 100644 --- a/src/plugins/geoservices/osm/qgeoroutereplyosm.cpp +++ b/src/plugins/geoservices/osm/qgeoroutereplyosm.cpp @@ -75,6 +75,13 @@ void QGeoRouteReplyOsm::networkReplyFinished() QList<QGeoRoute> routes; QString errorString; QGeoRouteReply::Error error = parser->parseReply(routes, errorString, reply->readAll()); + // Setting the request into the result + for (QGeoRoute &route : routes) { + route.setRequest(request()); + for (QGeoRoute &leg: route.routeLegs()) { + leg.setRequest(request()); + } + } if (error == QGeoRouteReply::NoError) { setRoutes(routes.mid(0, request().numberAlternativeRoutes() + 1)); |