我需要使用外部谷歌地图应用程序,我发现这个链接显示行驶方向 HTTP ://developer.android.com/guide/appendix/g-app-intents.html ,但低于打开地图应用程序给定位置
I need to show the driving direction using external google map application i found this link http://developer.android.com/guide/appendix/g-app-intents.html ,but the below opens the Maps application to the given location
Uri uri = Uri.parse("geo:13.070984,80.253639");
Intent in = new Intent(Intent.ACTION_VIEW, uri);
startActivity(in);
我需要知道的是有什么办法可以传递两个的地理位置让行驶方向。
I need to know is there is any way to pass two geo location to get driving direction.
是它很容易显示的方向,如果你有源和目标的经度和纬度。 刚刚看到下面的code:
yes its very easy to show the direction if you have the latitude and longitude of both source and destination. Just see the following code:
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("http://maps.google.com/maps?saddr="+latitude_source+","+longitude_source+"&daddr="+latitude_dest+","+longitude_dest));
startActivity(intent);
在哪里
latitude_source =纬度
源的
longitude_source =经度
源的
latitude_dest =纬度
您的目的地
longitude_dest =经度
您的目的地的
Where
latitude_source=Latitude
of your source
longitude_source=Longitude
of your source
latitude_dest=Latitude
of your destination
longitude_dest=Longitude
of your destination
只需更换这些值与实际数据。 。使用上述code对一些特定事件。
Just replace these value with your actual data. .Use the above code on some particular event.
希望这会帮助你。
上一篇:Android浏览器通过输入要素选择文件后刷新页面要素、浏览器、页面、文件
下一篇:如何确定UsbRequest.queue(..)方法接收的字节长度是多少?字节、长度、方法、UsbRequest