Android google maps APIs get directions programming

烂漫一生 提交于 2020-01-03 15:37:21

问题



I am new to Android google maps APIs. I am learning it from this TUT : http://mobiforge.com/developing/story/using-google-maps-android but there isn't any mention of getting the direction between 2 points. Is there any APIs can do this task in http://code.google.com/android/add-ons/google-apis/reference/index.html ?

Thank in advance !


回答1:


Google maps API does not provide any routing capabilities. You can use an intent to fire the google navigator (assuming it's on your device) or the the google maps version (as mentioned by Hwa Rang)

There are some tutorials to do this outside of the API, but be advised the google prohibits implementing turn by turn navigation, apparently simple routing is ok though.

How to add routing to google maps




回答2:


There is an intent to the Google Maps app you can use.

Intent i = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("http://maps.google.com/maps?saddr=" + saddr + "&daddr=" + daddr));


来源:https://stackoverflow.com/questions/6642438/android-google-maps-apis-get-directions-programming

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