1
我正在开发一个应用程序,在该应用程序中我必须显示给定经度和纬度的地址。 我有经度和纬度,但我不知道如何从那个经度和纬度得到我的地址。 任何建议将不胜感激 在此先感谢!从经纬度获取位置地址
我正在开发一个应用程序,在该应用程序中我必须显示给定经度和纬度的地址。 我有经度和纬度,但我不知道如何从那个经度和纬度得到我的地址。 任何建议将不胜感激 在此先感谢!从经纬度获取位置地址
我最近做了一些非常类似的事情。使用坐标,您可以使用MKReverseGeocoder来获取地址。
当你找到坐标,
self.reverseGeocoder =[[[MKReverseGeocoder alloc] initWithCoordinate:newLocation.coordinate]autorelease];
reverseGeocoder.delegate=self;
[reverseGeocoder start];
//调用时reverseGeocoder是能够成功中检索地址
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark{
NSString *street=[placemark.addressDictionary objectForKey:@"Street"];
//get the different address components
}
//调用时reverseGeocoder无法中检索地址
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error{
}
希望这会有所帮助
非常感谢你 – SampathKumar
[如何获取iphone应用程序中经度和纬度的地址]的可能重复(http://stackoverflow.com/questions/2063717/how-to-get-the-address-of-a-latitude-和经度在iphone应用程序) –