2点之间的Andr​​oid谷歌地图路线 [英] android google map route between 2 point

查看:89
本文介绍了2点之间的Andr​​oid谷歌地图路线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想提请在谷歌地图2点之间的路由与两端点的针痕。在这方面,用户可以选择的车一样行驶路线,通过循环,步行。我要像显示路由信息超前有2英里,从一条街左,对此也估计time.so,我发现很多教程在互联网上。我发现最好的是:

I want to draw route between 2 points in Google map with a pin mark at ends points. in this, user can choose any driving route like by car, by cycle, by walk. I have to show routing information like "2 miles ahead , left from next street" and also estimated time.so regarding this , I found a lot of tutorial on the internet. the best I found is:

http://$c$c.google.com/p/j2memaprouteprovider/source/browse/#svn/trunk/J2MEMapRouteAndroidEx

,这是非常复杂和缓慢。

which is very complex and slow.

接下来,我发现这一个:

next I found this one:

http://www.anddev.org/google_driving_directions_-_mapview_overlayed-t826.html

这一块是非常相似,我想要的东西,除了一些功能。但它已经过时了。

this one is very similar to what I want, except some feature. but it is outdated.

我还发现,我要使用KML这一点。但我不希望使用它,因为复杂性,所以有必要使用KML?有没有更好的方式来做到这一点?我可以有完整的源$ C ​​$ C作为我被看到code大块混淆。感谢很多提前。

I also found that I have to use KML for this. but i don't want to use it because of complexity so is it necessary to use KML? is there any better way to do this? can i have full source code as I got confused by seeing chunk of code. thanks a lot in advance,.

推荐答案

摇滚,

这个最简单的办法是打开已安装在Android设备谷歌地图应用程序。只是通过源和目标位置的经度和纬度作为参数,调用谷歌地图应用程序如下:

The simplest solution for this is to open "Google Map Application" that is already installed in android device. Just pass the source and target location's latitude and longitude as a parameter and call the google map application as follows:

Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("http://maps.google.com/maps?saddr="+latitude_source+","+longitude_source+"&daddr="+latitude_dest+","+longitude_dest));
        startActivity(i);

使用这种方法,你也可以选择乘汽车一样行驶路线,通过循环,通过由应用程序提供散步等和其他功能。

Using this approach, you can also choose any driving route like by car, by cycle, by walk etc and other functionalities that is provided by application.

这篇关于2点之间的Andr​​oid谷歌地图路线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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