通过Bing Maps API以编程方式获取行驶距离 [英] Getting driving distance using Bing maps API programmatically

查看:96
本文介绍了通过Bing Maps API以编程方式获取行驶距离的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用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.

样本:

看看Microsoft文档:

Take a look at the Microsoft documentation:

http://msdn.microsoft.com/en-us/library/ff701717.aspx 用Java做到这一点很容易.

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

这篇关于通过Bing Maps API以编程方式获取行驶距离的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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