通过Bing Maps API以编程方式获取行驶距离

编程入门 行业动态 更新时间:2024-10-24 16:22:40
本文介绍了通过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.

样本:

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以编程方式获取行驶距离

本文发布于:2023-11-25 17:21:56,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1630658.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:距离   方式   Bing   Maps   API

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!