![](/img/trans.png)
[英]Launching Google Maps Directions via an intent on Android
[英]Directions via Intent Automatically
我構建了一個包含許多地址的應用程序。 用戶可以 select 列表視圖中的地址。 這應該會自動顯示從用戶當前位置到該地址的用戶路線。
String uri = "geo:"+ selectedAddress.getLat+","+getLng();
StartActivity(new Intent(Intent.ACTION_VIEW,Uri.parse(uri)));
我知道這只是顯示指定坐標的位置。
我將如何 go 顯示從用戶當前位置到該位置的方向?
向用戶詢問地點並執行以下操作:
String place="";//user gives the place.
String url = "http://maps.google.com/maps?daddr="+place;
Intent drn = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(url));
startActivity(drn);
谷歌會自動以當前用戶位置為起點並給出指示
我將如何 go 顯示從用戶當前位置到該位置的方向?
正如@Frxstrem 所指出的,沒有記錄和支持的Intent
來提出方向。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.