1
我只需要当前位置的详细信息,如何使用坐标获取当前区域名称?
我已经完成了获取当前位置坐标的部分。
现在我想使用这些坐标来获取地区名称等(无地图)的详细信息。
如何做到这一点?任何示例代码可用?
在此先感谢。
我只需要当前位置的详细信息,如何使用坐标获取当前区域名称?
我已经完成了获取当前位置坐标的部分。
现在我想使用这些坐标来获取地区名称等(无地图)的详细信息。
如何做到这一点?任何示例代码可用?
在此先感谢。
实施MKReverseGeocoderDelegate
implements <MKReverseGeocoderDelegate>
添加一个实例变量:
MKReverseGeocoder *_reverseGeocoder;
创建反向地理编码对象:
CLLocationCoordinate2D location;
location.latitude = latitude; // You said you had this value
location.longitude = longitude; // You said you had this value
_reverseGeocoder = [[MKReverseGeocoder alloc]initWithCoordinate:location];
_reverseGeocoder.delegate = self;
[_reverseGeocoder start];
实现下面委托功能:
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark
{
/// placemark has your location!
}
您可以使用MKReverseGeocoder。
非常感谢marcc,我找到了解决方案。 – Nic 2009-11-10 08:13:12