3

https://www.npmjs.com/package/google-distance-matrix 示例中,我们可以添加多个目的地作为 latlong 对,

服务器端代码就像

string Test = "http://maps.googleapis.com/maps/api/distancematrix/json?origins=Lat1,long1&destinations=Lat2,long2&sensor=false"

现在的问题是如何在多源目的地模式下使用它我们可以像

string Test = "http://maps.googleapis.com/maps/api/distancematrix/json?origins=Lat1,long1,lat2,long2&destinations=Lat3,long3,Lat4,long4&sensor=false"

例子

http://maps.googleapis.com/maps/api/distancematrix/json?origins=23.020284,72.4396566&destinations=22.3039702,70.7671403&sensor=false http://maps.googleapis.com/maps/api/distancematrix/json?origins =23.027100,72.508000&destinations=22.999500,72.600300&sensor=false

这两者的组合

http://maps.googleapis.com/maps/api/distancematrix/json?origins=23.020284,72.4396566,23.027100,72.508000&destinations=22.3039702,70.7671403,22.999500,72.600300&sensor=false

4

1 回答 1

15

我通过使用“|”解决了它 分隔符。谢谢大家

于 2016-11-17T08:47:54.477 回答