google-mapsgoogle-maps-api-3google-maps-urls

Google Place get Share Link Maps by Place ID


I would like to get place maps link by place id ex Maps Place Link

I have this place ID ChIJfybAIuXzaS4R8vsIwXnJcz8 and also coordinate long 106.8271745 and lat -6.2285397

Q: How to generate share link like above? I try to generate manually with string name and long lat then put it in google maps place url but it is not correct sometime

Thanks


Solution

  • The recommended by Google and most straight forward way is using the Google Maps URLs API. You can read about this API here:

    https://developers.google.com/maps/documentation/urls/guide#search-action

    Using the Google Maps URLs you can create the following link for your place:

    https://www.google.com/maps/search/?api=1&query=106.8271745%2C-6.2285397&query_place_id=ChIJfybAIuXzaS4R8vsIwXnJcz8

    The result will be as shown in my screenshot

    enter image description here

    I hope this helps!