2017-07-18 8 views
0

私のアプリケーションではObjective-CのIOSでフォワードジオコーディングを使用して、与えられたアドレスの正確なlattitudelongitudeが必要です。フォワードジオコーディングを使用して特定のアドレスの正確な座標を取得する方法

アプリケーションで前方ジオコーディングを使用しましたが、正確なアドレスを指定していません。これは、あなたがより正確な場所の目印のプロパティにアクセスすることができアドバンス

答えて

0

-(void)detectlocation:(NSString*)address 
{ 
CLGeocoder *geocoder=[[CLGeocoder alloc]init]; 
    [geocoder geocodeAddressString:address completionHandler:^(NSArray *placemarks, NSError *error) 
    { 
     if(!error) 
     { 
      CLPlacemark *placemark = [placemarks objectAtIndex:0]; 

      NSLog(@"%f",placemark.location.coordinate.latitude); 
      NSLog(@"%f",placemark.location.coordinate.longitude); 
      self.latitude4=placemark.location.coordinate.latitude; 
      self.longitude4=placemark.location.coordinate.longitude; 
      NSLog(@"%@",[NSString stringWithFormat:@"%@",[placemark description]]); 
     } 
    }]; 
} 

感謝をジオコーディング前方の私のコードです。

これは迅速であるが、同じことが

Placemark Options

+1

スクリーンショットではなく、コードを優先Objective-Cのためのものです。 – Larme

+0

あなたのコメントは答えに関連していません。スクリーンショットには、彼が使用できるものと説明があります。したがって、この場合のコードよりも優れています。 – ppinho

+0

いいえ、関連性があります。イメージは死んでしまう可能性があります(デッドリンク)が、テキストは難しくなります。また、研究が容易です。 – Larme

関連する問題