skip to Main Content

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

2

Answers


  1. Chosen as BEST ANSWER

    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/


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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search