Commit acf7678c authored by Volker Krause's avatar Volker Krause
Browse files

Add action to open the current location on wheelmap.org

That has a lot more accessibility information than we currently show on
our indoor map.
parent 9dd46f6b
......@@ -110,6 +110,11 @@ Kirigami.Page {
text: i18n("Open Map");
onTriggered: NavigationController.showOnMap(map.mapData.center.y, map.mapData.center.x, 18);
},
Kirigami.Action {
text: i18n("Open wheelmap.org");
onTriggered: NavigationController.showOnWheelmap(map.mapData.center.y, map.mapData.center.x);
},
Kirigami.Action {
id: lightStyleAction
text: "Light Style"
......
......@@ -106,6 +106,18 @@ void NavigationController::showOnMap(float latitude, float longitude, int zoom)
QDesktopServices::openUrl(url);
}
void NavigationController::showOnWheelmap(float latitude, float longitude)
{
QUrl url;
url.setScheme(QStringLiteral("https"));
url.setHost(QStringLiteral("wheelmap.org"));
QUrlQuery query;
query.addQueryItem(QStringLiteral("lat"), QString::number(latitude));
query.addQueryItem(QStringLiteral("lon"), QString::number(longitude));
url.setQuery(query);
QDesktopServices::openUrl(url);
}
bool NavigationController::canNavigateTo(const QVariant& place)
{
if (place.isNull()) {
......
......@@ -20,6 +20,7 @@ class NavigationController
public:
Q_INVOKABLE void showOnMap(const QVariant &place);
Q_INVOKABLE void showOnMap(float latitude, float longitude, int zoom);
Q_INVOKABLE void showOnWheelmap(float latitude, float longitude);
Q_INVOKABLE bool canNavigateTo(const QVariant &place);
Q_INVOKABLE void navigateTo(const QVariant &place);
......
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