我正在开发我发送waypoints
到Gmaps
应用程序的功能,Intent
以便用户可以通过waypoints
我发送的自定义导航到目的地
当我在我的嵌入式中绘制这条路线时Google Maps
,我可以看到Circuit route
,但是当我在Gmaps
app 中看到相同的路线时,它就Circuit
坏了。
我的代码:
String srcAdd = "saddr="+latLngArrayList.get(0).latitude+","+latLngArrayList.get(0).longitude;
String desAdd = "&daddr="+latLngArrayList.get(latLngArrayList.size() - 1).latitude+","+latLngArrayList.get(latLngArrayList.size() - 1).longitude;
String wayPoints = "";
for (int j = 1; j < latLngArrayList.size() - 1; ++j) {
wayPoints =wayPoints+"+to:"+latLngArrayList.get(j).latitude+","+latLngArrayList.get(j).longitude;
}
String link="https://maps.google.com/maps?"+srcAdd+desAdd+wayPoints;
final Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(link));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity");
startActivity(intent);