首页 文章

适用于学校和大学类型的Google Places API网络服务自动填充功能

提问于
浏览
0

参考:

https://developers.google.com/places/web-service/autocomplete https://developers.google.com/places/supported_types#table1 https://developers.google.com/places/supported_types#table3

我检查了Place API中可用的“自动完成”功能的实现,发现请求中只允许使用某些“类型”值,如地理编码,地址, Build ,(区域),(城市) .

我想在“自动填充”功能中使用学校,大学,但只允许在“地方搜索”功能中使用 .

我不想指向任何特定位置,然后搜索附近的地方,而是将所有学校和大学作为自动完成结果 .

这可能是使用Google API还是我需要使用任何其他替代方案?

任何帮助表示赞赏 .

1 回答

  • 1

    您可以实例化自动填充功能,以便在具有componentRestriction选项的国家/地区内限制结果 . 您还可以使用types选项将结果限制为某种类型的位置,但唯一的选择是'geocode','establishment','(regions)','(cities)' . 学校和大学属于'establishment'类型 . https://developers.google.com/places/supported_types您可以通过此链接找到您需要的内容

相关问题