Where is Google maps navigation going?

Post your questions and help other users.

Moderator: Martin

Micky Micky
Posts: 179
Joined: 16 Oct 2019 17:38

Where is Google maps navigation going?

Post by Micky Micky » 16 Oct 2019 20:20

Hello,

Is there a way of detecting the destination after the navigation has started?

Thanks
Crude but it works.

Micky Micky
Posts: 179
Joined: 16 Oct 2019 17:38

Re: Where is Google maps navigation going?

Post by Micky Micky » 19 Oct 2019 09:27

I searched the web and found nothing.
So I devised this crude solution.

Google navigation posts a notification on the status bar.
The following script extracts the destination.

trim = replace(notification_text, content_title, "");
trim = replace(trim, notification_sub_text, "");
trimlength = length(trim);
trimmed = left(trim, trimlength-12);

I'd still prefer the latitude and longitude.
Crude but it works.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Where is Google maps navigation going?

Post by Desmanto » 03 Nov 2019 17:00

I have tried several times, the most you can get is the location name from the navigation notification. We can geocoding to get the lat long, using osm geocoding : https://nominatim.org/release-docs/develop/api/Search/

Unfortunately most location name are so vague that it can match with so many other similar location name in other state or country. I am still finding the way to limit the search within certain city, but can't get it right yet. You can try this
https://nominatim.openstreetmap.org/sea ... sdetails=1
The ressult is 10 locations. But actually we can loop search and find if the city is Mountain View, then that is the coordinate we want.

Other thing is that you should be careful with the search result, as it maybe wrong (because the name). You should try and not rely on it with 100% certainty.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Micky Micky
Posts: 179
Joined: 16 Oct 2019 17:38

Re: Where is Google maps navigation going?

Post by Micky Micky » 06 Nov 2019 20:57

Thanks for taking the time to look into this for me. I ended up with the same result as you, which I agree is prone to error.

Don't waste time on this because I've searched online for the answer to no avail.

I'd like to take this opportunity to thank you for all you help provided to this forum. You have solved many a problem for me and I'm sure for many others.

Many thanks.
Crude but it works.

Micky Micky
Posts: 179
Joined: 16 Oct 2019 17:38

Re: Where is Google maps navigation going?

Post by Micky Micky » 11 Dec 2019 20:36

Google must have noticed me searching for the solution and have now implemented it.
Works nicely.
Crude but it works.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Where is Google maps navigation going?

Post by Desmanto » 12 Dec 2019 06:34

Micky Micky wrote:
11 Dec 2019 20:36
Google must have noticed me searching for the solution and have now implemented it.
Works nicely.
How do you achieve it? I have updated to the latest google maps and can't find the way yet, only live location sharing.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Micky Micky
Posts: 179
Joined: 16 Oct 2019 17:38

Re: Where is Google maps navigation going?

Post by Micky Micky » 12 Dec 2019 07:04

From the notification like you suggested.
20191212_070052.jpg
20191212_070052.jpg (106.17 KiB) Viewed 17518 times
Crude but it works.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Where is Google maps navigation going?

Post by Desmanto » 12 Dec 2019 17:45

Hmmm, I don't have any coordinates at all. Have tried so many navigation to multiple places, even point at map without names; no coordinates show up in the notification. It shows up similar to yours, but the coordinate replaced by name place. If it has no name, it shows "point on map". I am using Google Maps 10.31.1. Maybe there is some extra setting to pop this up. I have skimmed thru most of the setting and found none. Do you need extra setting to get this? Or maybe this is server side.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Micky Micky
Posts: 179
Joined: 16 Oct 2019 17:38

Re: Where is Google maps navigation going?

Post by Micky Micky » 12 Dec 2019 19:04

I'm on 10.30.2

I think I've figured it out.
I'm starting the navigation with START ACTIVITY using coordinates in the Data URI.
If I use Google maps app and enter a street name then the notification contains the street name.
But before it was definitely converting the coordinates into a street name in the notification.
Crude but it works.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Where is Google maps navigation going?

Post by Desmanto » 13 Dec 2019 18:47

Oh. If you use the data URI, then you already have the coordinate from the beginning. I am thinking about extracting the coordinate from the google map. As when you tap a point, google map will convert it to name place, which lead to possible wrong coordinates when we geocoding them back.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply