2017-08-09 1 views
1

私はこのコードを使用してAndroidでGoogleマップアプリを開きます。アンドロイドでGoogleマップのソースとターゲットのラベルをプログラムで設定するにはどうすればよいですか?

それはアンドロイドのGoogleマップアプリになると、最初に、それは先のボックスとソース]ボックスで、「あなたの場所」にアドレスが表示されますが、その後、それがポイントの」に変更されます、何が起こる
if(source != null && destination != null) { 
        Intent intent = new Intent(android.content.Intent.ACTION_VIEW, 
          Uri.parse("http://maps.google.com/maps?daddr=" 
            + destination.latitude + "," + destination.longitude + "(" + ADDRESS + ")")); 
        startActivity(intent); 
       } else { 
        Toast.makeText(context, "Please check your internet connection and try again!!", Toast.LENGTH_LONG).show(); 
       } 

地図"。私がこれを避ける方法はありますか?それとも私は何かが足りない?

誰でも私にこれを手伝ってもらえますか?

答えて

1

あなたは、私はそれを得た... Google Maps

String uri = String.format(Locale.ENGLISH, "geo:%f,%f?z=17&q=%f,%f", sourcelatitude,sourcelongitude,destlatitude,destlongitude); 
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri)); 
+0

おかげラジャンに宛先と送信元ポイントを設定するmarkersを設定することができます。 –

関連する問題