在 Mapkit 搜索上搜索医院
我想搜索我所在位置附近的不同医院,然后在地图上显示它们。但问题是我不知道如何搜索我所在位置附近的医院。如果您能提供有关搜索医院位置的帮助,我们将不胜感激。
i want to search for different hospitals near to my location and then show them on map. But the problem is i don't know how to search for hospitals near to my location. Any help about searching the location for hospital is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以查询 GeoNames 的 webservices:此示例搜索伦敦附近的医院。
请注意,GeoNames 的结果并非万无一失,并且它们不提供任何数据准确性保证。请勿在紧急情况下使用它。
You can query GeoNames' webservices: this example searches for hospitals near London.
Beware that GeoNames' results are not foolproof, and they don't offer any guarantee on data accuracy. Do not use it for emergency situations.
尝试 Google Places API
Try the Google Places API
你可以使用mapkit
MapKit 教程
you can use mapkit
MapKit Tutorial
您还可以使用 Google 地图 API 来执行类似的操作。请查看此处的文档;-
http://code.google.com /apis/maps/documentation/places/#PlaceSearches
您需要获取 API 密钥并接受条款和条件,但当您使用 MapKit 时,您实际上是在这样做。 Apple 的文档中提到了这一点。
另一种选择是使用 Foursquare 数据,因为它们也有 API,并且数据质量应该相当好。然而,这将是另一个需要处理的 API、术语等,并且将搜索仅过滤到医院可能会更麻烦。
一旦获得一些结果并解析它们,MapKit 就会有一个非常简单的 API 来将注释添加到地图中。
You can also use the Google maps API to do a similar thing. Have a look at the documentation here;-
http://code.google.com/apis/maps/documentation/places/#PlaceSearches
You'll need to get an API key as well as accept the terms and conditions but as you are using MapKit, you are effectively doing this anyway. This is mentioned in Apple's documentation.
One other alternative would be to use Foursquare data as they too have an API and the data quality should be reasonably good. However, that will be another API, terms etc. to deal with and it might be more fiddly to filter your search to just hospitals.
Once you have some results and parse them, MapKit has a very straightforward API for adding the annotations to the map.