开发者

How can I find a city and show it on a MKMapView?

开发者 https://www.devze.com 2023-01-01 05:58 出处:网络
I\'m developing an iPh开发者_运维技巧one application to search cities on a MKMapView. The user specify a city and then it show its location on a MKMapView. Is that possible?

I'm developing an iPh开发者_运维技巧one application to search cities on a MKMapView. The user specify a city and then it show its location on a MKMapView. Is that possible?

Thanks.


EDIT: iOS 5 now includes CLGeocoder, which will do just that for you.

You could use Google's Geocoder REST API. A request looks like this:

http://maps.google.com/maps/api/geocode/json?address=city&sensor=true_or_false

Since the response is in JSON format, you'll need a JSON parser.

0

精彩评论

暂无评论...
验证码 换一张
取 消