Commit a2d556f2 authored by Volker Krause's avatar Volker Krause

Fix OSM navigation URL

parent a077002e
...@@ -187,11 +187,11 @@ void ApplicationController::navigateTo(const QGeoPositionInfo &from, const QVari ...@@ -187,11 +187,11 @@ void ApplicationController::navigateTo(const QGeoPositionInfo &from, const QVari
url.setScheme(QStringLiteral("https")); url.setScheme(QStringLiteral("https"));
url.setHost(QStringLiteral("www.openstreetmap.org")); url.setHost(QStringLiteral("www.openstreetmap.org"));
url.setPath(QStringLiteral("/directions")); url.setPath(QStringLiteral("/directions"));
const QString fragment = QLatin1String("route=") + QString::number(from.coordinate().latitude()) QUrlQuery query;
+ QLatin1Char(',') + QString::number(from.coordinate().longitude()) query.addQueryItem(QLatin1String("route"),
+ QLatin1Char(',') + QString::number(geo.latitude()) QString::number(from.coordinate().latitude()) + QLatin1Char(',') + QString::number(from.coordinate().longitude())
+ QLatin1Char(',') + QString::number(geo.longitude()); + QLatin1Char(';') + QString::number(geo.latitude()) + QLatin1Char(',') + QString::number(geo.longitude()));
url.setFragment(fragment); url.setQuery(query);
QDesktopServices::openUrl(url); QDesktopServices::openUrl(url);
return; return;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment