From b0dfc0d0ffe72d188cac75561fd178fde7d875a1 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 19 Apr 2020 18:46:40 -0700 Subject: [PATCH] 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 --- CHANGELOG.md | 1 + map-widget/qml/MapWidget.qml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d37eb805e..fb4c4cfd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +maps: show the dive site as marker when opening Google Maps Mobile: fix false rejection of Subsurface cloud SSL certificate Mobile: fix misdetection of Shearwater Petrel 2 on iOS Desktop: fix creation of new cylinder types (names couldn't be the start of already existing names) 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) }