[英]Java - Google maps API - distance between two addresses
Using Google Maps API how to determine the driving distance between two locations ? 使用Google Maps API如何确定两个位置之间的行车距离? Platform -Java
平台-Java
You will need to use the Google Directions Web Service . 您需要使用Google Directions Web Service 。 You can make an HTTP request, specifying your two locations as parameters, and get back JSON (or XML) describing the directions between the two points.
您可以发出HTTP请求,将两个位置指定为参数,然后返回描述两点之间方向的JSON(或XML)。
NB The Google Maps terms of service explicitly states that using the Google Maps Web Services without putting the results on a Google Map is prohibited. 注意 : 谷歌地图服务条款明确规定禁止使用谷歌地图网络服务而不将结果放在谷歌地图上。
I'm new in Java and I had the same issue. 我是Java的新手,我遇到了同样的问题。 That's why I've decided to make a Java library to provide theses information and more like route.
这就是为什么我决定创建一个Java库来提供这些信息,更像是路由。
Here's the link . 这是链接 。 Tell me what do you think about it and if it was useful for your case.
告诉我你怎么看待它以及它对你的情况是否有用。
Use the Directions API: http://code.google.com/apis/maps/documentation/directions/ 使用Directions API: http : //code.google.com/apis/maps/documentation/directions/
The default travel mode is for driving. 默认的旅行模式是用于驾驶。
Please read the terms of service: http://code.google.com/apis/maps/terms.html 请阅读服务条款: http : //code.google.com/apis/maps/terms.html
Particularly section 10.12 - which refers to using the results from this API. 特别是第10.12节 - 它指的是使用此API的结果。 In short, you must display it in conjunction with a Google map.
简而言之,您必须将其与Google地图一起展示。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.