使用 Google Maps API v2 获取行车路线 [英] Get driving directions using Google Maps API v2

查看:38
本文介绍了使用 Google Maps API v2 获取行车路线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取两个位置之间的行驶方向:

I am trying to get the driving direction between the two positions:

LatLng(12.917745600000000000,77.623788300000000000)
LatLng(12.842056800000000000,7.663096499999940000)

我尝试过的代码:

Polyline line = mMap.addPolyline(new PolylineOptions().
    add(new LatLng(12.917745600000000000,77.623788300000000000),
    new LatLng(12.842056800000000000,7.663096499999940000))
       .width(5).color(Color.RED));

但这在两点之间画了一条直线.

有没有其他方法/方式来获得这两点之间的行车路线.

But this draws a straight line between the two points .

Is there any other method/way to get the driving directions between these two points.

推荐答案

我刚刚在 Android 上发布了我最新的 Google Maps Direction API 库https://github.com/akexorcist/Android-GoogleDirectionLibrary

I just release my latest library for Google Maps Direction API on Android https://github.com/akexorcist/Android-GoogleDirectionLibrary

这篇关于使用 Google Maps API v2 获取行车路线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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