如何显示行车路线 [英] how to display the driving routes

查看:126
本文介绍了如何显示行车路线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个应用程序与其中,用户可以输入目的地,并从他的当前位置到目的地的路线将在谷歌地图上示出。 我在网上搜索,发现很多教程中,他们使用谷歌地图API的JavaScript V3。我也读

I am developing an app with which, the user can input the destination and a route from his current position to the destination will be shown on the google map. I searched online and found many tutorials in which they were using google map api javascript v3 . I also read the official documents from

https://developers.google.com/maps/articles/android_v3 https://developers.google.com/maps/documentation/directions/

不过,我很困惑,

  • 他们如何使用自己的程序中的JavaScript。
  • XML / JSON是如何工作的。
  • 这是怎么计划的整体是否有效?

由于我的理解,在上述文件中定义的方法都涉及到一个浏览器的应用程序,所以如何将它从Android应用程序启动?

As what I understand that the methods defined in the above documents are related to a browser app, so how will it be launched from an android application?

最后,这是最好的方法/方法/ API来开发这个程序。

And finally which is the best way/method/api to develop this app.

最后,我不是找code,我会制定了code自己。我只是想知道,整体如何将这些应用程序/谷歌地图的工作?

Lastly , I am not looking for the code ,as I will develop the code myself. I am just wanted to know that overall how these app/ google maps is working?

感谢

推荐答案

本的链接有教程绘制路线道路地图在我们的应用程序。这可能会帮助你, 使用下面的地图应用程序链接...这将带给你在谷歌地图应用程序

This link have tutorial to draw route path on map in our app. this may help you and use below to link with map app... this will take to you in google map application

String uri = "http://maps.google.com/maps?f=d&hl=en&saddr="+source_latitude+","+source_longitude+"&daddr="+destination_latitude+","+destination_longitude;
Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uri));
intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity");
startActivity(intent);

这篇关于如何显示行车路线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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