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
url.setScheme(QStringLiteral("https"));
url.setHost(QStringLiteral("www.openstreetmap.org"));
url.setPath(QStringLiteral("/directions"));
const QString fragment = QLatin1String("route=") + QString::number(from.coordinate().latitude())
+ QLatin1Char(',') + QString::number(from.coordinate().longitude())
+ QLatin1Char(',') + QString::number(geo.latitude())
+ QLatin1Char(',') + QString::number(geo.longitude());
url.setFragment(fragment);
QUrlQuery query;
query.addQueryItem(QLatin1String("route"),
QString::number(from.coordinate().latitude()) + QLatin1Char(',') + QString::number(from.coordinate().longitude())
+ QLatin1Char(';') + QString::number(geo.latitude()) + QLatin1Char(',') + QString::number(geo.longitude()));
url.setQuery(query);
QDesktopServices::openUrl(url);
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