java 如何在Android上的两个地理点之间绘制路线

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2125357/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-29 19:34:21  来源:igfitidea点击:

How to draw a route between two geopoints on the Android

javaandroidgoogle-mapsdraw

提问by Kareem

I have two OverlayItem's on a MapView. How can I draw a route between the two geopoints?

我在 MapView 上有两个 OverlayItem。如何在两个地理点之间绘制路线?

采纳答案by Vishal Khakhkhar

This application is contained with source code... It'll solve ur probs.

此应用程序包含在源代码中...它将解决您的问题。

http://www.anddev.org/the_friend_finder_-_mapactivity_using_gps_-_part_i_-_ii-t93.html

http://www.anddev.org/the_friend_finder_-_mapactivity_using_gps_-_part_i_-_ii-t93.html

回答by user278349

This posting J2ME/Android/BlackBerry - driving directions, route between two locationssuggests:

这个帖子J2ME/Android/BlackBerry - 行车路线,两个地点之间的路线建议:

you must not use the Map Service with any applications for route guidance, including but not limited to turn-by-turn route guidance that is synchronized to the position of a user's sensor-enabled device

您不得将地图服务与任何路线引导应用程序一起使用,包括但不限于与用户启用传感器的设备的位置同步的逐向路线引导

As such, there is no Android or Google API for showing the route between two points on Android, as far as I know. People have hacked it in by various approaches, but you run the risk of having your Map key disabled.

因此,据我所知,没有 Android 或 Google API 用于显示 Android 上两点之间的路线。人们已经通过各种方法入侵了它,但是您冒着禁用 Map 键的风险。

If I am wrong, I would love to be corrected.

如果我错了,我很乐意被纠正。