आप दो तरह से इस लक्ष्य को हासिल कर सकते हैं: -
सबसे पहले जिस तरह से: - जवाब में Google API
-(void)findAddresstoCorrespondinglocation
{
NSString *str = [NSString stringWithFormat:@"http://maps.googleapis.com/maps/api/geocode/json?latlng=%f,%f&sensor=false",myCoordInfo.latitude,myCoordInfo.longitude];
NSURL *url = [NSURL URLWithString:[str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
ASIHTTPRequest *request = [[[ASIHTTPRequest alloc] initWithURL:url] autorelease];
[request setRequestMethod:@"GET"];
[request setDelegate:self];
[request setDidFinishSelector: @selector(mapAddressResponse:)];
[request setDidFailSelector: @selector(mapAddressResponseFailed:)];
[networkQueue addOperation: request];
[networkQueue go];
}
का उपयोग कर आप आपके द्वारा निर्दिष्ट निर्देशांक स्थान के बारे में सभी जानकारी मिल जाएगी जानकारी प्राप्त करें।
द्वितीय कार्य: -
लागू
जियोकोडिंग रिवर्स एक) जोड़ने mapkit
ढांचे
ख) ज फ़ाइल में
MKReverseGeocoder *reverseGeocoder;
ग MKReverseGeocoder
का उदाहरण है)।।। .m फ़ाइल में
self.reverseGeocoder = [[MKReverseGeocoder alloc] initWithCoordinate:cordInfo];
reverseGeocoder.delegate = self;
[reverseGeocoder start];
लागू दो MKReverseGeoCoder
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error
{
NSLog(@"MKReverseGeocoder has failed.");
}
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark
{
MKPlacemark * myPlacemark = placemark;
NSString *city = myPlacemark.thoroughfare;
NSString *subThrough=myPlacemark.subThoroughfare;
NSString *locality=myPlacemark.locality;
NSString *subLocality=myPlacemark.subLocality;
NSString *adminisArea=myPlacemark.administrativeArea;
NSString *subAdminArea=myPlacemark.subAdministrativeArea;
NSString *postalCode=myPlacemark.postalCode;
NSString *country=myPlacemark.country;
NSString *countryCode=myPlacemark.countryCode;
NSLog(@"city%@",city);
NSLog(@"subThrough%@",subThrough);
NSLog(@"locality%@",locality);
NSLog(@"subLocality%@",subLocality);
NSLog(@"adminisArea%@",adminisArea);
NSLog(@"subAdminArea%@",subAdminArea);
NSLog(@"postalCode%@",postalCode);
NSLog(@"country%@",country);
NSLog(@"countryCode%@",countryCode);
}
के प्रतिनिधि तरीकों आप क्या मतलब है? आपको वही करना होगा कि स्थान आपका है या नहीं। यदि आप आईओएस 5 के लिए विकास कर रहे हैं तो यहां कुछ संदर्भ दिया गया है: http://developer.apple.com/library/ios/#documentation/CoreLocation/Reference/CLGeocoder_class – vakio
आप CLLocation.coordinat.longitude या अक्षांश को स्थान असाइन नहीं कर सकते हैं। और रिवर्स जीओकोडिंग विधि केवल CLLocation स्वीकार नहीं करता है CLLocationCoordinate2D – Garnik
'CLLocation * loc = [[CLLocation alloc] initWithLitudeitude: अक्षांश देशांतर: देशांतर];' – vakio