From b0dfc0d0ffe72d188cac75561fd178fde7d875a1 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 19 Apr 2020 18:46:40 -0700 Subject: maps: show the dive site when opening Google map I'm not sure if Google used to show the POI marker at the center location in the past or if this is actually a new feature. Either way this appears to do the right thing in my testing. Note that we need a 'plus' to connect the point of interest cooridnates, but a 'comma' to connect the map center coordinates. Reported-by: Chirana Gheorghita Eugeniu Theodor Signed-off-by: Dirk Hohndel --- map-widget/qml/MapWidget.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'map-widget/qml/MapWidget.qml') diff --git a/map-widget/qml/MapWidget.qml b/map-widget/qml/MapWidget.qml index a71ade59c..f028bd1c3 100644 --- a/map-widget/qml/MapWidget.qml +++ b/map-widget/qml/MapWidget.qml @@ -344,11 +344,12 @@ Item { */ function openLocationInGoogleMaps(latitude, longitude) { var loc = latitude + "," + longitude + var poi = latitude + "+" + longitude var x = map.zoomLevel var a = 53864950.831693 var b = -0.60455861606547030630 var zoom = Math.floor(a * Math.exp(b * x)) - var url = "https://www.google.com/maps/place/@" + loc + "," + zoom + "m/data=!3m1!1e3!4m2!3m1!1s0x0:0x0" + var url = "https://www.google.com/maps/place/" + poi + "/@" + loc + "," + zoom + "m/data=!3m1!1e3!4m2!3m1!1s0x0:0x0" Qt.openUrlExternally(url) console.log("openLocationInGoogleMaps() map.zoomLevel: " + x + ", url: " + url) } -- cgit v1.2.3-70-g09d2