Home > OS >  How to open google maps direction with multiple waypoint using Linking in React Native in single lin
How to open google maps direction with multiple waypoint using Linking in React Native in single lin

Time:01-18

For example i have 3 locations, I need to google maps directions with linking URL,

locations = [
    {
        lat : 1.310494,
        long : 103.815954
    },
    {
        lat : 1.301569,
        long : 103.785721
    },
    {
        lat : 1.278916,
        long : 103.825573
    },
]

how can i use this params locations tobe waypoint to open the google maps app

CodePudding user response:

location.map((item)=>{ return ( <Pressable onPress={() => Linking.openURL( https://www.google.com/maps/search/?api=1&query=${item.lat},${item.long}, ) }> ); })

CodePudding user response:

i slove with this url

https://www.google.com/maps/dir/{**waypoints_lot_and_lang**}

https://www.google.com/maps/dir/1.310494,103.815954/1.301569,103.785721/1.278916,103.825573/

  • Related