我的功能,我送waypoints
到Gmaps
应用程序通过Intent
工作,使得在使用可以导航到目的地由自定义waypoints
我送通过将航点至Google地图Android的创建电路路径
我时,我的情节此路线在我的嵌入式Google Maps
中,我可以看到Circuit route
,但是当我在Gmaps
应用中看到相同的路由时,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);
如何在应用程序活动中构建路线?你是否执行Directions API请求来获取多段线?您能否提供原始地点,目的地和航点的确切数值以在Google地图应用中重现问题? – xomena
是的,我使用方向API。 –
原点,目的地和航点的值如何?我需要他们来重现这个问题,否则我无法帮助。 – xomena