我一直在使用Bing API,它可以完美运行,并且可以很好地输出纬度和经度
I have been working with Bing API and it works perfect and outputs latitude and longditude very well
// 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 ?有什么方法可以增加行驶距离吗? 我一直在阅读文档,但无法为此找到一种方法?
Is there any way of getting the driving distance? I have been reading documentation but was not able to find a method for this ?
推荐答案路由API. Routes API用于计算行车路线.通过Routes API,您可以通过基于行驶,步行或交通的算法来获取路线距离计算,路线几何形状和分步路线.您还可以在路线上传递多达25个点,以在单个请求中计算出多站路线.
Routes API. The Routes API is for calculating driving directions. The Routes API allows you to get route distance calculations, route geometry and step-by-step directions via driving, walking or traffic based algorithms. You can also pass in up to 25 points on your route to calculate a multiple stop route in a single request.
样本:
dev.virtualearth/REST/v1/Routes?waypoint.1=waypoint1&waypoint.2=waypoint2&distanceUnit=mi&o=json&c=en- GB& key = key
看看Microsoft文档:
Take a look at the Microsoft documentation:
msdn.microsoft/en-us/library/ff701717.aspx 用Java做到这一点很容易.
msdn.microsoft/en-us/library/ff701717.aspx It's easy to make this in Java.
更多推荐
通过Bing Maps API以编程方式获取行驶距离
发布评论