From 5f2e60142a1c8717a612744ab82f7f8f5c6a3713 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Mon, 17 Jul 2017 00:25:19 +0300 Subject: mapwidget.qml: add the function centerOnCoordinates() This function can be called to center the map on a specific coordinates. For the C++ version call it via QMetaObject::invokeMethod() in centerOnDiveSite(). TODO: add QML property animations. Signed-off-by: Lubomir I. Ivanov --- mobile-widgets/qmlmapwidgethelper.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mobile-widgets/qmlmapwidgethelper.cpp') diff --git a/mobile-widgets/qmlmapwidgethelper.cpp b/mobile-widgets/qmlmapwidgethelper.cpp index d308afa40..2bd27fce8 100644 --- a/mobile-widgets/qmlmapwidgethelper.cpp +++ b/mobile-widgets/qmlmapwidgethelper.cpp @@ -15,4 +15,8 @@ void MapWidgetHelper::centerOnDiveSite(struct dive_site *ds) qreal longitude = ds->longitude.udeg / 1000000.0; qreal latitude = ds->latitude.udeg / 1000000.0; + + QMetaObject::invokeMethod(m_map, "centerOnCoordinates", + Q_ARG(QVariant, latitude), + Q_ARG(QVariant, longitude)); } -- cgit v1.2.3-70-g09d2