2015-12-21 2 views
0

Я не могу убедить, почему postalCode получил (null) в iOS SDK Google Maps. Ниже мой код.postalCode получил (null) в iOS Google Maps SDK обратное геокодирование

[[GMSGeocoder geocoder] reverseGeocodeCoordinate:CLLocationCoordinate2DMake(place.coordinate.latitude, place.coordinate.longitude) completionHandler:^(GMSReverseGeocodeResponse* response, NSError* error) { 
       NSLog(@"reverse geocoding results:"); 
       for(GMSAddress* addressObj in [response results]) 
       { 
        NSLog(@"coordinate.latitude=%f", addressObj.coordinate.latitude); 
        NSLog(@"coordinate.longitude=%f", addressObj.coordinate.longitude); 
        NSLog(@"thoroughfare=%@", addressObj.thoroughfare); 
        NSLog(@"locality=%@", addressObj.locality); 
        NSLog(@"subLocality=%@", addressObj.subLocality); 
        NSLog(@"administrativeArea=%@", addressObj.administrativeArea); 
        NSLog(@"postalCode=%@", addressObj.postalCode); 
        NSLog(@"country=%@", addressObj.country); 
        NSLog(@"lines=%@", addressObj.lines); 

       } 
      }]; 

Вот результат вышеуказанного кодирования.

2015-12-21 17:36:58.138 coordinate.latitude=51.509980 
2015-12-21 17:36:58.138 coordinate.longitude=-0.133700 
2015-12-21 17:36:58.138 thoroughfare=(null) 
2015-12-21 17:36:58.138 locality=London 
2015-12-21 17:36:58.138 subLocality=(null) 
2015-12-21 17:36:58.139 administrativeArea=(null) 
2015-12-21 17:36:58.139 postalCode=(null) 
2015-12-21 17:36:58.139 country=United Kingdom 
2015-12-21 17:36:58.142 lines=(
    "", 
    "London, UK" 
) 

Пожалуйста, помогите мне, как решить эту проблему.

ответ

0

Я инженер в SDK Google Maps для iOS. На первый взгляд это выглядит как ошибка. Не могли бы вы отправить файл на номер issue tracker? Это поможет нам отследить эту проблему и расставить приоритеты по другим вопросам. Пожалуйста, укажите версию SDK, которую вы используете, и координату, которую вы пытаетесь изменить геокодом.

0

Здравствуйте Все, что я нашел решение, пожалуйста, используйте этот код

[[GMSGeocoder geocoder] reverseGeocodeCoordinate:CLLocationCoordinate2DMake(place.coordinate.latitude, place.coordinate.longitude) completionHandler:^(GMSReverseGeocodeResponse* response, NSError* error) { 
       NSLog(@"reverse geocoding results:"); 
       GMSAddress* addressObj = [response firstResult]; 

        NSLog(@"coordinate.latitude=%f", addressObj.coordinate.latitude); 
        NSLog(@"coordinate.longitude=%f", addressObj.coordinate.longitude); 
        NSLog(@"thoroughfare=%@", addressObj.thoroughfare); 
        NSLog(@"locality=%@", addressObj.locality); 
        NSLog(@"subLocality=%@", addressObj.subLocality); 
        NSLog(@"administrativeArea=%@", addressObj.administrativeArea); 
        NSLog(@"postalCode=%@", addressObj.postalCode); 
        NSLog(@"country=%@", addressObj.country); 
        NSLog(@"lines=%@", addressObj.lines); 


      }];