Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide thorough documentation of OsmAnd Go URL scheme #275

Closed
apbarratt opened this issue Nov 13, 2023 · 10 comments
Closed

Provide thorough documentation of OsmAnd Go URL scheme #275

apbarratt opened this issue Nov 13, 2023 · 10 comments
Labels
Milestone

Comments

@apbarratt
Copy link

Hi guys, hoping to see the documentation updated at https://osmand.net/docs/technical/algorithms/osmand-intents/

I'm attempting to provide direct links to a number of navigation apps in our product and there has been strong interest from a few folk to have OsmAnd available in our list of apps.

Whilst geo:// links do indeed work correctly on Android, I've been attempting to provide direct links to specific apps for drivers using our app into their preferred apps on both iOS and Android utilising any additional functionality that are available.

For many apps, there is a URL scheme available that can take locations in the form of either coordinates or address searches and in several nifty cases, the intention can be provided in that URL to jump directly to the start navigation screen.

I've seen that the iOS app for osmand did once have this question asked in 2019 and a dev was kind enough to sort out a url scheme at the time to add some of this functionality here: osmandapp/OsmAnd-iOS#447
However I don't seem to be able to get the mentioned scheme to work and the code submitted in that commit no longer seems to exist.

What I have now found is this page on the website that documents extremely briefly the existence of an OsmAnd specific url with an example given of http://osmand.net/go?lat=34&lon=-106&z=11
I have tested this and it seems to work on both platforms, so that is particularly promising. However, as the example only handles lat long coordinates plus a zoom level, I've wondered if it can handle more.

The request:

Could that page be updated to specify exactly every parameter the osmand.net/go link can take?
It would be incredible to learn that it can take a search string for an address (similar to android geo://?q={address string}) and even better if it can take a little prompt to push it towards the navigation start confirmation screen.
Ideally, the solutions I'm most after would be something like:
For coordinates: http://osmand.net/go?lat=34&lon=-106&mode=navigation
For addresses: http://osmand.net/go?address=Bute%20House%2C%205%20Charlotte%20Square%2C%20Edinburgh%2C%20EH2%204DR&mode=navigation

But it's important to note this request is to see currently existing functionality of the URL documented, not for new functionality :)
Most of all just want to see a list of everything that can be provided to these go links, something along the lines of:

lat: latitude value as number,
lon: longitude value as number,
address: urlEncoded address query,
mode: 'show' or 'navigate' (defaults to 'show'),
z: zoom level as number as defined at [some doc page],
otherStuff: surprise me, I just have no idea what might actually be possible here!
@vshcherb
Copy link
Member

Now we aim to support https://osmand.net/map/#5/50.000/5.000 this scheme i.e. everything is doable on the site to cross link later to the app.

@vshcherb
Copy link
Member

But indeed we need to update documentation.

@vshcherb vshcherb added the documentation Improvements or additions to documentation label Nov 15, 2023
@apbarratt
Copy link
Author

That sounds good, similar to how google maps links work and allow us to provide it easily as an option with the same link regardless of whether the app itself is installed.
I don't suppose you know of anywhere the url scheme is laid out for that, even if it isn't a pretty documentation page yet :)
Also, I suppose a mailing list that might flag breaking changes to the scheme for me to subscribe to would be useful too if one exists :)

@kevinp2
Copy link

kevinp2 commented Dec 4, 2023

I am able to get this link to work successfully on iOS through Safari. I display a web page with an OSMAnd hyperlink and the OSMAnd iOS app displays the area around the coordinate:

https://osmand.net/go.html?lat=35.188872&lon=-114.527308

I have not tried this on Android.

My app that constructs the web page has access to the OSM node / way / relation IDs. It would be fantastic to have an URL that looked like this:

https://osmand.net/go.html?osmtype=node&id=123456

... where osmtype would be one of node, relation or way

This would enable a specific business or POI to be targeted precisely.

@vshcherb
Copy link
Member

vshcherb commented Dec 5, 2023

@vshcherb vshcherb closed this as completed Dec 5, 2023
@kevinp2
Copy link

kevinp2 commented Dec 5, 2023

URLS to be added to documentation:

...

  1. Navigation https://osmand.net/map/?start=52.236210,5.119629&finish=52.412472,4.855957&profile=car&pin=52.491143,7.116394#9/52.3873/5.2570

Hi @vshcherb, on the Navigation link, is there a way to specify "Current Location" instead of an explicit Start location?

@vshcherb
Copy link
Member

vshcherb commented Dec 5, 2023

Yep if you skip start it should work as well (Android was tested). We will retest

@apbarratt
Copy link
Author

Thanks for these guys. Could I ask if there is also a method to specify a query string for address lookup when we don't have coordinates to hand though? We regularly use coordinates but more often than not, the user submitted content is simply an address which we need to pass through and hope the app in question has semi-decent geo-coding.
One day we may do some geocoding ourselves before hand, but in the immediate future, we're just relying on what apps can handle the addresses we pass through :)

I suppose for your navigation link example, we'd be hoping for something like this:
Navigation https://osmand.net/map/?finishq=Bute%20House%2C%205%20Charlotte%20Square%2C%20Edinburgh%2C%20EH2%204DR&profile=car

Also, I suspect this is a silly question as I'm sure I've seen this before but have forgotten about it, but what is a pin in this situation?

@vshcherb
Copy link
Member

Our geocoding is not perfect... and I'm afraid the url we dont have yet for search so it will be a separate issue

@vshcherb vshcherb added this to the Documentation milestone Jan 10, 2024
@EugeneZmeuk
Copy link
Member

EugeneZmeuk commented Mar 11, 2024

Reviewed 11.03.2024:

@shurasmiling shurasmiling removed the documentation Improvements or additions to documentation label Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants