From a1fbffc96c911bccd52a3821444509d08fefeb38 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Sat, 15 Jul 2017 01:26:13 +0300 Subject: mapwidget: add placeholder centerOnDiveSite() public slot This is WIP and would be developed futher, so that the new map widget can center on a divesite location. Signed-off-by: Lubomir I. Ivanov --- desktop-widgets/mapwidget.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'desktop-widgets/mapwidget.cpp') diff --git a/desktop-widgets/mapwidget.cpp b/desktop-widgets/mapwidget.cpp index 2ebc92e0a..92c289051 100644 --- a/desktop-widgets/mapwidget.cpp +++ b/desktop-widgets/mapwidget.cpp @@ -3,6 +3,8 @@ #include #include "mapwidget.h" +#include "core/dive.h" +#include "core/divesite.h" MapWidget *MapWidget::m_instance = NULL; @@ -14,6 +16,17 @@ MapWidget::MapWidget(QWidget *parent) : QQuickWidget(parent) m_rootItem = qobject_cast(rootObject()); } +void MapWidget::centerOnDiveSite(struct dive_site *ds) +{ + if (!dive_site_has_gps_location(ds)) + return; + + qreal longitude = ds->longitude.udeg / 1000000.0; + qreal latitude = ds->latitude.udeg / 1000000.0; + + qDebug() << longitude << latitude; +} + MapWidget::~MapWidget() { m_instance = NULL; -- cgit v1.2.3-70-g09d2