2014-01-25 39 views
0

我一直在与必应API获取的行驶距离和它的作品完美输出纬度和longditude很好使用Bing地图API编程

  // However I need the driving distance . . . I thought it should be result.getDrivingDistance (
      System.out.println(result.getDrivingDistance); // There is no such a command 
      // What should I do to get the distance from the response ? 

有越来越行驶距离的方法吗? 我一直在阅读文档,但无法找到一个方法呢?

回答

1

路线API。路线API用于计算驾车路线。路线API允许您通过驾驶,步行或基于交通的算法来获取路线距离计算,路线几何和逐步路线。您还可以在您的路线上传递多达25个点,以便在单个请求中计算多站路线。

样本:

http://dev.virtualearth.net/REST/v1/Routes?waypoint.1=waypoint1&waypoint.2=waypoint2&distanceUnit=mi&o=json&c=en-GB&key=key

在微软文档看看:

http://msdn.microsoft.com/en-us/library/ff701717.aspx 这很容易让这个在Java中。