diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-12-26 13:22:50 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-12-26 13:33:11 -0800 |
commit | bf239e7c428c1407147b4e380655c08560e5a56d (patch) | |
tree | 20947b8d229c91f1e80e31697fc3a88b728c2619 /qt-mobile/qmlmanager.cpp | |
parent | 7ffe7a8c8a389fd56cba3c18d142bf1ad59d872c (diff) | |
download | subsurface-bf239e7c428c1407147b4e380655c08560e5a56d.tar.gz |
QML-UI: add hacky, useless way to show the GPS location of a dive
This is of course stupid and NOT what we want to do, but one could argue it's
better than nothing (well, not sure, whatever). If we have a GPS location
associated with a dive and you tap on the location name when showing the dive
details, it opens a static image of a satellite map with a marker for the dive
site.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile/qmlmanager.cpp')
-rw-r--r-- | qt-mobile/qmlmanager.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp index 6ad52c419..0897dcff8 100644 --- a/qt-mobile/qmlmanager.cpp +++ b/qt-mobile/qmlmanager.cpp @@ -4,6 +4,7 @@ #include <QDebug> #include <QNetworkAccessManager> #include <QAuthenticator> +#include <QDesktopServices> #include "qt-models/divelistmodel.h" #include "divelist.h" @@ -467,3 +468,12 @@ void QMLManager::setStartPageText(QString text) m_startPageText = text; emit startPageTextChanged(); } + +void QMLManager::showMap(QString location) +{ + if (!location.isEmpty()) { + QString link = QString("https://maps.googleapis.com/maps/api/staticmap?center=%1&zoom=15&size=600x400&maptype=satellite&markers=color:red|%2") + .arg(location).arg(location); + QDesktopServices::openUrl(link); + } +} |