Android Google API direction update

丶灬走出姿态 提交于 2019-12-11 04:13:35

问题


I am using Google API in my app. Everything works perfectly. I just want to know how to update directions while moving. For now I have button "Actualize direction", but I want to do it dynamically. For example I want to update it (maybe offline if it is possible?) after changing my actual location. I think that this app will be used by drivers so it would be good to have dynamical updating of those directions. Is it possible to do something like this?

Thx for help


回答1:


Implementing such kind of functionality using Maps Android API v2 seems to be against the Terms of Service of Maps APIs. Have a look at section 10.4 c (iii) of ToS:

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

If you need navigation you should create an intent that opens the Google Maps native 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

Hope this helps!



来源:https://stackoverflow.com/questions/44767869/android-google-api-direction-update

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!