get Lat Lang from a place_id returned by autocomplete place api

前端 未结 12 1444
情深已故
情深已故 2021-02-02 05:58

I am searching the place in my apps using the google autocomplete place api and now I want to get latitude and longitude of the place that i have searched. How to get latitude a

12条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-02 06:22

    Google Place Details is the answer.

    From the place_id you got, query Place Details something like https://maps.googleapis.com/maps/api/place/details/json?placeid={placeid}&key={key} and you can get the lat and lng from result.geometry.location JSON.

提交回复
热议问题