i want to search for different hospitals near to my location and then 开发者_如何学JAVAshow 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.
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.
Try the Google Places API
you can use mapkit MapKit Tutorial
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.
精彩评论