diff options
Diffstat (limited to 'mobile-widgets/qml')
-rw-r--r-- | mobile-widgets/qml/DiveDetails.qml | 2 | ||||
-rw-r--r-- | mobile-widgets/qml/DiveDetailsView.qml | 4 | ||||
-rw-r--r-- | mobile-widgets/qml/MapPage.qml | 12 |
3 files changed, 9 insertions, 9 deletions
diff --git a/mobile-widgets/qml/DiveDetails.qml b/mobile-widgets/qml/DiveDetails.qml index ea236dfaf..fbffa5303 100644 --- a/mobile-widgets/qml/DiveDetails.qml +++ b/mobile-widgets/qml/DiveDetails.qml @@ -180,7 +180,7 @@ Kirigami.Page { } onTriggered: { showMap() - mapPage.centerOnDiveSiteUUID(currentItem.modelData.dive.dive_site_uuid) + mapPage.centerOnDiveSite(currentItem.modelData.dive.dive_site) } } diff --git a/mobile-widgets/qml/DiveDetailsView.qml b/mobile-widgets/qml/DiveDetailsView.qml index f80e4ce78..1060f5246 100644 --- a/mobile-widgets/qml/DiveDetailsView.qml +++ b/mobile-widgets/qml/DiveDetailsView.qml @@ -52,7 +52,7 @@ Item { enabled: dive.gps_decimal !== "" onClicked: { showMap() - mapPage.centerOnDiveSiteUUID(dive.dive_site_uuid) + mapPage.centerOnDiveSite(dive.dive_site) } } } @@ -63,7 +63,7 @@ Item { text: qsTr("Map it") onClicked: { showMap() - mapPage.centerOnDiveSiteUUID(dive.dive_site_uuid) + mapPage.centerOnDiveSite(dive.dive_site) } } Row { diff --git a/mobile-widgets/qml/MapPage.qml b/mobile-widgets/qml/MapPage.qml index 9497ca7fc..f000c2020 100644 --- a/mobile-widgets/qml/MapPage.qml +++ b/mobile-widgets/qml/MapPage.qml @@ -40,19 +40,19 @@ Kirigami.Page { mapWidget.mapHelper.reloadMapLocations() } - function centerOnDiveSiteUUID(uuid) { - if (!uuid) { - console.warn("main.qml: centerOnDiveSiteUUI(): uuid is undefined!") + function centerOnDiveSite(ds) { + if (!ds) { + console.warn("main.qml: centerOnDiveSite(): dive site is undefined!") return } // on firstRun, hard pan/center the map to the desired location so that // we don't start at an arbitrary location such as [0,0] or London. if (firstRun) { - var coord = mapWidget.mapHelper.getCoordinatesForUUID(uuid) + var coord = mapWidget.mapHelper.getCoordinates(ds) centerOnLocationHard(coord.latitude, coord.longitude) firstRun = false - } // continue here as centerOnDiveSiteUUID() also does marker selection. - mapWidget.mapHelper.centerOnDiveSiteUUID(uuid) + } // continue here as centerOnDiveSite() also does marker selection. + mapWidget.mapHelper.centerOnDiveSite(ds) } function centerOnLocation(lat, lon) { |