citymapper/CMMapLauncher

Instructions for 5 more navigation apps: MAPS.ME / Scenic / Sygic / TomTom / Uber

Opened this issue · 0 comments

Hey, thanks for the great code sample, that definitely helped me!

This code base looks like it's not maintained anymore, but I'll open this issue hoping it will help other people.

Searching around I found a few more ones that you'd probably like to include:

  • MAPS.ME
  • Scenic
  • Sygic
  • TomTom
  • Uber

I'm using react native with Javascript, so just updating my code was simpler than integrating the library.
I'm hoping that this issue, even if not acted on, helps others the same way this PR helped with include Uber:
https://github.com/citymapper/CMMapLauncher/pull/12/files

I'll include a snippet of my code here, it's pretty self-explanatory, adding it here so that it helps others too:

handleClickStartDirections(_poi) {
    let latLonStrComma = _poi.latitude + ',' + _poi.longitude;
    let lonLatStrPipe = _poi.longitude + '|' + _poi.latitude;

    let navigationOptions = [
        {
            // Source: https://github.com/citymapper/CMMapLauncher/blob/master/CMMapLauncher/CMMapLauncher.m
            name: 'Apple Maps',
            url: 'http://maps.apple.com/?daddr=' + latLonStrComma,
        },
        {
            // Source: https://github.com/citymapper/CMMapLauncher/blob/master/CMMapLauncher/CMMapLauncher.m
            name: 'Google Maps',
            url: 'comgooglemaps://?q=' + latLonStrComma,
        },
        {
            // Source: https://github.com/citymapper/CMMapLauncher/blob/master/CMMapLauncher/CMMapLauncher.m
            name: 'Waze',
            url: 'https://waze.com/ul?ll=' + latLonStrComma + '&navigate=yes',
        },
        {
            // Source: https://github.com/citymapper/CMMapLauncher/blob/master/CMMapLauncher/CMMapLauncher.m
            name: 'Citymapper',
            url: 'citymapper://directions?endcoord=' + latLonStrComma,
        },
        {
            // Source: https://github.com/citymapper/CMMapLauncher/blob/master/CMMapLauncher/CMMapLauncher.m
            name: 'Yandex Navigator',
            url: 'yandexnavi://build_route_on_map?lat_to=' + _poi.latitude + '&lon_to=' + _poi.longitude,
        },
        {
            // Source: https://github.com/mapsme/api-ios#under-the-hood
            name: 'MAPS.ME',
            url: 'mapswithme://map?ll=' + latLonStrComma,
        },
        {
            // Source: https://www.sygic.com/developers/professional-navigation-sdk/ios/custom-url
            name: 'Scenic',
            url: 'https://scenicapp.space/api/openScenic.php?navigatelocation=' + latLonStrComma,
        },
        {
            // Source: https://www.sygic.com/developers/professional-navigation-sdk/ios/custom-url
            name: 'Sygic',
            url: 'com.sygic.aura://coordinate|' + lonLatStrPipe + '|show',
        },
        {
            // Source: https://discussions.tomtom.com/en/discussion/1118783/url-schemes-for-go-navigation-ios
            name: 'TomTom',
            url: 'tomtomgo://x-callback-url/navigate?destination=' + latLonStrComma,
        },
        {
            // Source: https://developer.uber.com/docs/riders/ride-requests/tutorials/deep-links/introduction
            // Found out about this one thanks to one of the pending PRs in this repo: https://github.com/citymapper/CMMapLauncher/pull/12/files
            name: 'Uber',
            url: 'uber://?action=setPickup&pickup=my_location&dropoff[latitude]=' + _poi.latitude + '&dropoff[longitude]=' + _poi.longitude,
        },
    ];
    // ... the rest of the function is irrelevant for the matter
}