Google Places API可以在没有位置的情况下拉特定类型的地方,例如学校吗? [英] Can Google Places API pull specific types of places, like schools, without a location?

查看:78
本文介绍了Google Places API可以在没有位置的情况下拉特定类型的地方,例如学校吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望用户能够搜索他们的学校,并且Google Places API返回结果列表(学校名称和地址).

I want to have users able to search their school and Google Places API return a list of results (School Names along with addresses).

例如用户输入"Springfield Elementary",然后Places API给出最佳结果.那有可能吗?

eg. User enters "Springfield Elementary" and the Places API gives the top results for that. Is that possible at all?

还不知道用户的位置吗?

And also without knowing the user's location?

推荐答案

您可以查看Places API 文本搜索.

You can have a look at the Places API text search.

例如,以下请求可以搜索包含"Springfield Elementary"且类型为"school"的地点:

For example, the following request can search places that contain "Springfield Elementary" and have a type "school":

https://maps.googleapis.com/maps/api/place/textsearch/json?query=Springfield%20Elementary&type=school&key=YOUR_API_KEY

外观上

我希望这会有所帮助!

这篇关于Google Places API可以在没有位置的情况下拉特定类型的地方,例如学校吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆