0

我浏览了很多链接,但我对在谷歌地图上获取方向感到困惑。当我的应用程序启动时,它会显示用户的当前位置,当用户点击地图上的医院标志时,它将显示 5 公里内的所有医院以及用户的当前位置。当用户点击任何地方医院时,他会获得有关它的信息。

现在我的意思是我想显示从当前位置到用户触摸的医院的方向。我正在使用谷歌地图API of v2

请给我完成这项任务的方法...

4

2 回答 2

1

Polyline查看我写的关于Google Maps API V2绘制从一个位置到另一个位置的方向的博客文章:

谷歌地图 API V2 方向

您将找到相关的方法来帮助您入门。

于 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 回答