且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Android应用程序中启用谷歌地图导航

更新时间:2022-12-20 22:20:24

Google Maps Android API v2不提供任何导航功能。这与Maps API的服务条款相矛盾。看一下10.4的ToS部分(iii):

The Google Maps Android API v2 doesn't provide any functionality for navigation. It is in contradiction with Terms of Service of Maps APIs. Have a look at section 10.4 c (iii) of ToS:


没有导航。你不会使用(a)实时导航或路线指引的服务或内容;或(b)自动或自动车辆控制。

No navigation. You will not use the Service or Content for or in connection with (a) real-time navigation or route guidance; or (b) automatic or autonomous vehicle control.

https://developers.google.com/maps/terms#section_10_4

如果您需要浏览导航应该创建意图,以导航模式打开Goog​​le地图应用。有一个Google地图网址可以构建一个通用的跨平台网址,以便从您的应用程序启动Google地图意图。您可以按照以下文档打开原生应用的导航模式:

If you need navigation you should create an intent that opens the Google Maps app in navigation mode. There is a Google Maps URLs that allows to construct a universal, cross-platform URL to launch Google Maps intents from your application. You can open navigation mode of native app following this documentation:

https://developers.google.com/maps/documentation/urls/guide#directions-action

希望这有助于!