您的位置:首页 > 移动开发 > IOS开发

使用ios系统自带的MapKit framework进行定位

2012-05-25 18:41 465 查看
这样使用的是谷歌的地图和LBS信息, 估计后续苹果会自己做地图服务了
CLLocationCoordinate2D coordinate;
coordinate.latitude = gpsInfo.lat;
coordinate.longitude = gpsInfo.log;

MKReverseGeocoder * reverseGeocoder = [[MKReverseGeocoder alloc] initWithCoordinate:coordinate];
reverseGeocoder.delegate = (id<MKReverseGeocoderDelegate>)self;
[reverseGeocoder start];
[reverseGeocoder release];


#pragma mark 使用mapkit定位的回调
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark
{
//把获取到的地址拼接起来
NSString * myAddress = [NSString stringWithFormat:@"%@%@%@",placemark.country,placemark.locality,placemark.thoroughfare];
}


- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error
{
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: