Skip to content

Commit 12fa931

Browse files
committed
Lines should be array of dictionaries, not array of string for Google #15
1 parent 5b62422 commit 12fa931

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

LMGeocoder/LMAddress.m

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -96,23 +96,23 @@ - (void)setGoogleLocationData:(id)locationData
9696
{
9797
NSDictionary *locationDict = (NSDictionary *)locationData;
9898

99-
NSArray *lines = locationDict[@"address_components"];
99+
NSArray *addressComponents = locationDict[@"address_components"];
100100
NSString *formattedAddress = locationDict[@"formatted_address"];
101101
double lat = [locationDict[@"geometry"][@"location"][@"lat"] doubleValue];
102102
double lng = [locationDict[@"geometry"][@"location"][@"lng"] doubleValue];
103103

104104
_coordinate = CLLocationCoordinate2DMake(lat, lng);
105-
_streetNumber = [self component:@"street_number" inArray:lines ofType:@"long_name"];
106-
_route = [self component:@"route" inArray:lines ofType:@"long_name"];
107-
_locality = [self component:@"locality" inArray:lines ofType:@"long_name"];
108-
_subLocality = [self component:@"sublocality" inArray:lines ofType:@"long_name"];
109-
_administrativeArea = [self component:@"administrative_area_level_1" inArray:lines ofType:@"long_name"];
110-
_subAdministrativeArea = [self component:@"administrative_area_level_2" inArray:lines ofType:@"long_name"];
111-
_postalCode = [self component:@"postal_code" inArray:lines ofType:@"short_name"];
112-
_country = [self component:@"country" inArray:lines ofType:@"long_name"];
113-
_ISOcountryCode = [self component:@"country" inArray:lines ofType:@"short_name"];
105+
_streetNumber = [self component:@"street_number" inArray:addressComponents ofType:@"long_name"];
106+
_route = [self component:@"route" inArray:addressComponents ofType:@"long_name"];
107+
_locality = [self component:@"locality" inArray:addressComponents ofType:@"long_name"];
108+
_subLocality = [self component:@"sublocality" inArray:addressComponents ofType:@"long_name"];
109+
_administrativeArea = [self component:@"administrative_area_level_1" inArray:addressComponents ofType:@"long_name"];
110+
_subAdministrativeArea = [self component:@"administrative_area_level_2" inArray:addressComponents ofType:@"long_name"];
111+
_postalCode = [self component:@"postal_code" inArray:addressComponents ofType:@"short_name"];
112+
_country = [self component:@"country" inArray:addressComponents ofType:@"long_name"];
113+
_ISOcountryCode = [self component:@"country" inArray:addressComponents ofType:@"short_name"];
114114
_formattedAddress = formattedAddress;
115-
_lines = lines;
115+
_lines = [formattedAddress componentsSeparatedByString:@", "];
116116
}
117117
}
118118

0 commit comments

Comments
 (0)