0

I want to render the directions between tow point (current location, passed location)

I'm using Linking to open the Google Maps App when clicking the button I passed the (lat, long), I want to see in the map.

so just when the Maps App open they get me to the Location I passed without display the destination between my current location and other address and without any Markers, any idea how to solve these?

maps

Here is my Code

_openMap = () => {
        const { region } = this.state;
        console.log('open directions');
        // Linking.openURL('geo:37.484847,-122.148386');
        Linking.canOpenURL(`geo:${region.latitude},${region.longitude}`).then(supported => {
            if (supported) {
                Linking.openURL(`geo:${region.latitude},${region.longitude}`);
            } else {
                alert('sorry invalid url')
            }
        });
    }
DevAS
  • 807
  • 2
  • 15
  • 41
  • may be a possible duplicate of [this](https://stackoverflow.com/questions/43214062/open-maps-google-maps-in-react-native) – mohshbool Jul 11 '19 at 16:39

1 Answers1

0

Use either:

google.navigation:q=a+street+address

or

google.navigation:q=latitude,longitude

Source: https://developers.google.com/maps/documentation/urls/android-intents#launch_turn-by-turn_navigation

Bleck
  • 26
  • 2