From b4740803a1b71d27146df0b13460c222cf2e2ca8 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Wed, 19 Jul 2017 03:06:40 +0300 Subject: mapwidgethelper: pass a MapLocation object to QML in centerOnDiveSite() The function in QML centerOnCoordinate() is now renamed centerOnMapLocation() and accepts a MapLocation object, so that a marker is selected (based on UUID). In MapWidgetHelper::centerOnDiveSite(), the pointer to a MapLocation is retrieved via MapLocationModel::getMapLocationForUuid(). Added in the previous commit. Signed-off-by: Lubomir I. Ivanov --- mobile-widgets/qml/MapWidget.qml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mobile-widgets/qml') diff --git a/mobile-widgets/qml/MapWidget.qml b/mobile-widgets/qml/MapWidget.qml index 7249ed632..ddfd2938c 100644 --- a/mobile-widgets/qml/MapWidget.qml +++ b/mobile-widgets/qml/MapWidget.qml @@ -70,10 +70,11 @@ Item { } } - function centerOnCoordinate(coordinate) { - map.newCenter = coordinate; + function centerOnMapLocation(mapLocation) { + map.newCenter = mapLocation.coordinate; map.zoomLevel = 2; mapAnimation.restart(); + mapHelper.model.selectedUuid = mapLocation.uuid; } } } -- cgit v1.2.3-70-g09d2