如何在Android应用程序中启用谷歌地图导航 [英] How to enable google map navigation in android app

查看:229
本文介绍了如何在Android应用程序中启用谷歌地图导航的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在谷歌地图上有两个点,第一个是源代码,第二个是目的地,我在地图上的这些点之间有路线。现在,我想像Google一样在Google地图上导航用户从源代码到目的地。 : -

I have two points on google map first one is the source and second is the destination, I have the route between these points on the map.Now I want to navigate user from source to destination as Google does on Google Map Like this:-

推荐答案

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

希望这有助于!

这篇关于如何在Android应用程序中启用谷歌地图导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆