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

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

Open
Paxa opened this issue Jun 25, 2017 · 24 comments
Open

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

Paxa opened this issue Jun 25, 2017 · 24 comments

Comments

@Paxa
Copy link

Paxa commented Jun 25, 2017

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
Copy link
Contributor

alexzatsepin commented Jun 26, 2017

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
Copy link

@alexzatsepin , does this mean will be able to solve #5507 ?

@alexzatsepin
Copy link
Contributor

alexzatsepin commented Jul 10, 2017

@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
Copy link

dpa99c commented Jul 10, 2017

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

@alexzatsepin
Copy link
Contributor

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

@dpa99c
Copy link

dpa99c commented Jul 10, 2017

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
Copy link
Contributor

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

@dpa99c
Copy link

dpa99c commented Jul 20, 2017

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

@vmihaylenko
Copy link
Contributor

@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
Copy link

dpa99c commented Jul 20, 2017

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

@vmihaylenko
Copy link
Contributor

@dpa99c you're welcome!

@dpa99c
Copy link

dpa99c commented Jul 21, 2017

@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
Copy link

dpa99c commented Jul 23, 2017

@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:

  • type=taxi also seems to work fine in iOS as it does in Android
  • It seems the order parameters in the URL scheme is important: if they are not in the order in the example you specified, then it doesn't work. This isn't a problem per-se, just pointing it out as it may catch out others.
  • It seems saddr and daddr, although being required parameters, don't actually do anything. If I pass saddr=Foo...&darr=Bar, I can't see any representation of those values in the maps.me app - I expected that they would be used as nicknames for the start and destination locations but couldn't see that they were displayed when inspected start/destination point details.
  • Start location (sll) being a required parameter was quite a pain because my plugin, up until now, has made start location an optional parameter, therefore to maintain that, if the start location isn't a specified input, I've had to use the iOS location manager to obtain the start location in order to pass it into the maps.me. This seems a bit unnecessary: none of the other navigation apps make start location a required parameter. Would be nice to make it optional.

@alexzatsepin
Copy link
Contributor

@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
Copy link

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

@Paxa
Copy link
Author

Paxa commented Nov 15, 2017

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

@cordovapolymer
Copy link

@gkitarp
Copy link

gkitarp commented Feb 5, 2018

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
Copy link
Contributor

Hi @gkitarp,

  1. The valid package name is com.mapswithme.maps.pro

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
Copy link
Author

Paxa commented Sep 29, 2018

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
Copy link

Any update for this ?

@jidanni
Copy link

jidanni commented May 2, 2019

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
Copy link
Contributor

mpimenov commented Feb 3, 2020

@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]

// Generates a short url.
//
// URL format:
//
// +------------------ 1 byte: zoom level
// |+-------+--------- 9 bytes: lat,lon
// || | +--+---- Variable number of bytes: point name
// || | | |
// ge0://ZCoordba64/Name
std::string GenerateShortShowMapUrl(double lat, double lon, double zoomLevel, std::string const & name);

[2]

omim/ge0/url_generator.cpp

Lines 86 to 103 in aab28bc

string GenerateShortShowMapUrl(double lat, double lon, double zoom, string const & name)
{
string urlPrefix = "ge0://ZCoordba64";
int const zoomI = (zoom <= 4 ? 0 : (zoom >= 19.75 ? 63 : static_cast<int>((zoom - 4) * 4)));
urlPrefix[6] = Base64Char(zoomI);
LatLonToString(lat, lon, urlPrefix.data() + 7, 9);
string result = urlPrefix;
if (!name.empty())
{
result += "/";
result += UrlEncodeString(TransformName(name));
}
return result;
}

@dpa99c
Copy link

dpa99c commented May 14, 2023

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants