How do I get a direct link to a place on google maps with the Place Id

前端 未结 4 1715
天涯浪人
天涯浪人 2021-02-04 05:29

I have the Place Id of a place on google maps in my app. Is there a way to put the place Id in a URL and have it directly link to the page? Or does it have to be done through

4条回答
  •  忘了有多久
    2021-02-04 05:57

    The URL for a specific Google Place is returned by the places details API endpoint.

    If for example you query:

    https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJV2BQ4laeekgRFauLvdXbFXE&key=YOUR_API_KEY
    

    You will see that in the returned JSON there is a key 'url' which points to https://maps.google.com/?cid=8148660811851344661

提交回复
热议问题