Getting driving distance using Bing maps API programmatically

吃可爱长大的小学妹 提交于 2019-12-11 19:08:11

问题


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 ?


回答1:


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.

sample:

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

Take a look at the Microsoft documentation:

http://msdn.microsoft.com/en-us/library/ff701717.aspx It's easy to make this in Java.



来源:https://stackoverflow.com/questions/21357073/getting-driving-distance-using-bing-maps-api-programmatically

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!