iOS - MKMapView place annotation by using address

2019-01-06 10:41发布

I am able to place annotations on my MKMapView by using latitude and longitude, however, my feed coming in that I need to use location for is using street addresses instead of Lat and Long. e.g 1234 west 1234 east, San Francisco, CA ...

Would this have something to do with the CLLocationManager?

Has anyone attempted this before?

7条回答
倾城 Initia
2楼-- · 2019-01-06 11:29

What you're after is called geocoding or forward-geocoding. Reverse-geocoding is the process of converting a lat/long pair to street address.

iOS5 provides the CLGeocoder class for geocoding. MKPlacemark supports reverse-goecoding in iOS >= 3.0. The data involved of course is very large, so your app will generally need network access to the functionality.

A good place to start is Apple's Location Awareness Programming Guide. Also, there are LOTS of questions about this here on SO. https://stackoverflow.com/search?q=geocoding

Good luck!

查看更多
登录 后发表回答