让Android的路线和导航路线、Android

由网友(我爱你你爱她,你好瞎哦c)分享简介:如何使用的谷歌API2 - 地图,让导航到指定的地方我搜索标签添加想要去的地方但不能使导航吧。how to use google-maps on API2 to get navigation to specified placei've add a search tab to get placesbut can...

如何使用的谷歌API2 - 地图,让导航到指定的地方我搜索标签添加想要去的地方但不能使导航吧。

how to use google-maps on API2 to get navigation to specified place i've add a search tab to get places but can't make navigation to it

推荐答案

我用下面的code在我的应用程序,它运行正常。

I have used the following code in my application and it runs fine.

在这里,

SADDR =源地址(纬度,经度)

DADDR =目标地址(纬度,经度)

请注意,您还可以通过地址字符串中纬度/经度代替。

Note that you can also pass Address string in stead of lat/lng.

public void showDirections(View view) {
        final Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse("http://maps.google.com/maps?" + "saddr="+ latitude + "," + longitude + "&daddr=" + latitude + "," + longitude));
        intent.setClassName("com.google.android.apps.maps","com.google.android.maps.MapsActivity");
        startActivity(intent);
    }

希望这将有助于...

Hope this will help...

阅读全文

相关推荐

最新文章