我浏览了很多链接,但我对在谷歌地图上获取方向感到困惑。当我的应用程序启动时,它会显示用户的当前位置,当用户点击地图上的医院标志时,它将显示 5 公里内的所有医院以及用户的当前位置。当用户点击任何地方医院时,他会获得有关它的信息。
现在我的意思是我想显示从当前位置到用户触摸的医院的方向。我正在使用谷歌地图API of v2
。
请给我完成这项任务的方法...
问问题
789 次
2 回答
1
于 2013-08-09T18:16:09.500 回答
1
尝试这个
try {
Intent directioIntent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("http://maps.google.com/maps?saddr=" + strSourceLatitude + "," + strSourceLongitude + "&daddr=" + strDestinationLatitude + "," + strDestinationLongitude));
directioIntent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity");
startActivity(directioIntent);
} catch (Exception e) {
Utilities.showToast(GetDirectionActivity.this, "Google Map is not installed on your device.");
}
于 2013-08-09T12:01:13.637 回答