I am trying to implement google geolocation using xcode. when I pass the URL with latitude and longitude, it returns the following result
<?xml version="1.0" encoding="UTF-8"?>
<GeocodeResponse>
<status>ZERO_RESULTS</status>
</GeocodeResponse>
But when I directly look at the url. he gives the correct result. sample URL: http://maps.googleapis.com/maps/api/geocode/xml?latlng=68.56066,76.8803&sensor=true
coord.latitude = 68.56066;
coord.longitude = 76.8803;
NSString *urlStr = [NSString stringWithFormat:@"http://maps.googleapis.com/maps/api/geocode/xml?latlng=%f,%f&sensor=true",coord.latitude,coord.longitude];
NSURL *url = [NSURL URLWithString:urlStr];
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
NSData *xmlData = [NSData dataWithContentsOfURL:url];
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
NSString *str = [[NSString alloc]initWithData:xmlData encoding:NSUTF8StringEncoding];
NSLog(@"XML Data is %@",str);
I need to get xml results. Are there any problems with my code. When I check ZERO_RESULTS on google. They mention it like that.
ZERO_RESULTS indicates that the search was successful but did not return any results. This can happen if the search went through a site in a remote location.
Any idea ...
Anish source
share