简体   繁体   English

什么类型的Google Map API用于搜索特定地点(例如医院)

[英]what type of Google map api use to search specific place like hospital in a redious

嗨,大家好,我是android新手,对于Android的Google map api我一无所知,我的问题是,在我的Android应用程序中,我想实现Google地图,该地图只能从用户当前位置搜索特定半径范围内的医院,所以现在请告诉我我需要使用哪种api来实现这一目标,谢谢

You need to use the Google Places API Web Service . 您需要使用Google Places API网络服务 It allows you to query for place information on a variety of categories, such as: establishments, prominent points of interest, geographic locations, and more. 它使您可以查询各种类别的场所信息,例如:场所,著名景点,地理位置等等。

Here is an example of a search request for places of type 'food' within a 500m radius of a point in Sydney, Australia, containing the word 'cruise' in their name: 以下是一个搜索请求的示例,该请求针对澳大利亚悉尼某点半径500m内的“食品”类型的地点进行搜索,其名称中包含“巡航”一词:

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=500&types=food&name=cruise&key=YOUR_API_KEY

Note that you'll need to replace the key in this example with your own key in order for the request to work in your application. 请注意,在此示例中,您需要用自己的密钥替换该密钥,以便该请求在您的应用程序中起作用。

Check this SO question on how to return the closest 20 location to the users current location. 检查有关如何将最近的20个位置返回到用户当前位置的SO问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM