我想显示从当前位置到特定已知位置(经度和纬度)的街道路线,如何使用谷歌地图进行操作?
答案 0 :(得分:0)
你可以这样做直到android 1.6,他们已经删除了那些版本后的街道方向。
使用以下代码获取高于Android 1.6版本的活动。 希望这会对你有所帮助。
final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://maps.google.com/maps?" +"saddr="+sourcelatitudeString+","+sourcelongitudeString+"&daddr="+sourcelatString+","+sourcelongString));
intent.setClassName(
"com.google.android.apps.maps",
"com.google.android.maps.MapsActivity");
startActivity(intent);
答案 1 :(得分:0)
您必须构建一个URL并通过HTTP连接发送,以便在单个输出文件中获取所有行车路线。 Google提供了一些文件格式来接收行车路线信息。其中一个是KML文件。
请参阅以下链接以了解相关信息。