Dhr*_*ruv 5 android google-maps routes traffic
我正在开发导航基础应用程序.在这些应用程序中,我必须打开Map应用程序以使用Traffic Enable绘制源和目标纬度/地址之间的路径.
我已经创建了通过Intent打开Google地图的功能,并绘制了两点之间的路径.
是否有可能在传递Intent时添加流量层?或者我需要添加哪个参数?
提前致谢.
你可以这样做:
我认为我的起始位置是当前位置.
您的目标位置将是动态的,如下所示:
double destinationLatitude = 22.3000;
double destinationLongitude = 73.2003;
String url = "http://maps.google.com/maps?f=d&daddr="+ destinationLatitude+","+destinationLongitude+"&dirflg=d&layer=t";
Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(url));
intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity");
startActivity(intent);
Run Code Online (Sandbox Code Playgroud)
完成
| 归档时间: |
|
| 查看次数: |
2144 次 |
| 最近记录: |