是否有在Android的谷歌地图导航的API? [英] Is there an API for Google Maps navigation in Android?

查看:142
本文介绍了是否有在Android的谷歌地图导航的API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个Android应用程序,其中我使用谷歌地图。它运作良好和良好的。但

I am developing an Android app where I am using Google Maps. It is working well and good. But

加载地图,当用户点击获取路线后,谷歌地图出现的方向,但也没有办法让轮流转书面指示。如果你只是打开谷歌地图,并获取路线,你可以来回切换的地图和方向列表之间。

After loading the map when a user has clicked "Get Directions", Google Maps comes up with the direction line, however there is no way to get the turn by turn written directions. If you just open Google Maps and Get Directions you can toggle back and forth between the Map and the Direction List.

有没有可用来获得所有功能的任何API如在Android设备默认的谷歌地图赋予?

Is there any API available to get all the features as given in default Google map of Android device?

推荐答案

获得的方向和路线,你可以使用谷歌地图的Web服务的最佳方式。它将为您提供一切。我已经在我的应用程序中使用这个。

The best way to get direction and routes you can use the Web Service of Google Maps. It will provide you everything. I have used this in my application.

下面的例子SADDR =源地址和放大器; DADDR =目标地址(即纬度和放大器;经度)。您也可以通过字符串的地址,而不是纬度/经度。

Here is the example where saddr = source address & daddr= destination address(i.e. latitude & longitude). You can also pass string as address instead of lat/lng.

final Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse("http://maps.google.com/maps?" + "saddr="+ latitude + "," + longitude + "&daddr=" + latitude + "," + longitude));
    intent.setClassName("com.google.android.apps.maps","com.google.android.maps.MapsActivity");
                        startActivity(intent);

希望这会帮助你。

Hope this will help you.

这篇关于是否有在Android的谷歌地图导航的API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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