2011-07-09 14 views
1

Googleマップを呼び出す注釈には次のようなボタンがあります。 私は、現在の既知の場所から、注釈レコードから渡された目的地までのルートをマップしようとしています。現在地をgoogleMapsの目的地にマッピングします

現在の場所はGoogleマップで認識されず、Current、Dent、Missouriのようなランダムな場所が示唆されます。私はここで間違っつもり

- (IBAction)GoogleMap 
{ 
    NSString *mapAddress = [NSString stringWithFormat:@"%@, %@, %@, %@",location.address, location.city, location.state, location.zipcode]; 

    NSString* url = [NSString stringWithFormat: @"http://maps.google.com/maps?saddr=Current+Location&daddr=%@", 
       // 40.7406578, -74.0020894, test coordinates 
       [mapAddress stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; 

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]]; 

}

任意のアイデア?これはうまくいかないでしょうか?ありがとう。

答えて

0

私の知る限り、現在の場所をGoogleマップに入力しても、現在の場所には実際には移動しません。

the method from this SO questionを使用して現在地を取得してから、代わりにCLLocationオブジェクトの座標をGoogleマップに渡すことをお勧めします。

+0

これはiPhoneでうまくいくがiPadではうまくいかないことが奇妙です。 – Jeremy

関連する問題