Google Places 文本搜索 API 问题
需求:
- 需要通过地址搜索商家,结果列表中应返回商家名称。
问题: 当我们仅按企业地址(不包含企业名称)进行搜索时,在结果列表中它仅返回地址或地点,而不返回企业名称。 为了在结果列表中获取公司名称,我在请求中传递了“Opennow = true”,该方法运行良好,每当我们仅搜索地址时,都会在结果集中返回公司名称。 但这里的挑战是,Opennow = true 只返回那些在搜索时间开放营业时间的商家,在营业时间之外它返回空白数据。
每当我们仅通过地址搜索时,无论营业时间是开放还是关闭,我都需要包含其名称的企业列表。
这是我用来获取文本搜索数据的 API: “https://maps.googleapis.com/maps/api/place/textsearch/json?query=&opennow=true&types=builtment®ion=us&key=”
Requirement:
- Need to search business through the address and in the result list Business name should return.
Problem:
When we search by only address of the business ( without business name ), then in the result list it returns only the address or place and does not return business name.
To get the business name in the result list, I had passed "Opennow = true" in the request, which works well and return business name in the results set whenever we search through only address.
But the challenge here is that, the Opennow = true returns only those businesses which opening hours are open at the search time, out of the opening hours it returns blank data.
I need the list of businesses with their name whenever we search through address only regardless of opening hours open or closed.
This is the API I am using to get text search data:
"https://maps.googleapis.com/maps/api/place/textsearch/json?query=&opennow=true&types=establishment®ion=us&key="
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在 Google 文档中找到了您查询的解决方案:
https:// /developers.google.com/maps/documentation/javascript/examples/places-autocomplete-hotelsearch
您可以尝试上面的方法吗,当然,它需要修改。
希望能解决您的问题
谢谢
I found resolution for your query in the google documentation:
https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-hotelsearch
Could you try the above, surely, it requires modifications.
Hope that will solve your problem
Thanks