mapsme / omim

🗺️ MAPS.ME — Offline OpenStreetMap maps for iOS and Android
Apache License 2.0
4.58k stars 1.15k forks source link

How to create a link to maps.me ? #6386

Open Paxa opened 7 years ago

Paxa commented 7 years ago

I found ge0 url decoders for PHP and JS, but how to create ge0 link?

Is it possible to make it open a route dialog? If I create share link and then open in app, it just center to that point, I would like to have navigation dialog open automatically, e.g. https://www.google.com/maps/dir/Current+Location/-8.7817254,115.141128

I'm making web application with some custom points that may not exists in maps.me, and users can get direction there with different map apps.

I'm sorry if this question is in a wrong place

alexzatsepin commented 7 years ago

Hey @Paxa !

As for Android, It will be possible in the nearest release. You can prepare your side according to this documentation https://github.com/mapsme/api-android/wiki/Build-Route-and-Show-On-Map-via-Intent . Our old mechanism is not reliable, and I would suggest you to wait for next release (middle of July 2017).

cordovapolymer commented 7 years ago

@alexzatsepin , does this mean will be able to solve https://github.com/mapsme/omim/issues/5507 ?

alexzatsepin commented 7 years ago

@cordovapolymer Yes, it does. You will be able to launch MapsMe from external app using simple android intent mechanism describing here https://github.com/mapsme/api-android/wiki/Build-Route-and-Show-On-Map-via-Intent . It will be supported by MapsMe in the nearest release, keep it in mind please.

dpa99c commented 7 years ago

@alexzatsepin Is there any intention to port this to the iOS version to enable launching via a URL scheme?

alexzatsepin commented 7 years ago

@dpa99c As far as I know, this feature is already presented in IOS version. @VladiMihaylenko can you help with it?

dpa99c commented 7 years ago

I had a look on the api-ios page and I didn't see any mention/examples of routing amongst the URL Scheme examples, so maybe it's currently undocumented?

alexzatsepin commented 7 years ago

@dpa99c Yes, it's undocumented yet. @igrechuhin could you help with this?

dpa99c commented 7 years ago

I don't need full documentation - just point me at the source code which defines the URL scheme for routing on iOS.

vmihaylenko commented 7 years ago

@dpa99c in order to build routing via an URI you have to generate and open an URL mapsme://route? with following parameters:

sll=1,1 - source_lat, source_lon, double
saddr=addr - source_name, string
dll=1,1 = destination_lat, destination_lon, double
daddr=addr = destination_name
type=vehicle|pedestrian|bicycle

All parameters are required! Also, the order is required too. Final URL will be something like this:

mapsme://route?sll=55.7522,37.6155&saddr=Destination&dll=55.763,37.6155&daddr=Destionation&type=pedestrian

Hope it helps.

dpa99c commented 7 years ago

Thanks @VladiMihaylenko, that's exactly what I'm looking for.

vmihaylenko commented 7 years ago

@dpa99c you're welcome!

dpa99c commented 7 years ago

@alexzatsepin Just want to confirm: the iOS URL scheme supports specifying the name of start and destination via saddr and daddr - is there any equivalent paramaters that can be passed to the Android Intent to specify these?

dpa99c commented 7 years ago

@VladiMihaylenko I've implemented the maps.me URL scheme for iOS in my LaunchNavigator plugin (currently on the dev branch). It is working fine and thanks for you help, and I'd like to offer a bit of constructive feedback:

alexzatsepin commented 7 years ago

@dpa99c I'll add saddr and daddr soon, It will be available for usage in the nearest major release. And I'll update the documentation https://github.com/mapsme/api-android/wiki as soon as it's done.

cordovapolymer commented 6 years ago

@Paxa if you are running your app on cordova you can use https://github.com/dpa99c/phonegap-launch-navigator

Paxa commented 6 years ago

@cordovapolymer I can't find an URL that you use, can you point in a code or give some example?

cordovapolymer commented 6 years ago

@Paxa https://github.com/mapsme/api-android/wiki/Deeplinks https://github.com/mapsme/api-android/wiki/Build-Route-and-Show-On-Map-via-Intent and implementation in the launch-navigator

gkitarp commented 6 years ago

Hi there this is great info thanks!

  1. I'm learning the Android app repo everyday and finding it very interesting implementation. Sorry for my noobness. However is the pro version merged with the lite version, I have read that the pro version is provided for free now but not sure if the package is still valid? Where is the com.mapswithme.maps.pro package located? Just referring to the instructions in this wiki, not sure if the package reference is still correct? https://github.com/mapsme/api-android/wiki/Build-Route-and-Show-On-Map-via-Intent

  2. Also it seems recently when clicking the http link to the shared location sent via SMS it first asks to open with installed maps.me app or a browser. Could it be because of a certain phone that supports intercepting the http URL link? Early in Jan 2018 (using a Samsung S3 phone) it just opened the webpage in a browser by default and didn't give option to view the location via the app. Is it phone related or was there recent addition to intercept the http link into the Android maps.me app? If it is phone related how can all phones be able to do the link interception to show the location on the app rather than go to the webpage in the browser?

alexzatsepin commented 6 years ago

Hi @gkitarp,

  1. The valid package name is com.mapswithme.maps.pro
  2. Is it phone related or was there recent addition to intercept the http link into the Android maps.me app?

Yes and no. We added support of http links within MapsMe app, about a half of year ago. Since it started to allow a user openning http links (build route/ show on map) in MapsMe besides the Browser. But, as I know, on some Samsung devices there is the situation when a click on http links is supposed to be used ONLY in samsung browser, i.e. not chrome and not in your app. And I still don't know how to fix this weird behaviour on those devices.

Paxa commented 6 years ago

Trying to make link as in example: https://dlink.maps.me/search?query=food&locale=en_US&cll=34.233456,51.345672&map Redirected to https://maps.me/search?query=food&locale=en_US&cll=34.233456,51.345672&map

screen shot 2018-09-29 at 20 00 03
nverinaud commented 5 years ago

Any update for this ?

jidanni commented 5 years ago

We observe the app is currently sharing

Check out
Forest
New list • Forest
ge0://02Rl9JSiSU/Forest
http://ge0.me/02Rl9JSiSU/Forest
  1. Please document the protocols and encoding used.
  2. Please provide a web page that takes input LAT, LON, and creates such links, so we can produce them without having to turn on our cell phone. E.g., when authoring webpages that we want to include them in. Thanks.

All I could find was https://github.com/mapsme/ge0_url_decoder and https://github.com/mapsme/omim/tree/master/geocoder . Seems to be a in-house algorithm, not any published standard?

mpimenov commented 4 years ago

@jidanni It is indeed an in-house algorithm, and a very simple one at that. The current version is at [0], in particular see [1] and [2]. [0] https://github.com/mapsme/omim/tree/aab28bc72ec3baf1ffb7588dd93375cb6604fcba/ge0 [1] https://github.com/mapsme/omim/blob/aab28bc72ec3baf1ffb7588dd93375cb6604fcba/ge0/url_generator.hpp#L11-L20 [2] https://github.com/mapsme/omim/blob/aab28bc72ec3baf1ffb7588dd93375cb6604fcba/ge0/url_generator.cpp#L86-L103

dpa99c commented 1 year ago

@dpa99c in order to build routing via an URI you have to generate and open an URL mapsme://route? with following parameters:

sll=1,1 - source_lat, source_lon, double
saddr=addr - source_name, string
dll=1,1 = destination_lat, destination_lon, double
daddr=addr = destination_name
type=vehicle|pedestrian|bicycle

All parameters are required! Also, the order is required too. Final URL will be something like this:

mapsme://route?sll=55.7522,37.6155&saddr=Destination&dll=55.763,37.6155&daddr=Destionation&type=pedestrian

Hope it helps.

@vmihaylenko this URL scheme appears to no longer be working in recent versions of the MAPS.ME app on iOS (e.g. v14.6.1)

Is there a new URL scheme which can be used to deep link to plan a route?