Note that there are some explanatory texts on larger screens.

plurals
  1. POCLLocationManager geocodeAddressString:inRegion not working to constrain region (ios5)
    primarykey
    data
    text
    <p>I'm trying to use (forward) geocoding using the new CLLocationManager APIs in iOS 5, and am not having any luck.</p> <p>I am specifying a region based on the current location, and yet it's giving me results on the other side of the world. </p> <pre><code>//CLLocation *currentloc is set to the current location when I get in here (&lt;+37.78583400,-122.40641700&gt;) CLRegion *region = [[CLRegion alloc] initCircularRegionWithCenter:[currentloc coordinate] radius:5000 /*meters*/ identifier:@"You are here"]; // Region is now: (identifier You are here) &lt;+37.78583400,-122.40641700&gt; radius 5000.00m NSString *addressString = @"Citibank"; //for example [geoCoder geocodeAddressString:addressString inRegion:region completionHandler:^(NSArray* placemarks, NSError* error){ for (CLPlacemark* aPlacemark in placemarks) { // Process the placemark. NSLog(@"Got Placemark : %@", aPlacemark); } }]; </code></pre> <p>And all I get is:</p> <pre><code>&gt; 2011-12-14 15:50:49.882 [12377:12503] Got Placemark : Citibank, New &gt; Delhi, Delhi, India @ &lt;+28.63470640,+77.22010140&gt; +/- 100.00m, region &gt; (identifier &lt;+28.63517750,+77.21878050&gt; radius 154.35) &gt; &lt;+28.63517750,+77.21878050&gt; radius 154.35m &gt; &gt; 2011-12-14 15:50:49.883[12377:12503] Got Placemark : CitiBank, Noida, &gt; Uttar Pradesh, India @ &lt;+28.58157180,+77.32408380&gt; +/- 100.00m, region &gt; (identifier &lt;+28.58161950,+77.32315050&gt; radius 154.41) &gt; &lt;+28.58161950,+77.32315050&gt; radius 154.41m &gt; &gt; 2011-12-14 15:50:49.885 [12377:12503] Got Placemark : Citibank, New &gt; Delhi, Delhi, India @ &lt;+28.53627320,+77.21128390&gt; +/- 100.00m, region &gt; (identifier &lt;+28.53630050,+77.21054050&gt; radius 154.46) &gt; &lt;+28.53630050,+77.21054050&gt; radius 154.46m &gt; &gt; ... </code></pre> <p>Any ideas:</p> <ol> <li><p>Does it think I'm in New Delhi? (I think the answer is no - because a search for "All Star Donuts" with the same inRegion puts me in Thailand</p></li> <li><p>Am I misusing "inRegion"</p></li> <li><p>Does this work for anyone? Because it will be GREAT if and when it does</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload