Add deep link option to route from current location without having to provide coordinates explicitly #3531
Labels
No labels
Accessibility
Accessibility
Address
Address
Android
Android
Android Auto
Android Auto
Android Automotive (AAOS)
Android Automotive (AAOS)
API
API
AppGallery
AppGallery
AppStore
AppStore
Battery and Performance
Battery and Performance
Blocker
Blocker
Bookmarks and Tracks
Bookmarks and Tracks
Borders
Borders
Bug
Bug
Build
Build
CarPlay
CarPlay
Classificator
Classificator
Community
Community
Core
Core
CrashReports
CrashReports
Cycling
Cycling
Desktop
Desktop
DevEx
DevEx
DevOps
DevOps
dev_sandbox
dev_sandbox
Directions
Directions
Documentation
Documentation
Downloader
Downloader
Drape
Drape
Driving
Driving
Duplicate
Duplicate
Editor
Editor
Elevation
Elevation
Enhancement
Enhancement
Epic
Epic
External Map Datasets
External Map Datasets
F-Droid
F-Droid
Fonts
Fonts
Frequently User Reported
Frequently User Reported
Fund
Fund
Generator
Generator
Good first issue
Good first issue
Google Play
Google Play
GPS
GPS
GSoC
GSoC
iCloud
iCloud
Icons
Icons
iOS
iOS
Legal
Legal
Linux Desktop
Linux Desktop
Linux packaging
Linux packaging
Linux Phone
Linux Phone
Mac OS
Mac OS
Map Data
Map Data
Metro
Metro
Navigation
Navigation
Need Feedback
Need Feedback
Night Mode
Night Mode
NLnet 2024-06-281
NLnet 2024-06-281
No Feature Parity
No Feature Parity
Opening Hours
Opening Hours
Outdoors
Outdoors
POI Info
POI Info
Privacy
Privacy
Public Transport
Public Transport
Raw Idea
Raw Idea
Refactoring
Refactoring
Regional
Regional
Regression
Regression
Releases
Releases
RoboTest
RoboTest
Route Planning
Route Planning
Routing
Routing
Ruler
Ruler
Search
Search
Security
Security
Styles
Styles
Tests
Tests
Track Recording
Track Recording
Translations
Translations
TTS
TTS
UI
UI
UX
UX
Walk Navigation
Walk Navigation
Watches
Watches
Web
Web
Wikipedia
Wikipedia
Windows
Windows
Won't fix
Won't fix
World Map
World Map
No milestone
No project
No assignees
2 participants
Due date
No due date set.
Dependencies
No dependencies set.
Reference: organicmaps/organicmaps-tmp#3531
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Thanks to all working on Organic Maps! It's wonderful to see it so vibrant. 🙏
From https://omaps.app/api, I see that I can deep link to get a route using a URL of the following shape:
om://route?sll=50.183933,8.942871&saddr=Start%20Point&dll=49.998912,8.278198&daddr=EndPoint&type=vehicle
I have tried to remove
sll
and bothsll
andsaddr
but it appears both are required. I would like to be able to either omitsll
or set it to a well-known value such ascurrent
to get directions from the current location.Background
I work on ODK, an open-source platform for mobile data collection (https://getodk.org). Field workers use the ODK Collect Android app to collect data. Sometimes they need to wayfind and we've documented doing this first with Maps.me and now with Organic Maps. Our users author forms in Excel and can use Android intents or deep links.
In an ODK form, requesting the current location requires end-user intervention in most cases.
We used to document using the
BUILD_ROUTE
intent:ex:com.mapswithme.maps.pro.action.BUILD_ROUTE(lat_to=number(${latitude}), lon_to=number(${longitude}), router=${mode})
One of our users just let us know that this no longer works and indeed I see that intent was removed here. It looks like this was first released in 2022.07.27 but not included in the release notes.
Now we can document using the deep link:
concat("om://route?sll=", ${start_lat}, "," ,${start_lon}, "&saddr=Current%20location&dll=", ${latitude}, ",", ${longitude}, "&daddr=Destination&type=", ${mode})
See full form definition here
But it requires having an explicit start location which is not desirable.
Thank you for the very detailed issue!
It's about Android only, right? Am I correctly understanding that before version 2022.07.27 it worked properly in OM?
@rtsisyk can you please restore the removed API behavior in a new format? I think the best approach would be to use the current position as the starting point if
sll
param is missing, and as an ending point ifdll
param is missing (routes to the current position probably won't work yet).@lognaturel, thanks for relying on our API! We will fix it for you.
To be honest, old MWM API wasn't properly reviewed, tested and documented until 2022.07.27, so it is a big surprise that SOME cases there were actually working. In 2022.07.27 we reviewed all things and started to document and legalize this API for developers. Old MapsWithMe
com.mapswithme.maps.pro.action.*
API has been removed in favor ofom://*
:com.mapswithme.maps.pro.action.BUILD_ROUTE
=>om://route
com.mapswithme.maps.pro.action.SHOW_ON_MAP
=>om://map
Both methods duplicated each other. The only one major difference was how input parameters were passed (Bundle vs URL). Please check https://github.com/organicmaps/api-android for actual examples.
Yes,
sll
andsaddr
should be optional. I can see that omittingsll
andsaddr
leads to "Navigation is available only from your current location". This issue should be addressed. I will try to raise a PR as soon as get time to fix it.Yes and yes.
Hehe, we have some of that style of integration in our codebase too. Thanks for doing the work to modernize yours!
Thanks for this pointer. We don't want our Android app to integrate with OM, we want forms rendered by our Android app to do the integration. This uses generic dynamic intent builder functionality in ODK Collect. I think our best bet is to use the deep links directly. In fact, I think exposing that option a bit more explicitly is helpful: https://github.com/organicmaps/api-android/pull/4
Thanks so much, we really appreciate it!
Sorry for the late answer. The proposed change is possible, but requires refactoring of legacy C++ code. We haven't started yet.