organicmaps / organicmaps

🍃 Organic Maps is a free Android & iOS offline maps app for travelers, tourists, hikers, and cyclists. It uses crowd-sourced OpenStreetMap data and is developed with love by MapsWithMe (MapsMe) founders and our community. No ads, no tracking, no data collection, no crapware. Please donate to support the development!
https://organicmaps.app
Apache License 2.0
9.9k stars 952 forks source link

Open Google Maps, OSM and geo url links in Organic Maps #475

Open ghost opened 3 years ago

ghost commented 3 years ago

Pls add option to Open OSM and geo url links through Organicmaps app.


Current status by @rtsisyk

DONE

TODO

Upvote & Fund

Fund with Polar

biodranik commented 3 years ago

geo:// links should work. Please share the one which doesn't work together with your OS and app version, we'll fix it. Which OSM URL links do you have in mind? https://www.openstreetmap.org/#map=ZZ/LAT/LON ?

biodranik commented 3 years ago

Here is a test page to check which links work now and which still should be fixed: https://omaps.app/test.html

ghost commented 3 years ago

https://github.com/osmandapp/OsmAnd/blob/e4f9a7cea01bf2083e0b800522f445642cf15b3f/OsmAnd/AndroidManifest.xml#L603

biodranik commented 3 years ago

That's a good idea, but need to update the parser code first, and it will work only on Android.

ghost commented 3 years ago

https://www.f-droid.org/en/packages/app.fedilab.nitterizeme/

This app helps to google maps links to osm or geo... it helps to click a google maps links convert to show osm result in organic map. Pls implement in Organic map. Iam currently using untrackme app for convert g maps links through help of untrackme to show result from organic maps...pls inbuild this feature.

rtsisyk commented 3 years ago

I think we can add support for Google links directly to our app. I don't see any blockers.

biodranik commented 3 years ago

It may work in Android only.

eighthave commented 3 years ago

https://github.com/guardianproject/LocationPrivacy is a simple, standlone app that parses all kinds of location links. It is probably easier to navigate than Osmand. I'm happy to help too.

eighthave commented 3 years ago

Also, I think the work here is basically the same as what needs to happen in #492

rtsisyk commented 3 years ago

References:

eighthave commented 3 years ago

FYI, I wrote some of the related code in Osmand, and it is also included in the Guardian Project app Location Privacy. Would you be interested in including the whole capability from Location Privacy? Basically, it also adds the ability to go online to get the location from URLs that do not include the location info in it. It can do this over Tor for privacy. Examples of relevant URLs are short links, some Google Maps links that use only a unique ID for a place entry, etc.

biodranik commented 3 years ago

@eighthave Is the basic idea to hide the real IP from Google?

anibyl commented 3 years ago

I have a similar, perhaps the same issue with links in Instagram. Steps:

eighthave commented 3 years ago

yeah, the idea is to hide the IP and any other identifying metadata like User Agent, logged in accounts, cookies, etc. that would be sent with the location if the user opened the link in a browser or other app like Google Maps. This approach should also be possible with other kinds of location links like Instagram. The only issue there would be the UX since it looks like it is not possible to tell from the URL alone that the Instagram link is a location link, and not some other kind of link like just a picture.

biodranik commented 3 years ago

Why going online if the address/location can be opened completely privately in offline?

eighthave commented 3 years ago

When the location can be parsed from the URL, then there is no reason to go online. But there are many location URLs that use internal identifiers, e.g. short URLs. Then the only way to get the location out is to go online and query that service.

vng commented 2 years ago

Check with the next Android app update.

rtsisyk commented 2 years ago

One more link type from #989:

https://maps.apple.com/place?address=4706%2050%20Ave,%20St.%20Paul%20AB%20T0A%203A2,%20Canada&ll=53.991561,-111.289525&q=Example%20Link&_ext=AbYpUFxEu1v+AbAxxqyaswXTW8A5zjFqF4L/AbBBWpCqWgvSW8BQBA%3D%3D&t=m

gerion0 commented 2 years ago

The OSM short links are missing currently. Example: https://osm.org/go/0CGsV6RxW?m= https://osm.org/go/0CGsV6RxW https://osm.org/go/0CGsV6RxW?node=281399025

Also, is it possible with the current data to open osm entities directly in organic maps? For example: https://www.openstreetmap.org/node/281399025 https://www.openstreetmap.org/relation/365331 https://www.openstreetmap.org/way/70856784

biodranik commented 2 years ago

The second is not possible without querying the OSM server.

eighthave commented 2 years ago

In LocationPrivacy, I made it query the server in some such cases. There are some URLs missing geo coords that are redirected to a parsable URL, so often, just a HEAD request is enough.

gerion0 commented 2 years ago

The second is not possible without querying the OSM server.

Ok. I had hoped that the ID maybe survived in the offline data ;). It's my preferred way to link to shops etc since the OSM website for example mentions the opening times there.

rigrig commented 2 years ago

My phone (LineageOS stock contactsapp) tries to open https://www.google.com/maps?daddr=Aardbei+1%0AHengelo%0ANetherlands+(Overijssel) It is opened in Organic Maps, but not recognized.

Thu URL corresponds to https://www.google.com/maps?daddr=<streetname>+<house number>%0A<city>%0A<countey>+(<province/state>)

licaon-kter commented 2 years ago

While testing https://github.com/iNPUTmice/Conversations/issues/4375 I saw that OrganicMaps does not appear as an option. Any news on future support for all the missing intents/websites?

biodranik commented 2 years ago

@licaon-kter thanks for the link! It would be great to support google.navigation URL scheme.

biodranik commented 1 year ago

There are several scenarios of how URLs can be opened by users in OM:

  1. On Android, the user can click on the URL in another app, and he will be offered to open Organic Maps with this link.
  2. On iOS and Android, users can copy links to the keyboard and open OM, and then either paste the URL into the search box, or (even better), OM can offer to open this link automatically after detecting it in the clipboard.

One of the possible implementations would be to make an HTTP request to get coordinates directly from OM's C++ code.

Another option is to open the system browser with the URL and open OM back again after redirecting to "om://" link. That can be not as convenient and slower.

Regarding privacy, I see two options:

  1. HTTP requests from OM can go to Cloudflare Workers (or a similar service that scales for free), which will do requests to Google and other providers to decode coordinates or the search query.
  2. HTTP requests from OM go to OM's proxy server first, to hide real users from Cloudflare too (that may delay the response a bit).
rtsisyk commented 1 year ago

I found three types of goo.gl links:

  1. Links with lat/lon

Generated by https://google.com/maps (web version).

https://goo.gl/maps/sXnse1erRvkA6aV99 => https://www.google.com/maps/place/Falafel+M.+Sahyoun/@33.8904447,35.5066505,17z/data=!3m1!4b1!4m6!3m5!1s0x151f16e2123697fd:0x8e6626b678863990!8m2!3d33.8904447!4d35.5066505!16s%2Fg%2F1td7wffc?utm_source=mstt_1&coh=164777&entry=tt&shorturl=1

33.8904447,35.5066505 is already lat/lon explicitly.

  1. Links with Google Maps Plus Codes

Generated by Google Maps on Android and iOS.

https://maps.app.goo.gl/xKoFkDSxx58wEviW6 => https://maps.google.com?q=VGR4+5MC+Falafel+M.+Sahyoun,+Beirut,+Lebanon&ftid=0x151f16e2123697fd:0x8e6626b678863990&hl=en-US&gl=tr&entry=gps&lucs=47067413&

VGR4+5MC+Falafel+M.+Sahyoun,+Beirut,+Lebanon Plus Code can be parsed into lat/lon.

  1. Links without lat/lon and Plus Codes

https://maps.app.goo.gl/9iasfbmabmUTpFuo8 => https://www.google.com/maps/place/Tekelli,+Uchisar+Castle,+50240+U%C3%A7hisar%2FNev%C5%9Fehir+Merkez%2FNev%C5%9Fehir,+T%C3%BCrkiye/data=!4m2!3m1!1s0x152a68ee7113bdc5:0x48a54ea63a91c5c9?utm_source=mstt_1&entry=gps&g_ep=CAESCTExLjc3LjMwMBgAIIgnKgBCAlJV

Tekelli,+Uchisar+Castle,+50240+Uçhisar/Nevşehir+Merkez/Nevşehir,+Türkiye doesn't have any coordinates and geocoding is needed here.

retiolus commented 7 months ago

Hi, I just set up this (Google Maps Unshortener) for an app I'm making, maybe it's of interest here...

Ex:

  1. https://mapu.retiolus.net/unshortener?link=https://goo.gl/maps/sXnse1erRvkA6aV99
  2. https://mapu.retiolus.net/unshortener?link=https://maps.app.goo.gl/xKoFkDSxx58wEviW6
  3. https://mapu.retiolus.net/unshortener?link=https://maps.app.goo.gl/9iasfbmabmUTpFuo8

Edit: I'm sorry if the links are down, I host this on a Raspberry Pi

eighthave commented 7 months ago

nice idea, it'll be good to have all these things mapped out in code. A while back, I made a Android app version of the same idea. I also can use Tor to do the HTTP GET:

https://gitlab.com/guardianproject/LocationPrivacy/-/tree/master/app/src/main/java/info/guardianproject/locationprivacy?ref_type=heads

RedAuburn commented 7 months ago

Hi, I just set up this (Google Maps Unshortener) for an app I'm making, maybe it's of interest here...

This is very cool! @rtsisyk maybe this could be deployed as part of the potential Mozilla-location-services replacement?

rtsisyk commented 5 months ago

Hi, I just set up this (Google Maps Unshortener) for an app I'm making, maybe it's of interest here...

Ex:

  1. https://mapu.retiolus.net/unshortener?link=https://goo.gl/maps/sXnse1erRvkA6aV99
  2. https://mapu.retiolus.net/unshortener?link=https://maps.app.goo.gl/xKoFkDSxx58wEviW6
  3. https://mapu.retiolus.net/unshortener?link=https://maps.app.goo.gl/9iasfbmabmUTpFuo8

Edit: I'm sorry if the links are down, I host this on a Raspberry Pi

Thanks for sharing!!! We will test your unresolver.

Could you please also take a look at https://github.com/organicmaps/url-privacy-proxy ?

retiolus commented 5 months ago

I'm very flattered to have been invited to be part of the organisation, thank you! I'll take a look.

rtsisyk commented 5 months ago

I'm very flattered to have been invited to be part of the organisation, thank you! I'll take a look.

The repo was private, but I've published it.