From 68da4de643d616a52990d7c109b33dca14ff61f3 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Thu, 8 Mar 2018 22:22:35 +0200 Subject: main.qml: modify showMap() to not accept location showMap() uses a location to open Google Maps in a browser. Make showMap() a generic function to push the mapPage on the view stack. Update the calls to this function from child widgets and pages. Also either call mapPage.centerOnLocation() or mapPage.centerOnDiveSiteUUID() depending if the caller wants the map to center on a dive site or on map coordinates. Signed-off-by: Lubomir I. Ivanov --- mobile-widgets/qml/main.qml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'mobile-widgets/qml/main.qml') diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml index 31c4d14b7..746c419f1 100644 --- a/mobile-widgets/qml/main.qml +++ b/mobile-widgets/qml/main.qml @@ -67,12 +67,10 @@ Kirigami.ApplicationWindow { diveList.scrollToTop() } - function showMap(location) { - var urlPrefix = "https://www.google.com/maps/place/" - var locationPair = location + "/@" + location - var urlSuffix = ",5000m/data=!3m1!1e3!4m2!3m1!1s0x0:0x0" - Qt.openUrlExternally(urlPrefix + locationPair + urlSuffix) - + function showMap() { + globalDrawer.close() + returnTopPage() + stackView.push(mapPage) } function startAddDive() { -- cgit v1.2.3-70-g09d2