File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -48,8 +48,14 @@ - (id)initWithDictionary:(NSDictionary *)result {
4848 if ([types containsObject: @" street_number" ])
4949 self.subThoroughfare = [component objectForKey: @" long_name" ];
5050
51- if ([types containsObject: @" route" ])
52- self.thoroughfare = [component objectForKey: @" long_name" ];
51+ if ([types containsObject: @" route" ]) {
52+ NSString *shortName = [component objectForKey: @" short_name" ];
53+ if ([self .formattedAddress rangeOfString: shortName].location != NSNotFound ) {
54+ self.thoroughfare = shortName;
55+ } else {
56+ self.thoroughfare = [component objectForKey: @" long_name" ];
57+ }
58+ }
5359
5460 if ([types containsObject: @" administrative_area_level_3" ] || [types containsObject: @" sublocality" ] || [types containsObject: @" neighborhood" ])
5561 self.subLocality = [component objectForKey: @" long_name" ];
You can’t perform that action at this time.
0 commit comments