开发者

Is there a way to find the state the user is in with the iphone's MapKit?

开发者 https://www.devze.com 2022-12-23 09:58 出处:网络
I am using the MapKit for the iPhone and have it setup to get the user\'s location and display it on the view. But I need to know which state they\'re in so I know what data to load 开发者_如何学Goand

I am using the MapKit for the iPhone and have it setup to get the user's location and display it on the view. But I need to know which state they're in so I know what data to load 开发者_如何学Goand display to the user. Is there any way to get that sort of info?


Have a look at the CurrentAddress code sample:

It makes use of the MKReverseGeocoder class that provides services for converting your map coordinate (specified as a latitude/longitude pair) into information about that coordinate, such as the country, city, or street. A reverse geocoder object is a single-shot object that works with a network-based map service to look up placemark information for its specified coordinate value. To use placemark information is leverages the MKPlacemark class to store this information.


Ok, so it seems the MKReverseGeocoder can do this, but I've yet to determine how, I'll do some digging.

0

精彩评论

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

关注公众号