Questions tagged [clgeocoder]

The CLGeocoder class provides services for converting between a coordinate (specified as a latitude and longitude) and the user-friendly representation of that coordinate.

The CLGeocoder class provides services for converting between a coordinate (specified as a latitude and longitude) and the user-friendly representation of that coordinate. A user-friendly representation of the coordinate typically consists of the street, city, state, and country information corresponding to the given location, but it may also contain a relevant point of interest, landmarks, or other identifying information. A geocoder object is a single-shot object that works with a network-based service to look up placemark information for its specified coordinate value.

http://developer.apple.com/library/ios/#documentation/CoreLocation/Reference/CLGeocoder_class

227 questions
3
votes
2 answers

iOS5 CLGeocoder

I'm developing an iPhone app for IOS5. I'm currently using the CLGeocoder class located within the CoreLocation framework. I cannot figure out if the completion handler block is called at the end, after the geocoding takes place or concurrently. I…
2
votes
1 answer

iOS - MKPlacemark set title issue

I'm having issues setting the title and subtitle of my placemark. CLGeocoder *geocoder = [[CLGeocoder alloc] init]; [geocoder geocodeAddressString:location completionHandler:^(NSArray* placemarks, NSError* error){ …
Romes
  • 3,088
  • 5
  • 37
  • 52
2
votes
1 answer

Waiting for CLGeocoder to finish on concurrent enumeration

I have the following bit of code in a class method NSDictionary *shopAddresses = [[NSDictionary alloc] initWithContentsOfFile:fileName]; NSMutableArray *shopLocations = [NSMutableArray arrayWithCapacity:shopAddresses.count]; [shopAddresses…
Beav
  • 495
  • 2
  • 5
  • 14
2
votes
1 answer

iOS - MKMapKit, show address of the users location in annotation

By default on a map view we can show the user's location. On tapping the annotation pin, it will show "Current Location". But I want to show the address of the user as street, city and country. How can I do it by using CLGeoCoder class?
Satyam
  • 15,493
  • 31
  • 131
  • 244
2
votes
1 answer

Forward Geocoding with CLGeocoder Issues

I'm having an issue using forward geocoding on iOS5 with the geocodeAddressString function. I have a MKMapView open up as a modal view to display different locations with data grabbed from the internet. My issue is when I dismiss the modal view,…
CoBrA2168
  • 418
  • 3
  • 12
2
votes
1 answer

Flutter Geocoding iOS locationFromAddress always return empty list

I'm using the function locationFromAddress from plugin https://pub.dev/packages/geocoding. sending the same info (address, city) in both Android and iOS, android return the right coordinates(lat, long) but iOS(real device) always returns Null,…
ALEXANDER LOZANO
  • 1,874
  • 3
  • 22
  • 31
2
votes
4 answers

Swift CLGeocoder to get TimeZone

I'm afraid I likely have the completion handler all messed up. What I am trying to do is use latitude and longitude to get a TimeZone. I want the entire function to return the value with a type TimeZone. The following code works, as in I can get the…
AvsBest
  • 435
  • 1
  • 4
  • 9
2
votes
0 answers

Get business name from CLPlacemark

I'm trying to get the business name from a CLLocation. I am able to get the exact street address by reverse geocoding the CLLocation, but am unable to get the name of the business, as the name property on CLPlacemark is just the address. I have…
soysauce44
  • 41
  • 4
2
votes
1 answer

Unable to get state & zipcode with CLGeoCoder in swift?

I am not able to get state & zip code with CLGeocoder.I get location name,country & city only.I am using this code in india for getting location.I am using below code for this. func getAddressFromLocation(location: CLLocation) { …
TechChain
  • 8,404
  • 29
  • 103
  • 228
2
votes
1 answer

swift variable scope in closure wrt CLGeocoder()

Can someone please help me understand why in the following code will have output like this: [<+37.49638550,-122.31160280> +/- 5.00m (speed 32.65 mps / course 294.26) @ 7/27/16, 4:34:19 AM Eastern Daylight Time] n/a Belmont Belmont Belmont 1 That…
rockhammer
  • 957
  • 2
  • 13
  • 38
2
votes
1 answer

Geocoding Address Not Returning Correct Coordinates

I am trying to get coordinates from address strings and place markers on my map view but I'm not getting the correct coordinates from the geocoder. There are a couple of problems I'm seeing. One, the annotation on the map are not where they should…
raginggoat
  • 3,570
  • 10
  • 48
  • 108
2
votes
1 answer

CLGeocodeCompletionHandler

So i am trying to have it do something after the completion handler but i keep getting an error: expected CLGeocodeCompletionHandler class func didCompleteGeocoding(placemarks: [CLPlacemark]?, error: NSError?, completion: (results: Bool) ->…
2
votes
2 answers

How to get postal code in Swift viewDidLoad?

I'm a newbie in Swift and I need to set var postalCode in viewDidLoad(). As you can see on my code below, I used the reverse geocode location in didUpdateLocations but since it's asynchronous, the postalCode variable is not set in viewDidLoad(). How…
Esthon Wood
  • 315
  • 3
  • 19
2
votes
1 answer

completionHandler connot be executed in unit test of Xcode, ex. asynchronous api - reverseGeocodeLocation of CLGeocoder

I understand CLGeocoder().reverseGeocodeLocation(...) will be executed in another thread, so that completionHandler will be executed in the main thread once it successfully gets the result from Apple server. The problem is I cannot see what happened…
James Fu
  • 444
  • 1
  • 8
  • 21
2
votes
0 answers

UISearchBar displaying suggested locations from CLGeocoder like in iOS weather app

I'm making a weather app and I have a view controller that the user goes to enter any location. I'm using the SOL open source weather app to search the locations with CLGeocoder I'm mainly focusing on this: -…
MendyK
  • 1,643
  • 1
  • 17
  • 30