如何使用Google API在特定区域附近停车?

问题描述 投票:0回答:1

我正在尝试使用place_id显示特定位置周围的停车位。我很确定这只是一个简单的问题,但我无法在文档中找到解决方案。

我尝试过使用origin = place_id:我已尝试过place_id的所有变体; placeid; place_id :.

我以此为例,它来自Google(参考URL = https://developers.google.com/maps/documentation/embed/start):

<iframe width="600" height="450" frameborder="0" style="border:0"
src="https://www.google.com/maps/embed/v1/search?q=parking&key={apikey}" allowfullscreen></iframe>

这是我目前的网址:

https://www.google.com/maps/embed/v1/search?q=parking&origin=place_id:ChIJkUJ52ya_QIYR4RcaJ2Z_RYE&radius=100&key={apikey}

如果有一种方法可以使用lat long,那也很好。真的只需要能够显示特定位置周围的停车位。

谢谢

api search google-places-api google-search-api parking
1个回答
0
投票

正确的实现将提供“停车附近”加上q参数中的地址,因为你有一个地方ID,你可以对其进行地理编码以获得在q参数中提供格式良好的地址,最终的URL将是:

<iframe width="600" height="450" frameborder="0" style="border:0"
src="https://www.google.com/maps/embed/v1/search?q=parking%20near%20501%20Crawford%20St%2C%20Houston%2C%20TX%2077002%2C%20USA&key=AIzaSyAj0aaMu_aY6xiDSWH0ac_4pqN_l-opwmI" allowfullscreen></iframe>
© www.soinside.com 2019 - 2024. All rights reserved.