0

ジオコーダーに基づくアプリケーションを開発しています。ジオコーダ デリゲート メソッド内で目印アドレス辞書メソッドを使用しています。インドの郵便番号を除くすべての詳細 (通り、都市、州、郡、国コード、およびすべて) を取得できます。郵便番号がないのはなぜですか? どんな提案でも大歓迎です

私のコード:

-(void)locationUpdate:(CLLocation *)location

{

currentLocation= [location coordinate];

if (currentLocation.latitude!=checking.latitude) 
{
    NSDate *currentTime =[NSDate date];

    fireTime = currentTime;

    checking.latitude=currentLocation.latitude;  
    checking.longitude=currentLocation.longitude;

}
MKReverseGeocoder *geocoder = [[MKReverseGeocoder alloc] initWithCoordinate:[location coordinate]];
[geocoder setDelegate:self];
[geocoder start];
}


-(void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark

{
    NSLog(@"placemark.postalCode ***********%@",placemark.postalCode);
}

ジオコーダが返されたため、次の出力が得られます。

{

City = Vishakhapatnam;
Country = India;
CountryCode = IN;
FormattedAddressLines =     (
    NH5,
    Vishakhapatnam,
    "Andhra Pradesh",
    India
);
State = "Andhra Pradesh";
Street = NH5;
Thoroughfare = NH5;

}



placemark.postalCode *********** (null)

他の国では問題なく動作しますが、インドの場所の郵便番号を取得できません。インドの場所の郵便番号も取得するにはどうすればよいですか?

4

1 に答える 1

3

これは、MapKit が Apple マップを使用してデータを取得しているためです。インドの住所を取得する場合、インドの Apple マップはあまり良くありません。

期待どおりの結果を得たい場合は、google api を使用してみてください。

Google は iOS 用のマップ SDK をリリースしました。ここにそのリンクがあります。https://developers.google.com/maps/documentation/ios

于 2013-01-19T12:33:58.277 に答える