gpt4 book ai didi

java - 使用 Google Maps API v2 的 Google map 导航

转载 作者:搜寻专家 更新时间:2023-11-01 08:02:11 25 4
gpt4 key购买 nike

我在我的应用程序中使用 Google Maps API v2。我想在我的应用程序中启用导航功能。我已阅读其他启动 Intent 并打开库存 Google map 应用程序以显示导航的帖子。但我只想在我的应用程序(SupportMapFragment 我使用过的)中显示导航。我该如何实现?

此代码运行良好,但它启动了一个 Intent :

Intent NavIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("google.navigation:q=" + incAddress));
startActivity(NavIntent);

最佳答案

无法在您的应用中显示谷歌地图应用导航,这是一个完全不同的应用。您可以在您的应用程序中显示导航的唯一方法是使用 Google Directions API 并在您的 map 上绘制路线,但您没有转弯指示。

我创建了一个使用 google directions api 的库,如果您想试用它,它很容易使用。

https://github.com/tyczj/MapNavigator

关于java - 使用 Google Maps API v2 的 Google map 导航,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19592274/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com